In diagfwd_peripheral_exit() free the memory associated with
early_init_info.
Change-Id: I862b6d806d67dad38316f1608827a4bf6f5a691f
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
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>
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>
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>
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>
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>
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>
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>
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>
There is no need to perform atomic operations under spinlock.
Change-Id: I2a38b672ec63f36c07c15d5460db16fbe826d47b
Signed-off-by: Katish Paran <kparan@codeaurora.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>