Commit Graph

123 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
Manoj Prabhu B 75b11c7f00 diag: Clear masks upon logging exit
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>
2017-12-19 21:34:38 -08:00
LuK1337 f77b254b9f Merge tag 'LA.BR.1.3.6-04510-8976.0' of https://source.codeaurora.org/quic/la/kernel/msm-3.10 into HEAD
"LA.BR.1.3.6-04510-8976.0"
2017-08-06 13:38:06 +02:00
Hardik Arya 54d9ba2b86 diag: Add protection while processing non-hdlc packets
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>
2017-07-25 22:55:07 -07:00
LuK1337 62829e8978 Merge tag 'LA.BR.1.3.6-04010-8976.0' of https://source.codeaurora.org/quic/la/kernel/msm-3.10 into HEAD
"LA.BR.1.3.6-04010-8976.0"

Change-Id: If446d01e5305f2e7b268b761d214305e35e2ce18
2017-06-09 23:21:11 +02:00
Gopikrishna Mogasati c4de80bf39 diag: Add proper synchronization checks to msg mask table
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>
2017-05-31 21:20:06 +05:30
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
Katish Paran ded3822f90 diag: Mutex protect the deinitialization for diag clients
This patch mutex protect the deinitialization steps for diag
clients.

Change-Id: I13410b0b1382de7b026726a3736f397dee1092fa
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2015-08-27 08:16:02 -07:00
Sreelakshmi Gownipalli 6e146a91ae diag: Donot drop the data in memory device mode
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>
2015-08-01 18:38:38 -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
Linux Build Service Account a2b0652202 Merge "diag: Fix bit mask value for Diag Sensors channel" 2015-07-04 12:31:51 -07:00
Ravi Aravamudhan 086ab32f0c diag: Fix bit mask value for Diag Sensors channel
Diag driver has an incorrect value for Sensor channel peripheral
mask leading to incorrect calculations.

Change-Id: Ia72edead666c93b80b374263d194a941efa8cbf7
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2015-07-02 00:28:11 -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
Mohit Aggarwal 11d6e2860b diag: Add support for time sync command
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>
2015-06-22 17:45:29 +05:30
Ravi Aravamudhan 0e5037c321 diag: Change bit mask value for Sensors STM
The value of sensors STM bit mask was set incorrectly leading to
erroneous calculations. This patch adds the correct value for
Sensors STM bit mask.

Change-Id: I6aad29025068f8386da30bff785e7e10fe282cc0
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2015-06-13 08:05:47 -07:00
Linux Build Service Account 430b65de41 Merge "diag: Add support for extended mobile ID version 2" 2015-06-06 18:39:09 -07:00
Linux Build Service Account 162f250eb6 Merge "diag: Add control packet support to indicate pd status" 2015-06-06 07:06:47 -07:00
Sreelakshmi Gownipalli 6a4d85b42a diag: Add support for extended mobile ID version 2
Add support for extended mobile ID command version 2
to provide chipid information to tools.

Change-Id: I428d62caafe638897aeb8fed66e35dccc1e11963
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
2015-06-04 12:53:52 -07:00
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
Katish Paran 5b3f5e71ab diag: Remove spinlock protection while releasing wake source
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>
2015-06-04 17:41:54 +05:30
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
Ravi Aravamudhan affd9394fb diag: Fix issues with log-on-demand command request
Diag driver must respond to log-on-demand command request if Modem
delegates the support for log-on-demand. Diag driver was forwarding
the command to Modem even if the support is present on Apps. This
patch fixes this issue.

Change-Id: I45265ea5fd3205b067ae829a2c105e449bdd621a
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2015-05-04 17:58:05 -07:00
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
Ravi Aravamudhan 135799223e diag: Generalize peripherals and channel types
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>
2015-04-30 00:09:59 -07:00
Ravi Aravamudhan 42cc7b6748 diag: Separate feature mask into different structure
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>
2015-04-30 12:30:38 +05:30
Ravi Aravamudhan f751d71887 diag: Remove the dead code
There are some macros and variables in the Diag driver that are
not being used. Remove all the instances of those macros and
variables.

Change-Id: I800b776f3db1356c55a51de7747a26d8581fe9bf
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2015-04-30 11:54:38 +05:30
Sreelakshmi Gownipalli 401e4bf4b6 diag: Forward commands to the diag clients registered on apps
Diag fails to  forward the commands registered on apps to
the user space clients since the proc id in the command
registration table is compared with the wrong proc id for
apps. Added a change to check the correct proc id for apps
while forwarding the command from kernel to userspace.

Change-Id: I4baac98fb752061b7621a6f725ce586bacd58a30
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
2015-04-30 11:36:16 +05:30
Katish Paran d291813fbf diag: Add IOCTL support to disable the hdlc encoding support
Provide ioctl support for the user space clients to toggle the
hdlc support on kernel side.

Change-Id: Ifd87c94a619165052599103991f3f296d2c272f3
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2015-04-20 16:38:06 +05:30
Katish Paran 405f4b63a8 diag: Add support for non hdlc packets
Tools and userspace clients can now send non HDLC encoded
packets to the target. Add support for incoming packets that
are not HDLC encoded and maintain backwards compatibility for
tools that needs HDLC encoding.

Change-Id: Ie56248ad7d48cacd5782fcd1f629fbb8319c7ecc
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2015-04-20 16:19:24 +05:30
Katish Paran cb99645f50 diag: Add support for querying the packet statistics
Add support in Diag driver to query log, event, msg packet allocation
and drop counts through command request/responses. Also added support
for resetting these statistics.

Change-Id: I4c33394101442e0955d66f30714e1d0dc1af4c1c
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2015-04-20 16:09:39 +05:30
Katish Paran ab8615e90d diag: Make command registration table dynamic
Currently, diag driver restricts the number of command registration
by the user space clients and registrations from peripherals to
a predefined number. Remove this restriction and make the table
dynamic in size.

Change-Id: I536af1d8fb4efabf483947c592ce1df2875f9c62
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2015-04-20 15:28:59 +05:30
Katish Paran a4b37ffb28 diag: Add support for multiple instances of callback process
Currently, diag driver has support for only one instance of
callback process. This process is used to communicate with both
local and remote processors. Expand the support for callback mode
to support multiple processes each communicating with different
processors.

Change-Id: I933a04c874e306527d11dbf706ea7ccc3e8c39ab
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2015-04-20 15:19:55 +05:30
Katish Paran 546eb7505d diag: Add support for 16k request/responses
Currently diag supports requests and response upto 4k in length.
Make changes to increase this size to 16k.

Change-Id: I414e703bc3b84d86e19077785c8387283db4441b
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
Signed-off-by: Katish Paran <kparan@codeaurora.org>
2015-04-20 15:06:59 +05:30
Ravi Aravamudhan 900cd09f13 diag: Add unique checks for different data types
Diag supports different types of data coming from the userspace.
Each type has an unique length requirement. Diag driver was
checking the incoming length against a common value. Refactor
the code to modularize different packet types and include
unique length checks in each module.

Change-Id: I921ef51a3e2bb97803aee380c790698da81d7033
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2015-03-11 13:17:22 -07:00
Ravi Aravamudhan 078f2aa222 diag: Add support for Extended Mobile ID
Diag driver has to support a new command for retrieving the
mobile id of the target. The response contains the chip family.

Change-Id: I2e12dd6834f8be95688678286e360c4e75af9524
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
2015-03-04 13:19:49 -08:00
Ravi Aravamudhan 18c177fceb diag: Add support for peripheral buffering modes
Diag on the peripherals has support to buffer diag data and drain
them as and when required. This patchset adds support on the apps
processor to enable different buffering modes on the peripherals.

Change-Id: I07b9ffe36dfc5c90ac0d8a8da91922e1127aed58
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-08-12 10:45:27 -07:00
Ravi Aravamudhan 38604baa7b diag: Modularize different logging modes
Diag driver has an ability to log diag data to USB or to the user
space clients. Make changes to modularize different modes of
logging schemes.

Change-Id: I91c95ce4ec8117f6926d8e6dfa164fd6cb07dc4b
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-08-04 15:50:12 -07:00
Ravi Aravamudhan 21ad45fc05 diag: Redesign diag bridge
Refactor diagfwd_bridge to make it scalable and to communicate
with the remote devices in a much cleaner fashion. Also make
changes to DCI to reflect the changes in the bridge.

Change-Id: Ica5a3552ec94c5543518698390c910518da04f3b
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-08-04 15:46:09 -07:00
Ravi Aravamudhan d3d930b1a7 diag: Create separate module for Diag-USB interaction
Diag USB structures are deeply coupled with diag drivers. Each
instance of USB channel is used explicitly. Make changes to
modularize USB channels designated for Diag.

Change-Id: Id408e227e7e92178afa847064afe18bb6c0dd019
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-07-23 15:44:11 -07:00
sgownipa b911e9d0e9 diag: Enable Diag on Sensors Processor
Add diag support on the apps to communicate with diag on sensors
processor.

Change-Id: I14632cdf55d917316f72153324a445553839e531
Signed-off-by: sgownipa <sgownipa@codeaurora.org>
2014-07-17 13:13:10 -07:00
Ravi Aravamudhan b3d0c5b7a4 diag: Separate SMUX structures from diag
Diag driver is deeply coupled with SMUX structures. Make changes
to remove references of SMUX from diag core files.

Change-Id: I2abc6b98659fea5b5b429467af9ccf5ed3d37eaf
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-07-15 18:17:50 -07:00
Ravi Aravamudhan 97a56ddaf2 diag: Remove references to USB structures in diag
Diag driver is currently using USB structures internally for
data transfers. Refactor the code by removing these structures.

Change-Id: I9e283af0f99cfb732fe74371dcbeae9c15e83b64
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-07-15 17:34:10 -07:00
Ravi Aravamudhan 6492bd8dca diag: Streamline diag memory pool
The current design of Diag memory pools makes it difficult to scale.
Diag HSIC structures maintain their own memory pools. Make changes
to bring all memory pools together.

Change-Id: I08acbd2ea35438637f875fdc5c2ab896d9db3dd9
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-07-15 13:45:39 -07:00
Ravi Aravamudhan a39838b5a5 diag: Build Mask Centralization
Diag driver on the apps processor should be responding to the
mask requests from tools. Make changes to the driver to centralize
diag log, event, msg build time and run time masks on the apps
processor.

Change-Id: I14b4119343d2b5def1ef203f26215511bc3cd465
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-07-03 13:03:23 -07:00
Ravi Aravamudhan 0ed84440c1 diag: Change implementation of Diag masks
Diag message, log and event masks were formatted uniquely. Refactor
code to change the design of all diag masks.

Change-Id: Ic1516591088404204ad11187487b96690706f17a
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-06-27 10:24:40 -07:00
Ravi Aravamudhan e3dff7b54a diag: Make changes to diag control packets
Refactor handling of diag control packets and make them robust
by adding more error handling.

Change-Id: I90d0212a10269ac00cc1bd3731f38f20e3918b2e
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-06-12 16:12:44 -07:00
Ravi Aravamudhan 734dfd57e0 diag: Prevent suspend while reading data from SMD and HSIC
Diag driver can let apps processor go to suspend when receiving
data from remote processors and peripherals. This can result in
diag data being dropped on the apps processor. This patch ensures
that the apps processor is awake till the data is copied to the
user space.

Change-Id: Id3c46c66675d3b5632721dede5e59420b69c568e
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
2014-05-21 13:35:40 -07:00
Linux Build Service Account 64ffd8e594 Merge "diag: Copy limited data from and to the user space" 2014-03-26 07:44:42 -07:00