This patch clears the peripheral masks upon the mdlog exit
and USB disconnection. This enables to keep the data and
cmd channel open for read.
CRs-Fixed: 1057143
Change-Id: Ie6f19319b75f3bf389ddd5a8168fd3bcd3efbc8b
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
Currently, there is a possibility of using already
freed memory while client reads from diag driver.
The patch adds proper protection to fix the issue.
CRs-Fixed: 2076623
Change-Id: Ic946865ac79f2684c06176be64fd2f3abc6048f7
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
Currently, while de-initializing clients, there is
a possibility of using already freed memory. The
patch adds proper protection to fix the issue.
CRs-Fixed: 2068569
Change-Id: I4b397a82e03fa2f1c84cfa8ca912cdb6a51ba08b
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
Currently, protection is missing when querying event
status due to which already removed dci client entry
might be accessed. This patch takes care of issue by
taking proper locking.
CRs-Fixed: 2015892
Change-Id: I4195c4c6198d85e96559f1728d74419527a76bc5
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
Currently, there is a possibility of out-of-bound access while
processing data received from user space. The patch adds proper
checks for valid address.
CRs-Fixed: 2048536
Change-Id: I1e0fc7a9d69e69f3326429d5d9540dd3bb1a59b0
Signed-off-by: Hardik Arya <harya@codeaurora.org>
Currently, there is possibility of out-of-bound accesses during
handling of data in non-hdlc path. The patch adds proper protection
when processing non-hdlc packet information to fix the issue.
CRs-Fixed: 2029216
Change-Id: I07c466f85bd8ac08226948fea86b1d8567e68431
Signed-off-by: Hardik Arya <harya@codeaurora.org>
This fix removes dependency between real time message mask
table and build time message mask table. Also this fix
synchronizes retrieval and modification of real time message
mask table.
CRs-Fixed: 2015227
Change-Id: Id0a0964337ec4645d7061fc35120dfa061a990ff
Signed-off-by: Gopikrishna Mogasati <gmogas@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>
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 provides the protection to dci client
entries from corruption.
CRs-Fixed: 984942 992683
Change-Id: Ifcd9f14dc03d9e42a31b3e126839489881e98303
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
Currently, while de-initializing dci clients, there is
a possibility to access stale entries. This patch fixes
this issue by adding proper protection mechanism.
CRs-Fixed: 960958 968445
Change-Id: I829c9497eeb356662a6531592c66108e615ce6e4
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
This patch rate limit few of the error logs to avoid flooding
of kernel logs.
Change-Id: I11843becf1d3ae97d5e433198ae27afd0237ed82
Signed-off-by: Katish Paran <kparan@codeaurora.org>
Currently, diag allows maximum 30 clients which is
exhausted and new clients are not able to open handle
with diag. This patch fixes this issue.
Change-Id: I1d016b1ed21c51b9282abc032d55bd87c94c0d8c
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
Clean up the client pid information from the client table on
lsm_deinit Ioctl call.
Change-Id: Ia40a481b1be909c46371c0bb295db7baa30bdbc8
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
Copy the data from buf table in diag_md_copy_to_user() if the
userspace buffer has space. If the data copy fails then drain
the data once the userpace buf is available instead of dropping
the data.
Change-Id: I6a24b13837ce7a07ea0d6bd2954b40a776c6ae0b
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
Currently, if APPS master table is having mode reset command
registration followed by other mode change commands then
APPS driver will not be able to forward mode change commands
to Modem. This patch fixes this issue.
Change-Id: I502e0a9a222d954c16b36df275585df39a84f970
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
Diag driver was ignoring delayed response type packets while
recording packet allocation and drop statistics which results in
erroneous prints. This patch solves this issue.
Change-Id: I299f341a91c027c7cc5ee185b854ca5ad1bcc114
Signed-off-by: Ravi Aravamudhan <aravamud@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>
This patch adds support for time sync command.
Also forwards the time sync control packet to all
the peripherals on receiving time sync switch command.
Change-Id: I5c42203bcf3cd830dbf937879b01d002c73c0c31
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
On removing command registration entries from the registration table
diag driver was not handling the mutexes properly.
Change-Id: I2a15ac736fd665eafb50d40bcb255b911ac216b5
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag driver is not cleaning up the buffers properly when the logging
mode is switched from memory-device mode to USB mode. Changing the
clean up sequence solves this issue.
Change-Id: I3523748a79e37489c378393f578f54d0a44bd0b9
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Diag driver is printing an error dmesg on failure to write to diagfwd
bridge. Change pr_err to pr_err_ratelimited to avoid flooding kernel
dmesg.
Change-Id: Iafe6e8270367ac27011b4e3935f67c2f97556e3f
Signed-off-by: Ravi Aravamudhan <aravamud@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>
Currently, apps diag is holding a spinlock while releasing
wake source. This may lead to spinlock contention in case
multiple zero size packets are received over smd thus leading
to lockout. This patch removes the spinlock protection while
releasing wake source.
Change-Id: I73f2b6f584bfbc259cd534c59aedbacd4cc59381
Signed-off-by: Katish Paran <kparan@codeaurora.org>
If hdlc is disabled on apps, the buffer length is not being
properly increased. Thus the overwrite is happening with the new
responses. This patch fixes the issue.
Change-Id: I1dcbd666bdaab70eabf72547acf77c056cf345b1
Signed-off-by: Katish Paran <kparan@codeaurora.org>
Currently while extracting events and logs information from
the data read over peripherals, the clients details are accessed
without mutex protection. As the client access may happen from
multiple context, mutex protection is needed. This patch
resolves the same.
Change-Id: I9bd115e1cd9eebc625f4a68854d554ff874d866d
Signed-off-by: Katish Paran <kparan@codeaurora.org>
Currently hdlc encoding is not turned on by default in case if
the logging mode is changed from usb mode to memory device mode
or vice-versa. By design, the hdlc encoding must be turned on
after any logging switch. Also, stop any further reads over
peripherals until the time the mux layer is established.
Change-Id: I21f89771412e2da8ee0243f5f6bb24f917038300
Signed-off-by: Katish Paran <kparan@codeaurora.org>
Currently, diag driver is allocating memory for registration
table entries and not releasing that memory.
Change-Id: Ia4652b18ba7813d459801f4dd0a94ecc24dc40b4
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
Diag driver needs to support writing partial packets over USB to
remove any dependency on the controller properties. Make change
to write large buffers in chunks.
Change-Id: I9f70396adbe3dfb988ad65319442ede88fbc6896
Signed-off-by: Ravi Aravamudhan <aravamud@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>
Macros referring to different peripherals have the type of channel
in their name and the macros for channel types have the underlying
transport in their name. This patch renames the macros used in
Diag driver.
Change-Id: I0c98e7e4fde68716bf3491e143603618d1740dac
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Peripheral features are embdedded in the diag core logic.
Refactor the code to separate the peripheral features into a
different structure.
Change-Id: I302d6523722d29e874337a032ea39df26d439d2e
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>