Commit Graph

22 Commits

Author SHA1 Message Date
LuK1337 39a771baad Merge tag 'LA.BR.1.3.6-05410-8976.0' of https://source.codeaurora.org/quic/la/kernel/msm-3.10 into HEAD
"LA.BR.1.3.6-05410-8976.0"
2018-02-06 13:11:45 +01:00
Sreelakshmi Gownipalli 8e4f17c71f diag: Free the memory in diagfwd_peripheral_exit()
In diagfwd_peripheral_exit() free the memory associated with
early_init_info.

Change-Id: I862b6d806d67dad38316f1608827a4bf6f5a691f
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
2017-12-05 14:05:52 -08:00
LuK1337 fc9499e55a Import latest Samsung release
* Package version: T713XXU2BQCO

Change-Id: I293d9e7f2df458c512d59b7a06f8ca6add610c99
2017-04-18 03:43:52 +02:00
Manoj Prabhu B bc3507bbb8 diag: Fix race condition while closing SMD
This patch initializes the control channel workqueues
before registering with SMD, close the SMD control channel
on receiving the feature mask from peripheral on socket channel
if the sockets are supported and reset the in_busy variable
for the buffer that reads the data from socket channel
when diag socket state is closed.
This patch also adds add mutex protection on receiving feature mask while closing
SMD and start reading from socket channel

CRs-Fixed: 1059771
Change-Id: Icdf27dce5b3eb7cfc4a7686f044195db13a81a58
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
2016-10-21 15:34:15 +05:30
Mohit Aggarwal 41cbc77d94 diag: Change to GFP_KERNEL in diagfwd_buffers_init()
In diagfwd_buffers_init() change the memory allocation
from GFP_ATOMIC to GFP_KERNEL.

Change-Id: I8ea299a4287401a0a01ff7bbdd86c37ccd138480
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
2016-08-09 14:36:20 +05:30
Ravi Aravamudhan 443f5910c8 diag: Perform member-wise copy instead of memcpy
Diag driver was copying the information from early initialization
information for forward channels onto the control channel objects.
This patch does a member-wise copy of the channel objects.

Change-Id: Iaf2f1e4ddb392e1f2ee65a8796e91e4831cf8974
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2016-08-08 22:12:56 -07:00
Manoj Prabhu B d77eb46756 diag: Fix possible kernel addresses leak
This patch addresses kernel addresses leak by changing
the format specifier to adhere to the kptr_restrict system setting.

CRs-Fixed: 987013
Change-Id: I32649a26f54d96c56d80aa2a1bd5f5d9dd0dd9d3
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
2016-06-16 02:50:29 -07:00
Katish Paran 7f5691eac2 diag: In case of memory allocation failure set buffers to null
This patch ensures that buffers are set to null in case of memory
allocation failure.

Change-Id: If6391d665cc2bf1cdb2db59e613c65c123ad9c51
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2015-09-10 23:37:40 -07:00
Katish Paran 23608b862c diag: Add padding to buffers while writing over to usb
Add padding to the buffers to avoid apf prefetch overrun.

Change-Id: I73df5f5d6b1924ea6dfabc3eaba233ef0f70d6cd
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2015-07-22 12:52:20 -07:00
Katish Paran 3edecc8601 diag: Queue the next read in case for usb connect event
Currently apps diag is not queueing the next read from
peripherals in case for usb connect event. This patch resolves
the issue.

Change-Id: I289826a6241d2930920275a8b0dd3a863e798095
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2015-07-12 19:13:52 -07:00
Ravi Aravamudhan efe1dadd32 diag: Make fixes in memory device mode
When there are multiple clients voting for memory device mode, diag
driver is incorrectly picking the client for draining data. Also,
memory device client that is currently receiving data won't receive
data when a new memory device client comes up. This patch addresses
these issues.

Change-Id: I6c2b3f46a1ade60c58db9c35b551f490268cfbee
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2015-06-30 10:38:42 -07:00
Katish Paran e6a209be94 diag: Rectify wait condition while reading over peripherals
While reading data over smd leads to infinite looping due to
incorrect wait condition. Also, there is no need to queue a
read until DATA event notification is received from smd.

Change-Id: Ibbd4d44f32adce362e9d44fc392c40543965403b
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2015-06-22 03:55:02 -07:00
Katish Paran f233c5eb41 diag: Atomic operations does not require spinlock
There is no need to perform atomic operations under spinlock.

Change-Id: I2a38b672ec63f36c07c15d5460db16fbe826d47b
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2015-06-17 14:16:24 +05:30
Sreelakshmi Gownipalli f207dbeaba diag: Add control packet support to indicate pd status
Add control packet support to signal MEMORY_DEVICE application
when a pd comes up.

Change-Id: I7182dfbe60ee07d0ab2f7c87eb981816ba764e25
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
2015-06-04 12:53:28 -07:00
Mohit Aggarwal 366685e4d3 diag: Fix wrongly marked kmemleak_not_leak
Current code does mark kmemleak_not_leak wrongly which leads
to issue of coloring unknown object. This patch fixes
this issue.

Change-Id: Ic03105cdb0208175a284f1900c4fe6e423fdf61e
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
2015-06-03 18:06:45 -07:00
Katish Paran 3b80656092 diag: Check for feature mask status before sending any command
Currently, APPS diag may send commands to peripherals even before
forwarding feature mask. This patch adds new check which ensures
that any command is sent to peripheral only after forwarding
feature mask.

Change-Id: I024ad6d3bcb2636f6f7d82a3744f034110ec1eb6
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2015-05-27 18:41:15 +05:30
Katish Paran ed0b8f903c diag: Release wake sources properly
There is a possibility that diag driver doesn't release wake
source in some cases. This patch ensures that the wake sources
hold are released properly. Also there is no need to queue a new
read in case read avail size is of zero bytes.

Change-Id: Ie31f2318a48b02aa594575970a1aac803b381dfd
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2015-05-25 11:28:21 +05:30
Ravi Aravamudhan 5da6a06d89 diag: Stop reading from peripherals during close
While switching logging modes there is a possibility that the previous
read queued to the transport layer may still be pending. This read
should be cancelled before closing the channel. Otherwise, while
opening the channel again, we may queue the same buffer twice for
reading.

Change-Id: Ic5fb7713876e245bcc3260a9e67e35e611cd93a4
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2015-05-20 22:46:24 -07:00
Ravi Aravamudhan 7637f4d5f5 diag: Pass correct value when there is a mux write failure
The buffer context passed to the peripheral transport layers if
there are any errors while writing to MUX is incorrect. This patch
fixes this issue.

Change-Id: I6c96b44f3ab7ac0b4ba254a1e04e283360b63ffb
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2015-05-11 22:16:39 -07:00
Katish Paran e424ae2ff3 diag: Release wake source in case for write failure
There can be cases where writes to USB may fail. In that case
diag must release the wake source hold earlier. This patch
resolves the same.

Change-Id: I0f7d0312816a873a640a2b26fd5bed3ca80535f7
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2015-05-08 12:42:45 +05:30
Ravi Aravamudhan 25fbececeb diag: Add support to communicate over Sockets
Diag on peripherals now support communication over IPC router
sockets. Add support on application processor to communicate with
the peripherals over sockets. This patch also maintains backwards
compatibility over SMD.

Change-Id: Id95d89e83a5532224594991c080c78747b510f74
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2015-05-04 17:58:02 -07:00
Ravi Aravamudhan 636ccf45ad diag: Separate SMD structures from Diag core logic
Diag SMD structures are embedded inside Diag core logic. This patch
modularizes operations performed over SMD, keeping it distinct from
other diag modules.

Change-Id: I6bd99b109da7b71d6310708312078d7334cc0f58
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2015-05-04 17:54:17 -07:00