When VM_MAYWRITE flag is used during mmap(), mprotect()
can be used later to change the protection of memstore
to allow write. Make sure this does not happen by
removing VM_MAYWRITE from the vm_flags of vma.
Change-Id: I6f69f05858ea40611d512cfa796caabeaa88cdb5
Signed-off-by: Indira Biruduraju <ibirudur@codeaurora.org>
Enable eMMC/SD card driver to be build as a loadable module
in the holi GKI defconfig file.
Change-Id: Ic13088afeaa70b9c0fddbbe03f5ca1545a1d4db5
Signed-off-by: Sarthak Garg <sartgarg@codeaurora.org>
Enable eMMC/SD card driver as a inbuilt module for holi
QGKI defconfig.
Also Enable a config flag to add Qualcomm specific code to upstream
MMC drivers.
Change-Id: Ic98253109fe656ee78c95ae21290210305f5ec4b
Signed-off-by: Sarthak Garg <sartgarg@codeaurora.org>
Due to measurement counter does not self-clear reliably, explicitly
clearing CLR_CNT in SW instead of relying on self-clear HW sequence.
SW/HW CLR_CNT enable and disable sequence requires ~1us delay to allow
clearing the count.
Increasing sample rate to 27ms to get more accurate measurement for low
frequency clocks which allows to keep logic simpler than implementing
different logic for higher vs slows clocks with respect to sample rate.
Change-Id: I054083358305124406294511b2d03554ee586557
Signed-off-by: Vivek Aknurwar <viveka@codeaurora.org>
When attempting to disable a flash node that is not configured, return
gracefully as it is not an error condition.
Change-Id: I3cf82eddc4ac078384a5278bd2832f7adceba853
Signed-off-by: Guru Das Srinagesh <gurus@codeaurora.org>
uaudio_dev_cleanup() API can be called from ADSP SSR context (from work
context) and USB headset disconnect context. When USB headset is being
removed, driver sends disconnect notification to ADSP firmware and it can
be blocked for 10 seconds (timeout) before calling uaudio_dev_cleanup().
If this thread is block (possibly due to ADSP SSR), and in parallel driver
is handling ADSP SSR notification, driver is releasing all resource
including secondary event ring. Once above thread unblocks or timeout, it
goes try to release secondary USB event ring. As uaudio_dev_cleanup() is
already being called, and release secondary USB event ring, it shall see
udev->dev as NULL. Fix this issue by adding explicit check against udev
with uaudio_dev_cleanup() API.
Change-Id: I1e2e4a61dcbea4c0570ac97677bf74b453fac82c
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
There can exist a possible race between a DRV suspend/resume and
the RPMSG probe/remove operations leading to a use after free
scenario from the RC driver. To avoid this, introduce a mutex to
lock RPMSG specific areas and mainly block GLINK from freeing the
rpdev if RC driver is currently performing any DRV suspend/resume
operation using rpmsg_trysend() or rpmsg_send().
Change-Id: If46d5af3a924bee8360fae5bfc3d42bb494f620d
Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
There was a missing EXPORT_SYMBOL() for some public APIs. Add
those statements to ensure clean builds so KOs can use them.
Change-Id: Iaac851ddad0b729208804320f02133d0fa039615
Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
- Add the hook to get mutex/rwsem information that the tasks
are waiting for.
- Add the hook to print messages for sched_show_task.
- ANDROID_VENDOR_DATA_ARRAY added to task_struct
Bug: 162776704
Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Change-Id: Ib436fbd8d0ad509c3b5a73ea8f5170e0761a13fd
timer wheel calculates the index for any timer based on the expiry
value and level granularity of the timer. Due to the level granularity
timer will not fire at the exact time instead expire at a time value
expires + granularity. This is done in the timer code when the index for
each timer is calculated based on the expiry and granularity at each
level:
expires = (expires + LVL_GRAN(lvl)) >> LVL_SHIFT(lvl);
For devfreq drivers the requirement is to fire the timer at the exact
time. If the timer does not expire at the exact time then it'll take
much longer to react and increase the device frequency. Devfreq driver
registers timer for 10ms expiry and due to slack in timer code the
expirty happens at 20 ms. For eg: Frame rendering time is 16ms.
If devfreq driver reacts after 20ms instead of 10ms, that's
way past a frame rendering time.
Timers with 10ms to 630ms expiry fall under level 0, to overcome the
granularity issue for level 0 with low expirty values do not add the
granularity by introducing a new function calc_index_min_granularity.
Change-Id: I60f6f4394de4b5f409829de9734645e1a0d7659e
Signed-off-by: Channagoud Kadabi <ckadabi@codeaurora.org>
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
[eberman@codeaurora.org: simplify to one function]
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
2G+5G+6G, total channel num is 157 until now, increase unsafe channel max
num to avoid out of buffer.
Change-Id: I1e433c0bd88290bb5493b2c4b0bda86e17b04a01
CRs-Fixed: 2752689
Signed-off-by: Jianmin Zhu <jianminz@codeaurora.org>
Signed-off-by: Manikandan Mohan <manikand@codeaurora.org>
Currently the composite driver encodes the MaxPower field of the
configuration descriptor by reading the c->MaxPower of the
usb_configuration only if it is non-zero, otherwise it falls back to using
the value hard-coded in CONFIG_USB_GADGET_VBUS_DRAW. However, there may be
times when a configuration may need to explicitly set the bMaxPower to 0,
particularly if its bmAttributes also has the Self-Powered bit set, which
is a legal combination.
This is specifically called out in the USB PD specification section 9.1,
where a PDUSB device "shall report zero in the bMaxPower field after
negotiating a mutually agreeable Contract", and is also verified by the
USB Type-C Functional Test TD.4.10.2 Sink Power Precedence Test.
This fix allows the c->MaxPower to be used for encoding the bMaxPower even
if it is 0, if the self-powered bit is also set. A typical usage of this
would be for the configFS gadget to be dynamically updated by userspace
when the Type-C connection is determined to be operating in Power Delivery
mode.
Change-Id: I9fce2123b23ca3fe250940757002669ab92cb21f
Signed-off-by: Ronak Vijay Raheja <rraheja@codeaurora.org>
Introduce low power mode so that listeners are aware when display is
going into low power mode. This requires moving notifier inside sde code
to be able to retrieve the low power state.
Add mode for fps change so that clients can be
notified whenever there is a change in fps.
Include the current vrefresh in the msm_drm_notifier data provided to
registered clients.
Include the index id in the drm_panel_notifier data
provided to registered clients.
Bug: 155453628
Co-Developed-by: Adrian Salido <salidoa@google.com>
Co-Developed-by: Steve Pfetsch <spfetsch@google.com>
Co-Developed-by: Krishna Manikandan <mkrishn@codeaurora.org>
Co-Developed-by: Samantha Tran <samtran@codeaurora.org>
Co-Developed-by: Dhaval Patel <pdhaval@codeaurora.org>
[chandanu@codeaurora.org: Squashed four different gerrits
into one change]
Change-Id: I8e29ab65991b5777c3bd64182ce989e80d2462bf
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
For allocating memory from DMA we need to do a size check.
This validation is required to avoid any improper paging
request. We already have the range in which the size is
expected to be.
Change-Id: I20a843366a7f3e3e21cef89cf1ea5bec3f93ab2d
Acked-by: Ekansh Gupta <ekangupt@qti.qualcomm.com>
Signed-off-by: Jeya R <jeyr@codeaurora.org>
Add missing setup_xfer_req() call in ufshcd_issue_devman_upiu_cmd() in
ufs-bsg path. Relocate existing setup_xfer_req() calls to a common place,
i.e., ufshcd_send_command(), to simplify the driver.
Bug: 163100328
Link: https://lore.kernel.org/r/20200706060707.32608-3-stanley.chu@mediatek.com
Acked-by: Avri Altman <Avri.Altman@wdc.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Change-Id: Ibe16a421e5f3f003529379b1ac96b0a9306b0fe0
(cherry picked from commit 6edfdcfe285e499994b94a0f93e1f46ab2398162)
Signed-off-by: nanich.lee <nanich.lee@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Fixes in qseecom driver to support shmbridge and
change parameters as hypervisor expects them to
be.
Change-Id: I57dc5d6fe7b74b45da2dee6de32c1251d77275ee
Signed-off-by: Anmolpreet Kaur <anmolpre@codeaurora.org>
Enable sharing of pmu counters between kernel clients for the
QGKI images of lahaina and holi.
Change-Id: I1f4ab232f78a37737f9110c7155a4443c8243ece
Signed-off-by: Kaushal Kumar <kaushalk@codeaurora.org>
Some devices need the USB UVC drivers built in, so enable the following
config options to do so:
CONFIG_MEDIA_USB_SUPPORT=y
CONFIG_USB_VIDEO_CLASS=y
CONFIG_USB_GSPCA=y
Bug: 163679730
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I2e1a80eceef8d3effe4efe452c94f1e98d1a3bdc
Its maximal load is about 20mA, so change it by measure.
Change-Id: I1184ac5db5aa067a10cb0accbfda3da7111b4fc3
Signed-off-by: Fei Mao <feim1@codeaurora.org>
It's needed by devices, so add it to the gki defconfig files
Bug: 163679730
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ia9c77c07e7e4c590b2f82355a9db24e9bd8ab1b2
Currently if qti_flash_lmh_mitigation_config() returns an error
in qti_flash_led_strobe(), spin_unlock() is not called in the
error return path. Fix it.
Fixes: 42bdecad7c ("leds: qti-flash: Fix LMH mitigation configuration")
Change-Id: I1bede93873a151cc9bab7f2000d8f058e1890fda
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Currently I/O requests could be still submitted to UFS device while
UFS is working on shutdown flow. This may lead to racing as below
scenarios and finally system may crash due to unclocked register
accesses.
To fix this kind of issues, in ufshcd_shutdown(),
1. Use pm_runtime_get_sync() instead of resuming UFS device by
ufshcd_runtime_resume() "internally" to let runtime PM framework
manage and prevent concurrent runtime operations by incoming I/O
requests.
2. Specifically quiesce the SCSI device of UFS Device well known LU
so that ufshcd_suspend() can still send the SSU cmd, and remove
all the other SCSI devices to block all I/O requests to those
SCSI devices.
Example of racing scenario: While UFS device is runtime-suspended
Thread #1: Executing UFS shutdown flow, e.g.,
ufshcd_suspend(UFS_SHUTDOWN_PM)
Thread #2: Executing runtime resume flow triggered by I/O request,
e.g., ufshcd_resume(UFS_RUNTIME_PM)
This breaks the assumption that UFS PM flows can not be running
concurrently and some unexpected racing behavior may happen.
Change-Id: I83345e6b48a832ec7962fc016f4fdf128c9a5bd1
Signed-off-by: Can Guo <cang@codeaurora.org>
Send SMMU IOVA range to Firmware only when SMMU S1 stage is
enabled.
Change-Id: I3d0d0b6ad3db18aded0d921f79337cf845ceb5f4
Signed-off-by: Naman Padhiar <npadhiar@codeaurora.org>
Set CONFIG_LEDS_CLASS_FLASH=y to enable the
flash LED sysfs class in /sys/class/leds
Bug: 163582665
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: I19fa50c328ed0ddda7a11a0ab49f878544ac9b46
Add backend user count check to protect the index
boundary.
Change-Id: Ic1b61d1f7130252cc54da0b16553858714988dbd
CRs-Fixed: 2009216
Signed-off-by: Walter Yang <yandongy@codeaurora.org>