Commit graph

1512 commits

Author SHA1 Message Date
Amit Blay
552c3a28c9 soc: qcom: scm_qcpe: Derive HAB id from HAB vmid dt node
Derive the QCPE HAB id from the HAB vmid DTS node, rather
than have it hard coded into the driver.

Change-Id: I29ec7647890f8bc194d31f0402c5ed314572462f
Signed-off-by: Amit Blay <ablay@codeaurora.org>
2018-03-04 10:06:03 +02:00
Yong Ding
7fc5b94897 soc: qcom: hab: clean the pr_fmt redefined build warning
In include/linux/printk.h, pr_fmt is programmed in such
below way.
		#ifndef pr_fmt
		#define pr_fmt(fmt) fmt
		#endif
And in hab.h, there is a customized pr_fmt definition. To
avoid its redefinition warning, it should be undefed before
the customized one if it already exists. And such warning
happens in building khab.c now.

Change-Id: Ia7a58bc32c7205ac27767f9738271ddce8fef339
Signed-off-by: Yong Ding <yongding@codeaurora.org>
2018-02-26 19:19:13 -08:00
smanag
6ff791a34d drivers: soc: Synchronize apr callback and voice svc release
Issue is seen when apr callback is received while voice_svc_release
is in process of freeing the driver private data.
Avoid invalid access of private data pointer by putting
the callback and release functions in the same locked context.

Change-Id: I93af13cab0a3c7e653a9bc9fa7f4f86bfa0502df
Signed-off-by: smanag <smanag@codeaurora.org>
2018-02-20 18:01:58 -08:00
Sudarshan Rajagopalan
b07c54bfd1 msm: secure_buffer: Add SPSS_SP_SHARED vmid
Add support for SPSS_SP_SHARED vmid. This vmid is equivalent
to TZ VM, which can be used for sharing memory with TZ with
the assign call.

Change-Id: I10b98820796e8bab7b8275f5ddf44e8814dc0fb0
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
2018-02-16 01:35:43 -08:00
Linux Build Service Account
38edeeedb5 Merge "icnss: Remove vote for hardware resources when FW is not down" 2018-02-15 12:21:04 -08:00
Yong Ding
435b592e06 soc: qcom: hab: fix the panic in shmem device shutdown
The global struct list_head pchannels should be directly
used as the list head for pchan list traversal. Previously,
a local struct list_head instance was wrongly created and
used for such traversal. It caused kernel panic in system
shutdown.

Change-Id: Ifb82b55d5a0237fd12f8f53db095fccbcef96fb8
Signed-off-by: Yong Ding <yongding@codeaurora.org>
2018-02-08 19:18:47 -08:00
Hardik Kantilal Patel
7311ff92a3 icnss: Avoid wlan driver remove during modem graceful shutdown
In case of modem graceful shutdown case during wlan driver
remove it delete the wlan interface and later probe time
create the new interface. some time new interface may get
different interface index. Android wificond framework module
is not aware about this interface index change due to this
after recovery it try to do scan with old interface index
which result into scan failure.

To address above issue avoid wlan driver remove during modem
graceful shutdown.

CRs-Fixed: 2157835
Change-Id: I8b828bef8b5f43cc39ba8ee578dcafc6afaa98d6
Signed-off-by: Hardik Kantilal Patel <hkpatel@codeaurora.org>
2018-01-31 21:47:15 -08:00
Linux Build Service Account
d10ff5a6dc Merge "soc: qcom: qdss_bridge: add support for SSR" 2018-01-29 14:02:08 -08:00
Linux Build Service Account
db3f5f103e Merge "qcom: qpnp-haptics: extend stop timer for a longer request" 2018-01-26 05:40:02 -08:00
Linux Build Service Account
d09447b958 Merge "soc: qcom: pil: Increase MBA encryption timeout to 5secs" 2018-01-25 11:37:37 -08:00
Linux Build Service Account
80418e1d7c Merge "icnss: Avoid qmi exchange when fw is down" 2018-01-25 11:37:35 -08:00
Yuanyuan Liu
8d7bc77acd icnss: Remove sending uevent after FW ready
FW ready indication doesn't mean it is safe to access HW register.
FW ready only means that WLAN FW is initialized. The HW register
is safe to access only after FW ack the wlan enable mode request.
Hence removing uevent in FW ready indication handler. WLAN driver
will responsible for setting FW ready state once wlan enable mode
request is return success.

CRs-Fixed: 2168628
Change-Id: I769d848efb9dd427da0d71494090fcbf9514cfb2
Signed-off-by: Yuanyuan Liu <yuanliu@codeaurora.org>
2018-01-25 10:23:36 -08:00
Jitendra Sharma
e8daf3a464 soc: qcom: pil: Increase MBA encryption timeout to 5secs
Increase PIL timeout to give MBA more time for encryption
for modem segments as now wlan segments are also being
dumped in addition to modem and we see that encryption
for WLAN is taking extra time.

Change-Id: Ic1b43c63bcd4f0d46fbd73695a95de5917fddd9e
Signed-off-by: Jitendra Sharma <shajit@codeaurora.org>
2018-01-25 11:43:30 +05:30
Anurag Chouhan
0c89a0b5b2 icnss: Avoid qmi exchange when fw is down
Currently wlan Host driver call exported API's which
invoke qmi exchanges irrespective of the firmware status
which leads to QMI timeouts.
To address this issue avoid sending qmi request to
firmware when firmware is down.

CRs-Fixed: 2175302
Change-Id: Ie5e340cebf7ee7f6143472e7dca0dfd9600d1b7d
Signed-off-by: Anurag Chouhan <achouhan@codeaurora.org>
2018-01-24 21:30:57 -08:00
Jitendra Sharma
abe5dd4032 soc: qcom: pil: Add PDR minidump support
This change add support to collect PD dump along
with minidump on subsystem ssr event.

Change-Id: Icb3c20ee2f37ecc8bdbc91d9ba1ee7f383fa075a
Signed-off-by: Jitendra Sharma <shajit@codeaurora.org>
2018-01-24 13:05:12 +05:30
Fenglin Wu
453824b9ab qcom: qpnp-haptics: extend stop timer for a longer request
Haptics works as a timed output device and it doesn't expect another
enable request while current one is still in progress. If a new
enabling request comes in and its duration is longer than current
pattern's expiry then extend the stop timer.

CRs-Fixed: 2171601
Change-Id: I1f1f4e9a58140114a41d2af54b06cd798332eae4
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
2018-01-24 14:19:25 +08:00
Yuanyuan Liu
00d56be680 icnss: Remove vote for hardware resources when FW is not down
There's a race condition that could happen between PDR and driver
unloading, where platform removes its hardware resources vote
at the end of driver de-initialization in between the 2 stages
of WLAN FW reset recipe, which led to a bad state in WLAN HW.
To avoid this, check WLAN FW state before removing hardware
resources vote. Do not remove vote during driver unloading if
WLAN FW is in down state. The vote will be released within FW
ready indication handler once WLAN FW is recovered.

Change-Id: Ic45c42c4d05676e60a8fb7a8b5cae306b1c3344e
CRs-Fixed: 2158466
Signed-off-by: Yuanyuan Liu <yuanliu@codeaurora.org>
2018-01-22 10:41:43 -08:00
Linux Build Service Account
a407c5262d Merge "soc: qcom: hab: add compat_ioctl support" 2018-01-19 09:30:33 -08:00
Linux Build Service Account
d23b921b46 Merge "soc: qcom: hab: add dts parsing into hab driver" 2018-01-19 09:30:32 -08:00
Yong Ding
bc474ffea6 soc: qcom: hab: add compat_ioctl support
This is used to allow 32-bit userland programs to make ioctl
calls on 64-bit kernel.

Change-Id: Ie5066a3445c79859fc0b509159b34ff08d36358a
Signed-off-by: Yong Ding <yongding@codeaurora.org>
2018-01-18 01:30:45 -08:00
Yong Ding
d062c8ead0 soc: qcom: hab: add dts parsing into hab driver
HAB driver can parse its relevant entries from device
tree, and get necessary info, like its local vmid,
physical channel groups, and etc.

Change-Id: Iab0501a442bd3c89dd4b348570108dbe5ab0adca
Signed-off-by: Yong Ding <yongding@codeaurora.org>
2018-01-18 17:16:04 +08:00
Linux Build Service Account
879163d599 Merge "soc: qcom: glink: Add sub system up notification in glink" 2018-01-13 03:50:13 -08:00
Linux Build Service Account
424c9af495 Merge "soc: msm: qdsp6v2: fix compile warning in ion vm driver" 2018-01-11 04:14:56 -08:00
Linux Build Service Account
eb26d9d0c0 Merge "icnss: Add size check before assigning msa permission" 2018-01-11 04:14:54 -08:00
Linux Build Service Account
3ff2845f4e Merge "oc: qcom: rpm-smd-debug: Fix potential memory leaks" 2018-01-11 04:14:51 -08:00
Dhoat Harpal
f43f048321 soc: qcom: glink: Add sub system up notification in glink
Glink does not wait for pil to inform about subsystem up. It triggers
link up on first interrupt processed after ssr, this can cause stability
issues if some delayed interrupt is processed after ssr.

Glink waits for PIL to notify about subsystem up and initializes
its state only after that.

CRs-Fixed: 2165753
Change-Id: I71614e6d7e68bf2fa12ac7f27894492019bd3829
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
2018-01-10 18:45:11 +05:30
Yuanyuan Liu
d49bcf2440 icnss: Add size check before assigning msa permission
While assigning msa permission, number of memory region is passed
as an argument within platform private data. This number could
exceed the range of memory region buffer that preallocated. Hence
add size check before accessing region buffer.

Change-Id: I45f4efc7edaa636c861458dab74b1956767d2019
CRs-Fixed: 2101134
Signed-off-by: Yuanyuan Liu <yuanliu@codeaurora.org>
2018-01-09 17:04:11 -08:00
Linux Build Service Account
9c7f12cde2 Merge "soc: qcom: glink: Modify glink logging in tx_common" 2018-01-09 15:40:25 -08:00
Linux Build Service Account
57f58180d9 Merge "soc: qcom: glink_pkt: Exit if device handle is NULL" 2018-01-09 15:40:23 -08:00
Linux Build Service Account
fa18c55b4d Merge "soc: qcom: hab: add some more logs" 2018-01-09 15:40:00 -08:00
Saranya Chidura
352e75bb9e soc: qcom: qdss_bridge: add support for SSR
Add support for mhi shutdown and sys_error notification.

Signed-off-by: Saranya Chidura <schidura@codeaurora.org>
Change-Id: Icb5f3ad2161f137adc13d1fb8fe283b638845e59
2018-01-09 10:49:53 +05:30
Raghavendra Kakarla
9c1ab77010 oc: qcom: rpm-smd-debug: Fix potential memory leaks
Fix memory leak due to rpm request not freed during error conditions.

Change-Id: I440a58bf452e76c8886f7bcd8f89b24698a301e9
Signed-off-by: Raghavendra Kakarla <rkakarla@codeaurora.org>
2018-01-08 01:44:51 -08:00
Derek Chen
ed79174927 soc: msm: qdsp6v2: fix compile warning in ion vm driver
Fix compile warning in audio ion vm driver.

Change-Id: I7b60e0aedcd7ebca60b3ee67107d1c2f4d2611ac
Signed-off-by: Derek Chen <chenche@codeaurora.org>
2018-01-04 09:53:32 -08:00
Dhoat Harpal
5916f7a1f2 soc: qcom: glink: Modify glink logging in tx_common
Glink log in tx_common uses context based logging after
wait_for_completion_timeout. This can lead to use after free
scenerio, since transport of context can be freed during wait time.

Use glink error logging.

CRs-Fixed: 2164929
Change-Id: If66bcb7cba1772c2648c143f43a3b88af0799844
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
2018-01-03 02:59:31 -08:00
Dhoat Harpal
89472d6d9f soc: qcom: glink_pkt: Exit if device handle is NULL
In notify_state_worker function, device handle is restored, if
it is NULL. This leads to use after free in glink_queue_rx_intent.

Do not restore device handle.

CRs-Fixed: 2162377
Change-Id: Ie1a60309889001bb38aa7975b40c7de6e9a09c7a
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
2018-01-03 02:59:13 -08:00
Yong Ding
dec36d01cb soc: qcom: hab: add some more logs
With this, it becomes clear to know it is HAB's log and
which line of which function shows the log. Moreover, it
is helpful for issue debugging with those prepared logs.

Change-Id: I9641e779f592a5be7750885228cac6374880c301
Signed-off-by: Yong Ding <yongding@codeaurora.org>
2017-12-22 18:24:13 +08:00
Linux Build Service Account
5529a30833 Merge "soc: qcom: pil: Align size of MBA and DP image to 4k" 2017-12-21 08:50:04 -08:00
Kyle Yan
07e9f6994d soc: qcom: pil: Align size of MBA and DP image to 4k
Image address and size must be aligned to 4k as the SMMU works on a
4k granularity.

Change-Id: I4780aa67f09796ec0a8dd5b62da0e9a99c50e596
Signed-off-by: Kyle Yan <kyan@codeaurora.org>
2017-12-20 23:01:07 -08:00
Yuanyuan Liu
daee03cd52 icnss: Do not send uevent when driver is unloading
If modem crashed during wlan driver unloading, icnss driver
will call driver uevent callback to send FW down uevent when
it receives BEFORE_SHUTDOWN notification. If wlan driver is
de-initialized just before the callback is called, kernel will
panic as driver's context is freed. This can be avoid by not
sending uevent when wlan host driver is unloading. Instead,
icnss driver will provide an API to host driver to check if
WLAN FW is down or not.

CRs-Fixed: 2161425
Change-Id: I569fd85366522606ececeda74df85c51b9b2fc28
Signed-off-by: Yuanyuan Liu <yuanliu@codeaurora.org>
2017-12-20 10:53:14 -08:00
Linux Build Service Account
2b22d5e4e3 Merge "ASoC: apr: Add validity check to APR port" 2017-12-19 22:27:47 -08:00
Linux Build Service Account
9644b44c7d Merge "soc: qcom: glink_smem_native_xport: Send blocked signal command" 2017-12-19 22:27:40 -08:00
Yong Ding
8ad90a3cf7 soc: qcom: hab: add some code clean up
Add some code clean up for hab driver, including removing
implicit type conversion, and etc.

Change-Id: Ic2910f48063e22d1708972c1e0a5d23cbf179874
Signed-off-by: Yong Ding <yongding@codeaurora.org>
2017-12-18 18:41:11 +08:00
Yong Ding
cd4b6d858f soc: qcom: hab: fix issues in multi-threads cases
In multi-threads stress tests, some synchronization issues
were found. Here are the fixes for them.

Change-Id: I43a1fef5771af08f3fe7c0be486cc2d36667e773
Signed-off-by: Yong Ding <yongding@codeaurora.org>
2017-12-18 18:41:07 +08:00
Yong Ding
3addfa2d6e soc: qcom: hab: use separated irq for each pchan
Before this change, all physical channels share only one single irq
issued by only one single virtual shmem device from hypervisor.
To achieve better performance, each physical channel will be built
on top of one virtual shmem device with its own irq.

Change-Id: I5bf42896883865908c80df75f848174f4acf3717
Signed-off-by: Yong Ding <yongding@codeaurora.org>
2017-12-18 18:41:01 +08:00
Yong Ding
8185adc10d soc: qcom: hab: add multi-GVMs support
This is the new feature to support multiple Guest Virtual
Machiness communications.
In the past, HAB driver supported the communication between
only one single GVM and the host machine. With this new
feature, more than one GVMs can communicate with the host
machine over HAB driver.

Change-Id: I22eb17b7cf367e25e2d829d9dbd2d3a3463be1e8
Signed-off-by: Yong Ding <yongding@codeaurora.org>
2017-12-18 18:39:55 +08:00
Aditya Bavanari
c643a15d73 ASoC: apr: Add validity check to APR port
Add boundary checks for APR port received from ADSP.

CRs-Fixed: 2143207
Change-Id: I9a7fa39ee223e1859323caa6eb74c1c8a26a041d
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2017-12-18 12:22:43 +05:30
Dhoat Harpal
e92da40a5d soc: qcom: glink_smem_native_xport: Send blocked signal command
Glink smem xprt driver is not sending blocked signal command to
remote side, when fifo gets full during tx_data. This results in
Glink tx_thread taking longer time in sending data to remote side.

Glink smem xprt driver sends blocked signal command.

CRs-Fixed: 2154819
Change-Id: I105fce28449db2dd0931292cd6850d2409ae683d
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
2017-12-14 21:39:15 +05:30
Swetha Chikkaboraiah
59bea78942 soc: qcom: pil: NULL check before pil_memset_io
In existing implementation if vmap fails device panics for
NULL pointer access while doing pil_memset_io.
Instead check for the NULL pointer.

Change-Id: I1b9fd084a8c168b70f6e01134e4122445e4873b4
Signed-off-by: Swetha Chikkaboraiah <schikk@codeaurora.org>
2017-12-10 06:31:30 -08:00
Yuanyuan Liu
8a23ecb418 icnss: Reject driver reinit request when FW is down
Reject driver reinit request when WLAN FW is down as FW
is in a bad state and can't communicate with host driver.

CRs-Fixed: 2153375
Change-Id: Id16cbfc05984091d61b18c98f7397baa871f82b4
Signed-off-by: Yuanyuan Liu <yuanliu@codeaurora.org>
2017-12-05 10:19:25 -08:00
Yuanyuan Liu
554899595c icnss: Reject register_driver request when WLAN FW is down
Reject regsiter_driver request when WLAN FW is already down as
WLAN FW is in a bad state and can't communicate with host driver.

Change-Id: I57ba839101f5c0a361e74060b18b45f87c71634c
CRs-Fixed: 2151726
Signed-off-by: Yuanyuan Liu <yuanliu@codeaurora.org>
2017-12-04 11:18:42 -08:00