Commit Graph

1080740 Commits

Author SHA1 Message Date
XiaoTan Luo
5c12a1263c ARM: dts: rockchip: rk3288: add spdif_2ch node
Signed-off-by: XiaoTan Luo <lxt@rock-chips.com>
Change-Id: Id0abf6748053cbf0666f20c28fd68bbf9c3f2086
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-18 11:11:17 +08:00
Jianqun Xu
a6202ba721 ARM: dts: rockchip: rk3288: fix to timer0 for broadcast timer
Change-Id: I0dd9a367c2587391b17ab9bb3a4610abdee14816
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-18 11:09:57 +08:00
Finley Xiao
9ee437dc1d ARM: dts: rockchip: rk3288: Change 400MHz to 420Mhz for gpu
It doesn't support 400MHz, but support 420MHz.

Change-Id: Ife31469307912f83919b02b532acde91cc0f19ce
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-18 11:04:04 +08:00
Jason Song
dff006bcf0 ARM: dts: rockchip: rk3288: fix uart pinctrl to pullup
Change-Id: Ia1d5af0a3fadf9f8649df664aef2e6f3d862d778
Signed-off-by: Jason Song <sxj@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-18 10:58:49 +08:00
Allon Huang
853742ebfe ARM: dts: rockchip: rk3288: Add csi_host and cif_pin
Change-Id: I43f289d3de897ef16098639a57b140c9554de3cd
Signed-off-by: Allon Huang <allon.huang@rock-chips.com
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-18 10:58:02 +08:00
xcq
0b16181d0a ARM: dts: rockchip: rk3288: Add isp config
Change-Id: I00883343c8addff1adc71bef5001d3064b829d97
Signed-off-by: xcq <shawn.xu@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-18 10:55:34 +08:00
William Wu
0fce242c01 ARM: dts: rockchip: rk3288: Fix reg size for ehci
According to rk3288 TRM, the size of usb ehci is 128K,
so let's fix it in dts.

Change-Id: I1adf02080033906a88b34cae877bb84ad0f63059
Signed-off-by: William Wu <william.wu@rock-chips.com>
2022-11-18 10:52:23 +08:00
Elon Zhang
e5611037e8 ARM: dts: rockchip: rk3288: Add firmware and optee node
Add optee node to supply OP-TEE required properties.
/optee node is supposed to be below /firmware node.

Signed-off-by: Elon Zhang <zhangzj@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I067f12319a2ec3252655669b199ced6ab451cbd9
2022-11-18 10:51:57 +08:00
Jianqun Xu
e7be6c1a29 ARM: dts: rockchip: rk3288: add rockchip-suspend node
Change-Id: Id5700548a6034248ed5ad3226dd652d0833eec13
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-18 10:51:27 +08:00
Jianqun Xu
d906b21832 ARM: dts: rockchip: rk3288: Add SCLK_HDMI_CEC to PD_VIO
Change-Id: I6de8283516f01093213ea16f0792bcd10fb1af2b
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-18 10:49:06 +08:00
Mike Rapoport
68d4b5fef2 BACKPORT: mm/page_alloc: always initialize memory map for the holes
Patch series "mm: ensure consistency of memory map poisoning".

Currently memory map allocation for FLATMEM case does not poison the
struct pages regardless of CONFIG_PAGE_POISON setting.

This happens because allocation of the memory map for FLATMEM and SPARSMEM
use different memblock functions and those that are used for SPARSMEM case
(namely memblock_alloc_try_nid_raw() and memblock_alloc_exact_nid_raw())
implicitly poison the allocated memory.

Another side effect of this implicit poisoning is that early setup code
that uses the same functions to allocate memory burns cycles for the
memory poisoning even if it was not intended.

These patches introduce memmap_alloc() wrapper that ensure that the memory
map allocation is consistent for different memory models.

This patch (of 4):

Currently memory map for the holes is initialized only when SPARSEMEM
memory model is used.  Yet, even with FLATMEM there could be holes in the
physical memory layout that have memory map entries.

For instance, the memory reserved using e820 API on i386 or
"reserved-memory" nodes in device tree would not appear in memblock.memory
and hence the struct pages for such holes will be skipped during memory
map initialization.

These struct pages will be zeroed because the memory map for FLATMEM
systems is allocated with memblock_alloc_node() that clears the allocated
memory.  While zeroed struct pages do not cause immediate problems, the
correct behaviour is to initialize every page using __init_single_page().
Besides, enabling page poison for FLATMEM case will trigger
PF_POISONED_CHECK() unless the memory map is properly initialized.

Make sure init_unavailable_range() is called for both SPARSEMEM and
FLATMEM so that struct pages representing memory holes would appear as
PG_Reserved with any memory layout.

[rppt@kernel.org: fix microblaze]
  Link: https://lkml.kernel.org/r/YQWW3RCE4eWBuMu/@kernel.org

(cherry picked from commit c3ab6baf6a)

Bug: 258556132
Link: https://lkml.kernel.org/r/20210714123739.16493-1-rppt@kernel.org
Link: https://lkml.kernel.org/r/20210714123739.16493-2-rppt@kernel.org
Change-Id: Ib60682288ba76e65384de91b70a08662ead12934
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Acked-by: David Hildenbrand <david@redhat.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Cc: Michal Simek <monstr@monstr.eu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-11-17 18:58:07 +00:00
Jianqun Xu
a4a177f736 ARM: dts: rockchip: rk3288-evb enable sound with rt5640
Change-Id: Ibe3f218f9b3283c82329500486fd73298fc3b0d6
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2022-11-17 18:07:13 +08:00
Jianqun Xu
9903fc2377 ARM: dts: rockchip: rk3288-evb-rk808-linux add wifi_enable_h pinctrl
DTC     arch/arm/boot/dts/rk3288-evb-rk808-linux.dtb
arch/arm/boot/dts/rk3288-evb-rk808-linux.dts:87.27-101.4: ERROR (phandle_references): /sdio-pwrseq: Reference to non-existent node or label "wifi_enable_h"

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I14eb634ed8823e4caef581b8974a5dded63f5d8e
2022-11-17 18:07:13 +08:00
Jianqun Xu
f1d80296b4 ARM: dts: rockchip: rk3288-evb-rk808-linux fix to hdmi_cec_c0
DTC     arch/arm/boot/dts/rk3288-evb-rk808-linux.dtb
arch/arm/boot/dts/rk3288.dtsi:1433.22-1463.4: ERROR (phandle_references): /hdmi@ff980000: Reference to non-existent node or label "hdmi_cec"

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I976f1ea4d9ee796ce1c179f5dfead625c257f8af
2022-11-17 18:07:13 +08:00
Jianqun Xu
1f38917aeb ARM: dts: rockchip: rk3288: fix base address for i2s to 0xff8b0000
This patch fixes the error base address for the i2s controller from
0xff88b0000 to 0xff8b0000.

Also order the i2s node by mapping address.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I613eaf64ee010c41208f1c8169e55efbf39fd34c
2022-11-17 18:07:13 +08:00
Yifeng Zhao
4ba9bb2228 drivers: rk_nand: fix compile warning
warning: drivers/rk_nand/rk_ftlv5_arm32.o uses 4-byte wchar_t yet
the output is to use 2-byte wchar_t;

Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: I9ea1cdb05be5e4edb297517a9ae8c5e5377538be
2022-11-17 16:46:48 +08:00
Jianwei Fan
3f98f91c6f arm64: dts: rockchip: rk3326-evb-lp3: remove pinctrl dvp_d0d1_m0
In rk3326-evb-lp3-avb, gpio2_b6 is used for CAM_PDN0 instead of cif_data1.

Change-Id: I926474f2b06cc39052997750eb1894a8b0fe04d7
Signed-off-by: Jianwei Fan <jianwei.fan@rock-chips.com>
2022-11-17 16:42:47 +08:00
Ziyuan Xu
f91fc90bbe media: i2c: sc3338: pm_runtime_put device until stream_off for thunderboot
The camera device should keep *power on* until stream off, that make
sure the mclk is enable.

Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Change-Id: I2db0070793d755d8d1fe2cda3f87aaa498e052d3
2022-11-17 16:17:58 +08:00
Lin Jianhua
334791b0d3 input: touchscreen: gt1x: ignore pin of reset and support power invert
Signed-off-by: Lin Jianhua <linjh@rock-chips.com>
Change-Id: I3f0da33eef197d78bfb72c620bfe2c25dd87d02a
2022-11-17 14:41:50 +08:00
David Wu
54f657fcdb configs: rockchip: Enable CONFIG_MOTORCOMM_PHY for RK631
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Id19b664d3688908f3f758bb26eab8e0b7c7d4201
2022-11-17 14:30:02 +08:00
David Wu
5b7a85aa3e net: phy: Add motorcomm driver for RK631 PHY
Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Iad8fd02e5f3dd2397dbdb7eb150325fc76e9c422
2022-11-17 14:28:50 +08:00
Peter Geis
4de4ec6c66 UPSTREAM: net: phy: abort loading yt8511 driver in unsupported modes
While investigating the clang `ge` uninitialized variable report, it was
discovered the default switch would have unintended consequences. Due to
the switch to __phy_modify, the driver would modify the ID values in the
default scenario.

Fix this by promoting the interface mode switch and aborting when the
mode is not a supported RGMII mode.

This prevents the `ge` and `fe` variables from ever being used
uninitialized.

Fixes: 48e8c6f161 ("net: phy: add driver for Motorcomm yt8511 phy")
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David Wu <david.wu@rock-chips.com>
(cherry-pick from commit 0cc8bddb5b)
Change-Id: I610c03a4f032a8a8dde8ef58d105b721c0541bf5
2022-11-17 14:28:29 +08:00
Peter Geis
14adf98ff1 UPSTREAM: net: phy: fix yt8511 clang uninitialized variable warning
clang doesn't preinitialize variables. If phy_select_page failed and
returned an error, phy_restore_page would be called with `ret` being
uninitialized.
Even though phy_restore_page won't use `ret` in this scenario,
initialize `ret` to silence the warning.

Fixes: 48e8c6f161 ("net: phy: add driver for Motorcomm yt8511 phy")
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David Wu <david.wu@rock-chips.com>
(cherry-pick from commit 546d6bad18)
Change-Id: I0467ca4b5846e71ddca8a6818e5c021010a72d98
2022-11-17 14:28:03 +08:00
Peter Geis
9ec339342e UPSTREAM: net: phy: add driver for Motorcomm yt8511 phy
Add a driver for the Motorcomm yt8511 phy that will be used in the
production Pine64 rk3566-quartz64 development board.
It supports gigabit transfer speeds, rgmii, and 125mhz clk output.

Signed-off-by: Peter Geis <pgwipeout@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: David Wu <david.wu@rock-chips.com>
(cherry-pick from commit 48e8c6f161)
Change-Id: If0af67cda0ad607e4a31f126804547e9d8b3df50
2022-11-17 14:27:47 +08:00
Ding Wei
d5519c9605 ARM: dts: rockchip: rk3288: hevc_service: add default val setting
Change-Id: I3f71fe50e8b51e21728afae850f0aca21b8b160c
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2022-11-17 14:26:53 +08:00
Ding Wei
fee9944154 ARM: dts: rockchip: rk3288 add clk-rates setting for vdpu and rkvdec
Change-Id: Ibd695ef470c40829a348c660dd94de3f6a2b320c
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2022-11-17 14:26:53 +08:00
Chen Jinsen
2e18f6fc32 ARM: dts: rockchip: vdpu support automatic frequency for rk3288
Signed-off-by: Chen Jinsen <kevin.chen@rock-chips.com>
Change-Id: I0378d57524d1b7146dbebec3d4fa9c125430b0d0
2022-11-17 14:26:53 +08:00
Ding Wei
a9175d765e video: rockchip: mpp: deal with the case for iommu share
In platform arm32, iommu is shared in different device,
it must attach to ensure hardware working in current device.

Change-Id: I854a362adf6145dcfd796885922683f8a6b7e131
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
2022-11-17 14:26:53 +08:00
Su Yuefu
d55a25476c media: i2c: gc3003: pm_runtime_put device until stream_off for thunderboot
Signed-off-by: Su Yuefu <yuefu.su@rock-chips.com>
Change-Id: I041b9cdb4a3416951e5d3855e2d4400db84e3c94
2022-11-17 14:19:33 +08:00
Su Yuefu
927e0f59f7 media: i2c: sc200ai: pm_runtime_put device until stream_off for thunderboot
Signed-off-by: Su Yuefu <yuefu.su@rock-chips.com>
Change-Id: I5754491e2d5344efcfe41897a241435b21804593
2022-11-17 14:19:17 +08:00
Su Yuefu
660f1d040d media: i2c: sc230ai: pm_runtime_put device until stream_off for thunderboot
Signed-off-by: Su Yuefu <yuefu.su@rock-chips.com>
Change-Id: If328b3af33d14fdc5309c35d6e3a222abbcb47ec
2022-11-17 14:18:51 +08:00
Cai YiWei
797a0b4b11 media: rockchip: isp: fix stats buf update for multi sensor
Change-Id: Ic1a8b62ab73b0076a83033c350759be71df53793
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-11-17 14:16:41 +08:00
Jon Lin
b7cf98650b mtd: spi-nor: core: Support misc devices
Calling ioctl PCIE_DMA_GET_FLASH_INFO to get spi nor id.

Change-Id: I1ecfdd527f18c0c323fba9673546c167032d1726
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
2022-11-17 12:06:59 +08:00
Shawn Lin
5083234249 mmc: dw_mmc: Remove useless SDMMC_INT_TXDR and SDMMC_INT_RXDR
These two interrupts are managed by data routine and not need to
enable it via runtime_resume each time.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Change-Id: I9ef2ae0acabefeba4a69ff6b4c7edc3c0318fdeb
2022-11-17 11:53:30 +08:00
Krishna Kurapati
a8997cb185 UPSTREAM: usb: dwc3: gadget: Submit endxfer command if delayed during disconnect
During a cable disconnect sequence, if ep0state is not in the SETUP phase,
then nothing will trigger any pending end transfer commands.  Force
stopping of any pending SETUP transaction, and move back to the SETUP
phase.

Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Link: https://lore.kernel.org/r/20220901193625.8727-6-quic_wcheng@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit 8422b769fa)

Bug: 258997352
Change-Id: I39f41c42d3c5aec76d4f65175e31e2e10a0825be
Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
2022-11-16 16:50:59 +00:00
Mayank Rana
910e9e6049 UPSTREAM: usb: dwc3: Fix ep0 handling when getting reset while doing control transfer
According to the databook ep0 should be in setup phase during reset.
If host issues reset between control transfers, ep0 will be  in an
invalid state. Fix this by issuing stall and restart on ep0 if it
is not in setup phase.

Also SW needs to complete pending control transfer and setup core for
next setup stage as per data book. Hence check ep0 state during reset
interrupt handling and make sure active transfers on ep0 out/in
endpoint are stopped by queuing ENDXFER command for that endpoint and
restart ep0 out again to receive next setup packet.

Signed-off-by: Mayank Rana <quic_mrana@quicinc.com>
Link: https://lore.kernel.org/r/1651693001-29891-1-git-send-email-quic_mrana@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit 9d778f0c5f)

Bug: 258997352
Change-Id: Ie7482ba08d4f77ad65f404b3014ac880f5a5a75e
Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
2022-11-16 16:50:59 +00:00
Greg Kroah-Hartman
bf759deb0f Merge 5.10.151 into android12-5.10-lts
Changes in 5.10.151
	bpf: Generate BTF_KIND_FLOAT when linking vmlinux
	kbuild: Quote OBJCOPY var to avoid a pahole call break the build
	kbuild: skip per-CPU BTF generation for pahole v1.18-v1.21
	kbuild: Unify options for BTF generation for vmlinux and modules
	kbuild: Add skip_encoding_btf_enum64 option to pahole
	Linux 5.10.151

Change-Id: I9933085e5146688af0c7ebae2708c1c978100a90
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2022-11-16 15:33:22 +00:00
SeongJae Park
e0243d1991 UPSTREAM: mm/damon/core: initialize damon_target->list in damon_new_target()
'struct damon_target' creation function, 'damon_new_target()' is not
initializing its '->list' field, unlike other DAMON structs creator
functions such as 'damon_new_region()'.  Normal users of
'damon_new_target()' initializes the field by adding the target to DAMON
context's targets list, but some code could access the uninitialized
field.

This commit avoids the case by initializing the field in
'damon_new_target()'.

Bug: 254441685
Link: https://lkml.kernel.org/r/20221002193130.8227-1-sj@kernel.org
Fixes: f23b8eee18 ("mm/damon/core: implement region-based sampling")
Signed-off-by: SeongJae Park <sj@kernel.org>
Reported-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit b1f44cdaba)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Ie500358e0cc7d5bf82225e6e2b5229f6629736f4
2022-11-16 14:53:12 +00:00
Heikki Krogerus
82b904105a UPSTREAM: usb: typec: ucsi: Remove incorrect warning
Sink only devices do not have any source capabilities, so
the driver should not warn about that. Also DRP (Dual Role
Power) capable devices, such as USB Type-C docking stations,
do not return any source capabilities unless they are
plugged to a power supply themselves.

Bug: 254441685
Fixes: 1f4642b72b ("usb: typec: ucsi: Retrieve all the PDOs instead of just the first 4")
Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20220922145924.80667-1-heikki.krogerus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 415ba26cb7)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I3e10fb2c610a753e19deab7dcceda10599f56c03
2022-11-16 14:48:59 +00:00
Mario Limonciello
5f1257b5ff UPSTREAM: xhci: Don't show warning for reinit on known broken suspend
commit 8b328f8002 ("xhci: re-initialize the HC during resume if HCE was
set") introduced a new warning message when the host controller error
was set and re-initializing.

This is expected behavior on some designs which already set
`xhci->broken_suspend` so the new warning is alarming to some users.

Modify the code to only show the warning if this was a surprising behavior
to the XHCI driver.

Bug: 254441685
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216470
Fixes: 8b328f8002 ("xhci: re-initialize the HC during resume if HCE was set")
Reported-by: Artem S. Tashkinov <aros@gmx.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20220921123450.671459-4-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 484d6f7aa3)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Icf85934a304d1fa18c68b9b4ed08dce60f85a403
2022-11-16 14:48:59 +00:00
Baolin Wang
2df2e2c084 UPSTREAM: mm/damon: validate if the pmd entry is present before accessing
pmd_huge() is used to validate if the pmd entry is mapped by a huge page,
also including the case of non-present (migration or hwpoisoned) pmd entry
on arm64 or x86 architectures.  This means that pmd_pfn() can not get the
correct pfn number for a non-present pmd entry, which will cause
damon_get_page() to get an incorrect page struct (also may be NULL by
pfn_to_online_page()), making the access statistics incorrect.

This means that the DAMON may make incorrect decision according to the
incorrect statistics, for example, DAMON may can not reclaim cold page
in time due to this cold page was regarded as accessed mistakenly if
DAMOS_PAGEOUT operation is specified.

Moreover it does not make sense that we still waste time to get the page
of the non-present entry.  Just treat it as not-accessed and skip it,
which maintains consistency with non-present pte level entries.

So add pmd entry present validation to fix the above issues.

Bug: 254441685
Link: https://lkml.kernel.org/r/58b1d1f5fbda7db49ca886d9ef6783e3dcbbbc98.1660805030.git.baolin.wang@linux.alibaba.com
Fixes: 3f49584b26 ("mm/damon: implement primitives for the virtual memory address spaces")
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit c8b9aff419)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Idda1765dcbc93a28ad38ccc53688d69b64202330
2022-11-16 14:48:59 +00:00
Greg Kroah-Hartman
ed91943b48 UPSTREAM: mm/damon/dbgfs: fix memory leak when using debugfs_lookup()
When calling debugfs_lookup() the result must have dput() called on it,
otherwise the memory will leak over time.  Fix this up by properly calling
dput().

Bug: 254441685
Link: https://lkml.kernel.org/r/20220902191149.112434-1-sj@kernel.org
Fixes: 75c1c2b53c ("mm/damon/dbgfs: support multiple contexts")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 1552fd3ef7)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I7f2e8fa0167b3e44c4c251a51df341a6a7d98fd2
2022-11-16 14:48:59 +00:00
Badari Pulavarty
3093f8b52c UPSTREAM: mm/damon/dbgfs: avoid duplicate context directory creation
When user tries to create a DAMON context via the DAMON debugfs interface
with a name of an already existing context, the context directory creation
fails but a new context is created and added in the internal data
structure, due to absence of the directory creation success check.  As a
result, memory could leak and DAMON cannot be turned on.  An example test
case is as below:

    # cd /sys/kernel/debug/damon/
    # echo "off" >  monitor_on
    # echo paddr > target_ids
    # echo "abc" > mk_context
    # echo "abc" > mk_context
    # echo $$ > abc/target_ids
    # echo "on" > monitor_on  <<< fails

Return value of 'debugfs_create_dir()' is expected to be ignored in
general, but this is an exceptional case as DAMON feature is depending
on the debugfs functionality and it has the potential duplicate name
issue.  This commit therefore fixes the issue by checking the directory
creation failure and immediately return the error in the case.

Bug: 254441685
Link: https://lkml.kernel.org/r/20220821180853.2400-1-sj@kernel.org
Fixes: 75c1c2b53c ("mm/damon/dbgfs: support multiple contexts")
Signed-off-by: Badari Pulavarty <badari.pulavarty@intel.com>
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: <stable@vger.kernel.org>	[ 5.15.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit d26f607036)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I8951b95f41306818ef1b4a5789369a84d8ca2cf2
2022-11-16 14:48:59 +00:00
Eric Biggers
3f23bb2255 UPSTREAM: crypto: lib - remove unneeded selection of XOR_BLOCKS
CRYPTO_LIB_CHACHA_GENERIC doesn't need to select XOR_BLOCKS.  It perhaps
was thought that it's needed for __crypto_xor, but that's not the case.

Enabling XOR_BLOCKS is problematic because the XOR_BLOCKS code runs a
benchmark when it is initialized.  That causes a boot time regression on
systems that didn't have it enabled before.

Therefore, remove this unnecessary and problematic selection.

Bug: 254441685
Fixes: e56e189855 ("lib/crypto: add prompts back to crypto libraries")
Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 874b301985)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I89d552f31062ad677407107280874bc7eafe60bf
2022-11-16 14:48:59 +00:00
Michael Wu
bf4603f495 UPSTREAM: pinctrl: sunxi: Fix name for A100 R_PIO
The name of A100 R_PIO driver should be sun50i-a100-r-pinctrl,
not sun50iw10p1-r-pinctrl.

Bug: 254441685
Fixes: 473436e764 ("pinctrl: sunxi: add support for the Allwinner A100 pin controller")
Signed-off-by: Michael Wu <michael@allwinnertech.com>
Acked-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20220819024541.74191-1-michael@allwinnertech.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 76648c867c)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I950bddf7f50616714a5bd7a8438eb5f518ea70fc
2022-11-16 14:48:59 +00:00
Tetsuo Handa
a0630a0536 UPSTREAM: cgroup: Add missing cpus_read_lock() to cgroup_attach_task_all()
syzbot is hitting percpu_rwsem_assert_held(&cpu_hotplug_lock) warning at
cpuset_attach() [1], for commit 4f7e723643 ("cgroup: Fix
threadgroup_rwsem <-> cpus_read_lock() deadlock") missed that
cpuset_attach() is also called from cgroup_attach_task_all().
Add cpus_read_lock() like what cgroup_procs_write_start() does.

Bug: 254441685
Link: https://syzkaller.appspot.com/bug?extid=29d3a3b4d86c8136ad9e [1]
Reported-by: syzbot <syzbot+29d3a3b4d86c8136ad9e@syzkaller.appspotmail.com>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Fixes: 4f7e723643 ("cgroup: Fix threadgroup_rwsem <-> cpus_read_lock() deadlock")
Signed-off-by: Tejun Heo <tj@kernel.org>
(cherry picked from commit 43626dade3)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Ifd2f0fb1e4e8c3d474dc4a1d943ae92ff3b0d145
2022-11-16 14:48:59 +00:00
Jing Leng
2a11f678f6 BACKPORT: usb: gadget: f_uac2: fix superspeed transfer
On page 362 of the USB3.2 specification (
https://usb.org/sites/default/files/usb_32_20210125.zip),
The 'SuperSpeed Endpoint Companion Descriptor' shall only be returned
by Enhanced SuperSpeed devices that are operating at Gen X speed.
Each endpoint described in an interface is followed by a 'SuperSpeed
Endpoint Companion Descriptor'.

If users use SuperSpeed UDC, host can't recognize the device if endpoint
doesn't have 'SuperSpeed Endpoint Companion Descriptor' followed.

Currently in the uac2 driver code:
1. ss_epout_desc_comp follows ss_epout_desc;
2. ss_epin_fback_desc_comp follows ss_epin_fback_desc;
3. ss_epin_desc_comp follows ss_epin_desc;
4. Only ss_ep_int_desc endpoint doesn't have 'SuperSpeed Endpoint
Companion Descriptor' followed, so we should add it.

Bug: 254441685
Fixes: eaf6cbe099 ("usb: gadget: f_uac2: add volume and mute support")
Cc: stable <stable@kernel.org>
Signed-off-by: Jing Leng <jleng@ambarella.com>
Signed-off-by: Jack Pham <quic_jackp@quicinc.com>
Link: https://lore.kernel.org/r/20220721014815.14453-1-quic_jackp@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f511aef2eb)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I7e4a0ce5482f44df32cfa13cc011281c2bc6393d
2022-11-16 14:48:59 +00:00
Johan Hovold
347d7198a6 BACKPORT: usb: dwc3: qcom: fix runtime PM wakeup
A device must enable wakeups during runtime suspend regardless of
whether it is capable and allowed to wake the system up from system
suspend.

Bug: 254441685
Fixes: 2664deb093 ("usb: dwc3: qcom: Honor wakeup enabled/disabled state")
Tested-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20220804151001.23612-6-johan+linaro@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 6498a96c8c)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: If23278f148db9f1f5f6ac283ede5ebb5b658f8c8
2022-11-16 14:48:59 +00:00
Oliver Upton
af723545ed UPSTREAM: KVM: arm64: Reject 32bit user PSTATE on asymmetric systems
KVM does not support AArch32 EL0 on asymmetric systems. To that end,
prevent userspace from configuring a vCPU in such a state through
setting PSTATE.

It is already ABI that KVM rejects such a write on a system where
AArch32 EL0 is unsupported. Though the kernel's definition of a 32bit
system changed in commit 2122a83331 ("arm64: Allow mismatched
32-bit EL0 support"), KVM's did not.

Bug: 254441685
Fixes: 2122a83331 ("arm64: Allow mismatched 32-bit EL0 support")
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220816192554.1455559-3-oliver.upton@linux.dev
(cherry picked from commit b10d86fb8e)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I73b63bf79bfbade51dc417fe2c76fd0057eb21b8
2022-11-16 14:48:59 +00:00
Oliver Upton
8407a5ca14 UPSTREAM: KVM: arm64: Treat PMCR_EL1.LC as RES1 on asymmetric systems
KVM does not support AArch32 on asymmetric systems. To that end, enforce
AArch64-only behavior on PMCR_EL1.LC when on an asymmetric system.

Bug: 254441685
Fixes: 2122a83331 ("arm64: Allow mismatched 32-bit EL0 support")
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220816192554.1455559-2-oliver.upton@linux.dev
(cherry picked from commit f3c6efc72f)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: I982a10aee328eec10b7d75b7fa580748540ddf47
2022-11-16 14:48:59 +00:00