Update "get_fifo_length_us" function to support the T_LRA_X_2/4/8
periods. So that the FIFO mode can work for all T_LRA periods.
Change-Id: I5d6b2c95eff66cddcec9388082c4d540493f2c86
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
For mass storage function driver ep_disable will be called in worker
thread context. Making sure controller is active and then calling
ep_disable and then putting controller back to lpm is very difficult
to achieve in mass storage driver. The reason is that fsg_disable
raises an exception which actaully waits for the completion
callback to come from gadget driver and if for some reason (like
command timeout error) if it doesn't, then do_set_iterface will
not be called which will do put_sync. This can prevent controller
from going to lpm.
To solve above problem, commit ad8d260c33 ("usb: dwc3: gadget: Check
controller status with endpoint enable/disable") moved pm_runtime_sync
operations from mass storage driver to gadget driver. But there is a
chance that pm_runtime get_sync and put sync operations in gadget
driver can be called in atomic context (taking spin_lock in function
driver and then calling) and lead to crash. Adding in_lpm check and
performing these operations only if controller is in lpm will ensure
that these operations will be done only for mass storage driver and
not be done in atomic context. For other function drivers where
ep_disable will be called in atomic context, there is no chance that
ep_disable will be called when controller is in lpm as bh_work or
resume work will be called and will ensure controller to be out of
LPM before ep_disable is called.
Change-Id: I37635fd75e44a67deadbd4796b757d85d604aed4
Signed-off-by: Rohith Kollalsi <rkollals@codeaurora.org>
When in rndis composition, if device is disabled in device manager,
usb enters low power mode. Then if rndis interface is put down,
ep_disable is called leading to crash due to unclocked access as
clocks are turned off when usb enters lpm. Fix this by waking up
the controller, then performing ep_disable operation and then
putting controller back to lpm.
Change-Id: I45d29ef2e2678a3d6383d3fdd5550c8b8e156875
Signed-off-by: Rohith Kollalsi <rkollals@codeaurora.org>
ADB function is mainly used for debugging, hence it is
not expected to allow USB LPM followed by system suspend
in device bus suspend. Driver also doesn't handle
usb_ep_dequeue failure in LPM when adbd is interrupted
by signal as buffer is left queued to the hardware after
usb_ep_dequeue failure and can cause memory corruption.
In addition to above comments, when controller is in lpm
there is a chance that ffs_ioctl can issue clear halt as
a part of which send_gadget_ep_cmd will be called where
registers are accessed with clock's turned off leading
to crash due to unclocked access. Hence do not allow usb
lpm with adb.
Change-Id: Ib89c80318dcdd0dbb35d122a2ab77fb61f83518e
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Rohith Kollalsi <rkollals@codeaurora.org>
Release spinlock before notifying client driver and acquire
spinlock once done because once host notifies client driver with
an event, client can schedule an recovery in same context before
returning and expects an new event which could cause an race
condition if spinlock is acquired.
Also use list_for_each_entry_safe() while travesing the list of
registered clients for notification.
Change-Id: I6ae55032acdb1a5b14f473eadacb7a009a8df753
Signed-off-by: Vivek Pernamitta <vpernami@codeaurora.org>
Enablig CONFIG_PRINTK_CALLER, causes printk to add a caller "thread id"
or a caller "processor id" to the message.
Change-Id: Ifd0a2a151df71156d57344d819ce3d5583c60e53
Signed-off-by: satyanarayan kamasali <kamasali@codeaurora.org>
Ensure that the input parameters of qcom_wdt_register is checked before
proceeding as this could cause NULL pointer dereferences.
Change-Id: I29e7eee946fb9fe0ba7fe75b96acedff7deab4bd
Signed-off-by: Prakruthi Deepak Heragu <pheragu@codeaurora.org>
There is a possibility for the calculation to overflow when size is large
enough to overflow when added to the size of payload. Ensure that this
overflow is caught early.
Change-Id: I876fbaa704ba51dc4a9e4eb4d3f7f0eaa749e06d
Signed-off-by: Prakruthi Deepak Heragu <pheragu@codeaurora.org>
Signed-off-by: Swetha Chikkaboraiah <schikk@codeaurora.org>
This change is for general scheduler improvements.
Change-Id: I78a13f15f7b95d7b6583222fbc68b828e651b802
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
Changed “icnss_long1” to “icnss_smp2p” as it contain
only SMP2P logs. Created “icnss_soc_wake” IPC to separate
SOC_WAKE logs from “icnss”.
Change-Id: I073868e4954903fbb780bec44d8172bbf7e4393c
Signed-off-by: Naman Padhiar <npadhiar@codeaurora.org>
Retain the old copyright year which was dropped during propagation of
a recent change.
Fixes: dd473e6c28 ("haven: hh_rm_core: Change datatype of
num_fragments").
Change-Id: If8d66b096403ae1c54c072ef86a1bfbda828f50f
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
This change enables the framework needed to run the link layer
tests on sdxlemur.
Change-Id: I05975750d84cdbb6583bd314cce6912c8b1e9599
Signed-off-by: Elson Roy Serrao <eserrao@codeaurora.org>
Change done to support 32 clients for mac based filtering.
Change-Id: I69e652f2962dc94025dbb0b1936236214034c2d5
Signed-off-by: Praveen Kurapati <pkurapat@codeaurora.org>
Consider a case where DUT is in a low memory condition and
it is switching between host and none frequently. This can
lead the driver to fail the allocation of primary event ring
and go into error path where it will try to cleanup the event
ring. Since secondary event ring was not even initialized, while
fetching the entries to cleanup, it will lead to NULL pointer
dereference.
Avoid this by adding a NULL check for secondary event ring before
fetching the entries and bailing out early from cleanup function.
Change-Id: I21488d0e0a02347a392d890918c5c874b704795f
Signed-off-by: Pratham Pratap <prathampratap@codeaurora.org>
When charging with some fixed voltage USBPD adapters and when VBUS voltage
is moving from 9V to 5V, usbin-ov interrupt is triggered because of the
VBUS voltage is not settled before updating 5V VBUS allowance. To avoid
this, adding 40ms delay before updating 5V VBUS allowance.
Change-Id: I1a439210e7ceb46bf59f900f3c72e71715c590d3
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
Add support to read ibat range factor from nvmem and use it to
scale ibat current for greater than default max supported
ibat range.
Change-Id: Iee83be8d6663920d4df0b792417820d222e3ff46
Signed-off-by: Gopala Krishna Nuthaki <gnuthaki@codeaurora.org>
Add slatecom_interface header file in gen_headers to make it
accessible from userspace modules who uses Android.bp files
for compilation.
Change-Id: Ie298ec28983c16999d941ee8667e2dd7b5c3db22
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
Integer overflow can occur for a large value of req_buff_size because
num_fragments is declared as u8. Declare it as int in order to prevent
this from occurring.
Change-Id: I9e3655af13134ec57d123317ebb7b287a7470a19
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
Signed-off-by: Swetha Chikkaboraiah <schikk@codeaurora.org>
Update the fmax frequency to 200MHz for SDCC clock.
Change-Id: If77e30d586e3b33c35a7ccf3cd67eb98b6dac101
Signed-off-by: Taniya Das <tdas@codeaurora.org>
Smmu driver keeps a vote on cx gdsc to block cx gdsc collapse
when CONFIG_ARM_SMMU_POWER_ALWAYS_ON is enabled. So don't bother
polling for cx gdsc collapse during the slumber sequence when this
config is enabled.
Change-Id: Iacbbfcc76600e0e567610265d5da87146946df66
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
Adding new API to perform host reset request to device
to collect device side dumps.
Use mhi_soc_reset() API in place of register write
Currently, a direct register write is used when ramdump collection
in panic path occurs. Replace that with new mhi_soc_reset() API
such that a controller defined reset() function is exercised if
one is present and the regular SOC reset is done if it is not.
Change-Id: Ibd15b231072a9b811ced0031387d605184806e9a
Signed-off-by: Vivek Pernamitta <vpernami@codeaurora.org>
Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
The MHI specification allows to perform a hard reset of the device
when writing to the SOC_RESET register. It can be used to completely
restart the device (e.g. in case of unrecoverable MHI error).
This is up to the MHI controller driver to determine when this hard
reset should be used, and in case of MHI errors, should be used as
a reset of last resort (after standard MHI stack reset).
This function is a stateless function, the MHI layer do nothing except
triggering the reset by writing into the right register(s), this is up
to the caller to ensure right mhi_controller state (e.g. unregister the
controller if necessary).
Change-Id: I84a7c02b243301fd6e7d61fe8d23443aa4f8a171
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Git-commit: b5a8d233a588b3acf2a7a3a8da30f8f68f376626
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
Signed-off-by: Vivek Pernamitta <vpernami@codeaurora.org>
It is expected from the clients to follow the below steps on an imported
dmabuf fd:
a) dmabuf = dma_buf_get(fd) // Get the dmabuf from fd
b) dma_buf_attach(dmabuf); // Clients attach to the dmabuf
o Here the kernel does some slab allocations, say for
dma_buf_attachment and may be some other slab allocation in the
dmabuf->ops->attach().
c) Client may need to do dma_buf_map_attachment().
d) Accordingly dma_buf_unmap_attachment() should be called.
e) dma_buf_detach () // Clients detach to the dmabuf.
o Here the slab allocations made in b) are freed.
f) dma_buf_put(dmabuf) // Can free the dmabuf if it is the last
reference.
Now say an erroneous client failed at step c) above thus it directly
called dma_buf_put(), step f) above. Considering that it may be the last
reference to the dmabuf, buffer will be freed with pending attachments
left to the dmabuf which can show up as the 'memory leak'. This should
at least be reported as the WARN().
Change-Id: Ia58b41500be943fe3c2da3eb0f5480ae99715de2
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1627043468-16381-1-git-send-email-charante@codeaurora.org
Signed-off-by: Christian König <christian.koenig@amd.com>