Commit graph

23 commits

Author SHA1 Message Date
Dilip Kota
e98ad55129 slimbus: Avoid uninitialized variable access
Avoid reading uninitalized variables.
Initialize it to default value before reading.

Change-Id: Ic34dfec16357cbc4992912e883f21f014cf8a66c
Signed-off-by: Dilip Kota <dkota@codeaurora.org>
Signed-off-by: Shrey Vijay <shreyv@codeaurora.org>
2018-03-20 19:25:09 +05:30
Linux Build Service Account
732c56a77c Merge "slim: msm: Avoid registration with notifier if service is not located" 2016-09-13 05:43:48 -07:00
Linux Build Service Account
d3747e3e27 Merge "slim: ngd: Avoid warning associated with TASK_INTERRUPTIBLE" 2016-09-13 05:43:47 -07:00
Sagar Dharia
e92e3b2194 slim: msm: Avoid registration with notifier if service is not located
Service locator framework may call callback with LOCATOR_UP even if
service is not located. Avoid registering with service-notifier in
that case.

Change-Id: Ib73570d1703803dbe0d769d9d43f9d7d2b257770
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
2016-09-09 11:02:56 -06:00
Dilip Kota
acca783612 slim-msm: Differentiate SSR from Noise during power up
During power up operation check whether power up
failure is due to SSR or noise over slimbus.
If power up failure is due to SSR prevent retry
operation.
This change also do allocate DMA memory for slimbus
bulk trasactions. Memory should be DMA for slimbus
transactions as using non-DMA memory will end up
in creating bounce buffers and affect the performance.

Change-Id: Iaca520d92c4ee2d73f8e751699779e6cfc9ddb87
Signed-off-by: Dilip Kota <dkota@codeaurora.org>
2016-09-01 18:50:32 +05:30
Sagar Dharia
6354fad32c slim: ngd: Handle Process Domain restart
Slimbus master component driver typically resides in a domain on remote
processor (ADSP). If that domain restarts, slimbus master driver
restarts reinitializing the slimbus HW.
Handle such process domain restart, and use subsystem restart if the
process domain restart is not available.

Change-Id: I253c33d07aad513a6621571e870e1d3f66a1b6a1
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
2016-08-18 15:08:42 -06:00
Dilip Kota
b5bc5681c5 slim-msm: Handling resources during port de-allocation
In port de-allocate operation free the resources
only if port is connected as memory allocates while
connecting the port.

Change-Id: I743a27025e83f0f4bb8a47c20b2bb2d4cff80caa
Signed-off-by: Dilip Kota <dkota@codeaurora.org>
2016-08-11 22:30:28 -07:00
Sagar Dharia
2a488ee470 slim: msm: Handle slimbus HW noise during early boot-up
Capability exchange may timeout during boot due to noise on slimbus
lines. Introduce retry mechanism to recover from this state. If the
HW noise happens just after capability exchange is successful, make
sure slimbus satellite HW powered on again by checking HW status
during message transfer.

Change-Id: I6ebf0ec78201551152bf6ac0d4372f36734a4708
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
2016-07-27 13:41:39 -07:00
Dilip Kota
97442af04a slim-msm: Synchronize SSR callbacks
Subsystem will restart within short timeframe.
Synchronise subsytem up/down callback notifications
to avoid functionality failures.
Use mutex locks to achieve synchronization.

Change-Id: I5881c7d468507bb8402a2e9f8178b9c31e57e8a5
Signed-off-by: Dilip Kota <dkota@codeaurora.org>
2016-07-27 13:41:16 -07:00
Dilip Kota
067b2cf5fd slim-msm-ngd:Avoid using stale pipe handle
Make sure to use pipe handle from the TX
endpoint rather than using a stored handle.
The stored handle may become invalid if SSR
happens between storing of that handle
and locking the mutex.

Change-Id: I53e8f860c2d50061b6c4e6ce2f944c1e2ed8dff2
Signed-off-by: Dilip Kota <dkota@codeaurora.org>
2016-07-27 13:40:53 -07:00
Sagar Dharia
4c4cade3ed slim: ngd: Avoid warning associated with TASK_INTERRUPTIBLE
Use wait_for_event_interruptible instead of setting current task to
TASK_INTERRUPTIBLE to avoid associated warning.

Change-Id: I576959d88ff8278f890ab71963fcec5f547c264d
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
2016-07-25 16:41:05 -06:00
Sagar Dharia
99a0947bbf slim: ngd: retention support in power-collapse
Support retention by checking interrupt status rather than logical
address register. During retention, interrupt status is zero'ed but
logical address may be retained to avoid report-present generation.

Change-Id: I9e7f24c5f4eb722643bf3fac2d5c898ad107dd24
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
2016-05-11 17:44:11 -07:00
Phani Kumar Uppalapati
c9ef6d3852 slimbus: Add API to get matching ID table
Add API in slimbus driver for clients to get the
matching ID table which helps in accessing driver
data and name fields.

CRs-fixed: 975738
Change-Id: I09c9f1de74e348b032d215cbb0fb9ba6c7aecf18
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
2016-05-11 17:44:02 -07:00
Sagar Dharia
a632de294e slim: msm: ngd: Add priority to DSP SSR notifier
Currently SSR framework seems to make callbacks in the order
they were registered, or based on pririties.
Due to this, APR's callback (done in its probe) may be executed
before slimbus driver's callback (only registered after children
are probed). This still works, but may take longer since codec
may try sending some disconnection commands over slimbus if APR
is notified about SSR before codec was notified by slimbus.
This failure may result in some delay in SSR handling which is
more than the KPI numbers expected for this recovery mechanism.
Priority is added to slimbus SSR notifier registration to make
sure its callback is called before APR's.

CRs-Fixed: 996871
Change-Id: Ib7f002d52310dc13b60a18972a6899ebae21ba24
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
2016-05-06 12:06:22 -07:00
Dilip Kota
53ae191724 slim-msm-ngd: Register with specific subsystem
Slimbus master is present in different subsystem
on different tragets.
Register with specific subsystem as mentioned in
the device tree.

Change-Id: I1bee7fdd7578deedca8e4e43af9055b41b96d652
Signed-off-by: Dilip Kota <dkota@codeaurora.org>
2016-03-23 21:21:18 -07:00
Sagar Dharia
df0d2be28a slimbus: Reset data channels for a controller when framer reboots
Framer is responsible for clocking slimbus, and when it reboots, state
of all associated data channels is reset to be consistent with HW
state.

Change-Id: Ie74ace2b20ad6c255440ff6ce593f7d5503bf388
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
2016-03-23 21:17:22 -07:00
Sagar Dharia
8957b9e33d slim: msm: Improve bulk message timeout error handling
If a bulk message times out due to interrupt starvation, a late
coming interrupt may access structures that are not valid.
Improve timeout error handling by resetting variables, and changing
relevant logging.

Change-Id: Ie0ee2fd9c2ce1628c69e1975fe713a2a26d9e716
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
2016-03-23 21:17:20 -07:00
Sagar Dharia
1389ff19f5 slim: msm: Fix the instance number being sent to ADSP
Every bus instance can have 2 NGD devices. Fix the instance number
determination based on NGD device-id.

Change-Id: I515f4f09d58a7abc0c0322ca714b88fb847a0909
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
2016-03-23 21:16:53 -07:00
Sagar Dharia
5e06ef1264 slim: msm: Set Device state to sleep in case of a suspend-timeout
If low-power mode is not entered due to timeout, it is possible that
HW has actually been turned off by ADSP but the response was not
received by driver on apps on time.
Change device state to sleep to make sure HW is woken up for
subsequent runtime-resume operation.

Change-Id: I4e454f7e90e1244985c86286b95202eecfc50a7e
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
2016-03-23 21:16:12 -07:00
Sagar Dharia
9d9d7008b7 slim: msm: Return success for ch-remove type of messages during SSR
During SSR, all channels are removed and ports are disconnected since
slimbus HW is not functional. Return success to clients for such
calls so that client can mark channel/port state constistent with HW

Change-Id: I9b18f8e7ffe233090c9612d0811a7d36645d0329
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
2016-03-23 21:15:51 -07:00
Sagar Dharia
ed2fedf0a5 slim_msm: Gracefully handle QMI timeout failures
QMI timeout can happen if other processor doesn't respond within the
time expected by slimbus driver on apps. It has been noticed that QMI
call to power-on slimbus rarely takes more than 500msec. Timeout
is increased to allow that possibility. Additionally, QMI channel is
drained out of left-over messages and runtime-PM state check is
modified to allow graceful handling of timeout if at all any timeout
still happens.

Change-Id: I392a4fa761735135a261fb543815823cee5eba41
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
2016-03-23 21:13:24 -07:00
Girish Mahadevan
3dae886c11 slimbus: Remove use of PM_RUNTIME feature flag
Remove the use of PM_RUNTIME feature flag which is obsoleted on newer
kernel versions. Instead use PM feature flag to condiitionally compile
RPM callbacks.

Change-Id: I775c89f79b698bf3f20fdb655216027e58e7059d
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
2016-03-22 11:10:36 -07:00
Girish Mahadevan
1f6c29a46f slimbus: Add snapshot of slimbus driver
Add snapshot of slimbus driver from msm-3.18 branch.
Baseline:
e70ad0cd5efdd9dc91a77dcdac31d6132e1315c1

Change-Id: I82f8f91596d2c3e9ef111e26c80298d990f6c193
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
2016-03-22 11:10:35 -07:00