The length of an IOVA mapped to an sg-list in fast_smmu_unmap_sg() is
determined using the DMA length of the data in the sg-list. Using the
DMA length of the entries in the sg-list may result in incorrectly
calculating the length of the IOVA range that needs to be freed, as
the buffers are mapped at an IOMMU granule.
Thus, align the IOVA length to the IOMMU granule when unmapping IOVAs
in fast_smmu_unmap_sg().
Change-Id: I7dbe88ed2db46b1c9b278f92c2a23a9ebc2d503a
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
In case of send_modfd_cmd we are using older allocation
methods, which are using more time and causing performace
degradation, hence updating it to use shmbridge instead.
Change-Id: I01afa0ac36d584fcc1a84570dc159b3af99f48c8
Signed-off-by: Monika Singh <monising@codeaurora.org>
If refcount on mem entry is the last refcount, we will call
kgsl_mem_entry_destroy and detach it from process list. If
there is no refcount on the process private as well then we
will call kgsl_destroy_process_private to cleanup. During
cleanup, we will try to remove the same sysfs node which is
in use by the current thread and this situation will end up in
a deadlock.
To fix this problem, use a worker to put the refcount on mem
entry.
Change-Id: I69a77c4059489c95de2ca205701571daac4bdc8a
Signed-off-by: Pankaj Gupta <gpankaj@codeaurora.org>
Currently the phy driver is asserting and deasserting
usb phy reset signal to reset qusb phy. This changes adds
a wrapper function around the assert and deassert of usb
phy reset signal to make the code more readable and remove
code duplicacy.
Change-Id: I4fa03ae2d6bccf7386fcf3a7aa5df0345054147d
Signed-off-by: Pratham Pratap <prathampratap@codeaurora.org>
Consider a case where SVDM message sent on SOP' failed
before starting the power negotiation with the sink.
Currently pd driver will not be freeing vdm_tx and
will be kept around till we reach PE_SRC_Ready state. Now
the same will be sent on SOP instead of SOP' and also with
wrong SVDM version which was kept for the first SVDM msg,
because of Commit I0bafb619e0a("usb: pd: Correctly handle
SVDM versions), causing the other partner to NAK it.
Fix this by clearing the vdm_tx if SVDM message is sent
on SOP'(intended of e-mark cable) which has been failed.
Change-Id: I729a66058ea8829625185483cbec87b435ee66fc
Signed-off-by: Pratham Pratap <prathampratap@codeaurora.org>
Add new virtual sensor definition for penta-cpu-max-step for MSM8917.
This virtual sensor can be used to monitor the overall temperature
of CPU cluster device.
Change-Id: I6a587b42cb4a474e1ce53ebbf893bbc168f22be4
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Signed-off-by: Archana Sriram <apsrir@codeaurora.org>
Enable CONFIG_ION_SYSTEM_HEAP for bengal which is required to
get ion pool stats for system heap.
Change-Id: Ia41490fdffe3c1a1cd0a8a56e718eff42c0bc646
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
commit 34b1a1ce1458f50ef27c54e28eb9b1947012907a upstream
fixup_pi_state_owner() tries to ensure that the state of the rtmutex,
pi_state and the user space value related to the PI futex are consistent
before returning to user space. In case that the user space value update
faults and the fault cannot be resolved by faulting the page in via
fault_in_user_writeable() the function returns with -EFAULT and leaves
the rtmutex and pi_state owner state inconsistent.
A subsequent futex_unlock_pi() operates on the inconsistent pi_state and
releases the rtmutex despite not owning it which can corrupt the RB tree of
the rtmutex and cause a subsequent kernel stack use after free.
It was suggested to loop forever in fixup_pi_state_owner() if the fault
cannot be resolved, but that results in runaway tasks which is especially
undesired when the problem happens due to a programming error and not due
to malice.
As the user space value cannot be fixed up, the proper solution is to make
the rtmutex and the pi_state consistent so both have the same owner. This
leaves the user space value out of sync. Any subsequent operation on the
futex will fail because the 10th rule of PI futexes (pi_state owner and
user space value are consistent) has been violated.
As a consequence this removes the inept attempts of 'fixing' the situation
in case that the current task owns the rtmutex when returning with an
unresolvable fault by unlocking the rtmutex which left pi_state::owner and
rtmutex::owner out of sync in a different and only slightly less dangerous
way.
Change-Id: Ic19f2e16d6de16db63594706eae5f547e38ea852
Fixes: 1b7558e457 ("futexes: fix fault handling in futex_lock_pi")
Reported-by: gzobqq@gmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 6e7bfa046d
Git-repo: https://android.googlesource.com/kernel/msm
Signed-off-by: PavanKumar S.R. <pavasr@codeaurora.org>
Fix the unnecessary periodic wakeups of discard thread that happens under
below two conditions -
1. When f2fs is heavily utilized over 80%, the current discard policy
sets the max sleep timeout of discard thread as 50ms
(DEF_MIN_DISCARD_ISSUE_TIME). But this is set even when there are
no pending discard commands to be issued.
2. In the issue_discard_thread() path when there are no pending discard
commands, it fails to reset the wait_ms to max timeout value.
Change-Id: Ic358ea425a1e152438eb3185e6b7932c7fd4930f
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Git-commit: c35b8d5e757e0fd0144890b7b536f7b756f3a648
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Sayali Lokhande <sayalil@codeaurora.org>
With the default DPOLICY_BG discard thread is ioaware, which prevents
the discard thread from issuing the discard commands. On low RAM setups,
it is observed that these discard commands in the cache are consuming
high memory. This patch aims to relax the memory pressure on the system
due to f2fs pending discard cmds by changing the policy to DPOLICY_FORCE
based on the nm_i->ram_thresh configured.
Change-Id: Icac4a6ad2885eb463d7e11bfc99486a4cb96533b
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Git-commit: d6d2b491a82e1e411a6766fbfb87c697d8701554
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Sayali Lokhande <sayalil@codeaurora.org>
commit c5cade200ab9a2a3be9e7f32a752c8d86b502ec7 upstream
Updating pi_state::owner is done at several places with the same
code. Provide a function for it and use that at the obvious places.
This is also a preparation for a bug fix to avoid yet another copy of the
same code or alternatively introducing a completely unpenetratable mess of
gotos.
Change-Id: I08631f77e21eb3faacb13fc8a39184a0b6728f24
Originally-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: 0e1501f7b1
Git-repo: https://android.googlesource.com/kernel/msm
Signed-off-by: PavanKumar S.R. <pavasr@codeaurora.org>
Currently PHY driver relies on regulators(vdd, 1p8, 3p1) to be
disabled for the PHY to come out of high-Z state when charger
driver is done with APSD. This works for the platforms having
single instance of PHY.
Consider a case where there are two instances of the same phy
(primary and secondary) and both are sharing the same resources
(regulators - vdd, 1p8, 3p1). If the platform is configured in
such a way that the secondary instance is always powered on
(e.g. host mode) and booted up with charger(DCP) connected on
the primary port, when charger is disconnected after bootup,
dpdm_regulator_disable will be called from charger driver which
will disable regulator but the regulators will not be disabled
since the secondary instance still has vote for regulators.
This will lead the primary instance to be in high-Z state even
though nothing is connected and causes extra power consumption.
Fix this by resetting the phy before turning off the regulators
in dpdm_regulator_disable for snps/qusb phys.
Change-Id: If96a878448144e446d12acf136c9c6d8fa9432cb
Signed-off-by: Pratham Pratap <prathampratap@codeaurora.org>
commit 04b79c55201f02ffd675e1231d731365e335c307 upstream
If that unexpected case of inconsistent arguments ever happens then the
futex state is left completely inconsistent and the printk is not really
helpful. Replace it with a warning and make the state consistent.
Change-Id: Id27fa72fbfd7dc689784e36d91e7319d7bed9ec9
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Git-commit: f03b21494d
Git-repo: https://android.googlesource.com/kernel/msm
Signed-off-by: PavanKumar S.R. <pavasr@codeaurora.org>
Diag char driver calls usb_diag_request_size() to get max request
size supported by underlying USB hardware. If there is race between
disable() and this API call, it results in accessing NULL pointer
dereference. Hence fix this by returning zero in case ctxt is NULL.
Change-Id: I51274db0af4cfbc8ba975744f55ad17ec311e32e
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
In SSR scenario while teardown the pipe there could be possibility to
receive the UL data to avoid queuing the data checking for disconnect
InProgress flag.
Change-Id: I73397e51e6e7affae71313d08356f809788db484
Signed-off-by: Ashok Vuyyuru <avuyyuru@codeaurora.org>
Protect maps using map mutex as well as avoid
deadlock during SSR in case of legacy targets.
Change-Id: Ia972302a8830d501c40d06df79e7eb305327c5ad
Acked-by: Deepika Singh <dsi@qti.qualcomm.com>
Signed-off-by: Jeya R <jeyr@codeaurora.org>
ChipIdea controller can be queued a maximum packet size of 16KB.
If a request larger than this size arrives on IN endpoint,
request is failed. Fix this by limiting the max request size to
16k if the controller is ChipIdea.
Change-Id: Iac696addc9b1ca50e78ae66f73f5b66bd3100c1c
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Pratham Pratap <prathampratap@codeaurora.org>
Due to hw limitation to sync current, voltage bump up was observed
for sdcc vbias. Switch to required pad voltage for vbias bypass
as hw work around.
Change-Id: I888db2bb093c7a1153649f15167eb8428722256c
Signed-off-by: Ram Prakash Gupta <rampraka@codeaurora.org>
To support vbias bypass hw work around add flag to
support work around on bengal platforms.
Change-Id: Ia07674b25b2d21d3bf5a8c075de857272885bb66
Signed-off-by: Ram Prakash Gupta <rampraka@codeaurora.org>
This reverts commit c54188e5da.
Revert vdd io parent regulator vote as it has been changed to
bypass mode.
Change-Id: I7549f2dab38c225996d379257b5ad49d6f779a5f
Signed-off-by: Ram Prakash Gupta <rampraka@codeaurora.org>
Remove NOMINAL_L1 fmax support from clock
gpu_cc_gx_gfx3d_clk_src as it is not
supported from HW.
Change-Id: Ie581b215de9c3662bbe6f8341a22c896eab13add
Signed-off-by: Madhuri Medasani <mmedasan@codeaurora.org>
In rapid PIPO cases SD card gets removed in between some ongoing
read/write transaction which can lead to CRC/timeout errors which are
expected only.
In such cases avoid dumping the registers.
Change-Id: If490d4f1c598b3d2399971b5e782fda574b2e9b3
Signed-off-by: Sarthak Garg <sartgarg@codeaurora.org>
configfs_composite_unbind sets the gadget data
to null. Therefore, add check in android_disconnect
function to make sure that cdev is not NULL. This
prevents NULL pointer dereference upon accessing
cdev.
Change-Id: Ib59cdd88557d917c85d8d33968efc295bcef2280
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
The CTS tests in CtsHardwareTestCases are required for all Android
devices. In order to pass these tests, kernel configs must be
enabled. Make these configs mandatory to help OEMs pass CTS tests.
Configs added:
CONFIG_HID_PLAYSTATION
CONFIG_PLAYSTATION_FF
CONFIG_SONY_FF
(Covered by android.hardware.input.cts.tests.
SonyDualSenseBluetoothTest#testAllKeys).
CRs-fixed: 2971837
Change-Id: Ie9078bdce75907b19588d1c1d28c888ca5475931
Signed-off-by: Kishor Krishna Bhat <kishkris@codeaurora.org>
The DualSense features 5 player LEDs below its touchpad, which are
meant as player id indications. The LEDs are configured with a
player ID determined by an ID allocator, which assign player ids
to ps_device instances.
This patch is the combination of the following original patches
minus use of LED framework APIs:
- HID: playstation: add DualSense player LEDs support.
- HID: playstation: DualSense set LEDs to default player id.
Bug: 167947264
CRs-fixed: 2971837
Change-Id: I2a9ef9949bb82df18247a14e64cb8c54e9b3924c
Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com>
Reviewed-by: Barnabás Pőcze <pobrn@protonmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Farid Chahla <farid.chahla@sony.com>
Signed-off-by: Siarhei Vishniakou <svv@google.com>
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
Git-commit: 949aaccda019723050a2cd98d7b4492b06423f27
Signed-off-by: Kishor Krishna Bhat <kishkris@codeaurora.org>
The DualSense controller has a built-in microphone exposed as an
audio device over USB (or HID using Bluetooth). A dedicated
button on the controller handles mute,but software has to configure
the device to mute the audio stream.
This patch captures the mute button and schedules an output report
to mute/unmute the audio stream as well as toggle the mute LED.
Bug: 167947264
CRs-fixed: 2971837
Change-Id: I6fce08b0b28c1cf41c682a2ff5655f00d7a52843
Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com>
Reviewed-by: Barnabás Pőcze <pobrn@protonmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Farid Chahla <farid.chahla@sony.com>
Signed-off-by: Siarhei Vishniakou <svv@google.com>
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
Git-commit: c26e48b150fccb07c4b7f0f419f2b0a2c42e57d2
Signed-off-by: Kishor Krishna Bhat <kishkris@codeaurora.org>