When we call crypto_qti_program_key to program the key, and
it fails due to trustzone busy issue, we try to call invalidate
key method just after that, and in the process, overwrite the
error code returned by the program key failure. Fix this by handling
the errors from both program key and invalidate key separately,
and return the program key error code to caller.
Test: Verified device boot up and reboot.
Change-Id: Iaff0844f68b4886c23e1840d7e0e4a404d38fc96
Signed-off-by: Vaibhav Agrawal <vagrawa@codeaurora.org>
Currently driver is just proceding further if start xfer times
out for ep0. Start xfer failing for ep0 indicates that the
controller is already in bad state and it can access unmapped
address leading to SMMU fault. Prevent this by marking this as
an error event and restart USB session.
Change-Id: Ia46387e16a79318ad945079ced7209a8f2bf47ef
Signed-off-by: Pratham Pratap <prathampratap@codeaurora.org>
This change is for general scheduler improvements.
Change-Id: I37d6cb75ca8b08d9ca155b86b7d71ff369f46e14
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
Avoid deadlock scenario when wake interrupt arrives at enumeration
time and holds recovery lock and wake handler workqueue tries to
acquire enumeration lock. In parallel client driver can call
msm_pcie_pm_control for suspend where enumeration lock could
be successfully acquired by msm_pcie_pm_control instead by wake
handler and waiting for recovery lock which is currently acquired
by wake handler (which is currently waiting for enumertion lock)
which could leads to deadlock scenario.
msm_pcie_enumerate wake handler pm_control
| | (suspend thread)
| | |
| x acquired |
x acquired | recovery lock |
| enumerate lock | |
| o waiting for |
| enumerate lock |
x released x acquired
| enumerate lock | enumerate lock
|
o waiting for
recovery lock
we have fixed the order of locking in msm_pcie_pm_control to avoid
deadlock scenario.
Change-Id: Ifc72c643f7c0793cfa10a953723e953ce73a82b6
Signed-off-by: Vivek Pernamitta <vpernami@codeaurora.org>
This chage adds retry mechanism to smcinvoke driver
in case when secure side is busy. Driver will wait for
30 milliseconds before retrying the scm call. This
change also makes smcinvoke driver at par with qseecom
in terms of trying for around 2 seconds before sending
EBUSY error back to client.
Change-Id: Ie9523bc81f3aa03497836f06180c9d3f8a8efc99
Signed-off-by: Anmolpreet Kaur <anmolpre@codeaurora.org>
'commit abc0fc15dcec ("block: Enable BFQ io scheduler as default")'
This is to fix the Native Daemon and Zygote Preload regressions
during bootup.
Change-Id: I4cfb40d0622319ce84d17fa409a4fcb5ab429dbc
Signed-off-by: Pradeep P V K <pragalla@codeaurora.org>
Currently support to enable/disable dplus hsphy irq and dminus hsphy
irq in case of resume/suspend is present only for pdc interrupts.
This support should be present even for non pdc interrupts if the
platform uses snps usb hs phy. Absence of this support leads to
dp/dm hsphy irq not being fired and usb stuck in lpm in host mode
eventhough there is a disconnect or remote wakeup issued from
hs/fs device connected to it. Hence add support to enable/disable
dp hsphy irq and dm hsphy irq for platforms that use snps hs phy.
On platforms which use snps phy and mpm interrupts, dp/dm lines are
directly connected to gic when cpu is active, mpm is involved only
when cpu is not active. Now in cpu active case, in host mode if usb
goes to lpm with hs/fs/ls device connected and unplug/remote wakeup
is issued, dp falling edge is monitored in software to detect that.
But gic is not capable of detecting a falling edge. Hence this
change adds support to program power event irq to wakeup the system
in this case. Note that gic takes care of dp rising edge wakeup
events like usb connect over otg when usb is in lpm and in host
mode. Only in case where dp falling edge is monitored i.e in case
of hs/fs/ls device connect and usb enteres lpm, then power event
irq is used to detect wakeup event as GIC cannot detect falling
edge.
Change-Id: I085b86c7df52daeedfb35cb71657c5163c2d5aaa
Signed-off-by: Rohith Kollalsi <rkollals@codeaurora.org>
Platforms using Synopsys SS phy are enabling pwr_evt_irq for
wakeup events in host mode as a part of dwc3_msm_suspend, but
before all the resources have been relinquished. So it is
possible that an IRQ is fired before dwc->in_lpm could be set to
1. Because of this, the pwr_event_handler will try to read
STAT_REG without issuing resume_work leading to unclocked access.
Fix this by enabling pwr_evt_irq only after in_lpm flag is set to
1, hence ensuring resume when the irq is fired.
Change-Id: I9772f427ecd10c2922c998cf0d57734362413051
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
'commit abc0fc15dcec ("block: Enable BFQ io scheduler as default")'
This is to fix the Native Daemon and Zygote Preload regressions
during bootup.
Change-Id: I4cfb40d0622319ce84d17fa409a4fcb5ab429dbc
Signed-off-by: Pradeep P V K <pragalla@codeaurora.org>
Set the channel attribute for QRTR channels (MHI_CLIENT_IPCR_OUT
and MHI_CLIENT_IPCR_IN) so that QRTR client gets the uevent
broadcast when the channel state changes. Change the naming
for the structure to mhi_chan_attr_table since kernel clients are
also configured using the same structure.
Change-Id: I40232a09c27d7410d772055448d0354fb0c359b1
Signed-off-by: Gauri Joshi <gaurjosh@codeaurora.org>
Collect the ram dumps when process is
initialized and process is not cleaned
on DSP to fix UAF on init memory.
Change-Id: I3ddae176039efa57e057eca730e7ed1cec706484
Acked-by: Krishnaiah Tadakamalla <ktadakam@qti.qualcomm.com>
Signed-off-by: Jeya R <jeyr@codeaurora.org>
Add support to enable access for tlmm spare registers
for blair.
Change-Id: I250c0fd796ca80e019c6d5732394817c7527cc1c
Signed-off-by: Mayank Grover <groverm@codeaurora.org>
Add support to read and write SPARE registers in TLMM block.
Change-Id: I6426b86510256983b509c5f48c2ab02f80b48ef8
Signed-off-by: Mayank Grover <groverm@codeaurora.org>
ns service was notifying only local node ID services after
a pci disconnect and reconnect. Fix it to iterate over all
nodes and announce services of all nodes.
Change-Id: I4f91a71ad847b815318a7de47134f6b9c57dff53
Signed-off-by: Manoharan Vijaya Raghavan <mraghava@codeaurora.org>
The default Node ID 1 has conflict, as node ID 1 is being used
in IPQ-RC too. Hence fix the Node ID to be 2, (similar to sdx55).
Change-Id: I887b6523119531158e33d706b3b9fca2281d9bf5
Signed-off-by: Manoharan Vijaya Raghavan <mraghava@codeaurora.org>
Handle -EEXIST error case while register state callback
with mhi device. If channel is open during registration
no callback will issue instead mhi stack return -EEXIST
to notify the client. Further state change notification
will be informed via registered callback.
commit net: qrtr: mhi_dev: Handle mhi register error case
(f1eeca90b18b7).
Change-Id: Icf60de35d23393a0808ef90058c1108e950d02b9
Signed-off-by: Arun Prakash <app@codeaurora.org>
Signed-off-by: Manoharan Vijaya Raghavan <mraghava@codeaurora.org>
Registering only for endpoint RX channel to complete enumeration and
starting to open both RX/TX channels leads to race condition on TX channel.
Since the host does TX followed by RX init.
Wait for endpoint TX channel init to synchronise with host.
commit qrtr: mhi-dev: Wait for RX channel to be enumerated
(5593a67ad0546).
Change-Id: Ied002a89b51f71fa30cb7557f7dce27cfe1fd202
Signed-off-by: Sricharan R <sricharan@codeaurora.org>
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
Signed-off-by: Manoharan Vijaya Raghavan <mraghava@codeaurora.org>
After MHI device receives a reset command the internal
state machine suspends all activity on the channel and
processes the device reset. Clients are notified on
the channel close. Existing close function checks if
there are pending data to be read but since the device
is in the process of cleaning the transfer buffers
and the channels are suspended this check is not required.
commit msm: mhi_dev: Update release function in MHI
(6772e50d7b8fc).
Change-Id: Iafc5249762b1468ee2cca4ac141522ce0356d403
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: Manoharan Vijaya Raghavan <mraghava@codeaurora.org>
mhi_dev_read_channel returns the number of bytes read. Do not post a
packet to qrtr if the length returned is 0. This prevents an issue
where qrtr receives duplicates packets from the mhi_dev transport.
commit net: qrtr: mhi_dev: Only post valid data
(b4451ceb04138).
Change-Id: Ib1a31665730293baa9af61a9ae61bd8bdf6cab6f
Signed-off-by: Sricharan R <sricharan@codeaurora.org>
Signed-off-by: Chris Lew <clew@codeaurora.org>
Signed-off-by: Manoharan Vijaya Raghavan <mraghava@codeaurora.org>
qrtr_mhi_dev_event_cb will be called only once if there is
more than one packet at that time. Hence, call mhi_dev_read_channel
in a loop until it returns zero.
commit net: qrtr: Loop on mhi_dev_read_channel until it returns 0
(1a79f2584ef87).
Change-Id: I2f171cb45e66c1c439fcc7d0027c22d0edb4fb19
Signed-off-by: Jay Jayanna <jayanna@codeaurora.org>
Signed-off-by: Manoharan Vijaya Raghavan <mraghava@codeaurora.org>
MHI's IN channel is QRTR's OUT channel and vice-versa.
commit net: qrtr: Change the in and out channels
(5c9c165066de0).
Change-Id: If16790e629263cfa2787a08326c079b58f42617b
Signed-off-by: Chris Lew <clew@codeaurora.org>
Signed-off-by: Manoharan Vijaya Raghavan <mraghava@codeaurora.org>
Add a transport that uses the mhi device APIs. The mhi device APIs are
used to transfer data from a device to the host over MHI. The modem
will generally be configured as a device and this transport is intended
to be used on the modem controller co-processor.
commit net: qrtr: Add support for a mhi device transport
(89754e5ed45dd).
Change-Id: Ie9276fe6c0846581192aff881e59baa5fecf1ca4
Signed-off-by: Chris Lew <clew@codeaurora.org>
Signed-off-by: Manoharan Vijaya Raghavan <mraghava@codeaurora.org>
Poll for ipa_dma_disable prior to entering mhi suspend, until it returns
success. this is to prevent IPA disable failure in case on
pending transfers.
Change-Id: I38143284447b86ce34c47e100e6fe0c23cf28f0b
Signed-off-by: Subramanian Ananthanarayanan <skananth@codeaurora.org>
Signed-off-by: Nitesh Gupta <nitegupt@codeaurora.org>
Signed-off-by: Gauri Joshi <gaurjosh@codeaurora.org>
Print subsystem notify event string for wpss & modem instead of
event code. Print proper file type in log while downloading BDF
and REGDB file. Log the error immediately if request_firmware
API get fail.
Change-Id: I32a07895faf2bce640e0bfe89e348c36b02c5150
Signed-off-by: Vijay Patil <vijaylil@codeaurora.org>
The "trivial conversion" in commit cccaa5e33525 ("init: use do_mount()
instead of ksys_mount()") was totally broken, since it didn't handle the
case of a NULL mount data pointer and while I had "tested" it (and
presumably Dominik had too) that was hidden by me having options.
Change-Id: I2b1db7b68e0e398ce803da40b37595c286c97d9c
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Arnd Bergmann <arnd@arndb.de>
Reported-by: Ondřej Jirman <megi@xff.cz>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Reported-and-tested-by: Borislav Petkov <bp@suse.de>
Tested-by: Chris Clayton <chris2553@googlemail.com>
Tested-by: Eric Biggers <ebiggers@kernel.org>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Guido Günther <agx@sigxcpu.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Git-commit: 7de7de7ca0ae0fc70515ee3154af33af75edae2c
Git-repo: https://github.com/torvalds/linux.git
[pragalla@codeaurora.org:fix merge conflicts and port changes to 5.4 kernel]
Signed-off-by: Pradeep P V K <pragalla@codeaurora.org>
In prepare_namespace(), do_mount() can be used instead of ksys_mount()
as the first and third argument are const strings in the kernel, the
second and fourth argument are passed through anyway, and the fifth
argument is NULL.
In do_mount_root(), ksys_mount() is called with the first and third
argument being already kernelspace strings, which do not need to be
copied over from userspace to kernelspace (again). The second and
fourth arguments are passed through to do_mount() anyway. The fifth
argument, while already residing in kernelspace, needs to be put into
a page of its own. Then, do_mount() can be used instead of
ksys_mount().
Once this is done, there are no in-kernel users to ksys_mount() left,
which can therefore be removed.
Change-Id: Ie21248b26e4a98796e092e20c9b8cb8126dc5eee
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Patch-mainline: linux-kernel@vger.kernel.org @ 12/12/2019, 14:57
[pragalla@codeaurora.org:fix merge conflicts and port changes to 5.4 kernel]
Signed-off-by: Pradeep P V K <pragalla@codeaurora.org>