Commit Graph
821933 Commits
Author SHA1 Message Date
zhaoxp3 b2f8ddf75a Revert "mm, vmstat: hide /proc/pagetypeinfo from normal users"
This reverts commit 6c944fc51f.

Change-Id: I92b732f1a3c51bada8db2d6e606344f3ead5cd0f
Moto-CRs-fixed: (CR)
Signed-off-by: zhaoxp3 <zhaoxp3@motorola.com>
Reviewed-on: https://gerrit.mot.com/1543986
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
2023-06-01 00:47:11 -03:00
zhaoxp3 ca75b9e966 arm/defconfig: guamna: init kernel deconfig
add guamna kernel config

Change-Id: I4523f7636d0043d54717b38a472baa37544dff03
Signed-off-by: zhaoxp3 <zhaoxp3@motorola.com>
Reviewed-on: https://gerrit.mot.com/1540905
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
2023-06-01 00:47:11 -03:00
zhaoxp3 43858f10e0 arm/defconfig: add 32bit debug config
define arm and arm64 specific debug config

Change-Id: Ib56827bf9550739f236b4a52b8e0f94b213ec060
Signed-off-by: zhaoxp3 <zhaoxp3@motorola.com>
Reviewed-on: https://gerrit.mot.com/1539598
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
2023-06-01 00:47:11 -03:00
zhaoxp3 2bb28e781c defconfig.mk: add arch specific debug
support 32bit device
and share common debug config
Change-Id: I00e0cecefaaa0b67e25276dde60ba9fb8a533969
Signed-off-by: zhaoxp3 <zhaoxp3@motorola.com>
Reviewed-on: https://gerrit.mot.com/1539596
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
2023-06-01 00:47:11 -03:00
lulei1 c0db61f2e7 enable psi for guam guamp
Change-Id: I62c1f54e33e59dd60bb35411e828f8e86a9ae199
Reviewed-on: https://gerrit.mot.com/1538649
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Zhangqing Huang <huangzq2@motorola.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2023-06-01 00:47:11 -03:00
huangzq2 a1f22e95d6 Revert "defconfig: disable MEMCG for bengal 32"
This reverts commit 6b4ee95cbd.

Change-Id: I5c1c09912e34909211cb13a914cf965117c8fa6e
Reviewed-on: https://gerrit.mot.com/1536521
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2023-06-01 00:47:10 -03:00
yanyh2 d1bb1a5c2c Fix QC rebase issue for dual role sysfs access issue
As the USB hal service is the root user, so it is the same user as the
dual role sysfs node, and it is OK to change the sysfs node access mode
dynamicly for PD. Otherwise the sysfs node will lose sysfs node mode
update.

Revert "Revert "usb: phy: dual-role: update sysfs attrs when changed""

This reverts commit 4dabf448ae341dd492b45eb0f82fdd77ee5ef584.

Change-Id: Id3651703b4e250ac6af6cb3dc94d3ca328a3a259
Reviewed-on: https://gerrit.mot.com/1257104
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wentao Xu <xuwt2@motorola.com>
Reviewed-by: Lu Chai <chailu1@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1413206
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Reviewed-on: https://gerrit.mot.com/1536373
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
2023-06-01 00:47:10 -03:00
xizx e9daf31317 ion: display ion total size in debufs node
after list all ion dma-buffer, cacluate the total size,
and display it in the end.

Change-Id: I108ebe7aa3560538b1f24033dc219e8215720069
Reviewed-on: https://gerrit.mot.com/1535658
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Shanghui Zhang <zhangsh@motorola.com>
Reviewed-by: Dawei Wang <wangdw10@motorola.com>
Reviewed-by: Bolei Shang <shangbl1@lenovo.com>
Reviewed-by: Zhenxin Xi <xizx@motorola.com>
Submit-Approved: Jira Key
2023-06-01 00:47:10 -03:00
zhangzl7 1dca9978e3 ion: dmabuf improve debugfs
Improvements made to ION to add an additional debugfs file
to display allocation/reference information for all ION buffers.

Change-Id: Ife122fb3357c549ce962e7b7ead8d2447d352885
Signed-off-by: zhangzl7 <zhangzl7@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1535657
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Zhenxin Xi <xizx@motorola.com>
Submit-Approved: Jira Key
2023-06-01 00:47:10 -03:00
xuwei9 d85ff23cb4 kernel:support huawei p10 5A cable
Huawei 5A cable is one sepcial designed cable
as debug accessory cable.
for supporting it, enalble debug cable charging.

Porting from https://gerrit.moto.com/#/c/1447696
             https://gerrit.moto.com/#/c/1500769

Change-Id: Ibac57e482cbda5999b8fd4455c8986ec7c365ba2
Signed-off-by: xuwei9 <xuwei9@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1535670
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2023-06-01 00:47:10 -03:00
a17671 b52b1d6754 bengal:Enable dual role usb interface
Dual role class usb interface is
Needed for MicroB products

Change-Id: I7040da253829ead2a4de2635d6529f091ebe3e56
Signed-off-by: a17671 <a17671@motorola.com>
Reviewed-on: https://gerrit.mot.com/1534064
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2023-06-01 00:47:10 -03:00
a17671 dd6f66d0ba smb5:Add dual role class support in smb5
Charging driver needs to support dual role class
Products so USB hal 1.0 could work properly

Change-Id: I02b0d104791c422372aff24b6889978997c6a4b4
Signed-off-by: a17671 <a17671@motorola.com>
Reviewed-on: https://gerrit.mot.com/1534063
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2023-06-01 00:47:10 -03:00
a17671 c80a102f02 usb:Add dual role class support
USB hal 1.0 needs dual role class support
For MicroB USB products

Change-Id: Ia48350bea2ba217e1524f4c36b5e3288d8a436d9
Signed-off-by: a17671 <a17671@motorola.com>
Reviewed-on: https://gerrit.mot.com/1534062
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2023-06-01 00:47:10 -03:00
Shiyong Li 44bd4a147a sdcardfs: don't depend on reserved_mb to check free space
Even if reserving nothing in sdcardfs, lower fs statfs info is still
needed to avoid APP overwriting media storage.

port (CR) from P.

Change-Id: I63e87c3b34c739aeff2dcdd5e6fb3f34c4270cfa
Signed-off-by: Shiyong Li <a22381@motorola.com>
Reviewed-on: https://gerrit.mot.com/1435235
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1531815
Reviewed-by: Zonghua Liu <a17671@motorola.com>
2023-06-01 00:47:10 -03:00
Shiyong Li 9a7ae86cc9 sdcardfs: check the free space before creating files
User can create zero byte files even sdcardfs hits the reserved limit
that will consume blocks for the file name and eventually use up all
memeory. Check the avaliable free space before creating files.

port (CR) from P.

Change-Id: Ib902844f2e6e6c638184895e3f4fa7282acc8333
Signed-off-by: a17671 <a17671@motorola.com>
Reviewed-on: https://gerrit.mot.com/1435234
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1531814
Reviewed-by: Shi-Yong Li <a22381@motorola.com>
2023-06-01 00:47:10 -03:00
Shiyong Li b987498275 sdcardfs: copy inode size while getting attributes
Copy inode size from lower file system while getting attributes, or file
size is wrong for those files that have already existed before.

port (CR) from P.

Change-Id: I0c61e09ff2223d492518b6b4de320f6c640b2115
Signed-off-by: Shiyong Li <a22381@motorola.com>
Reviewed-on: https://gerrit.mot.com/1435233
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1531813
Reviewed-by: Zonghua Liu <a17671@motorola.com>
2023-06-01 00:47:10 -03:00
zhangj10 2d38e5c53e : remove nfc function for guam
changelist: remove nfc config for guam
                   not support nfc

Change-Id: I5575bf68c4741efb6db65958b6bf83dbd4975e40
Signed-off-by: zhangj10 <zhangj10@motorola.com>
Reviewed-on: https://gerrit.mot.com/1532121
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Lu Lu <lulu2@lenovo.com>
2023-06-01 00:47:10 -03:00
xuwei9 5ec82e6090 charger:allow APSD re-run at factory usb detection
Factory mode usb enumeration slow
Allow APSD re-run at factory mode

Change-Id: Id95427a04e5bd45279f3275cfb57981e072dff1c
Signed-off-by: xuwei9 <xuwei9@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1530969
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Zonghua Liu <a17671@motorola.com>
Submit-Approved: Jira Key
2023-06-01 00:47:10 -03:00
lulu2 8c7db8f0f0 CONFIG_FPR_FPC disable for rebase fingerprint fix
Change-Id: Ic4232c1df4f539195530d390158c5b6a7c32a7c3
Reviewed-on: https://gerrit.mot.com/1534501
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Submit-Approved: Jira Key
Tested-by: Jira Key
Reviewed-by: Lu Lu <lulu2@lenovo.com>
2023-06-01 00:47:10 -03:00
Andrew Wheeler 00beb389a9 defconfig.mk: Don't force make defconfig
Forcing the re-make of defconfig causes a ton of stuff to get
rebuilt during dirty builds.  So don't do it.

Change-Id: I945fc8bfe3f2a52c3a8069fa016fc6f948f1b30f
Signed-off-by: zhaoxp3 <zhaoxp3@motorola.com>
Reviewed-on: https://gerrit.mot.com/1529110
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
2023-06-01 00:47:10 -03:00
zhaoxp3 a137fc5035 gitignore: ignore dts link
Ignore commit history for softlink
arch/arm64/boot/dts/vendor
So that there won't be extra sync failure
once kernel gets update.
Change-Id: I2c0cdd5fd5763d742e22bc577994331396feae19
Signed-off-by: zhaoxp3 <zhaoxp3@motorola.com>
Reviewed-on: https://gerrit.mot.com/1524582
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
2023-06-01 00:47:10 -03:00
jixu dda4d1a6ad guamp: arm64/dtsi enable regulator_fixed_voltage
-- Enable CONFIG_REGULATOR_FIXED_VOLTAGE
-- Camera macro AF driver LDO enabled needed

Change-Id: Id827744e0768583d32855ff7a69b4a48f5d362c4
Signed-off-by: jixu <jixu@motorola.com>
Reviewed-on: https://gerrit.mot.com/1521069
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wang Liu <liuwang2@lenovo.com>
Reviewed-by: Jian Zhang <zhangjo@motorola.com>
Reviewed-by: Dawei Wang <wangdw10@motorola.com>
Reviewed-by: Long Cheng <chengl1@motorola.com>
Reviewed-by: Shuo Wang <wangsh18@motorola.com>
Reviewed-by: Zhuoran Xu <xuzr3@motorola.com>
Reviewed-by: Zhilong Wang <wangzl30@motorola.com>
Reviewed-by: Zhichao Chen <chenzc2@motorola.com>
Reviewed-by: Zhenxin Xi <xizx@motorola.com>
Submit-Approved: Jira Key
2023-06-01 00:47:10 -03:00
luodw1 96ac3c6c18 power: Add wakeup source in battery historian logging
Change-Id: I194ceccd10e455da8c58a2c96e4339557024b142
Signed-off-by: luodw1 <luodw1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1523886
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2023-06-01 00:47:10 -03:00
zhaoxp3 e3a5fdf0f3 arm64/defconfig: enable softlockup panic for debug
enable softlockup panic for debug
remove duplicated option
Change-Id: Ief23a78fffdefb13dfee92c9863c62cd2dfae0d1
Signed-off-by: zhaoxp3 <zhaoxp3@motorola.com>
Reviewed-on: https://gerrit.mot.com/1522506
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
2023-06-01 00:47:10 -03:00
zhangj10 9746c26d18 : arm64/defconfig : enable NFC
changelist
    enable NFC config


Change-Id: Ia4e17046fc95588e940e7ce2c0510f0d471f4698
Signed-off-by: zhangj10 <zhangj10@motorola.com>
Reviewed-on: https://gerrit.mot.com/1518991
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Lu Lu <lulu2@lenovo.com>
2023-06-01 00:47:10 -03:00
xuwei9 1b96407e54 kernel:add OCP charger current limitation
Add Other charger port current
limitaion

Change-Id: I8ab0b2eaa5bbe2756594b4288024b841df4e5483
Signed-off-by: xuwei9 <xuwei9@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1517843
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2023-06-01 00:47:10 -03:00
dengwei1 bf5eabcbd7 guam: add touch module support
add touch module
support

Change-Id: I6d86a65f9eda5ae6d2af53ad17ff4421990bbd12
Signed-off-by: dengwei1 <dengwei1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1515456
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2023-06-01 00:47:09 -03:00
Lei Chen 3d05723955 Revert "(CR): config: disable CONFIG_PANIC_ON_REFCOUNT_ERROR"
This reverts commit 06b7802261ddec2212369109df674b12981181c3.

Change-Id: I87909be01da86795b90661cf2373af8955486c15
Reviewed-on: https://gerrit.mot.com/1514012
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2023-06-01 00:47:09 -03:00
zhaoxp3 1334d5592b arm64/defconfig: disable debug config
remove unused touch driver
disable debug options

Change-Id: Iae9623ab8df0bad56d214d2f18366c22addc0294
Signed-off-by: zhaoxp3 <zhaoxp3@motorola.com>
Reviewed-on: https://gerrit.mot.com/1512672
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Submit-Approved: Jira Key
2023-06-01 00:47:09 -03:00
chenl18 800da5bc37 config: disable CONFIG_PANIC_ON_REFCOUNT_ERROR
Disable CONFIG_PANIC_ON_REFCOUNT_ERROR to avoid panic from
rmmmoding goodix_fod_mmi.

Change-Id: Ie02cd5d6feca17ebd92e887efe8dfabb3ee619e9
Signed-off-by: chenl18 <chenlei18@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1513033
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yan Zhang <zhangy26@motorola.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2023-06-01 00:47:09 -03:00
zhaoxp3 1ccf517704 arm64/configs: sm4250: Enable USB console
There are quite some use cases where we need live serial logs to
analyze issues on close phones without physical debugging UART
port exposed. Having the capability of re-directing serial logs
over USB is helpful for both general development and return analysis
scenarios where we have to avoid HW changes as much as possible.

The 2 new configs will add the capability of re-directing serial logs
to USB CDC ACM interface, though it is up to init's decision as for
whether to activate the capability based on bootloader's input.

Change-Id: Ic7b7846671292a7bb8b13051b2c233bd26b24ae9
Signed-off-by: zhaoxp3 <zhaoxp3@motorola.com>
Reviewed-on: https://gerrit.mot.com/1510439
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Submit-Approved: Jira Key
2023-06-01 00:47:09 -03:00
Qing Chang eb8f514a8b tty: msm_geni_serial: Support the match() callback
The new match() callback for earlycon is to tell whether earlycon and
the "real" console are the same device.

Change-Id: I8b54d5d9f1d737650d0890fc9f596080c8b1aaf2
Signed-off-by: Qing Chang <a21550@motorola.com>
Reviewed-on: https://gerrit.mot.com/1472629
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Qing Chang <qing@motorola.com>
Submit-Approved: Jira Key
Signed-off-by: Qing Chang <a21550@motorola.com>
Reviewed-on: https://gerrit.mot.com/1474156
Reviewed-on: https://gerrit.mot.com/1509729
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
2023-06-01 00:47:09 -03:00
Qing Chang 7b6dfedec4 printk: Keep boot console on if enabled
Without this change, the boot console has strong assumption of the state of
the "real" console, so when PM kicks in during early boot stage, resources
(l(CR) clocks, GPIOs, etc) for the boot console may be turned off if the "real"
console sharing these resources is not enabled, which will lead to malfuntion
of boot console.

Change-Id: I19a58d76c99e0fb7bff0d9dc06a2b0f9066063e2
Signed-off-by: Qing Chang <a21550@motorola.com>
Reviewed-on: https://gerrit.mot.com/1472630
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Qing Chang <qing@motorola.com>
Submit-Approved: Jira Key
Signed-off-by: Qing Chang <a21550@motorola.com>
Reviewed-on: https://gerrit.mot.com/1474157
Reviewed-on: https://gerrit.mot.com/1509725
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
2023-06-01 00:47:09 -03:00
zhaoxp3 280c7b9502 arm64/config: support UAS of usb storage
With UAS (USB Attached SCSI), the tested Samsung SSD read and write
speed gets 3x and 2x respectively on Nash.

Testing results for Samsung 256GB Portable SSD T5:
Seq. read:  244 MB/s v.s. 84 MB/s
Seq. write: 161 MB/s v.s. 94 MB/s

Port of (CR) on kernel 4.4.

Change-Id: I53fcc1a18977041215989aa93fc2b0c82354a17c
Signed-off-by: zhaoxp3 <zhaoxp3@motorola.com>
Reviewed-on: https://gerrit.mot.com/1511645
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Zonghua Liu <a17671@motorola.com>
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
2023-06-01 00:47:09 -03:00
zhaoxp3 889c770cc3 arm64/defconfig: enable usbnet drivers
Enable the usbnet framework and drivers to support
USB net.

Change-Id: I4bc66d8c34de6d20cc01044d9efbe97bdf71999c
Signed-off-by: zhaoxp3 <zhaoxp3@motorola.com>
Reviewed-on: https://gerrit.mot.com/1511644
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Zonghua Liu <a17671@motorola.com>
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
2023-06-01 00:47:09 -03:00
a17671 8b24262499 usb:configfs:Set udc_name NULL if attach failed
If the probing of UDC controller failed
udc_name shall be NULL to avoid double unregistration
and the panic
It could happen in some corner case

Change-Id: I2e6e4168a505b86d8f1b57db53be91acc608ee97
Signed-off-by: a17671 <a17671@motorola.com>
Reviewed-on: https://gerrit.mot.com/1438349
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1457371
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
(cherry picked from commit 9fc2515cb3fe8ffdf26f04c0a58a57552e50b6f3)
Reviewed-on: https://gerrit.mot.com/1459030
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Reviewed-on: https://gerrit.mot.com/1463803
Reviewed-on: https://gerrit.mot.com/1511643
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
2023-06-01 00:47:09 -03:00
Kenny Kessler e9d9047bd4 usb/dwc3: msm: Enable all Debug Logs
Force all logs to print.

The USB DWC3 is very important and tracking dmesg
is much easier when everything is ON.

Port-of: https://gerrit.mot.com/1307019

Change-Id: Iebde3d9feadde8a3e92acb10baeb97c5ba7e07cf
Signed-off-by: Kenny Kessler <kenny.kessler@motorola.com>
Reviewed-on: https://gerrit.mot.com/1332192
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1391225
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Reviewed-on: https://gerrit.mot.com/1449174
Reviewed-on: https://gerrit.mot.com/1511642
Reviewed-by: Zonghua Liu <a17671@motorola.com>
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
2023-06-01 00:47:09 -03:00
liuyc20 a56ba64469 gadget: bcdUSB version back to 2.0 when not SuperSpeed
Some of PC USB3.0 port don't support bcdUSB 2.1 version.
But the phone bcdUSB will focus on bcdUSB 2.1.then USB gadget will
reset continually.Change bcdUSB to 2.0 to compat all PC USB port type.

07-02 08:05:34.853 0 0 D dwc3 a600000.dwc3: Notify OTG from dwc3_gadget_reset_interrupt
07-02 08:05:35.182 0 0 D dwc3 a600000.dwc3: Notify OTG from dwc3_gadget_reset_interrupt
07-02 08:05:35.415 0 0 D dwc3 a600000.dwc3: Notify OTG from dwc3_gadget_reset_interrupt
07-02 08:05:35.647 0 0 D dwc3 a600000.dwc3: Notify OTG from dwc3_gadget_reset_interrupt
07-02 08:05:44.171 0 0 D dwc3 a600000.dwc3: Notify OTG from dwc3_gadget_reset_interrupt

Change-Id: Icb46a95226caecc9778c6889a85654f97fa85012
Signed-off-by: liuyc20 <liuyc20@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1383246
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiaojun Ji <jixj@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1449152
Reviewed-by: Yuecai Liu <liuyc20@motorola.com>
Reviewed-on: https://gerrit.mot.com/1511641
Reviewed-by: Zonghua Liu <a17671@motorola.com>
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
2023-06-01 00:47:09 -03:00
Yonghua Yan a3db809d7c usb: configfs: synchronize the secure and udc_name state
The gadget driver unregister/probe is not allowed to reentry
for the same udc.

As the conditions for gadget driver unregister/probe entry,
gadget secure and udc_name status should be synchronized.
Otherwise, in old implement code logic, there is still a chance
to fall into trouble of gadget driver unregister/probe reentry
for the same udc.

Change-Id: I6eb30a36eab84afd656f5bee9678e8d44933c6bc
Signed-off-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1287442
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Yuecai Liu <liuyc20@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1338870
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Reviewed-on: https://gerrit.mot.com/1449122
Reviewed-on: https://gerrit.mot.com/1511640
Reviewed-by: Zonghua Liu <a17671@motorola.com>
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
2023-06-01 00:47:06 -03:00
Yonghua Yan a4fd173df1 usb: configfs: skip unregister gadget in secure
There will be gadget driver unregister twice in USB secure
when try to set the UDC to none from userspace, which will cause
kernel panic in 4.9 kernel version, as there is a feature
about pending gadget driver list being added in this version.

As a solution, make sure gadget driver unregister or probe only
once over secure mode entry or usb configure from userspace.

Kernel BUG at ffffff8093067140 [verbose debug info unavailable]
Internal error: Accessing user space memory outside uaccess.h
routines: 96000045 [#1] PREEMPT SMP
PC is at usb_gadget_unregister_driver+0x88/0xf0
LR is at usb_gadget_unregister_driver+0x30/0xf0

Change-Id: I77dfbd4162c7a4d96bbe297Montana4c99e876f5cf88
Signed-off-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1287125
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiaojun Ji <jixj@motorola.com>
Reviewed-by: Yuecai Liu <liuyc20@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1338869
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Reviewed-on: https://gerrit.mot.com/1449121
Reviewed-on: https://gerrit.mot.com/1511639
Reviewed-by: Zonghua Liu <a17671@motorola.com>
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
2023-06-01 00:47:06 -03:00
Jerry Zhang fbd97d639f usb: gadget: f_mtp: Return error if count is negative
If the user passes in a negative file size in a int64,
this will compare to be smaller than buffer length,
and it will get truncated to form a read length that
is larger than the buffer length.

To fix, return -EINVAL if the count argument is negative,
so the loop will never happen.

Mot-CRs-fixed: (CR)
CVE-fixed: CVE-2017-13163
Bug: 37429972

Test: Test with PoC
Change-Id: I5Montanae38e6fbe2c17eb8c493f9eb81df6cfd780a4
Signed-off-by: Jerry Zhang <zhangjerry@google.com>
Signed-off-by: Amarendra Reddy <amarenr@motorola.com>
Reviewed-on: https://gerrit.mot.com/1090092
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1167331
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Reviewed-on: https://gerrit.mot.com/1262843
Reviewed-on: https://gerrit.mot.com/1338862
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Reviewed-on: https://gerrit.mot.com/1449108
Reviewed-on: https://gerrit.mot.com/1511638
Reviewed-by: Zonghua Liu <a17671@motorola.com>
2023-06-01 00:47:06 -03:00
Ravi Vembu bcf6a699d1 usb: gadget: storage: Support READ_TOC for MacOS
Modify READ_TOC handling to add support for both Windows and MacOS
host environments.

Change-Id: I4bf3c6a8fbec95387608869efbacb6f0537c7bbf
Signed-off-by: Ravi Vembu <raviv@motorola.com>
Moto-CRs-fixed: (CR)
Reviewed-on: http://gerrit.mot.com/864910
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
Signed-off-by: Rav(CR) Vembu <raviv@motorola.com>
Reviewed-on: https://gerrit.mot.com/944111
Reviewed-on: https://gerrit.mot.com/1167320
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Lu Chai <chailu1@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1262841
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Reviewed-on: https://gerrit.mot.com/1338861
Reviewed-on: https://gerrit.mot.com/1449077
Reviewed-on: https://gerrit.mot.com/1511637
Reviewed-by: Zonghua Liu <a17671@motorola.com>
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
2023-06-01 00:47:06 -03:00
Ravi Vembu 63fb41f31c usb: configfs: Implement secure attribute
Implement the secure attribute for locking USB access
from the gadget driver.

echo 1 > /sys/class/android_usb/android0/secure
will lock USB access and disable USB enumeration.

Change-Id: Ieb4f9358052a4596b2a2cf39143404dd5b52fee1
Signed-off-by: Ravi Vembu <raviv@motorola.com>
Moto-CRs-fixed: (CR)
Reviewed-on: https://gerrit.mot.com/965870
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Zong-Hua Liu <a17671@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
Reviewed-on: https://gerrit.mot.com/1167324
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Lu Chai <chailu1@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key

Conflicts:
	drivers/usb/gadget/configfs.c
Change-Id: Ieb4f9358052a4596b2a2cf39143404dd5b52fee1
Reviewed-on: https://gerrit.mot.com/1257220
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiaojun Ji <jixj@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1338831
Reviewed-on: https://gerrit.mot.com/1449037
Reviewed-on: https://gerrit.mot.com/1511635
Reviewed-by: Zonghua Liu <a17671@motorola.com>
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
2023-06-01 00:47:06 -03:00
Ravi Vembu 23e5982bf2 usb: configfs: Reset the use_os_desc flag
os_desc support can be turned off via userspace. Kernel also
needs to correspondingly reset its state if userspace has changed
it. Otherwise this cause os descs to be advertised on drivers that
have no os desc support.

Change-Id: Ib8da2eb78a1640aac9abdb29840a33773603d1a8
Signed-off-by: Ravi Vembu <raviv@motorola.com>
Moto-CRs-fixed: (CR)
Reviewed-on: https://gerrit.mot.com/920122
SLTApproved: Slta Waiver <sltawvr@motorola.com>
SME-Granted: SME Approvals Granted
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Christopher Fries <cfries@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
Reviewed-on: https://gerrit.mot.com/1167316
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Lu Chai <chailu1@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1257205
Reviewed-by: Xiaojun Ji <jixj@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Reviewed-on: https://gerrit.mot.com/1338832
Reviewed-on: https://gerrit.mot.com/1449034
Reviewed-on: https://gerrit.mot.com/1511634
Reviewed-by: Zonghua Liu <a17671@motorola.com>
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
2023-06-01 00:47:06 -03:00
Ravikumar Vembu 4763aedad8 usb: mass_storage: Add support for SC_REBOOT
Add support for a vendor specific SCSI pass through command to
trigger reboot.

SC_REBOOT (0xd7) - triggers reboot into fastboot mode
SC_REBOOT_1 (0xd8) - triggers reboot into normal mode.

Propagated from (CR)

Change-Id: I15e37c907fe0fcb3d0186bb58aa1995e63fcb944
Signed-off-by: Rav(CR) Vembu <raviv@motorola.com>
Reviewed-on: https://gerrit.mot.com/942135
SLTApproved: Slta Waiver <sltawvr@motorola.com>
SME-Granted: SME Approvals Granted
Tested-by: Jira Key <jirakey@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
Reviewed-on: https://gerrit.mot.com/1312200
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Ling Jin <lingjin@motorola.com>
Submit-Approved: Jira Key
(cherry picked from commit e1048f3a683f50c3e80c2ee9edf43c769a01a59c)
Reviewed-on: https://gerrit.mot.com/1252613
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Reviewed-on: https://gerrit.mot.com/1338912
Reviewed-on: https://gerrit.mot.com/1449026
Reviewed-on: https://gerrit.mot.com/1511633
Reviewed-by: Zonghua Liu <a17671@motorola.com>
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
2023-06-01 00:47:06 -03:00
Ravi Vembu e56df2d966 usb: f_mtp: Handle OS descriptors only when bound
Handle OS descriptors and other Vendor defined requests only
when the MTP function is bound. Otherwise MTP responds for
setup requests from Windows Hosts when other gadget drivers are
active and the host ends up loading the wrong driver.

Change-Id: I324d42bd0fab743c7b40d2b119225a6d66781a52
Signed-off-by: Ravi Vembu <raviv@motorola.com>
Moto-CRs-fixed: (CR)
Reviewed-on: https://gerrit.mot.com/946404
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
Reviewed-on: https://gerrit.mot.com/1167321
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Lu Chai <chailu1@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1262838
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Reviewed-on: https://gerrit.mot.com/1338858
Reviewed-on: https://gerrit.mot.com/1448946
Reviewed-on: https://gerrit.mot.com/1511632
Reviewed-by: Zonghua Liu <a17671@motorola.com>
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
2023-06-01 00:47:06 -03:00
xuwei9 30b0c9d6fc config:remove unused smb1355 config
smb1355 not userd at
guam/guamp , remove it

Change-Id: I24fe1541297c00617661fc338f1342171a1ab2b7
Signed-off-by: xuwei9 <xuwei9@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1511767
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2023-06-01 00:47:06 -03:00
dengwei1 9814b4696e guam: input add touch class support
input add touch
class support

Change-Id: Id5ee7235aeb89f23906ff8fa2af9528dce36447b
Signed-off-by: dengwei1 <dengwei1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1511705
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2023-06-01 00:47:06 -03:00
zhaoxp3 9ef49dfd65 arm64/config: enable DIAG_OVER_TTY
Moto diag driver built-in or DLKM requires DIAG_OVER_TTY
for both user and userdebug version.

Change-Id: I5f6bec18700f3fd8a5198266625837b8830fa10e
Signed-off-by: zhaoxp3 <zhaoxp3@motorola.com>
Reviewed-on: https://gerrit.mot.com/1510729
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
Submit-Approved: Jira Key
2023-06-01 00:47:06 -03:00
Ryan Lattrel 1fc1372a3f drivers: tty: add tty diag module
Add tty diag module for tcmd.  Copied from kernel 4.4.

Ported from: https://gerrit.mot.com/#/c/677438/

Change-Id: I124a256ab2f554260d773baccee6d7104bfe2e58
Signed-off-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-on: https://gerrit.mot.com/1180336
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Reviewed-by: Ling Jin <lingjin@motorola.com>
Tested-by: Jira Key
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1242980
Reviewed-by: Master Yoda
Reviewed-by: Shengqi Wang <wangsq2@motorola.com>
Reviewed-by: Yuecai Liu <liuyc20@motorola.com>
Reviewed-on: https://gerrit.mot.com/1448862
Reviewed-on: https://gerrit.mot.com/1510728
2023-06-01 00:47:06 -03:00