Commit graph

855765 commits

Author SHA1 Message Date
qctecmdr
65ce6f8272 Merge "net: qrtr: fix a kernel-infoleak in qrtr_recvmsg()" 2021-10-18 13:18:35 -07:00
qctecmdr
c5bfb24d25 Merge "tty: Fix ->session locking" 2021-10-18 13:18:35 -07:00
Gopala Krishna Nuthaki
f391b6c81f drivers: thermal: Update a variable type in QMI encode logic
Change a variable type in QMI encode logic to avoid
buffer overflow scenario.

Change-Id: I11b10cce0e9ab5b02738b2ba13e637df979e9310
Signed-off-by: Gopala Krishna Nuthaki <gnuthaki@codeaurora.org>
2021-10-18 13:05:49 +05:30
Allen Chiu
96e6fb8126 BACKPORT: dma-buf: Move dma_buf_release() from fops to dentry_ops
Charan Teja reported a 'use-after-free' in dmabuffs_dname [1], which
happens if the dma_buf_release() is called while the userspace is
accessing the dma_buf pseudo fs's dmabuffs_dname() in another process,
and dma_buf_release() releases the dmabuf object when the last reference
to the struct file goes away.

I discussed with Arnd Bergmann, and he suggested that rather than tying
the dma_buf_release() to the file_operations' release(), we can tie it to
the dentry_operations' d_release(), which will be called when the last ref
to the dentry is removed.

The path exercised by __fput() calls f_op->release() first, and then calls
dput, which eventually calls d_op->d_release().

In the 'normal' case, when no userspace access is happening via dma_buf
pseudo fs, there should be exactly one fd, file, dentry and inode, so
closing the fd will kill of everything right away.

In the presented case, the dentry's d_release() will be called only when
the dentry's last ref is released.

Therefore, lets move dma_buf_release() from fops->release() to
d_ops->d_release()

Many thanks to Arnd for his FS insights :)

[1]: https://lore.kernel.org/patchwork/patch/1238278/

Fixes: bb2bb90 ("dma-buf: add DMA_BUF_SET_NAME ioctls")
Reported-by: syzbot+3643a18836bce555bff6@syzkaller.appspotmail.com
Cc: <stable@vger.kernel.org> [5.3+]
Cc: Arnd Bergmann <arnd@arndb.de>
Reported-by: Charan Teja Reddy <charante@codeaurora.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Tested-by: Charan Teja Reddy <charante@codeaurora.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200611114418.19852-1-sumit.semwal@linaro.org

Bug: 162699017

Signed-off-by: Allen Chiu <allen.chiu@mediatek.com>
Change-Id: Ief19296f201132c3e32b11958a857798c34f81fb
Git-commit: 2581e5be6555232e784487fc00961ce83c5236a1
Git-repo: https://android.googlesource.com/kernel/msm
Signed-off-by: PavanKumar S.R. <pavasr@codeaurora.org>
2021-10-18 12:32:23 +05:30
Anirudh Ghayal
1b2e4c4392 power: smb1398-charger: Toggle UVLO for Slave CP on USB removal
In addition to the master CP, toggle the UVLO config for slave CP
on USB removal to avoid poweroff-leakage.

Change-Id: I1f5d5185d003cfe104b4a67efc1fe88f105f0151
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2021-10-18 07:48:40 +05:30
Jilai Wang
48b897f215 msm: npu: handle system shutdown/reboot event properly
When system shuts down while there are work running on NPU,
NPUSS will be shut down without notifying kernel driver which
causes IPC commands timedout and triggers SSR handling.
This change is to detect this case and handle it properly
to avoid SSR.

Change-Id: I4ba6d702c2d39aa8e1894eba2ec049787df14aa8
Signed-off-by: Jilai Wang <jilaiw@codeaurora.org>
2021-10-17 19:14:20 -04:00
Linux Build Service Account
a9961fafc7 Merge d079ef6772 on remote branch
Change-Id: I111d0e2aa2bbc0661339f06e95ac257abeaddb46
2021-10-17 03:53:43 -07:00
qctecmdr
b43d06a654 Merge "USB: gadget: f_uvc: Enable more controls for CT and PU" 2021-10-13 23:26:24 -07:00
Patrick Daly
e29f5d1c4e 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-10-13 18:20:46 +05:30
Sarannya S
99ac515580 net: qrtr: Change error logging in callback
Print error logs in the callback by using pr_err_ratelimited
so that watchdog bark will not occur due to excessive logging
when the callback is triggered before probe is completed.

Change-Id: I82bb84b7812cef5cb8a37e99c5cf1a54411cbdb8
Signed-off-by: Sarannya S <sarannya@codeaurora.org>
2021-10-12 18:54:56 +05:30
qctecmdr
d079ef6772 Merge "net: qualcomm: rmnet: enable support for cksumv3" 2021-10-11 21:04:25 -07:00
qctecmdr
e53f9c37b1 Merge "usb: dwc3: dwc3-msm: optimize perf vote work" 2021-10-11 09:28:11 -07:00
Shilpa Suresh
9dd5d135be defconfig: Enable PMIC related configs for MSM8937_32
For MSM8937_32, add the configs related to charging,
vibrator and rtc.

Change-Id: I584a8520a9cd9344f72549a0bf62dc57ac9d8507
Signed-off-by: Shilpa Suresh <sbsure@codeaurora.org>
2021-10-11 17:02:15 +05:30
Shilpa Suresh
53bda56b4f defconfig: Enable PMIC related configs for MSM8937_64
For MSM8937_64 targets, add PMIC configs related to
charging, vibrator and rtc.

Change-Id: I2891118f051ff9697aafcfa394940e1765fba2e4
Signed-off-by: Shilpa Suresh <sbsure@codeaurora.org>
2021-10-11 16:56:46 +05:30
Shilpa Suresh
c4285df71f defconfig: Enable Charger/LED/RTC configs for MSM8937_32go
For MSM8937_32go, add the configs related
to charging, vibration and rtc.

Change-Id: I0f7ca9fab3eddff785c9c755daf15796973d0226
Signed-off-by: Shilpa Suresh <sbsure@codeaurora.org>
2021-10-11 16:48:14 +05:30
Shilpa Suresh
874f7ea12c power: linear-charger: Report the correct battery status at SOC=0
Userspace initiates a shutdown if battery_status != charging
and SOC = 0, this is to prevent a deep-discharge of the battery
when the discharge current is higher than the charge current
at SOC = 0. Report this status from the kernel driver when
additionally the current voltage is below the cutoff threshold.

Change-Id: I89bb283ce9c0e01cd8c04cba2d7d33d5baca3fe7
Signed-off-by: Shilpa Suresh <sbsure@codeaurora.org>
2021-10-11 16:40:23 +05:30
Shilpa Suresh
06b2ca9274 power: charger/fg: Add charger/fg/bms drivers for QM215
Add Charger/FG/BMS drivers qpnp-linear-charger.c, qpn-vm-bms.c,
smb1360-charger-fg.c and related files for QM215 target.
Add snapshots of the new files as of msm-4.9 commit 0848b3af1d2f
("ARM: dts: qcom: disabled wled bl type for sim_vid panel").

Change-Id: Ibc5d2a8daace8351020c53a9129fff9999f552da
Signed-off-by: Shilpa Suresh <sbsure@codeaurora.org>
2021-10-11 01:55:10 -07:00
qctecmdr
191df0c7bb Merge "defconfig: Enable ADC thermal and SPMI configs for SPF targets" 2021-10-10 22:50:30 -07:00
Archana Sriram
17ab1175a2 defconfig: Enable ADC thermal and SPMI configs for SPF targets
Enable configs for ADC_TM and SPMI VADC, ADC5 drivers for
SPF targets for 32, 32Go and 64 bit variants.

Change-Id: Ic75dbe6fcafb1e4d2a49bbe87439fde4351b1218
Signed-off-by: Archana Sriram <apsrir@codeaurora.org>
Signed-off-by: Manjunatha Madana <mamanj@codeaurora.org>
2021-10-08 19:30:42 -07:00
Archana Sriram
c57142fede thermal: Modify qpnp_adc_tm driver for IIO framework
Make changes to use IIO framework APIs for reading
ADC channel information instead of VADC APIs.

Change-Id: I70ab09905d0f4a23fb5d0617ba6d031ecc7fb8bc
Signed-off-by: Manjunatha Madana <mamanj@codeaurora.org>
Signed-off-by: Archana Sriram <apsrir@codeaurora.org>
2021-10-09 07:41:39 +05:30
qctecmdr
952ccdab4d Merge "msm: ipa3: Queue nop desc again if it fails" 2021-10-08 07:17:25 -07:00
Manjunatha Madana
14595b56e3 thermal: qpnp-adc: Add snapshot of qpnp-adc-tm driver
This is snapshot of qpnp-adc-tm  driver as of
msm-4.9 'commit 7e65e03259909 (Merge "msm: kgsl:
Deregister gpu address on memdesc_sg_virt failure")'.

Removed support for adc_tm_hc and hkadc_ldo as they
are not used for SPF targets. Removed IADC, VADC APIS,
structs and enums not needed for ADC_TM. VADC functions
required for sake of compilation have been retained,
which will be subsequently replaced with IIO functions
to suit msm-4.19.

Change-Id: If8e4fb03471ec045293659b2404f8be95684f8be
Signed-off-by: Manjunatha Madana <mamanj@codeaurora.org>
Signed-off-by: Archana Sriram <apsrir@codeaurora.org>
2021-10-08 07:02:23 -07:00
qctecmdr
5bf744ccb5 Merge "msm: kgsl: Add timeline traces" 2021-10-08 04:09:03 -07:00
Piyush Dhyani
4c94b16ae1 msm: ipa3: Queue nop desc again if it fails
Currently during nop desc send, we are setting
nop pending flag to false before queing desc,
due to which we are not able to queue nop desc
again if it fails for first time. Now setting
nop pending flag to false only if we successfully
queued nop desc.

Change-Id: Ice0b3726f2ff0e81c0e5b041346e0ba06619ef62
Signed-off-by: Piyush Dhyani <pdhyani@codeaurora.org>
2021-10-08 02:31:06 -07:00
Vivek Golani
7f766a685e diag: Drop packets to avoid memory exhaustion
Added support to drop packets if more than 10
packets have accumulated in the rx list since usb
is not sending write done for previous packets sent
to usb to avoid memory exhaustion.

Change-Id: I44fe814abc5b199e1d1b86dcc6d0e2f043d15c49
Signed-off-by: Vivek Golani <vgolani@codeaurora.org>
2021-10-07 22:02:59 -07:00
qctecmdr
468bb1a57f Merge "msm-ipa: fix use-after-free of rt_tbl" 2021-10-07 16:57:12 -07:00
qctecmdr
3536e7af00 Merge "serial: msm_geni_serial: Avoid port pointer access for earlyconsole case" 2021-10-07 09:50:37 -07:00
Muralidharan M
3152811105 msm-ipa: fix use-after-free of rt_tbl
Fix use-after-free of rt_tbl in __ipa_del_flt_rule
by checking if the rt_tbl is already freed.

Change-Id: I09541f65f474dc42f262c603d99f6bbcbb0ce8ec
Signed-off-by: Muralidharan M <murm@codeaurora.org>
2021-10-07 18:05:15 +05:30
Sharath Chandra Vurukala
d33df102ac net: qualcomm: rmnet: enable support for cksumv3
Enables support for cksumv3 calculation.

Change-Id: Iccf092459cc23a2ed493c914e2d4089fabbc332a
Acked-by: Divyarajsinh Jhala <djhala@qti.qualcomm.com>
Signed-off-by: Sharath Chandra Vurukala <sharathv@codeaurora.org>
Signed-off-by: Kaustubh Pandey <kapandey@codeaurora.org>
2021-10-07 05:00:51 -07:00
qctecmdr
c3a5f5cfcc Merge "rpmsg: glink: Change error logging to avoid throttling" 2021-10-06 08:06:56 -07:00
Chandana Kishori Chiluveru
b3613d5d93 serial: msm_geni_serial: Avoid port pointer access for earlyconsole case
Add defensive check in msm_geni_serial_enable_interrupts to avoid
null pointer dereference issues with earlyconsole usecase.

Change-Id: I7a82a4a387583425c1926a59f7181d39889cba75
Signed-off-by: Chandana Kishori Chiluveru <cchiluve@codeaurora.org>
2021-10-06 04:36:27 -07:00
Sarannya S
061f52b739 rpmsg: glink: Change error logging to avoid throttling
Avoid printing error when ENODEV is returned from glink callback
and use dev_err_ratelimited so that throttling will not happen
due to excessive logging.

Change-Id: I9369046c2f907ecd38416c8927764c7a8b7c1ca4
Signed-off-by: Sarannya S <sarannya@codeaurora.org>
2021-10-06 15:14:59 +05:30
Vijayavardhan Vennapusa
daeafdcabe USB: gadget: f_uvc: Enable more controls for CT and PU
Enable more basic controls for Camera Terminal and Processing Unit

Change-Id: Ia3627731e05afa57c770439b958c9af51e42c630
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
2021-10-05 21:12:48 -07:00
qctecmdr
8eaf52d7f0 Merge "USB: gadget: f_uvc: Enable required controls for CT and PU" 2021-10-05 08:28:22 -07:00
qctecmdr
e1eda9a5c9 Merge "wait: add wake_up_sync()" 2021-10-05 05:24:13 -07:00
qctecmdr
8c5c8420b0 Merge "fuse: give wakeup hints to the scheduler" 2021-10-05 05:24:05 -07:00
Yatish Kumar Singh
d89ef97fa7 serial: msm_geni_serial: Reduce stale delay added in stop_rx_sequencer
Currently driver calculating stale delay based on baud rate during
stop_rx sequencer. When BT started with lower baud rate like 2400
this logic will add around 130msecs of extra delay during BT INIT.

This change will remove logic for stale delay calculation
based on baud rate and add constant delay of 10msec to
wait for stale interrupt during stop_rx_sequencer.

Change-Id: I566d79145ba887de71482642655b63c5bd640fc8
Signed-off-by: Yatish Kumar Singh <yatishku@codeaurora.org>
2021-10-05 03:44:54 -07:00
Rohan Sethi
3a9c5960d9 msm: kgsl: Add timeline traces
Add some traces to make it easier to debug and track timeline behavior.

Change-Id: Ic0dedbadbfe623c675616a0d2fdd800b49f14705
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rohan Sethi <rohsethi@codeaurora.org>
2021-10-04 12:49:33 +05:30
Jordan Crouse
d01a2bda03 msm: kgsl: Add software timelines
Some graphics APIs want the ability to create and use timelines
with 64 bit sequence numbers to synchronize between threads.

Add support for timelines that can be created, signaled and managed from
user space. Timelines can also be signaled from a draw context command
stream via an auxiliary command and a wait can be added as a sync object
to any GPU command.

Change-Id: Ic0dedbad0ffc99cc309951369eaf85b56727802c
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rohan Sethi <rohsethi@codeaurora.org>
2021-10-04 12:48:09 +05:30
Linux Build Service Account
64b09e43c3 Merge 2d773a4e21 on remote branch
Change-Id: Ib9b3e0b249ea023e36a1db996bb57a9758673cdc
2021-09-30 10:48:22 -07:00
qctecmdr
7a50a7a361 Merge "serial: msm_geni_serial: Reduce stale delay added in stop_rx_sequencer" 2021-09-29 08:37:33 -07:00
Yatish Kumar Singh
e374091555 serial: msm_geni_serial: Reduce stale delay added in stop_rx_sequencer
Currently driver calculating stale delay based on baud rate during
stop_rx sequencer. When BT started with lower baud rate like 2400
this logic will add around 130msecs of extra delay during BT INIT.

This change will remove logic for stale delay calculation
based on baud rate and add constant delay of 10msec to
wait for stale interrupt during stop_rx_sequencer.

Change-Id: I566d79145ba887de71482642655b63c5bd640fc8
Signed-off-by: Yatish Kumar Singh <yatishku@codeaurora.org>
2021-09-29 16:19:47 +05:30
qctecmdr
42cae30da8 Merge "usb: f_mtp: Limit MTP Tx req length to 16k for ChipIdea" 2021-09-29 01:59:11 -07:00
qctecmdr
343ff3c9cb Merge "msm: ipa: Fix to free up all pending EOB pages" 2021-09-28 22:37:59 -07:00
Ajay Agarwal
0866f29257 usb: f_mtp: Limit MTP Tx req length to 16k for ChipIdea
Currently, the f_mtp driver marks the mtp_tx_req_len to 1M.
As a result, file transfer from device to host PC fails for
devices using ChipIdea controller since it does not allow request
length greater than 16k for IN Endpoint. Hence, to allow such
file transfers, limit Tx req length to 16k.

Change-Id: Ib9ca95880ca0b1a2f0c66817e54e9a7b2af53fe6
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
[ppratap@codeaurora.org : replace DBG with mtp_log]
Signed-off-by: Pratham Pratap <ppratap@codeaurora.org>
2021-09-29 10:28:25 +05:30
Pradeep P V K
4e2e0b5cf0 fuse: give wakeup hints to the scheduler
Use synchronous wakeup interface to wakeup the userspace daemon.
Scheduler can make use of this hint to find a better CPU for the
waker task.

Change-Id: I7d077235f9b8fe771869dd7e6fccee7d356d858b
Suggested-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Pradeep P V K <pragalla@codeaurora.org>
2021-09-28 15:43:08 +05:30
Pradeep P V K
7e075c9bbb wait: add wake_up_sync()
The synchronous wakeup interface is available only for the interruptible
wakeup. Add it for normal wakeup.

Change-Id: Ia4460aa55690d14d203cdc843bd600c9e26c53f1
Suggested-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Pradeep P V K <pragalla@codeaurora.org>
2021-09-28 11:59:05 +05:30
Jagadeesh Ponduru
8a0e38750d msm: ipa: Fix to free up all pending EOB pages
Make changes to free up all pending EOB pages when SKB allocation
used to handle EOT is failed as we could end up in a frag
overflow.

Change-Id: I80ae84d00d1bbf2cf89e97261d2fe8c3742eda04
Signed-off-by: Jagadeesh Ponduru <jponduru@codeaurora.org>
2021-09-28 11:06:24 +05:30
Jordan Crouse
22ba0d986c msm: kgsl: Add the user API definition for timelines
Extend the KGSL uapi for the sempahore timeline APIs,
aux commands and syncobjs.

Change-Id: Ic0dedbadf7338b49da52ab9d0e54d5321217c3fd
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rohan Sethi <rohsethi@codeaurora.org>
2021-09-27 15:54:11 +05:30
Prateek Raj Singh
85866d270d Add support for new HSP version
This patch contains changes for adding support for new HSP SoC versions.

CRs-Fixed: 2941918
Change-Id: I170bf26458dbeb84182ead97594c3dc605b1a64f
Signed-off-by: Prateek Raj Singh <pratsing@codeaurora.org>
2021-09-26 22:35:51 -07:00