Commit graph

58 commits

Author SHA1 Message Date
Linux Build Service Account
cbae14bbfc Merge "ASoC: msm: Fix KW issues for audio drivers" 2018-03-21 10:10:17 -07:00
Tony Han
0152bff079 ASoC: msm: Fix KW issues for audio drivers
The fixed issues include variable initialization missing and improper NULL
pointer checking.

Change-Id: I5302cf84f7f0414fe0cf69ccc0cafc8225142c5f
Signed-off-by: Tony Han <xiahan@codeaurora.org>
2018-03-15 13:52:52 +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
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
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
Yimin Peng
b8a78b95ae audio: ion: switch to msm ion on gvm.
Fix build error if msm ion is enabled.

Change-Id: Ica2af79b0ac344f663bbbbf3495a14e2ca947e59
Signed-off-by: Yimin Peng <yiminp@codeaurora.org>
2017-11-02 18:52:27 +08:00
Honghao Liu
a71c664a97 soc: qcom: add SMMU support for virtualized audio ION driver
Update the virtualized audio ION driver to add SMMU support.
The virtualized audio ION driver will provide the ION memory
allocated from the guest VM to the physical VM to perform SMMU
mapping.

The virtualized audio ION driver will receive SMMU mapped
device address from physical VM and provide the device address
to its clients. Upon its client frees the memory, the virtualized
audio ION driver will request the physical VM to perform SMMU
un-mapping.

CRs-fixed: 2099245
Change-Id: Idca4ecda65910308d7f7af288381866ab4ce4a7a
Signed-off-by: Honghao Liu <honghaol@codeaurora.org>
2017-10-18 12:10:55 -07:00
Derek Chen
1bc3c0f656 soc: qcom: add audio apr and ion virtualization support
Add support for virtualized APR and ION frontend driver
for audio.
Virtualized APR frontend driver resides in guest VM and
supports all legacy APR APIs. It will rely on MSM_HAB
to communicate with APR backend driver, which resides in
physical VM, where legacy SMD is utilized for communication
between APPS and ADSP.
Virtualized ION driver currently is designed to extract
physical memory through hypervisor abstracted ion layer,
which can be shared between APPS and ADSP directly.

CRs-fixed: 2047379
Change-Id: I7dad5aebfd1db00cd32807dc1219818a7a4e62c5
Signed-off-by: Derek Chen <chenche@codeaurora.org>
2017-10-18 11:28:36 -07:00
Linux Build Service Account
f61a791dc1 Merge "ASoC: msm: qdspv2: add an API to destroy ion client" 2017-08-23 20:24:47 -07:00
yidongh
4c78ad9740 ASoC: APR: initialize struct member before being used
Initialize member value of struct apr_client_data after declaration.

CRs-Fixed: 2091948
Change-Id: I8a185ebd4126f7d064de90bf652bc96c2ab7b408
Signed-off-by: Yidong Huang <yidongh@codeaurora.org>
2017-08-22 01:36:18 -07:00
Vidyakumar Athota
e4faef1e35 ASoC: msm: qdspv2: add an API to destroy ion client
Currently ion fd is used to extract ion handle to free ion client.
ION FD is not valid if user-space application is crashed so ion handle
is returned to the client during msm_audio_ion_phys_assign() API which
is used to destroy ion client in msm_audio_ion_phys_free() API.

Change-Id: Idcc4ca838741aac26662a679117af9d9c935e630
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
2017-08-21 10:56:56 -07:00
Vidyakumar Athota
92c993fd6d soc: qcom: qdsp6v2: use hyp_assign() API for secure memory
Add a new API to call hyp_assign_phys() function to assign the
memory permissions to different subsystem like ADSP for secure
playback applications.

Change-Id: I1d13bd0cd3b5cdcbe37488800c7dad44a20f4996
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
2017-08-07 22:30:01 -07:00
Linux Build Service Account
36d10a3882 Merge "ASoC: audio_notifier : Change logic for initial boot" 2017-06-01 01:53:14 -07:00
Ramprasad Katkam
098babd32f ASoC: audio_notifier : Change logic for initial boot
In sdm660 due to change of notifier logic, there is a chance of
receiving only service down notifications during bootup. In this case
the initial boot flag is not cleared, as it is only cleared on
service up notification currenly.because of this, the next service down
 event during SSR/PDR will be ignored. To fix this, clear initial boot flag
for both first service up/down notification, so that Reset notifications
are not ignored.

Change-Id: Iae3ccc6a81fac5d9e5c640f0fee8bb2aee2271cd
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2017-05-19 02:28:21 +05:30
Ramprasad Katkam
3589a465d7 ASOC: APR: Add separate notifier nodes for adsp/modem notifications
APR registers for subsys_notification via audio_notifier for both adsp &
modem services, with the same notifier node. This causes intermixing of
the audio notifier lists of modem and adsp as the same apr notifier node
is added to  both adsp & modem list.Make separate notifier nodes for apr
adsp & modem notifications to avoid this issue.

Change-Id: I4a9146fbe340d02e8af0082d5342e5ac8009e0c4
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2017-05-19 02:05:41 +05:30
Ramprasad Katkam
8f0c7ae73c ASoC: APR: Fix missing APR deregister from asm
APR deregister is to be called for two ports from both
q6asm_callback(during RESET) and q6asm_audio_client_free.
In race condition between the two, APR deregister is called
only for one port. The mismatch in apr register-deregister
count causes apr not to reset service after ssr, causing
APR communication failure.

Change-Id: Ibd0528215bf2fb986eda03ae0d683b2af31358fe
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2017-05-18 21:59:39 +05:30
Linux Build Service Account
8d3c81087c Merge "ASoC: msm: q6dspv2: fix APR deregistration logic in ASM during ADSP SSR" 2017-05-01 23:56:51 -07:00
Linux Build Service Account
8ab454448f Merge "ASoC: msm: qdsp6v2: Initialize variables before use" 2017-04-14 07:30:06 -07:00
Banajit Goswami
860a024bf4 soc: q6dspv2: apr: fix client registration refcount
Audio Packet Router (APR) is used by multiple audio services
to communicate between APSS and ADSP. These audio services
registers for service level APR communication (port 0xFFFFFFFF),
or for session level APR communication (using port 0x101 etc.).
The services might choose to call apr_register for any port at
random. The expectation is that the refcounting for the number
of ports registered with APR for any specific service, is handled
irrespective of the order in which registrations are done. The
current logic fails to handle the refcounting when apr_register
is called for 0xFFFFFFFF before other session based ports. Fix
this correctly using the service count (svc_cnt) variable in apr_svc.

CRs-fixed: 2022490
Change-Id: I2fcd1269facf24d509db0d90314e0d2545a2ad67
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
2017-04-13 00:46:31 -07:00
Linux Build Service Account
f0677827e0 Merge "drivers: soc: apr: remove GLINK_TX_REQ_INTENT flag in apr write" 2017-04-04 03:08:14 -07:00
Surendar Karka
028dfd7730 drivers: soc: apr: remove GLINK_TX_REQ_INTENT flag in apr write
Glink will return failure if there are no intents available
at the remote endpoint. Remove the GLINK_TX_REQ_INTENT flag
so that glink returns EAGAIN error code so that apr_tal
can retry.

CRs-Fixed: 2002511
Signed-off-by: Surendar karka <sukark@codeaurora.org>
Change-Id: I494bd26ed48ea2d80b1f76c8ee871ec76d428e4c
2017-03-23 12:44:22 +05:30
Rohit Kumar
59212de85b drivers: soc: Add mutex lock in audio_notifier_late_init
Audio_notifier_late_init registers clients dependent on PDR to
correct service if registration to PDR on init fails.
There is a possible race condition when audio_notifier_late_init
and audio_notifier_register is called at same time. This may
cause manipulation of the same lists and critical data at the
same time. Add mutex lock to protect critical data.

CRs-Fixed: 2016927
Change-Id: Iec5190a93b390d46f47fd67fd79b1b83d7fe4b29
Signed-off-by: Rohit Kumar <rohitkr@codeaurora.org>
2017-03-22 00:25:59 -07:00
Karthikeyan Mani
a5bc5ed2f1 ASoC: msm: qdsp6v2: Initialize variables before use
Initialize variable before use to avoid
invalid memory access.

CRs-fixed: 2004067
Change-Id: I1ede035a71a620e6981731f0c76d90625c4898b8
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2017-03-17 15:53:48 -07:00
Siena Richard
5b2f6e011b drivers: soc: add size check
Add size check to ensure the payload fits inside the declared payload
size to prevent loss of data when copying.

CRs-Fixed: 2009224
Signed-off-by: Siena Richard <sienar@codeaurora.org>
Change-Id: I4275c626605272941143b54a7b8861b25f8e750a
2017-03-03 10:29:35 -08:00
Satya Durga Srinivasu Prabhala
544dff7ea4 soc: qcom: pil-loaders: move pil loading of ADSP, SLPI & CDSP to workqueue
When pil loading done through user space helper, there is a possibility
that signal could be pending on thread that initiated the pil, which would
lead to pil failure. To avoid this issue, move pil loading for ADSP, SLPI
and CDSP to separate workqueue in respective loader drivers.

Change-Id: Ie60a7eba7c52ac1565ce166d0e367379cce0b03e
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
2017-02-27 11:46:00 -08:00
Vikram Panduranga
43d4e6ad30 drivers: soc: apr: add wake_up for a waitqueue
APR client waits in a waitqueue for glink to queue intents.
On receiving notification about availability of intent, wake_up
should be called on the waitqueue to wake up any waiting APR
client.

CRs-Fixed: 1096481
Change-Id: I5a2b902fa831709092be1a9a3073b8d784adba81
Signed-off-by: Vikram Panduranga <vpandura@codeaurora.org>
2017-02-22 12:16:02 -08:00
Vatsal Bucha
59645729eb drivers:soc: Avoid use of uninitialized variable
While notifier de_register, we access the list which is not initialized.
Hence can result in access of uninitialized variable.
Update the loop to use correct list variable.

CRs-Fixed: 2002748
Change-Id: Ibff56477ed3fba90c8ff704ea7dbe3c472f59836
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2017-02-20 21:31:48 -08:00
Siena Richard
d323731631 drivers: soc: add mutex to prevent response being processed twice
Add a mutex to prevent two threads from processing the same response
at the same time. This ensures responses are processed completely and
sequentially.

CRs-Fixed: 1116015
Change-Id: Id2ef32edb939f8af2850b54bd6f6f447939c0732
Signed-off-by: Siena Richard <sienar@codeaurora.org>
2017-02-07 15:02:16 -08:00
Linux Build Service Account
9ffdcf0122 Merge "drivers: soc: apr: create glink buffers dynamically" 2017-02-03 06:26:57 -08:00
Sathish Ambley
224c188111 msm: CDSP: Enable CDSP loader driver
Add CDSP loader driver to bring compute DSP out of reset
during boot.

Change-Id: I2571e2158fcf7706efc5a5922da24f22755eeed7
Acked-by: Himateja Reddy <hmreddy@qti.qualcomm.com>
Signed-off-by: Sathish Ambley <sathishambley@codeaurora.org>
2017-01-23 09:56:24 -08:00
Shiv Maliyappanahalli
2ab8a458a0 drivers: soc: apr: create glink buffers dynamically
It is not always guaranteed that glink will ack all
tx buffers intime and hence apr might run out of tx
buffers for apr message transactions. Create TX buffers
dynamically instead of preallocating fixed number of
buffers.

Change-Id: I53c9529d1e84a88cc2e0b161a8a5047d5a475620
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
2017-01-20 17:25:44 -08:00
Linux Build Service Account
cd316285c5 Merge "drivers: soc: implement notify_tx_abort()" 2016-11-07 22:29:10 -08:00
Shiv Maliyappanahalli
e20ce23300 drivers: soc: implement notify_tx_abort()
The glink buffers used to send commands to adsp using
glink_tx() will be freed by glink using notify_tx_abort()
during remote subsystem restart. Implement notify_tx_abort()
so that the buffers can be reclaimed by APR.

Change-Id: Ibc9ce23d4ba15d0e3faa9db3e760965a7439aed8
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
2016-11-03 11:39:41 -07:00
Siena Richard
a608944cfb drivers: soc: Add new parameters for APR IPC logging
Add the ability to log source address, dest address, opcode, token,
and possibly return value in APR IPC logging to better assist
with debugging issues.

CRs-fixed: 1064187
Change-Id: I86976ac6139b8c76d9239acae073f03fbc5e0a38
Signed-off-by: Siena Richard <sienar@codeaurora.org>
2016-10-26 10:39:41 -07:00
Linux Build Service Account
a1989e62bc Merge "drivers: soc: Initialize return var to default value" 2016-10-25 18:31:01 -07:00
Siena Richard
efb766e449 drivers: soc: add size checks and update log messages
Add size checks to validate minimum size is met. Update log messages
to include only relevant information to ensure logs are accurate and
useful.

Change-Id: Idf76a7d964ec6989a0474d49895e54103f17938b
CRs-fixed: 1073129
Signed-off-by: Siena Richard <sienar@codeaurora.org>
2016-10-13 17:32:42 -07:00
Linux Build Service Account
3fe3b20c5e Merge "msm: kgsl: Remove obsolete IOMMU domain attribute" 2016-10-11 01:16:53 -07:00
Kuirong Wang
cbd3e0cb06 ASoC: msm: Update the error handling when APR sends packet failed
Update the error handling when APR sends packet failed so that audio
driver can perform proper error recovery.

CRs-Fixed: 1050605
Change-Id: I6210e244e6299ec747836f40d03e92c15c6e53ee
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
2016-09-30 10:56:00 -07:00
Mitchel Humpherys
7052d6a21c ASoC: msm: qdsp6v2: Remove obsolete IOMMU domain attribute
The DOMAIN_ATTR_COHERENT_HTW_DISABLE IOMMU domain attribute is being
removed.  SMMU coherency will be configured through the SMMU device tree
nodes moving forward.  Remove the obsolete option.

Change-Id: I6ae3cebd4f3a1f3abc8d84ab407d2e256d55309a
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2016-09-26 17:42:40 -07:00
Vikram Panduranga
1d36d1fe94 drivers: soc: Initialize return var to default value
Initialize return variable to default invalid handle before
it is used. During an error condition it sets correct
error code to avoid returning uninitialized return value.

Change-Id: Ibad70b1bb364b60439c4988e318105a733396db8
Signed-off-by: Vikram Panduranga <vpandura@codeaurora.org>
CRs-Fixed: 1059495
2016-09-26 17:23:54 -07:00
Ben Romberger
03ef2316fd drivers: soc: Enable APR driver to use audio notifier
Modify APR driver to use audio notifier framework.
Audio notifier framework connects to best available
subsystem for remote notifications.

Change-Id: I783b7df9c7e0253e5dc88bd60e0b5300e26fba56
CRs-Fixed: 1054000
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
2016-09-26 14:50:54 -07:00
Ben Romberger
bc0560f6fa drivers: soc: Add Audio Notifier, PDR, and SSR drivers
The audio PDR driver is used to control the process
domain restart recovery mechanism. The audio SSR
driver is used to control the Subsystem Restart
recovery mechanism. Both are controlled through the
Audio Notifier driver which determines whether PDR
or SSR is used and provides the core interface to
all audio drivers.

Change-Id: I15325c1385eaa0f0cca2c07130f2b4a997d98e1f
CRs-Fixed: 1054000
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
2016-09-26 14:50:05 -07:00
Ben Romberger
01fb5de81b drivers: soc: Set APR Glink transport to SMEM
Set APR to use SMEM for the Glink transport
type instead of smd_trans. SMEM is used for all
Glink transport. The transport smd_trans is no
longer used and use of it as a transport causes
Glink to take a very long time to establish a
connection.

Change-Id: Ie65f79051bfc452c63067c21efcfd9d98429bb15
CRs-Fixed: 1050763
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
2016-08-09 16:39:09 -07:00
Shiv Maliyappanahalli
5f0a4b1fef drivers: soc: set apr handle to NULL on glink_open error
After sub system restart, opening glink channel while
lpass transport is not up results in failure and returns
error pointer. APR glink client although returns error for
the first glink command, does not set the apr handle to NULL
and incorrectly assumes err pointer as a valid handle when
opening the channel again.

Fix this by updating the apr handle to NULL when glink_open()
fails.

Change-Id: I53a219b1ebed5bc3593d500d80d580aac6431ab5
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
2016-07-11 14:27:35 -07:00
Josh Kirsch
c0494b3e29 drivers: soc: Add buffer overflow check for svc send request
Add buffer overflow check in voice_svc_send_req.

CRs-fixed: 1010081
Change-Id: I4ae703334b0cf04f327b392bc9cd6febd4ad32f2
Signed-off-by: Josh Kirsch <jkirsch@codeaurora.org>
2016-07-05 15:28:38 -07:00
Ben Romberger
b65caeaa32 ASoC: msm: qdsp6v2: Change audio drivers to use %pK
Change all qdsp6v2 audio driver to use %pK instead
of %p. %pK hides addresses when the users doesn't
have kernel permissions. If address information
is needed echo 0 > /proc/sys/kernel/kptr_restrict.

Change-Id: I7baa9f127266726fecf9238167a1e0128a258847
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
2016-05-24 11:58:34 -07:00
Banajit Goswami
5c8fe61c60 soc: qcom: q6dspv2: add priority to ADSP SSR notifier for APR
Currently ADSP SSR notifications to APR come much earlier
than ADSP SSR notifications to SLIMbus. This causes audio
playback resume to take more time than expected, as code in WCD
codec driver has dependency on the sequence at which SSR
notifications are received. Add a priority to the notifier
block for APR, so that the APR has lower priority compared
to SLIMbus.

CRs-fixed: 989828
Change-Id: Idb089ec8d036d441e32bc927d7294121a1d2735d
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
2016-05-06 12:06:22 -07:00
Josh Kirsch
1f2cb1a4a4 drivers: soc: Add intent notification callback for APR Glink
APR is required not to send any packet until the far end queues
at least one intent. Add the wait during client registration time.

Change-Id: Ie29ddda4527ae7a70afff2c595d6e3c76500a8af
Signed-off-by: Deven Patel <cdevenp@codeaurora.org>
Signed-off-by: Josh Kirsch <jkirsch@codeaurora.org>
2016-04-22 14:58:45 -07:00
Deven Patel
8e969233a2 drivers: soc: Fix implicit typecast warning
Remove unused variable in the function and avoid typecast
const pointer to non-const ones.

CRs-fixed: 987841
Change-Id: Iaf59087f9d68e134125621afe42d92d49b6b90fc
Signed-off-by: Deven Patel <cdevenp@codeaurora.org>
2016-03-25 16:03:34 -07:00
Deven Patel
1543f39115 drivers: soc: Add transport info when APR opens a channel
The transport "smd_trans" is required if far end is running SMD
instead of Glink. If far end is already running Glink, this property
is ignored in Glink layer and communication will be through Glink.

CRs-fixed: 986398
Change-Id: I76b59a9782ab77e1ee3b37afb1db6ec01340ea33
Signed-off-by: Deven Patel <cdevenp@codeaurora.org>
2016-03-25 16:03:14 -07:00