Commit graph

904,692 commits

Author SHA1 Message Date
Pratham Pratap
f5f85bb96c usb: dwc: Release wakeup source if vbus_active is cleared
Commit 980a25b5c2 ("usb: dwc3: Dont release wakeup source
during usb restart") introduced a check in dwc3_msm_suspend
for in_restart before releasing the wakeup source to ensure
that driver doesn't release the wakeup source if suspend is
kicked while restart session was executing. Now consider a
case where, due to some reason, erratic event is seen on the
controller and restart session is kicked. While restart work
was running, physical cable disconnect happened which will
call suspend routine eventually but due to in_restart flag
being set driver will not release the wakeup source and will
end up consuming power even though cable got disconnected.

Fix this by adding one more level of judgement of vbus_active
to ensure that wakeup source is released when cable gets
disconnected during restart usb work.

Change-Id: Ie54618640d08c4f2e3f0dc1d38260e0aa2d309c2
Signed-off-by: Pratham Pratap <quic_ppratap@quicinc.com>
2021-12-21 10:21:20 +05:30
qctecmdr
b02a89590b Merge "pci: msm: Return -EDEFER when i2c is not probed" 2021-12-19 20:08:35 -08:00
qctecmdr
7fbe930d38 Merge "msm: npu: fix network and misc commands race condition problem" 2021-12-19 03:19:34 -08:00
Jilai Wang
90811ee5b8 msm: npu: fix network and misc commands race condition problem
misc command doesn't do npu_init before sending to firmware, so
it's possible that npu will be turned off while npu firmware is
handling misc commands which causes times out in host driver.
To fix this issue, npu_init/npu_deinit need to be called before
and after misc commands are handled. In addition, only one misc
command should be handled at any moment. The misc command should
be failed right away while the other one is being handled.

Change-Id: I523255da15fa4e3b8b21d74b28f90d3458ebeb3c
Signed-off-by: Jilai Wang <jilaiw@codeaurora.org>
2021-12-15 06:45:10 -08:00
qctecmdr
e4c620112c Merge "usb: f_cdev: Handle the serial state properly" 2021-12-15 05:53:08 -08:00
Subramanian Ananthanarayanan
8bf3347530 pci: msm: Return -EDEFER when i2c is not probed
Change is to reutrn -EDEFER error when i2c is not probed and delay
PCIE probe. I2C probe is gettting called post pcie enumeration
and this results in i2c de-emphasis settings not being applied.
Pine doesn't enumerate as these settings are not applied.

Change-Id: I1ac966b26c65f44afb32987927558209bf8787a7
Signed-off-by: Subramanian Ananthanarayanan <quic_skananth@quicinc.com>
2021-12-15 12:47:03 +05:30
qctecmdr
78d3775595 Merge "i2c: i2c-msm-geni: Change the high and low time for SCL" 2021-12-13 20:43:36 -08:00
qctecmdr
83f68ed045 Merge "msm: synx: Prevent accessing valid but released handles" 2021-12-13 20:43:35 -08:00
Rohith Kollalsi
08122aebc0 usb: f_cdev: Handle the serial state properly
Currently when dtr high is send by the host, dsr high should be
sent by the device by performing a term io to acm conversion.
But if dtr high is received twice, serial state which is converted
to acm signal is again converted, leading to serial state becoming
null. Fix this by clearing ACM bits from previous conversion before
performing uart to acm conversion.

Change-Id: Iaad3f200599f6bd4224db0c3987420cc022b34ef
Signed-off-by: Rohith Kollalsi <quic_rkollals@quicinc.com>
2021-12-12 20:29:53 -08:00
qctecmdr
631faf6b17 Merge "msm: mhi_dev: Don't process any other interrupts during M0 processing" 2021-12-06 21:22:42 -08:00
qctecmdr
4e09fbde44 Merge "msm: mhi_dev: Checking the out channel status directly" 2021-12-06 21:22:42 -08:00
qctecmdr
80f48a5524 Merge "clk: qcom: gpucc-blair: Scale both cx and gx rails for gfx3d clock" 2021-12-06 16:31:47 -08:00
qctecmdr
b05a0f59ef Merge "power: supply: qcom: Disable suspend on collapse on USB removal" 2021-12-06 07:44:17 -08:00
Taniya Das
1cdfc65d53 clk: qcom: gpucc-blair: Scale both cx and gx rails for gfx3d clock
There is a requirement to scale both CX and GX rails during the gpu core
clock scaling, thus add the corresponding vdd data.

Change-Id: Ib27f4697a84ece1d0d1ce2b5297c03bf8ed955c6
Signed-off-by: Taniya Das <quic_tdas@quicinc.com>
2021-12-06 02:06:18 -08:00
Pratham Pratap
63b8a425d9 USB: dwc3: remove debugfs root dentry storage
There is no need to keep around the debugfs "root" directory for the
dwc3 device.  Instead, look it up anytime we need to find it.  This will
help when callers get out-of-order and we had the potential to have a
"stale" pointer around for the root dentry, as has happened in the past.

Change-Id: I7fd1973704cd2a9e193fd77e01f7e09236f41117
Tested-by: Jack Pham <jackp@codeaurora.org>
Reviewed-by: Peter Chen <peter.chen@kernel.org>
Acked-by: Felipe Balbi <balbi@kernel.org>
Link: https://lore.kernel.org/r/20210609093924.3293230-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 8562d5bfc0fcdfd3aef32991e17dca585ae5ae7d
Git-Repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[quic_ppratap@quicinc.com: resolved trivial merge conflicts]
Signed-off-by: Pratham Pratap <quic_ppratap@quicinc.com>
2021-12-06 02:01:41 -08:00
Sai Chaitanya Kaveti
52f01ef023 msm: mhi_dev: Checking the out channel status directly
If the net dev init process is scheduled out in between registering
a callback for in-channel and out-channel and start command for these
channels gets processed at this time (after registering the callback
for out channel but before registeringthe callback for in-channel)
then with existing logic, we never register with the network interface.

Checking the out channel status directly rather than using local bool
variable out_channel_started before calling
mhi_dev_net_open_chan_create_netif API. If out channel status is
connected the mhi_dev_net_open_chan_create_netif API is called.

Change-Id: I69af6c49ee565ffd04c4d0ac22b686ff986b7bc7
Signed-off-by: Sai Chaitanya Kaveti <quic_skaveti@quicinc.com>
2021-12-05 21:16:56 -08:00
Veerabhadrarao Badiganti
570829fbc1 msm: mhi_dev: Don't process any other interrupts during M0 processing
M0 (mhi resume) processing and doorbell interrupt processing are done
in different contexts. And there can be a chance that DB processing
can proceed even before the resume is completely done.

Say while processing M0, MHI has issued M0-ack but not updated channel
state to running state for *all* channels yet. The host can start ringing
DB the moment it sees M0-ack and it's the channel is in running state.

To avoid this race condition, ensure MHI doesn't process any CHDB
interrupt until it's completely done with the resume.

Change-Id: Ie8f7fec034be6b17c71e3b7437ab8e6effb63365
Signed-off-by: Veerabhadrarao Badiganti <quic_vbadigan@quicinc.com>
2021-12-06 09:56:16 +05:30
qctecmdr
97db20de99 Merge "msm: kgsl: Signal fence only if last fence refcount was not put" 2021-12-03 04:17:08 -08:00
qctecmdr
abef4d28a3 Merge "byte-cntr: Compatible with ETR sg buff mode" 2021-12-03 04:17:08 -08:00
qctecmdr
da4fb4a3e3 Merge "icnss2: Show QMI timeout value in millisecond" 2021-12-03 04:17:07 -08:00
qctecmdr
7bcbd2b4b1 Merge "arm64: defconfig: holi-qgki: enable devfreq vdd cdev driver" 2021-12-03 04:17:07 -08:00
qctecmdr
b1d4c68617 Merge "msm: adsprpc: Handle UAF in process shell memory" 2021-12-03 04:17:07 -08:00
qctecmdr
f41fdcc116 Merge "defconfig: sdxlemur: Enable CTR crypto in kernel" 2021-12-03 04:17:06 -08:00
qctecmdr
7f0235fa21 Merge "usb: pd: Do not respond to SVDM messages in PD 2.0" 2021-12-03 04:17:05 -08:00
qctecmdr
9ea9441514 Merge "usb: pd: Clear vdm_tx if SVDM message is sent on SOP'" 2021-12-03 04:17:05 -08:00
qctecmdr
f51f324009 Merge "usb: pd: Reset pd protocol during cable disconnect" 2021-12-03 04:17:04 -08:00
qctecmdr
fdc7322f76 Merge "Merge android11-5.4.147+ (e785a25) into msm-5.4" 2021-12-03 00:18:06 -08:00
Puranam V G Tejaswi
339824df70 msm: kgsl: Signal fence only if last fence refcount was not put
Currently there is a chance that release for the fence was already called
before we call dma_fence_get during kgsl_timeline_signal and
kgsl_ioctl_timeline_destroy. This can cause use-after-free issue as we can
access fence after release. Fix this by signalling fence only if the last
refcount on the fence was not yet put. This makes sure that release for the
fence will not be called until we are done signalling.

Change-Id: I6bdcefa1f128febb7a0f7aef133757268a3b9ae3
Signed-off-by: Puranam V G Tejaswi <quic_pvgtejas@quicinc.com>
2021-12-02 21:27:14 +05:30
Yuanfang Zhang
a1b161fca6 byte-cntr: Compatible with ETR sg buff mode
In ETR sg buff mode, at most 4K data can be obtained
at a time. This change to support this mode.

Change-Id: I26da71e7210f0a85dbd969c6ff047598a1cbddcd
Signed-off-by: Yuanfang Zhang <quic_yuanfang@quicinc.com>
2021-12-01 03:30:40 -08:00
Vijay Patil
033f3443e3 icnss2: Show QMI timeout value in millisecond
Show QMI timeout value in millisecond.

Change-Id: I696d381a6c9a8a652266056e39eb82281dcda916
Signed-off-by: Vijay Patil <quic_vijaylil@quicinc.com>
2021-12-01 15:41:36 +05:30
Priyansh Jain
3fccafbea3 arm64: defconfig: holi-qgki: enable devfreq vdd cdev driver
Enable devfreq vdd cdev driver to set minimum operating
level to gpu devfreq during cold thermal condition.

Change-Id: I81c934921138d29766c1c0cfb9e481045b2ce167
Signed-off-by: Priyansh Jain <priyjain@codeaurora.org>
2021-11-30 09:55:33 -08:00
Liangwei Dong
036089f311 defconfig: sdxlemur: Enable CTR crypto in kernel
CTR crypto is used in FILS (Fast Initial Link Setup - 802.11ai) AEAD
Encryption and Decryption. Hence add changes to enable CTR crypto in
kernel.

Change-Id: I223b8323362a2dcaf88a40a902f43279ba0fd86e
Signed-off-by: Liangwei Dong <quic_liangwei@quicinc.com>
2021-11-30 18:20:20 +08:00
prabha
eec9f0cfa9 msm: adsprpc: Handle UAF in process shell memory
Added flag to indicate memory used
in process initialization. And, this memory
would not removed in internal unmap to avoid
UAF or double free.

Change-Id: Ie470fe58ac334421d186feb41fa67bd24bb5efea
Signed-off-by: prabha <prabha@codeaurora.org>
2021-11-30 10:49:33 +05:30
qctecmdr
5e3cf80f1b Merge "msm: mhi_dev: Fail start command if fails to allocate reqs" 2021-11-28 21:19:01 -08:00
Konstantin Dorfman
991ca50f4b soc: qcom: spcom: maintain wakeup window when active packet exchange
This change activate PM wakeup source in following way:
1. Activate on receive a spcom request from SPU
2. Close window in the end of packet exchange or timeout:
   - end of tx of spcom response to SPU (server case)
   - end of delivery of spcom request to usersace (client case)
   - timeout for handling a packet exchange for 2 seconds

Change-Id: Ibbb6ba9870226299e5731fda6133c3dde780ca25
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
2021-11-27 22:52:46 -08:00
qctecmdr
8b0fa0a0cf Merge "msm: mhi_dev: Adding mhi and pcie state change logs to console" 2021-11-26 21:59:37 -08:00
qctecmdr
738d523efe Merge "msm: ipa: Add macsec mode ioctl" 2021-11-25 02:19:30 -08:00
Srinivasarao Pathipati
2603172e50 Merge android11-5.4.147+ (e785a25) into msm-5.4
* refs/heads/tmp-e785a25:
  Revert "ANDROID: GKI: Enable CHACHA20POLY1305 and XCBC"
  ANDROID: GKI: rework the ANDROID_KABI_USE() macro to not use __UNIQUE()
  UPSTREAM: security: selinux: allow per-file labeling for bpffs
  ANDROID: GKI: Enable CHACHA20POLY1305 and XCBC
  ANDROID: Incremental fs: Fix dentry get/put imbalance on vfs_mkdir() failure
  ANDROID: f2fs: fix potential deadlock by android ftrace

Change-Id: I261a5fa5682452c021ad0ba4bb4da085ee340ab3
Signed-off-by: Srinivasarao Pathipati <quic_spathi@quicinc.com>
2021-11-25 14:17:09 +05:30
Ilia Lin
f3c056ad48 msm: ipa: Add macsec mode ioctl
Introducing a new ioctl and corresponding data structures
to map or unmap one or more physical ethernet NICs
to macsec interface/s.

Change-Id: I15f5f88226ffa07818526f591468053992ad78e9
Signed-off-by: Ilia Lin <quic_ilial@quicinc.com>
2021-11-24 23:28:14 -08:00
qctecmdr
3762d49204 Merge "drivers: thermal: Add devfreq vdd floor cooling device" 2021-11-24 21:19:07 -08:00
urevanth
cb0218278f Dm-verity: Enable dm_device_wait parameter
Set dm_device_wait parameter through rootwait
to eliminate dm-verity timing issue for emmc.

Change-Id: I7a5065f2c020c98c3a308d2c17ad3610a7ae0c07
Signed-off-by: urevanth <quic_urevanth@quicinc.com>
2021-11-23 17:12:39 -08:00
qctecmdr
e6d9ead216 Merge "dma-mapping-fast: Fix iova address leak with non-zero scatterlist offset" 2021-11-23 02:28:59 -08:00
Patrick Daly
6508829687 dma-mapping-fast: Fix iova address leak with non-zero scatterlist offset
The underlying arm-smmu hardware only supports mapping addresses
aligned to PAGE_SIZE. Thus the actual mapped region may be larger than
the range returned by iommu_map_sg():

[sg_dma_address(), sg_dma_address() + sg->length)

When unmapping, ensure the same alignment requirements are applied
in order to avoid leaking iova addresses.

Change-Id: I1f5d5185d003cfe104b4a67efc1fe88f105f015f
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
2021-11-22 22:18:05 -08:00
qctecmdr
ba64e46bda Merge "msm:pci: Usage of disable_pc in multiclient scenario" 2021-11-22 22:10:22 -08:00
Sai Chaitanya Kaveti
02ccb1d6dd msm: mhi_dev: Adding mhi and pcie state change logs to console
Adding mhi and pcie state change logs to console to make testing and
debugging easier.

Change-Id: I1fe176fc532a99de9de862ad556df831b6db6bf6
Signed-off-by: Sai Chaitanya Kaveti <quic_skaveti@quicinc.com>
2021-11-21 20:37:23 -08:00
qctecmdr
8876d1c1a1 Merge "usb: gadget: f_fs: Use stream_open() for endpoint files" 2021-11-20 03:23:56 -08:00
qctecmdr
4fd1eea424 Merge "Merge android11-5.4.147+ (dc8c919) into msm-5.4" 2021-11-19 22:36:17 -08:00
Veerabhadrarao Badiganti
0ec602298e msm: mhi_dev: Fail start command if fails to allocate reqs
Fail the start command if we fails to allocate buffer for event
requests.

Change-Id: I05e9acb093f53f1675a4f711182730ab420e0e5a
Signed-off-by: Veerabhadrarao Badiganti <quic_vbadigan@quicinc.com>
2021-11-19 22:31:45 +05:30
Veerabhadrarao Badiganti
eb29f2d763 msm: mhi_dev: Ensure event buffer size reflects the right size
We are setting event buffer size with the requested size and then
allocating the buffer for event requests (ereqs). But if the memory
allocation for ereq buffer fails, the event-buffer-size variable
is not getting set to zero.

Due to this, if a client calls open channel multiple times,
our logic proceeded without really allocating the buffer for ereqs.
And while processing completion events, we are observing null pointer
dereference issues.

Change-Id: I10bee8428d178ef5a7f0fe5fcd93fcce8dcbe27d
Signed-off-by: Veerabhadrarao Badiganti <quic_vbadigan@quicinc.com>
2021-11-19 22:31:21 +05:30
Pavankumar Kondeti
283ff9717c usb: gadget: f_fs: Use stream_open() for endpoint files
Function fs endpoint file operations are synchronized via an interruptible
mutex wait. However we see threads that do ep file operations concurrently
are getting blocked for the mutex lock in __fdget_pos(). This is an
uninterruptible wait and we see hung task warnings and kernel panic
if hung_task_panic systcl is enabled if host does not send/receive
the data for long time.

The reason for threads getting blocked in __fdget_pos() is due to
the file position protection introduced by the commit 9c225f2655
("vfs: atomic f_pos accesses as per POSIX"). Since function fs
endpoint files does not have the notion of the file position, switch
to the stream mode. This will bypass the file position mutex and
threads will be blocked in interruptible state for the function fs
mutex.

It should not affects user space as we are only changing the task state
changes the task state from UNINTERRUPTIBLE to INTERRUPTIBLE while waiting
for the USB transfers to be finished. However there is a slight change to
the O_NONBLOCK behavior. Earlier threads that are using O_NONBLOCK are also
getting blocked inside fdget_pos(). Now they reach to function fs and error
code is returned. The non blocking behavior is actually honoured now.

Reviewed-by: John Keeping <john@metanate.com>
Signed-off-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
Link: https://lore.kernel.org/r/1636712682-1226-1-git-send-email-quic_pkondeti@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Git-commit: c76ef96fc00eb398c8fc836b0eb2f82bcc619dc7
Change-Id: Ifb99336a4da7587c7e71a6c45999a36948194d7a
Signed-off-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
2021-11-19 09:40:32 +05:30