platform/kernel/linux-thead.git
7 months agoRISCV: configs: tizen-lpi4a: Enable watchdog driver 58/319058/1 accepted/tizen_unified_toolchain accepted/tizen/unified/toolchain/20241022.122702 accepted/tizen/unified/toolchain/20241022.123103 accepted/tizen/unified/x/20241017.075855 accepted/tizen/unified/x/asan/20241022.113555
Michal Wilczynski [Mon, 14 Oct 2024 08:40:26 +0000 (10:40 +0200)]
RISCV: configs: tizen-lpi4a: Enable watchdog driver

The watchdog driver is necessary for the 'reboot' feature to work.
Enable it in the config.

Change-Id: I9c7e25baa6df0495fccc5e6e2e610273fda796df
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
7 months agoriscv: dts: thead: Enable light_event and dependent nodes 57/319057/1
Michal Wilczynski [Mon, 14 Oct 2024 08:34:28 +0000 (10:34 +0200)]
riscv: dts: thead: Enable light_event and dependent nodes

Light event device tree node is required for the 'reboot' feature to
work, as the driver function gets called by the watchdog. Enable it in
the device tree to get the driver initialized properly. Add aon_iram
dependent node as well. Ported from vendor kernel [1].

[1] https://gitee.com/thead-yocto/kernel.git

Change-Id: Id77c4901a2a77146d0f26e31769221a1cf5ca853
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
7 months agosoc: thead: Introduce thead light_event driver 56/319056/1
Michal Wilczynski [Mon, 14 Oct 2024 08:28:34 +0000 (10:28 +0200)]
soc: thead: Introduce thead light_event driver

This driver is required for the 'reboot' feature to work. Watchdog
driver calls light_event_set_rebootmode() exported from this driver.
Port it from the vendor kernel [1].

[1] - https://gitee.com/thead-yocto/kernel.git

Change-Id: Ia25f95ed72669df348f72bcfcb0ca5eabb51dfc7
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
7 months agowatchdog: light_wdt: Introduce thead watchdog driver 55/319055/1
Michal Wilczynski [Mon, 14 Oct 2024 08:21:06 +0000 (10:21 +0200)]
watchdog: light_wdt: Introduce thead watchdog driver

T-Head watchdog driver is required for 'reboot' feature to work.
Port it from the vendor kernel [1].

[1] - https://gitee.com/thead-yocto/kernel.git

Change-Id: If4d54fcdc65c77b6068b4cd989f3f869fec5428a
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
8 months agoriscv: dts: thead: Enable uart4 for Bluetooth HCI 96/318896/2 accepted/tizen/unified/x/20241014.143212
Michal Wilczynski [Thu, 10 Oct 2024 13:44:48 +0000 (15:44 +0200)]
riscv: dts: thead: Enable uart4 for Bluetooth HCI

On LicheePi4A the HCI for Bluetooth is using UART. Enable uart4 so
the communication with the chip works.

Change-Id: If8c40574fe47dc20901b7142d664656ca5b418df
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
8 months agoRISCV: configs: tizen-lpi4a: drop DM_BOW 94/317894/2 accepted/tizen/unified/x/20241011.021746 accepted/tizen/unified/x/asan/20241014.000543
Marek Szyprowski [Fri, 20 Sep 2024 07:40:43 +0000 (09:40 +0200)]
RISCV: configs: tizen-lpi4a: drop DM_BOW

dm-bow kernel module has been moved to external linux-tizen-modules
repository, so drop it from tizen_lpi4a_defconfig.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I877de7f16d007703b4cc3da3c0be33184dd571b1

8 months agoRevert "device-mapper: Add dm-bow" 93/317893/2
Marek Szyprowski [Fri, 20 Sep 2024 07:38:34 +0000 (09:38 +0200)]
Revert "device-mapper: Add dm-bow"

The dm-bow kernel module (developed externally by Google team) has been
moved to linux-tizen-modules-source repository, so keeping a copy of it
in each kernel repository is not needed anymore.

This reverts commit b5c5df065d73537ff80dcabae573e23a49ff02f9.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ia30b192e5e825bd013c6b0f39b2ee0c614f3c09c

8 months agoRISCV: configs: tizen-lpi4a: Enable wireless drivers 60/318660/1 accepted/tizen/unified/x/20241008.135226
Michal Wilczynski [Fri, 4 Oct 2024 10:29:04 +0000 (12:29 +0200)]
RISCV: configs: tizen-lpi4a: Enable wireless drivers

Aic8800 drivers are written in a way that they can only work as modules,
and can't be compiled in the kernel. Enable them as modules so the Wi-Fi
works.

Change-Id: I15336469583726ba5a4bd898349809ab15421ca3
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
8 months agoriscv: dts: thead: Add Wi-Fi rfkill node, and SDIO bus node 59/318659/1
Michal Wilczynski [Fri, 4 Oct 2024 10:14:20 +0000 (12:14 +0200)]
riscv: dts: thead: Add Wi-Fi rfkill node, and SDIO bus node

In order for Wi-Fi to work the SDIO bus needs to be enabled in the
device tree, as well as the node required to turn on the GPIO to power
on the device - wcn_wifi.

Port them from the vendor kernel [1].

[1] - https://gitee.com/thead-yocto/kernel.git

Change-Id: I4b673316100f5a75195105befb6895095a9cb690
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
8 months agoriscv: dts: thead: Remove interfering regulator 58/318658/1
Michal Wilczynski [Fri, 4 Oct 2024 10:01:58 +0000 (12:01 +0200)]
riscv: dts: thead: Remove interfering regulator

Regulator soc_cam2_dvdd12_ir_reg seems to be using the same gpio
controller as the rfkill gpio. It was observed that when this regulator
is enabled the rfkill setting up it's GPIO doesn't actually have any
effect i.e the Wi-Fi card never actually shows up on the SDIO bus.
Remove this regulator for now, as it doesn't seem to be critical for any
other functionality on the SoC.

Change-Id: I5e54831e4084ab04bc5d3618cbde318d9775aa62
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
8 months agonet: rfkill: Enable custom rfkill for LicheePi4A Wi-Fi 57/318657/1
Michal Wilczynski [Fri, 4 Oct 2024 09:40:21 +0000 (11:40 +0200)]
net: rfkill: Enable custom rfkill for LicheePi4A Wi-Fi

Enable the driver responsible for powering-on the Wi-Fi card on the
T-Head LicheePi4A SoC. One could argue that the net/rfkill might not be
the best place for it, however it was put there originally in the vendor
kernel. For now will keep it there.

It was observed that the driver doesn't really do much else, than set
the gpio specified in the device during the boot up of the system.

Ported from vendor kernel [1].

[1] https://gitee.com/thead-yocto/kernel.git

Change-Id: I268f531f9e7860ee22d261268bc06acd51088e99
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
8 months agowireless: aic8800: Enable LicheePi 4A wireless driver 56/318656/1
Michal Wilczynski [Fri, 4 Oct 2024 09:15:49 +0000 (11:15 +0200)]
wireless: aic8800: Enable LicheePi 4A wireless driver

Ported from the vendor kernel [1].

[1] https://gitee.com/thead-yocto/kernel.git

Change-Id: Ibd067b5ebf33e6206e57b9e45a2e8b1a1c88011f
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
8 months agommc: sdhci: Prevent stale command and data interrupt handling 55/318655/1
Michal Wilczynski [Thu, 3 Oct 2024 12:53:27 +0000 (14:53 +0200)]
mmc: sdhci: Prevent stale command and data interrupt handling

While working with the T-Head 1520 LicheePi4A SoC, certain conditions
arose that allowed me to reproduce a race issue in the sdhci code.

To reproduce the bug, you need to enable the sdio1 controller in the
device tree file
`arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi` as follows:

&sdio1 {
bus-width = <4>;
max-frequency = <100000000>;
no-sd;
no-mmc;
broken-cd;
cap-sd-highspeed;
post-power-on-delay-ms = <50>;
status = "okay";
wakeup-source;
keep-power-in-suspend;
};

When resetting the SoC using the reset button, the following messages
appear in the dmesg log:

[    8.164898] mmc2: Got command interrupt 0x00000001 even though no
command operation was in progress.
[    8.174054] mmc2: sdhci: ============ SDHCI REGISTER DUMP ===========
[    8.180503] mmc2: sdhci: Sys addr:  0x00000000 | Version:  0x00000005
[    8.186950] mmc2: sdhci: Blk size:  0x00000000 | Blk cnt:  0x00000000
[    8.193395] mmc2: sdhci: Argument:  0x00000000 | Trn mode: 0x00000000
[    8.199841] mmc2: sdhci: Present:   0x03da0000 | Host ctl: 0x00000000
[    8.206287] mmc2: sdhci: Power:     0x0000000f | Blk gap:  0x00000000
[    8.212733] mmc2: sdhci: Wake-up:   0x00000000 | Clock:    0x0000decf
[    8.219178] mmc2: sdhci: Timeout:   0x00000000 | Int stat: 0x00000000
[    8.225622] mmc2: sdhci: Int enab:  0x00ff1003 | Sig enab: 0x00ff1003
[    8.232068] mmc2: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
[    8.238513] mmc2: sdhci: Caps:      0x3f69c881 | Caps_1:   0x08008177
[    8.244959] mmc2: sdhci: Cmd:       0x00000502 | Max curr: 0x00191919
[    8.254115] mmc2: sdhci: Resp[0]:   0x00001009 | Resp[1]:  0x00000000
[    8.260561] mmc2: sdhci: Resp[2]:   0x00000000 | Resp[3]:  0x00000000
[    8.267005] mmc2: sdhci: Host ctl2: 0x00001000
[    8.271453] mmc2: sdhci: ADMA Err:  0x00000000 | ADMA Ptr:
0x0000000000000000
[    8.278594] mmc2: sdhci: ============================================

I also enabled some traces to better understand the problem:

     kworker/3:1-62      [003] .....     8.163538: mmc_request_start:
mmc2: start struct mmc_request[000000000d30cc0c]: cmd_opcode=5
cmd_arg=0x0 cmd_flags=0x2e1 cmd_retries=0 stop_opcode=0 stop_arg=0x0
stop_flags=0x0 stop_retries=0 sbc_opcode=0 sbc_arg=0x0 sbc_flags=0x0
sbc_retires=0 blocks=0 block_size=0 blk_addr=0 data_flags=0x0 tag=0
can_retune=0 doing_retune=0 retune_now=0 need_retune=0 hold_retune=1
retune_period=0
          <idle>-0       [000] d.h2.     8.164816: sdhci_cmd_irq:
hw_name=ffe70a0000.mmc quirks=0x2008008 quirks2=0x8 intmask=0x10000
intmask_p=0x18000
     irq/24-mmc2-96      [000] .....     8.164840: sdhci_thread_irq:
msg=
     irq/24-mmc2-96      [000] d.h2.     8.164896: sdhci_cmd_irq:
hw_name=ffe70a0000.mmc quirks=0x2008008 quirks2=0x8 intmask=0x1
intmask_p=0x1
     irq/24-mmc2-96      [000] .....     8.285142: mmc_request_done:
mmc2: end struct mmc_request[000000000d30cc0c]: cmd_opcode=5
cmd_err=-110 cmd_resp=0x0 0x0 0x0 0x0 cmd_retries=0 stop_opcode=0
stop_err=0 stop_resp=0x0 0x0 0x0 0x0 stop_retries=0 sbc_opcode=0
sbc_err=0 sbc_resp=0x0 0x0 0x0 0x0 sbc_retries=0 bytes_xfered=0
data_err=0 tag=0 can_retune=0 doing_retune=0 retune_now=0 need_retune=0
hold_retune=1 retune_period=0

Here's what happens: the __mmc_start_request function is called with
opcode 5. Since the power to the Wi-Fi card, which resides on this SDIO
bus, is initially off after the reset, an interrupt SDHCI_INT_TIMEOUT is
triggered. Immediately after that, a second interrupt SDHCI_INT_RESPONSE
is triggered. Depending on the exact timing, these conditions can
trigger the following race problem:

1) The sdhci_cmd_irq top half handles the command as an error. It sets
   host->cmd to NULL and host->pending_reset to true.
2) The sdhci_thread_irq bottom half is scheduled next and executes faster
   than the second interrupt handler for SDHCI_INT_RESPONSE. It clears
   host->pending_reset before the SDHCI_INT_RESPONSE handler runs.
3) The pending interrupt SDHCI_INT_RESPONSE handler gets called, triggering
   a code path that prints: "mmc2: Got command interrupt 0x00000001 even
   though no command operation was in progress."

To solve this issue, we need to clear pending interrupts when resetting
host->pending_reset. This ensures that after sdhci_threaded_irq restores
interrupts, there are no pending stale interrupts.

Change-Id: Idd6b1623cd842e00a30466074a225e7d847d1f98
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
9 months agoRISCV: configs: tizen-lpi4a: enable drivers needed for host USB support 66/316866/1 accepted/tizen/unified/toolchain/20241004.102134 accepted/tizen/unified/x/20240830.151547
Marek Szyprowski [Thu, 29 Aug 2024 14:34:45 +0000 (16:34 +0200)]
RISCV: configs: tizen-lpi4a: enable drivers needed for host USB support

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I45392bbd63292da19e7a3bae0e86c5f7d48faaa3

9 months agoriscv: dts: thead: Add devicetree nodes for DWC3 (host USB) controller 65/316865/1
Marek Szyprowski [Thu, 29 Aug 2024 14:30:50 +0000 (16:30 +0200)]
riscv: dts: thead: Add devicetree nodes for DWC3 (host USB) controller

Add DWC3 device controller and the needed glue nodes.

Ported from vendor kernel [1].

[1] https://gitee.com/thead-yocto/kernel.git

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I3e023ec8d778c44204fa2e67b107431fff36f035

9 months agousb: dwc3: add THEAD/LicheePi4A vendor driver 64/316864/1
Marek Szyprowski [Thu, 29 Aug 2024 14:24:57 +0000 (16:24 +0200)]
usb: dwc3: add THEAD/LicheePi4A vendor driver

Taken from vendor kernel [1].

[1] https://gitee.com/thead-yocto/kernel.git

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I213452d619632addb75a23373542a962c21e6c9b

10 months agogpu: drm: img-rogue: Fix shrinker name 22/316122/1 accepted/tizen/unified/x/20240818.074458
Seung-Woo Kim [Wed, 14 Aug 2024 01:02:13 +0000 (10:02 +0900)]
gpu: drm: img-rogue: Fix shrinker name

The empty character shrinker name causes build warning, so fix it
to NULL as like other git trees including img-rogue.

Change-Id: I4aca9e4309ad27bd9922af54f9a10de11b929d20
Ref: https://git.tizen.org/cgit/platform/kernel/linux-starfive/tree/drivers/gpu/drm/img/img-rogue/services/server/env/linux/physmem_osmem_linux.c?h=7d2455338737#n615
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
10 months agofirmware: thead: Remove unused-function warning 94/316094/1
Seung-Woo Kim [Tue, 13 Aug 2024 11:13:31 +0000 (20:13 +0900)]
firmware: thead: Remove unused-function warning

Remove unused function to resolve unused-function warning.

Change-Id: Idfb3f4c329616dd182078942a020a8c70d376eb1
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
10 months agofirmware: thead: Fix format warning 93/316093/1
Seung-Woo Kim [Tue, 13 Aug 2024 11:11:59 +0000 (20:11 +0900)]
firmware: thead: Fix format warning

Fix format warning with proper printing format.

Change-Id: Ie25c9d68846c78ea5f3b8c13791f932971ac36e9
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
10 months agofirmware: thead: Remove unused-variable warning 92/316092/1
Seung-Woo Kim [Tue, 13 Aug 2024 11:04:01 +0000 (20:04 +0900)]
firmware: thead: Remove unused-variable warning

Remove unused-variable warning.

Change-Id: I80939412e9086d1b00542cfb733ccb11b86e565c
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
10 months agofirmware: thead: Remove int-conversion waring in light_proc 91/316091/1
Seung-Woo Kim [Tue, 13 Aug 2024 11:02:36 +0000 (20:02 +0900)]
firmware: thead: Remove int-conversion waring in light_proc

In Tizen toolchain -Wint-conversion warning causes build error.
Remove the warning with proper casting.

Change-Id: Ibb7c0be7fc2d4176f91800986c4ba113b2ad1dad
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
10 months agoRISCV: configs: tizen-lpi4a: Enable options required for GPU 35/316035/2
Michal Wilczynski [Fri, 9 Aug 2024 16:07:22 +0000 (18:07 +0200)]
RISCV: configs: tizen-lpi4a: Enable options required for GPU

GPU resides in it's own power island. Always-on drivers are required to
power on that island. Enable both GPU driver and dependent AON driver
config options.

Change-Id: I74e1563488f2ccf31ddce5f64d40378f2b26da82
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
10 months agoriscv: dts: thead: Add GPU node and dependent nodes 34/316034/2
Michal Wilczynski [Fri, 9 Aug 2024 16:04:27 +0000 (18:04 +0200)]
riscv: dts: thead: Add GPU node and dependent nodes

GPU device tree node is dependent on always-on module working correctly.
Fix aon node by supplying it with correct reserved memory space. Add the
gpu node itself. Add an empty aon node in the beaglev-ahead dts, to
avoid breaking the compilation.

Change-Id: I9eafb0d576b1045089a640419ee7a0400ba90550
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
10 months agoriscv: dts: thead: Enable thead fan 33/316033/2
Michal Wilczynski [Fri, 9 Aug 2024 15:58:12 +0000 (17:58 +0200)]
riscv: dts: thead: Enable thead fan

The drivers responsible for supporting thead fan are already in the
repo. Enable the fan in the device tree for better SoC usability.
Ported from [1].

[1] - https://github.com/revyos/thead-kernel.git

Change-Id: I8b7efb97ec4ceb0c0484dd49631aef9a4101ab3b
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
10 months agomailbox: Introduce thead mailbox driver 32/316032/2
Michal Wilczynski [Mon, 12 Aug 2024 08:18:47 +0000 (10:18 +0200)]
mailbox: Introduce thead mailbox driver

The always-on driver required for GPU to work is also dependent on the
mailbox. Enable the Thead mailbox driver. Ported from [1].

[1] - https://github.com/revyos/thead-kernel.git

Change-Id: Ic56a740e1f618f5ceaa51addc3ed9a66d6c10ab6
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
10 months agoregulator: light-regulator-aon: Update aon regulator driver 31/316031/2
Michal Wilczynski [Fri, 9 Aug 2024 15:38:16 +0000 (17:38 +0200)]
regulator: light-regulator-aon: Update aon regulator driver

Update the light-regulator-aon driver to the newest version from [1].
It is important that this regulator works correctly as the GPU driver
depends on the aon working correctly, since it's situated in it's own
power island.

Fix the formatting by using clang-format with kernel style config.

[1] - https://github.com/revyos/thead-kernel.git

Change-Id: I6be797fe8f2512bc3cd93baf62e3a9f92dd12287
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
10 months agofirmware: thead: Update always-on module drivers 30/316030/1
Michal Wilczynski [Fri, 9 Aug 2024 14:59:07 +0000 (16:59 +0200)]
firmware: thead: Update always-on module drivers

GPU resides in it's own power island. The always-on module is resposible
for powering the GPU on. Update the drivers to the newest available
from [1].

In new version the extra debug FW info was added. Sadly this new debug
module called light-proc-debug needs custom thead cache flushing
functions to work correctly. Port them as well.

[1] - https://github.com/revyos/thead-kernel.git

Change-Id: I98a3e4549cb7e3ae5d0d282af35953a04db82882
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
10 months agogpu: drm: img: Adjust the driver code for 6.6 kernel 29/316029/1
Michal Wilczynski [Fri, 9 Aug 2024 14:29:55 +0000 (16:29 +0200)]
gpu: drm: img: Adjust the driver code for 6.6 kernel

Across 5.10 and 6.6 many of the interfaces changed e.g the vma_flags
can't be changed directly as it only should be changed using a provided
API. Adjust the driver code so it compiles on a new kernel.

Change-Id: Id1129caa0ab516568489b856b6dcc4b8112bf1c6
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
10 months agogpu: drm: img: Fix to use iterator instead of list 28/316028/1
Michal Wilczynski [Fri, 9 Aug 2024 12:38:40 +0000 (14:38 +0200)]
gpu: drm: img: Fix to use iterator instead of list

This commit is cherry-picked from starfive repo [1] 1691514834f8
("gpu: drm: img: Fix to use iterator instead of list").

[1] - git://git.tizen.org/platform/kernel/linux-starfive

Change-Id: I4146b481a31c722785fce84d86b1c41788908afd
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
10 months agoriscv: mm: fix NOCACHE_THEAD does not set bit[61] correctly 27/316027/1
Michal Wilczynski [Wed, 21 Feb 2024 03:02:31 +0000 (11:02 +0800)]
riscv: mm: fix NOCACHE_THEAD does not set bit[61] correctly

Previous commit dbfbda3bd6bf ("riscv: mm: update T-Head memory type
definitions") from patch [1] missed a `<` for bit shifting, result in
bit(61) does not set in _PAGE_NOCACHE_THEAD and leaves bit(0) set instead.
This patch get this fixed.

Link: https://lore.kernel.org/linux-riscv/20230912072510.2510-1-jszhang@kernel.org/
Fixes: dbfbda3bd6bf ("riscv: mm: update T-Head memory type definitions")
Signed-off-by: Yangyu Chen <cyy@cyyself.name>
Reviewed-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Jisheng Zhang <jszhang@kernel.org>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/tencent_E19FA1A095768063102E654C6FC858A32F06@qq.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
[ need this commit for GPU to work as the GPU driver is manually setting
page properties ]
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Change-Id: I59b1d7d18be9e8f43606f494a0b8b5f834b30189

10 months agoriscv: mm: update T-Head memory type definitions 26/316026/1
Michal Wilczynski [Tue, 12 Sep 2023 07:25:10 +0000 (15:25 +0800)]
riscv: mm: update T-Head memory type definitions

Update T-Head memory type definitions according to C910 doc [1]
For NC and IO, SH property isn't configurable, hardcoded as SH,
so set SH for NOCACHE and IO.

And also set bit[61](Bufferable) for NOCACHE according to the
table 6.1 in the doc [1].

Link: https://github.com/T-head-Semi/openc910
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Reviewed-by: Guo Ren <guoren@kernel.org>
Tested-by: Drew Fustini <dfustini@baylibre.com>
Link: https://lore.kernel.org/r/20230912072510.2510-1-jszhang@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
[ need this commit for GPU to work as the GPU driver is manually setting
page properties ]
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Change-Id: I62a5af81620466024fdf5bf9c3f322aadddf6366

10 months agogpu: drm: img-rogue: Initial port of img-rogue
Michal Wilczynski [Mon, 12 Aug 2024 13:15:26 +0000 (15:15 +0200)]
gpu: drm: img-rogue: Initial port of img-rogue

This is an initial copy of the PVR GPU driver from [1]. Of course it
doesn't compile on the 6.6 kernel, but it's better to make separate
commits with the 6.6 adaptations.

[1] - https://github.com/revyos/thead-kernel.git

Change-Id: If3cadbc1f65a4a07604bf9ed9b2a26904c658336
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
11 months agodrm: bridge: synopsys: dw-hdmi: Resolve unused-function build warning 39/313839/1 accepted/tizen/unified/toolchain/20240812.133512 accepted/tizen/unified/x/20240703.103758 accepted/tizen/unified/x/asan/20240813.231955
Seung-Woo Kim [Tue, 2 Jul 2024 09:46:07 +0000 (18:46 +0900)]
drm: bridge: synopsys: dw-hdmi: Resolve unused-function build warning

Resolve unused-function build warning for is_csc_needed().

Change-Id: Ib65bca5e8d4451f16d5f306eff5505c2106bd0a9
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
11 months agodrm: verisilicon: Resolve build warnings 38/313838/1
Seung-Woo Kim [Tue, 2 Jul 2024 09:42:46 +0000 (18:42 +0900)]
drm: verisilicon: Resolve build warnings

Remove below build warnings:
   drivers/gpu/drm/verisilicon/vs_dc.c: In function 'dc_resume':
   drivers/gpu/drm/verisilicon/vs_dc.c:1355:9: warning: unused variable 'i' [-Wunused-variable]
    1355 |     int i, ret;
         |         ^
   drivers/gpu/drm/verisilicon/vs_drv.c: In function 'vs_debugfs_planes_show':
   drivers/gpu/drm/verisilicon/vs_drv.c:80:36: warning: format '%p' expects argument of type 'void *', but argument 3 has type 'u32' {aka 'unsigned int'} [-Wformat=]
      80 |         seq_printf(s, "\tformat = %p4cc\n", state->fb ?
         |                                   ~^        ~~~~~~~~~~~
         |                                    |
         |                                    void *
         |                                   %d
      81 |                state->fb->format->format : 0);
         |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         |                                          |
         |                                          u32 {aka unsigned int}

Change-Id: I5040d64d7a900c298307cd77ee04aa4fc74124f7
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
11 months agoperf tools: Address python 3.6 DeprecationWarning for string scapes 31/313831/1
Benjamin Gray [Tue, 12 Sep 2023 06:07:59 +0000 (16:07 +1000)]
perf tools: Address python 3.6 DeprecationWarning for string scapes

Python 3.6 introduced a DeprecationWarning for invalid escape sequences.
This is upgraded to a SyntaxWarning in Python 3.12, and will eventually
be a syntax error.

Fix these now to get ahead of it before it's an error.

Signed-off-by: Benjamin Gray <bgray@linux.ibm.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Kieran Bingham <kbingham@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mykola Lysenko <mykolal@fb.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Todd E Brandt <todd.e.brandt@linux.intel.com>
Cc: Tom Rix <trix@redhat.com>
Cc: linux-doc@vger.kernel.org
Cc: linux-ia64@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Cc: llvm@lists.linux.dev
Link: https://lore.kernel.org/r/20230912060801.95533-6-bgray@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
[sw0312.kim: cherry-pick the mainline commit 280b4e4a9e80 to resolve python 3.12 syntax warning]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I06385423db9dc27f2bd93adb0ed9f1db2c032e4c

12 months agoRISCV: configs: tizen-lpi4a: Enable DM_BOW feature 64/312664/1 accepted/tizen/unified/toolchain/20240624.121702 accepted/tizen/unified/x/20240614.080534 accepted/tizen/unified/x/asan/20240625.092909
Marek Szyprowski [Wed, 12 Jun 2024 16:56:29 +0000 (18:56 +0200)]
RISCV: configs: tizen-lpi4a: Enable DM_BOW feature

It's needed for system upgrade.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I3aa3394ea0c0b5ee4b1d421892ec7b4d06c21c5e

12 months agodevice-mapper: Add dm-bow 63/312663/1
Mateusz Moscicki [Thu, 8 Jul 2021 13:36:25 +0000 (15:36 +0200)]
device-mapper: Add dm-bow

dm-bow is a device mapper driver that allows to create a checkpoint on
the volume so that it is possible to restore the state if necessary.
This is needed to protect the ext4 partition during a system upgrade in
case of a power failure.

Originally-by: Paul Lawrence <paullawrence@google.com>
Origin: https://android.googlesource.com/kernel/common/+/refs/heads/android-mainline/drivers/md/dm-bow.c
Signed-off-by: Mateusz Moscicki <m.moscicki2@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
[mszyprow: this is a squashed set of the following patches
     from platform/kernel/linux-rpi 'tizen' (c4f85fdcd893) branch:
 device-mapper: Add dm-bow
 dm-bow: Fix 5.15 compatibility issue
 ported and adapted to Linux v6.6 kernel base]

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Id44a1fece8b1be096689a86bd9ea8356c25db5e0

12 months agodrm: verisilicon: vs_gem: Fix wrong return type with gcc14 23/312223/1 accepted/tizen/unified/toolchain/20240610.172832 accepted/tizen/unified/x/20240610.223411
Jaehoon Chung [Wed, 5 Jun 2024 06:09:45 +0000 (15:09 +0900)]
drm: verisilicon: vs_gem: Fix wrong return type with gcc14

The retrun value of vmap callback is using to check if there is an
error. If error is not existed, the checking iosys_map is null or not
with iosys_map_is_null().

[  273s] drivers/gpu/drm/verisilicon/vs_gem.c: In function 'vs_gem_prime_vmap':
[  273s] drivers/gpu/drm/verisilicon/vs_gem.c:388:53: error: returning 'void *' from a function with return type 'int' makes integer from pointer without a cast [-Wint-conversion]
[  273s]   387 |         return vs_obj->dma_attrs & DMA_ATTR_NO_KERNEL_MAPPING ?
[  273s]       |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[  273s]   388 |                        page_address(vs_obj->cookie) :
[  273s]       |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
[  273s]   389 |                        vs_obj->cookie;
[  273s]       |                        ~~~~~~~~~~~~~~
[  273s]   AR      drivers/misc/lis3lv02d/built-in.a

Change-Id: I22dea91de15eb1e75d0591d26fe50df1d003e658
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
12 months agodrm: verisilicon: vs_drv: Fix type mismatch with gcc14 22/312222/1
Jaehoon Chung [Wed, 5 Jun 2024 06:07:11 +0000 (15:07 +0900)]
drm: verisilicon: vs_drv: Fix type mismatch with gcc14

Fix type mismatch with gcc14.
NULL pointer should be 0 as int type.

[  272s] drivers/gpu/drm/verisilicon/vs_drv.c: In function 'vs_debugfs_planes_show':
[  272s] drivers/gpu/drm/verisilicon/vs_drv.c:81:42: error: pointer/integer type mismatch in conditional expression [-Wint-conversion]
[  272s]    81 |                state->fb->format->format : "(null)");
[  272s]       |                                          ^
[  272s]   CC      lib/timerqueue.o

Change-Id: I00868d7f6ca94a9c9939d7a68b7fbf6b29f98330
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
12 months agobtrfs: fix kvcalloc() arguments order in btrfs_ioctl_send() 08/312208/1
Dmitry Antipov [Thu, 21 Dec 2023 08:47:45 +0000 (11:47 +0300)]
btrfs: fix kvcalloc() arguments order in btrfs_ioctl_send()

When compiling with gcc version 14.0.0 20231220 (experimental)
and W=1, I've noticed the following warning:

fs/btrfs/send.c: In function 'btrfs_ioctl_send':
fs/btrfs/send.c:8208:44: warning: 'kvcalloc' sizes specified with 'sizeof'
in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
 8208 |         sctx->clone_roots = kvcalloc(sizeof(*sctx->clone_roots),
      |                                            ^

Since 'n' and 'size' arguments of 'kvcalloc()' are multiplied to
calculate the final size, their actual order doesn't affect the result
and so this is not a bug. But it's still worth to fix it.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
(cherry picked from commit 6ff09b6b8c2fb6b3edda4ffaa173153a40653067)
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I5308f4b8759c03ad1190bba8c3d7a0c6e2f97bf4

12 months agoperf tools: Fix calloc() arguments to address error introduced in gcc-14 78/312178/1
Sun Haiyong [Sat, 6 Jan 2024 09:41:29 +0000 (17:41 +0800)]
perf tools: Fix calloc() arguments to address error introduced in gcc-14

the definition of calloc is as follows:

    void *calloc(size_t nmemb, size_t size);

number of members is in the first parameter and the size is in the
second parameter.

Fix error messages on gcc 14 20240102:

  error: 'calloc' sizes specified with 'sizeof' in the earlier argument and
  not in the later argument [-Werror=calloc-transposed-args]

Committer notes:

I noticed this on fedora 40 and rawhide.

cherry-picked from commit 7bbe8f0071dfa23fcc3b2864ec9f3b1aeb7ab2df

Change-Id: Ia96dbd404a3f9339e7e402465eaaa1b98c9d507c
Signed-off-by: Sun Haiyong <sunhaiyong@loongson.cn>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20240106094129.3337057-1-siyanteng@loongson.cn
Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
12 months agoperf top: Remove needless malloc(0) call that triggers -Walloc-size 77/312177/1
Sun Haiyong [Mon, 4 Dec 2023 08:20:55 +0000 (16:20 +0800)]
perf top: Remove needless malloc(0) call that triggers -Walloc-size

GCC 14 introduces a new -Walloc-size included in -Wextra which errors out
like:

  builtin-top.c: In function ‘prompt_integer’:
  builtin-top.c:360:21: error: allocation of insufficient size ‘0’ for
  type ‘char’ with size ‘1’ [-Werror=alloc-size]
    360 |         char *buf = malloc(0), *p;
        |                     ^~~~~~

Just set it to NULL, getline() will do the allocation.

cherry-picked from commit 79baac8acfc60a7a5114f6d60731e28c242ef8ce

Change-Id: I3065836e0e7c352eb7dd7a82b73d4392b8142221
Signed-off-by: Sun Haiyong <sunhaiyong@loongson.cn>
Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20231204082055.91877-1-siyanteng@loongson.cn
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
12 months agoRISCV: configs: tizen-lpi4a: enable options required for display 94/311594/3 accepted/tizen/unified/toolchain/20240530.231450 accepted/tizen/unified/x/20240530.042952
Michal Wilczynski [Wed, 22 May 2024 16:32:57 +0000 (18:32 +0200)]
RISCV: configs: tizen-lpi4a: enable options required for display

Support for display subsystem depends on multiple config options. Enable
them.

Change-Id: I3b2102d9a48d17854bbe096c04895f94ea168d77
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
12 months agoriscv: dts: thead: Add device tree for hdmi port and dependent nodes 93/311593/3
Michal Wilczynski [Wed, 22 May 2024 16:08:28 +0000 (18:08 +0200)]
riscv: dts: thead: Add device tree for hdmi port and dependent nodes

Hdmi port device tree node requires a lot of extra dependencies.
hdmi_tx node depends on disp1_out, which depends on enc1_in.

Additionally the main node for display subsystem, called
display-subsystem depends on dpu_disp0 and dpu_disp1.

There are additional dependencies on dsi0 nodes for lcd0_backlight,
pcal6408ahk_d, soc_vdd18_lcd0_en_reg, soc_vdd33_lcd0_en_reg, which
in turn brings a lot of pinctrl and i2c nodes.

Add all the required nodes for the drm subsystem to load correctly.

Ported from vendor kernel [1].

[1] https://gitee.com/thead-yocto/kernel.git

Change-Id: Ib2f8daca209caaac175e12d7ea45326b7e3465f0
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
12 months agoriscv: dts: thead: Move pinctrl nodes to th1520-lichee-module-4a.dtsi 92/311592/3
Michal Wilczynski [Wed, 22 May 2024 16:00:12 +0000 (18:00 +0200)]
riscv: dts: thead: Move pinctrl nodes to th1520-lichee-module-4a.dtsi

padctrl0 and padctrl1 should be defined for a family of 4a boards, as
they will cross-reference with aoc nodes defined in the next commit.
Move them to th1520-lichee-module-4a.dtsi.

Change-Id: Ief61183bde82c41c2f771da88c2d27135e3a3844
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
12 months agoriscv: dts: thead: Move osc_32k and rc_24m clocks under clock parent 91/311591/3
Michal Wilczynski [Wed, 22 May 2024 12:46:42 +0000 (14:46 +0200)]
riscv: dts: thead: Move osc_32k and rc_24m clocks under clock parent

Both osc_32k and rc_24m clocks are under soc parent, while they should
be under 'clocks' parent, per vendor kernel. Move them to appropriate
place.

Change-Id: I3f65c2697da4f6f0403482f70042daf99680a48b
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
12 months agopwm: Enable LicheePi 4A pwm driver 90/311590/3
Michal Wilczynski [Wed, 22 May 2024 12:39:30 +0000 (14:39 +0200)]
pwm: Enable LicheePi 4A pwm driver

Ported from vendor kernel [1].

[1] https://gitee.com/thead-yocto/kernel.git

Change-Id: I8835dfbabc99d9c9286322bd30dc0ecf7eceec26
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
12 months agophy: Enable LicheePi 4A phy drivers 89/311589/3
Michal Wilczynski [Wed, 22 May 2024 12:37:11 +0000 (14:37 +0200)]
phy: Enable LicheePi 4A phy drivers

Ported from vendor kernel [1].

[1] https://gitee.com/thead-yocto/kernel.git

Change-Id: I947031a16cc46e9db670da96dd9d925fb43bb078
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
12 months agoregulator: Enable LicheePi 4A regulator driver 87/311587/3
Michal Wilczynski [Wed, 22 May 2024 12:30:12 +0000 (14:30 +0200)]
regulator: Enable LicheePi 4A regulator driver

Ported from vendor kernel [1].

[1] https://gitee.com/thead-yocto/kernel.git

Change-Id: I86b522985cdd2e2e61f9b885154f86b1485c4226
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
12 months agofirmware: Enable LicheePi 4A firmware drivers 88/311588/3
Michal Wilczynski [Wed, 22 May 2024 12:34:05 +0000 (14:34 +0200)]
firmware: Enable LicheePi 4A firmware drivers

Ported from vendor kernel [1].

[1] https://gitee.com/thead-yocto/kernel.git

Change-Id: I6339a711e54502ac8c094d451c104ba31aa586e6
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
12 months agodrm: bridge: synopsys: dw-hdmi: Enable LicheePi 4A dw-hdmi modifications 86/311586/3
Michal Wilczynski [Mon, 27 May 2024 13:04:59 +0000 (15:04 +0200)]
drm: bridge: synopsys: dw-hdmi: Enable LicheePi 4A dw-hdmi modifications

Unfortunately, besides adding it's own hdmi driver LicheePi4 also
need some modifications to generic dw-hdmi driver. Enable them.

Change-Id: I5c49d46fed5a8c1b57863404438ef0f1ff25d883
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
12 months agodrm: verisilicon: Enable LicheePi4 drm drivers 85/311585/2
Michal Wilczynski [Wed, 22 May 2024 11:52:30 +0000 (13:52 +0200)]
drm: verisilicon: Enable LicheePi4 drm drivers

Ported from vendor kernel [1].

[1] https://gitee.com/thead-yocto/kernel.git

Change-Id: I66e5fc772a89f9bcccac678a0cd2652d3dee1357
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
13 months agoRISCV: configs: tizen-lpi4a: enable options required for ethernet 93/310993/4 accepted/tizen/unified/x/20240514.123342
Michal Wilczynski [Fri, 10 May 2024 11:31:49 +0000 (13:31 +0200)]
RISCV: configs: tizen-lpi4a: enable options required for ethernet

Support for ethernet driver depends on multiple different drivers, like
clock, efuse. Enable them all, so the ethernet driver can work.

Change-Id: I8bd92822ec3afa074084fef2e660ed2aa3135031
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
13 months agoRISCV: configs: tizen-lpi4a: sync with savedefconfig 05/311005/2
Seung-Woo Kim [Mon, 13 May 2024 02:15:19 +0000 (11:15 +0900)]
RISCV: configs: tizen-lpi4a: sync with savedefconfig

Sync with minimized defconfig made with the command,
"make savedefconfig".

Change-Id: Icc670f8b36655b2876335c4fc451e032133450b8
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
13 months agoriscv: dts: thead: Add device tree for ethernet and dependent nodes 92/310992/3
Michal Wilczynski [Fri, 10 May 2024 11:21:26 +0000 (13:21 +0200)]
riscv: dts: thead: Add device tree for ethernet and dependent nodes

Ethernet support device tree nodes depends on multiple device tree
nodes: pinctrl, clocks, nvmem controller for efuse. Add them, so the
ethernet node dependencies are satisfied.

Ported from vendor kernel [1].

[1] https://gitee.com/thead-yocto/kernel.git

Change-Id: Ic44fb31705ec20940df2f4b01c234f2dbfba88be
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
13 months agonet: stmmac: Enable LicheePi 4A ethernet drivers 91/310991/3
Michal Wilczynski [Fri, 10 May 2024 11:16:07 +0000 (13:16 +0200)]
net: stmmac: Enable LicheePi 4A ethernet drivers

Ported from vendor kernel [1].

[1] https://gitee.com/thead-yocto/kernel.git

Change-Id: I81aa81094fa68fe5a206035040aac2ff3ed2fdbb
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
13 months agonvmem: Enable LicheePi 4A efuse drivers 90/310990/2
Michal Wilczynski [Fri, 10 May 2024 11:13:28 +0000 (13:13 +0200)]
nvmem: Enable LicheePi 4A efuse drivers

Ported from vendor kernel [1].

[1] https://gitee.com/thead-yocto/kernel.git

Change-Id: I3eef31098c19c4c5349126d0747d0335388c9e9e
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
13 months agopinctrl: thead: Enable LicheePi 4A pinctrl drivers 89/310989/2
Michal Wilczynski [Fri, 10 May 2024 11:03:13 +0000 (13:03 +0200)]
pinctrl: thead: Enable LicheePi 4A pinctrl drivers

Ported from vendor kernel [1].

[1] https://gitee.com/thead-yocto/kernel.git

Change-Id: I115151f8ef109ae41a37512760ed96c1dcd182f1
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
13 months agoclk: thead: Enable LicheePi 4A clock drivers 88/310988/2
Michal Wilczynski [Fri, 10 May 2024 11:00:13 +0000 (13:00 +0200)]
clk: thead: Enable LicheePi 4A clock drivers

Ported from vendor kernel [1].

[1] https://gitee.com/thead-yocto/kernel.git

Change-Id: I2151bedd0e7d3c18d6ad940cdbcec400234b9015
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
14 months agoRISCV: configs: tizen-lpi4a: disable unused modules and drivers 33/309433/2 accepted/tizen/unified/x/20240416.084350
Marek Szyprowski [Wed, 10 Apr 2024 08:44:54 +0000 (10:44 +0200)]
RISCV: configs: tizen-lpi4a: disable unused modules and drivers

This enables modules to fit into the limited modules partition.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I760ae3dff82d6d90ea6ca6a4df0de7f675234773

14 months agoRevert "tizen: Add extlinux.conf file to boot Tizen" 04/308504/1 accepted/tizen/unified/x/20240328.131010
Marek Szyprowski [Tue, 26 Mar 2024 23:09:51 +0000 (00:09 +0100)]
Revert "tizen: Add extlinux.conf file to boot Tizen"

This reverts commit e72a2f6fb82be2ff7252a172e66c1a153d409b2f. With
adapted u-boot installed on SD-card a standard Tizen's boot.scr.uimg
based booting is possible.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I336508b4ee08846d8079f3925817974383f9d865

14 months agoRISCV: configs: tizen-lpi4a: enable options needed to boot Tizen OS 03/308503/1
Marek Szyprowski [Tue, 26 Mar 2024 13:14:08 +0000 (14:14 +0100)]
RISCV: configs: tizen-lpi4a: enable options needed to boot Tizen OS

Enable all options needed for Tizen OS and disable useless virtio based
drivers.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I270b20277e3e1d751e77df0732b8461fae9848ed

15 months agotizen: Add extlinux.conf file to boot Tizen 38/307938/1
Jaehoon Chung [Thu, 14 Mar 2024 10:47:07 +0000 (19:47 +0900)]
tizen: Add extlinux.conf file to boot Tizen

Add extlinux.conf file to boot Tien OS.
It will be used to choose which OS can be booting.

Change-Id: I273b3949f7a0f75830a2f2599251be85669839dd
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
15 months agopackaging: linux-lpi4a: Add the initial spec file 30/307830/2 accepted/tizen/unified/x/20240314.073055
Jaehoon Chung [Wed, 13 Mar 2024 07:46:10 +0000 (16:46 +0900)]
packaging: linux-lpi4a: Add the initial spec file

ADd the initial spec file.

Change-Id: I0ae20783340b8182e7f1517c4bb3275bf609ed87
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
15 months agoRISCV: configs: tizen-lpi4a: Enable CONFIG_ARCH_THEAD 29/307829/2
Jaehoon Chung [Wed, 13 Mar 2024 10:25:11 +0000 (19:25 +0900)]
RISCV: configs: tizen-lpi4a: Enable CONFIG_ARCH_THEAD

Enable CONFIG_ARCH_THEAD to use Licheepi 4A board.

Change-Id: I9d3e948c1064d5c6f8fffbce935475dca6db2a0d
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
15 months agoperf: riscv_pmu_sbi: Set SYSCTL_LEGACY by default 28/307828/2
Jaehoon Chung [Tue, 12 Mar 2024 10:57:28 +0000 (19:57 +0900)]
perf: riscv_pmu_sbi: Set SYSCTL_LEGACY by default

This patch is workaround for LicheePi 4A.
During running ubrowser, SIGILL is occurred.
To prevent the SIGILL, sysctl_perf_user_acces is set SYSCTL_LEGACY by
default.

Change-Id: I0b33397bf7cc58c7390eccb5f6a5c7936eaec32c
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
15 months agoRISCV: configs: tizen-lpi4a: Disable CONFIG_IKHEADERS 27/307827/1
Jaehoon Chung [Wed, 13 Mar 2024 09:59:09 +0000 (18:59 +0900)]
RISCV: configs: tizen-lpi4a: Disable CONFIG_IKHEADERS

Disable CONFIG_IKHEADERS.
During buiding on gbs, the build failure is occurred like the below.

[  527s]   AR      drivers/built-in.a
[  543s] tar: unrecognized option `--sort=name'
[  543s] Try `tar --help' or `tar --usage' for more information.
[  543s] make[3]: *** [kernel/Makefile:158: kernel/kheaders_data.tar.xz] Error 64
[  543s] make[2]: *** [scripts/Makefile.build:480: kernel] Error 2
[  543s] make[1]: *** [/home/abuild/rpmbuild/BUILD/linux-kernel-6.6.20/Makefile:1913: .] Error 2
[  543s] make: *** [Makefile:234: __sub-make] Error 2
[  543s] error: Bad exit status from /var/tmp/rpm-tmp.EP1fRT (%build)

Change-Id: I1080415d1468f20ce8a744267cffaf9618c873d5
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
15 months agommc: sdhci-of-dwcmshc: Add support for T-Head TH1520 99/307399/1
Drew Fustini [Fri, 10 Nov 2023 05:41:13 +0000 (21:41 -0800)]
mmc: sdhci-of-dwcmshc: Add support for T-Head TH1520

Add support for the mmc controller in the T-Head TH1520 with the new
compatible "thead,th1520-dwcmshc". Implement custom sdhci_ops for
set_uhs_signaling, reset, voltage_switch, and platform_execute_tuning.

Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Drew Fustini <dfustini@baylibre.com>
Link: https://lore.kernel.org/r/20231109-th1520-mmc-v5-3-018bd039cf17@baylibre.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit 43658a542ebf13f1bb80cfaa8ae58f061d0d71b0)
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I01a0df403985333f3b9f5f9dd971af807c285be9

15 months agommc: sdhci: add __sdhci_execute_tuning() to header 98/307398/1
Drew Fustini [Fri, 10 Nov 2023 05:41:12 +0000 (21:41 -0800)]
mmc: sdhci: add __sdhci_execute_tuning() to header

Expose __sdhci_execute_tuning() so that it can be called from the
mmc host controller drivers.

In the sdhci-of-dwcmshc driver, sdhci_dwcmshc_th1520_ops sets
platform_execute_tuning to th1520_execute_tuning(). That function has
to manipulate phy registers before tuning can be performed. To avoid
copying the code verbatim from __sdhci_execute_tuning() into
th1520_execute_tuning(), make it possible for __sdhci_execute_tuning()
to be called from sdhci-of-dwcmshc.

Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Drew Fustini <dfustini@baylibre.com>
Link: https://lore.kernel.org/r/20231109-th1520-mmc-v5-2-018bd039cf17@baylibre.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit 9cc811a342be78270d20d1fff3832bc0b23ef364)
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I09c16cb610ab20299155797e87484e814b126dbf

15 months agoriscv: dts: thead: Enable LicheePi 4A eMMC and microSD 97/307397/1
Drew Fustini [Wed, 6 Dec 2023 08:09:24 +0000 (00:09 -0800)]
riscv: dts: thead: Enable LicheePi 4A eMMC and microSD

Add emmc node properties for the eMMC device and add sdio0 node
properties for the microSD slot. Set the frequency for the sdhci
reference clock.

Signed-off-by: Drew Fustini <dfustini@baylibre.com>
Reviewed-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
(cherry picked from commit b6b5028473ceb3054f8a440f85e3d728a3fba1dc)
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: Ic17b1ed949808ed9736540a08b7e93b5cd8d3524

15 months agoriscv: dts: thead: Enable BeagleV Ahead eMMC and microSD 96/307396/1
Drew Fustini [Wed, 6 Dec 2023 08:09:23 +0000 (00:09 -0800)]
riscv: dts: thead: Enable BeagleV Ahead eMMC and microSD

Add emmc node properties for the eMMC device and add sdio0 node
properties for the microSD slot. Set the frequency for the sdhci
reference clock.

Signed-off-by: Drew Fustini <dfustini@baylibre.com>
Reviewed-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
(cherry picked from commit 18d92a03b319b10269a8aca478b31496a9701326)
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I04bff256a2b998d6cbba740abb28458812cd8e46

15 months agoriscv: dts: thead: Add TH1520 mmc controllers and sdhci clock 95/307395/1
Drew Fustini [Wed, 6 Dec 2023 08:09:22 +0000 (00:09 -0800)]
riscv: dts: thead: Add TH1520 mmc controllers and sdhci clock

Add node for the fixed reference clock used for emmc and sdio nodes.
Add emmc node for the 1st dwcmshc instance which is typically connected
to an eMMC device. Add sdio0 node for the 2nd dwcmshc instance which is
typically connected to microSD slot. Add sdio1 node for the 3rd dwcmshc
instance which is typically connected to an SDIO WiFi module. The node
names are based on Table 1-2 C910/C906 memory map in the TH1520 System
User Manual.

Link: https://git.beagleboard.org/beaglev-ahead/beaglev-ahead/-/tree/main/docs
Signed-off-by: Drew Fustini <dfustini@baylibre.com>
Reviewed-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
Reviewed-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
(cherry picked from commit a77f02e8489673cc80948a6f30ed262db1dee8d6)
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I9f95a1c539b96c23297eec6b9fdb0f0980820f74

15 months agoriscv: dts: thead: convert isa detection to new properties 94/307394/1
Conor Dooley [Sun, 22 Oct 2023 15:41:35 +0000 (23:41 +0800)]
riscv: dts: thead: convert isa detection to new properties

Convert the th1520 devicetrees to use the new properties
"riscv,isa-base" & "riscv,isa-extensions".
For compatibility with other projects, "riscv,isa" remains.

Reviewed-by: Jisheng Zhang <jszhang@kernel.org>
Acked-by: Guo Ren <guoren@kernel.org>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20231022154135.3746-1-jszhang@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
(cherry picked from commit 0804f3bec9e9a3e9f3b5431ac9a11417041bc4c2)
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I98e3bc7c2f3629ea986b5b3c731289994642f2d4

15 months agoRISCV: config: Add tizen-lpi4a_defconfig file 93/307393/1
Jaehoon Chung [Fri, 8 Mar 2024 02:19:32 +0000 (11:19 +0900)]
RISCV: config: Add tizen-lpi4a_defconfig file

Add tizen-lpi4a_defconfig file as initial version.

Change-Id: Ic6bf265262796da496fa935a5840d38650d41cf4
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
15 months agoLinux 6.6.20 upstream v6.6.20
Greg Kroah-Hartman [Sat, 2 Mar 2024 17:23:09 +0000 (18:23 +0100)]
Linux 6.6.20

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15 months agofs/ntfs3: fix build without CONFIG_NTFS3_LZX_XPRESS
Mark O'Donovan [Wed, 21 Feb 2024 10:43:58 +0000 (10:43 +0000)]
fs/ntfs3: fix build without CONFIG_NTFS3_LZX_XPRESS

commit c8e314624a1666ed2eec28549713021a8ec801e9 upstream.

When CONFIG_NTFS3_LZX_XPRESS is not set then we get the following build
error:

  fs/ntfs3/frecord.c:2460:16: error: unused variable ‘i_size’

Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Fixes: 4fd6c08a16d7 ("fs/ntfs3: Use i_size_read and i_size_write")
Tested-by: Chris Clayton <chris2553@googlemail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Reported-by: Rainer Fiebig <jrf@mailbox.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15 months agoLinux 6.6.19 v6.6.19
Greg Kroah-Hartman [Fri, 1 Mar 2024 12:35:11 +0000 (13:35 +0100)]
Linux 6.6.19

Link: https://lore.kernel.org/r/20240227131625.847743063@linuxfoundation.org
Tested-by: Luna Jernberg <droidbittin@gmail.com>
Tested-by: SeongJae Park <sj@kernel.org>
Tested-by: Allen Pais <apais@linux.microsoft.com>
Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
Tested-by: Kelsey Steele <kelseysteele@linux.microsoft.com>
Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Conor Dooley <conor.dooley@microchip.com>
Tested-by: Shuah Khan <skhan@linuxfoundation.org>
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Tested-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Tested-by: Ron Economos <re@w6rz.net>
Tested-by: kernelci.org bot <bot@kernelci.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15 months agoahci: Extend ASM1061 43-bit DMA address quirk to other ASM106x parts
Lennert Buytenhek [Tue, 30 Jan 2024 13:21:51 +0000 (15:21 +0200)]
ahci: Extend ASM1061 43-bit DMA address quirk to other ASM106x parts

commit 51af8f255bdaca6d501afc0d085b808f67b44d91 upstream.

ASMedia have confirmed that all ASM106x parts currently listed in
ahci_pci_tbl[] suffer from the 43-bit DMA address limitation that we ran
into on the ASM1061, and therefore, we need to apply the quirk added by
commit 20730e9b2778 ("ahci: add 43-bit DMA address quirk for ASMedia
ASM1061 controllers") to the other supported ASM106x parts as well.

Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/linux-ide/ZbopwKZJAKQRA4Xv@x1-carbon/
Signed-off-by: Lennert Buytenhek <kernel@wantstofly.org>
[cassel: add link to ASMedia confirmation email]
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15 months agoata: ahci: add identifiers for ASM2116 series adapters
Szuying Chen [Thu, 21 Sep 2023 09:33:51 +0000 (17:33 +0800)]
ata: ahci: add identifiers for ASM2116 series adapters

commit 3bf6141060948e27b62b13beb216887f2e54591e upstream.

Add support for PCIe SATA adapter cards based on Asmedia 2116 controllers.
These cards can provide up to 10 SATA ports on PCIe card.

Signed-off-by: Szuying Chen <Chloe_Chen@asmedia.com.tw>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15 months agomptcp: add needs_id for netlink appending addr
Geliang Tang [Thu, 15 Feb 2024 18:25:29 +0000 (19:25 +0100)]
mptcp: add needs_id for netlink appending addr

commit 584f3894262634596532cf43a5e782e34a0ce374 upstream.

Just the same as userspace PM, a new parameter needs_id is added for
in-kernel PM mptcp_pm_nl_append_new_local_addr() too.

Add a new helper mptcp_pm_has_addr_attr_id() to check whether an address
ID is set from PM or not.

In mptcp_pm_nl_get_local_id(), needs_id is always true, but in
mptcp_pm_nl_add_addr_doit(), pass mptcp_pm_has_addr_attr_id() to
needs_it.

Fixes: efd5a4c04e18 ("mptcp: add the address ID assignment bitmap")
Cc: stable@vger.kernel.org
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15 months agomptcp: userspace pm send RM_ADDR for ID 0
Geliang Tang [Wed, 25 Oct 2023 23:37:04 +0000 (16:37 -0700)]
mptcp: userspace pm send RM_ADDR for ID 0

commit 84c531f54ad9a124a924c9505d74e33d16965146 upstream.

This patch adds the ability to send RM_ADDR for local ID 0. Check
whether id 0 address is removed, if not, put id 0 into a removing
list, pass it to mptcp_pm_remove_addr() to remove id 0 address.

There is no reason not to allow the userspace to remove the initial
address (ID 0). This special case was not taken into account not
letting the userspace to delete all addresses as announced.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/379
Reviewed-by: Matthieu Baerts <matttbe@kernel.org>
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
Signed-off-by: Mat Martineau <martineau@kernel.org>
Link: https://lore.kernel.org/r/20231025-send-net-next-20231025-v1-3-db8f25f798eb@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Fixes: d9a4594edabf ("mptcp: netlink: Add MPTCP_PM_CMD_REMOVE")
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15 months agoselftests: mptcp: add mptcp_lib_get_counter
Geliang Tang [Tue, 28 Nov 2023 23:18:55 +0000 (15:18 -0800)]
selftests: mptcp: add mptcp_lib_get_counter

commit 61c131f5d4d2b79904af2fdcb2839a9db8e7c55c upstream.

To avoid duplicated code in different MPTCP selftests, we can add
and use helpers defined in mptcp_lib.sh.

The helper get_counter() in mptcp_join.sh and get_mib_counter() in
mptcp_connect.sh have the same functionality, export get_counter() into
mptcp_lib.sh and rename it as mptcp_lib_get_counter(). Use this new
helper instead of get_counter() and get_mib_counter().

Use this helper in test_prio() in userspace_pm.sh too instead of
open-coding.

Reviewed-by: Matthieu Baerts <matttbe@kernel.org>
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
Signed-off-by: Mat Martineau <martineau@kernel.org>
Link: https://lore.kernel.org/r/20231128-send-net-next-2023107-v4-11-8d6b94150f6b@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15 months agoselftests: mptcp: join: stop transfer when check is done (part 2)
Matthieu Baerts (NGI0) [Wed, 31 Jan 2024 21:49:54 +0000 (22:49 +0100)]
selftests: mptcp: join: stop transfer when check is done (part 2)

commit 04b57c9e096a9479fe0ad31e3956e336fa589cb2 upstream.

Since the "Fixes" commits mentioned below, the newly added "userspace
pm" subtests of mptcp_join selftests are launching the whole transfer in
the background, do the required checks, then wait for the end of
transfer.

There is no need to wait longer, especially because the checks at the
end of the transfer are ignored (which is fine). This saves quite a few
seconds on slow environments.

While at it, use 'mptcp_lib_kill_wait()' helper everywhere, instead of
on a specific one with 'kill_tests_wait()'.

Fixes: b2e2248f365a ("selftests: mptcp: userspace pm create id 0 subflow")
Fixes: e3b47e460b4b ("selftests: mptcp: userspace pm remove initial subflow")
Fixes: b9fb176081fb ("selftests: mptcp: userspace pm send RM_ADDR for ID 0")
Cc: stable@vger.kernel.org
Reviewed-and-tested-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://lore.kernel.org/r/20240131-upstream-net-20240131-mptcp-ci-issues-v1-9-4c1c11e571ff@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15 months agomm: zswap: fix missing folio cleanup in writeback race path
Yosry Ahmed [Thu, 25 Jan 2024 08:51:27 +0000 (08:51 +0000)]
mm: zswap: fix missing folio cleanup in writeback race path

commit e3b63e966cac0bf78aaa1efede1827a252815a1d upstream.

In zswap_writeback_entry(), after we get a folio from
__read_swap_cache_async(), we grab the tree lock again to check that the
swap entry was not invalidated and recycled.  If it was, we delete the
folio we just added to the swap cache and exit.

However, __read_swap_cache_async() returns the folio locked when it is
newly allocated, which is always true for this path, and the folio is
ref'd.  Make sure to unlock and put the folio before returning.

This was discovered by code inspection, probably because this path handles
a race condition that should not happen often, and the bug would not crash
the system, it will only strand the folio indefinitely.

Link: https://lkml.kernel.org/r/20240125085127.1327013-1-yosryahmed@google.com
Fixes: 04fc7816089c ("mm: fix zswap writeback race condition")
Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
Reviewed-by: Chengming Zhou <zhouchengming@bytedance.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Nhat Pham <nphamcs@gmail.com>
Cc: Domenico Cerasuolo <cerasuolodomenico@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15 months agomm/zswap: invalidate duplicate entry when !zswap_enabled
Chengming Zhou [Thu, 8 Feb 2024 02:32:54 +0000 (02:32 +0000)]
mm/zswap: invalidate duplicate entry when !zswap_enabled

commit 678e54d4bb9a4822f8ae99690ac131c5d490cdb1 upstream.

We have to invalidate any duplicate entry even when !zswap_enabled since
zswap can be disabled anytime.  If the folio store success before, then
got dirtied again but zswap disabled, we won't invalidate the old
duplicate entry in the zswap_store().  So later lru writeback may
overwrite the new data in swapfile.

Link: https://lkml.kernel.org/r/20240208023254.3873823-1-chengming.zhou@linux.dev
Fixes: 42c06a0e8ebe ("mm: kill frontswap")
Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Yosry Ahmed <yosryahmed@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15 months agoselftests: mptcp: join: stop transfer when check is done (part 1)
Matthieu Baerts (NGI0) [Wed, 31 Jan 2024 21:49:53 +0000 (22:49 +0100)]
selftests: mptcp: join: stop transfer when check is done (part 1)

commit 31ee4ad86afd6ed6f4bb1b38c43011216080c42a upstream.

Since the "Fixes" commit mentioned below, "userspace pm" subtests of
mptcp_join selftests introduced in v6.5 are launching the whole transfer
in the background, do the required checks, then wait for the end of
transfer.

There is no need to wait longer, especially because the checks at the
end of the transfer are ignored (which is fine). This saves quite a few
seconds in slow environments.

Note that old versions will need commit bdbef0a6ff10 ("selftests: mptcp:
add mptcp_lib_kill_wait") as well to get 'mptcp_lib_kill_wait()' helper.

Fixes: 4369c198e599 ("selftests: mptcp: test userspace pm out of transfer")
Cc: stable@vger.kernel.org # 6.5.x: bdbef0a6ff10: selftests: mptcp: add mptcp_lib_kill_wait
Cc: stable@vger.kernel.org # 6.5.x
Reviewed-and-tested-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://lore.kernel.org/r/20240131-upstream-net-20240131-mptcp-ci-issues-v1-8-4c1c11e571ff@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15 months agoi2c: imx: when being a target, mark the last read as processed
Corey Minyard [Wed, 21 Feb 2024 19:27:13 +0000 (20:27 +0100)]
i2c: imx: when being a target, mark the last read as processed

[ Upstream commit 87aec499368d488c20292952d6d4be7cb9e49c5e ]

When being a target, NAK from the controller means that all bytes have
been transferred. So, the last byte needs also to be marked as
'processed'. Otherwise index registers of backends may not increase.

Fixes: f7414cd6923f ("i2c: imx: support slave mode for imx I2C driver")
Signed-off-by: Corey Minyard <minyard@acm.org>
Tested-by: Andrew Manley <andrew.manley@sealingtech.com>
Reviewed-by: Andrew Manley <andrew.manley@sealingtech.com>
Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>
[wsa: fixed comment and commit message to properly describe the case]
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
15 months agodrm/amd/display: Fix memory leak in dm_sw_fini()
Armin Wolf [Tue, 13 Feb 2024 00:50:50 +0000 (01:50 +0100)]
drm/amd/display: Fix memory leak in dm_sw_fini()

[ Upstream commit bae67893578d608e35691dcdfa90c4957debf1d3 ]

After destroying dmub_srv, the memory associated with it is
not freed, causing a memory leak:

unreferenced object 0xffff896302b45800 (size 1024):
  comm "(udev-worker)", pid 222, jiffies 4294894636
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace (crc 6265fd77):
    [<ffffffff993495ed>] kmalloc_trace+0x29d/0x340
    [<ffffffffc0ea4a94>] dm_dmub_sw_init+0xb4/0x450 [amdgpu]
    [<ffffffffc0ea4e55>] dm_sw_init+0x15/0x2b0 [amdgpu]
    [<ffffffffc0ba8557>] amdgpu_device_init+0x1417/0x24e0 [amdgpu]
    [<ffffffffc0bab285>] amdgpu_driver_load_kms+0x15/0x190 [amdgpu]
    [<ffffffffc0ba09c7>] amdgpu_pci_probe+0x187/0x4e0 [amdgpu]
    [<ffffffff9968fd1e>] local_pci_probe+0x3e/0x90
    [<ffffffff996918a3>] pci_device_probe+0xc3/0x230
    [<ffffffff99805872>] really_probe+0xe2/0x480
    [<ffffffff99805c98>] __driver_probe_device+0x78/0x160
    [<ffffffff99805daf>] driver_probe_device+0x1f/0x90
    [<ffffffff9980601e>] __driver_attach+0xce/0x1c0
    [<ffffffff99803170>] bus_for_each_dev+0x70/0xc0
    [<ffffffff99804822>] bus_add_driver+0x112/0x210
    [<ffffffff99807245>] driver_register+0x55/0x100
    [<ffffffff990012d1>] do_one_initcall+0x41/0x300

Fix this by freeing dmub_srv after destroying it.

Fixes: 743b9786b14a ("drm/amd/display: Hook up the DMUB service in DM")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
15 months agoselftests/iommu: fix the config fragment
Muhammad Usama Anjum [Thu, 22 Feb 2024 07:49:33 +0000 (12:49 +0500)]
selftests/iommu: fix the config fragment

[ Upstream commit 510325e5ac5f45c1180189d3bfc108c54bf64544 ]

The config fragment doesn't follow the correct format to enable those
config options which make the config options getting missed while
merging with other configs.

➜ merge_config.sh -m .config tools/testing/selftests/iommu/config
Using .config as base
Merging tools/testing/selftests/iommu/config
➜ make olddefconfig
.config:5295:warning: unexpected data: CONFIG_IOMMUFD
.config:5296:warning: unexpected data: CONFIG_IOMMUFD_TEST

While at it, add CONFIG_FAULT_INJECTION as well which is needed for
CONFIG_IOMMUFD_TEST. If CONFIG_FAULT_INJECTION isn't present in base
config (such as x86 defconfig), CONFIG_IOMMUFD_TEST doesn't get enabled.

Fixes: 57f0988706fe ("iommufd: Add a selftest")
Link: https://lore.kernel.org/r/20240222074934.71380-1-usama.anjum@collabora.com
Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
15 months agodrm/syncobj: handle NULL fence in syncobj_eventfd_entry_func
Erik Kurzinger [Wed, 21 Feb 2024 18:44:28 +0000 (10:44 -0800)]
drm/syncobj: handle NULL fence in syncobj_eventfd_entry_func

[ Upstream commit 2aa6f5b0fd052e363bb9d4b547189f0bf6b3d6d3 ]

During syncobj_eventfd_entry_func, dma_fence_chain_find_seqno may set
the fence to NULL if the given seqno is signaled and a later seqno has
already been submitted. In that case, the eventfd should be signaled
immediately which currently does not happen.

This is a similar issue to the one addressed by commit b19926d4f3a6
("drm/syncobj: Deal with signalled fences in drm_syncobj_find_fence.").

As a fix, if the return value of dma_fence_chain_find_seqno indicates
success but it sets the fence to NULL, we will assign a stub fence to
ensure the following code still signals the eventfd.

v1 -> v2: assign a stub fence instead of signaling the eventfd

Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com>
Fixes: c7a472297169 ("drm/syncobj: add IOCTL to register an eventfd")
Signed-off-by: Simon Ser <contact@emersion.fr>
Link: https://patchwork.freedesktop.org/patch/msgid/20240221184527.37667-1-ekurzinger@nvidia.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
15 months agodrm/syncobj: call drm_syncobj_fence_add_wait when WAIT_AVAILABLE flag is set
Erik Kurzinger [Fri, 19 Jan 2024 16:32:06 +0000 (08:32 -0800)]
drm/syncobj: call drm_syncobj_fence_add_wait when WAIT_AVAILABLE flag is set

[ Upstream commit 3c43177ffb54ea5be97505eb8e2690e99ac96bc9 ]

When waiting for a syncobj timeline point whose fence has not yet been
submitted with the WAIT_FOR_SUBMIT flag, a callback is registered using
drm_syncobj_fence_add_wait and the thread is put to sleep until the
timeout expires. If the fence is submitted before then,
drm_syncobj_add_point will wake up the sleeping thread immediately which
will proceed to wait for the fence to be signaled.

However, if the WAIT_AVAILABLE flag is used instead,
drm_syncobj_fence_add_wait won't get called, meaning the waiting thread
will always sleep for the full timeout duration, even if the fence gets
submitted earlier. If it turns out that the fence *has* been submitted
by the time it eventually wakes up, it will still indicate to userspace
that the wait completed successfully (it won't return -ETIME), but it
will have taken much longer than it should have.

To fix this, we must call drm_syncobj_fence_add_wait if *either* the
WAIT_FOR_SUBMIT flag or the WAIT_AVAILABLE flag is set. The only
difference being that with WAIT_FOR_SUBMIT we will also wait for the
fence to be signaled after it has been submitted while with
WAIT_AVAILABLE we will return immediately.

IGT test patch: https://lists.freedesktop.org/archives/igt-dev/2024-January/067537.html

v1 -> v2: adjust lockdep_assert_none_held_once condition

(cherry picked from commit 8c44ea81634a4a337df70a32621a5f3791be23df)

Fixes: 01d6c3578379 ("drm/syncobj: add support for timeline point wait v8")
Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com>
Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Simon Ser <contact@emersion.fr>
Link: https://patchwork.freedesktop.org/patch/msgid/20240119163208.3723457-1-ekurzinger@nvidia.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
15 months agonet: phy: realtek: Fix rtl8211f_config_init() for RTL8211F(D)(I)-VD-CG PHY
Siddharth Vadapalli [Tue, 20 Feb 2024 07:00:07 +0000 (12:30 +0530)]
net: phy: realtek: Fix rtl8211f_config_init() for RTL8211F(D)(I)-VD-CG PHY

[ Upstream commit 3489182b11d35f1944c1245fc9c4867cf622c50f ]

Commit bb726b753f75 ("net: phy: realtek: add support for
RTL8211F(D)(I)-VD-CG") extended support of the driver from the existing
support for RTL8211F(D)(I)-CG PHY to the newer RTL8211F(D)(I)-VD-CG PHY.

While that commit indicated that the RTL8211F_PHYCR2 register is not
supported by the "VD-CG" PHY model and therefore updated the corresponding
section in rtl8211f_config_init() to be invoked conditionally, the call to
"genphy_soft_reset()" was left as-is, when it should have also been invoked
conditionally. This is because the call to "genphy_soft_reset()" was first
introduced by the commit 0a4355c2b7f8 ("net: phy: realtek: add dt property
to disable CLKOUT clock") since the RTL8211F guide indicates that a PHY
reset should be issued after setting bits in the PHYCR2 register.

As the PHYCR2 register is not applicable to the "VD-CG" PHY model, fix the
rtl8211f_config_init() function by invoking "genphy_soft_reset()"
conditionally based on the presence of the "PHYCR2" register.

Fixes: bb726b753f75 ("net: phy: realtek: add support for RTL8211F(D)(I)-VD-CG")
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240220070007.968762-1-s-vadapalli@ti.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
15 months agoFix write to cloned skb in ipv6_hop_ioam()
Justin Iurman [Mon, 19 Feb 2024 13:52:54 +0000 (14:52 +0100)]
Fix write to cloned skb in ipv6_hop_ioam()

[ Upstream commit f198d933c2e4f8f89e0620fbaf1ea7eac384a0eb ]

ioam6_fill_trace_data() writes inside the skb payload without ensuring
it's writeable (e.g., not cloned). This function is called both from the
input and output path. The output path (ioam6_iptunnel) already does the
check. This commit provides a fix for the input path, inside
ipv6_hop_ioam(). It also updates ip6_parse_tlv() to refresh the network
header pointer ("nh") when returning from ipv6_hop_ioam().

Fixes: 9ee11f0fff20 ("ipv6: ioam: Data plane support for Pre-allocated Trace")
Reported-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Justin Iurman <justin.iurman@uliege.be>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
15 months agophonet/pep: fix racy skb_queue_empty() use
Rémi Denis-Courmont [Sun, 18 Feb 2024 08:12:14 +0000 (10:12 +0200)]
phonet/pep: fix racy skb_queue_empty() use

[ Upstream commit 7d2a894d7f487dcb894df023e9d3014cf5b93fe5 ]

The receive queues are protected by their respective spin-lock, not
the socket lock. This could lead to skb_peek() unexpectedly
returning NULL or a pointer to an already dequeued socket buffer.

Fixes: 9641458d3ec4 ("Phonet: Pipe End Point for Phonet Pipes protocol")
Signed-off-by: Rémi Denis-Courmont <courmisch@gmail.com>
Link: https://lore.kernel.org/r/20240218081214.4806-2-remi@remlab.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
15 months agophonet: take correct lock to peek at the RX queue
Rémi Denis-Courmont [Sun, 18 Feb 2024 08:12:13 +0000 (10:12 +0200)]
phonet: take correct lock to peek at the RX queue

[ Upstream commit 3b2d9bc4d4acdf15a876eae2c0d83149250e85ba ]

The receive queue is protected by its embedded spin-lock, not the
socket lock, so we need the former lock here (and only that one).

Fixes: 107d0d9b8d9a ("Phonet: Phonet datagram transport protocol")
Reported-by: Luosili <rootlab@huawei.com>
Signed-off-by: Rémi Denis-Courmont <courmisch@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20240218081214.4806-1-remi@remlab.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
15 months agonet: sparx5: Add spinlock for frame transmission from CPU
Horatiu Vultur [Mon, 19 Feb 2024 08:00:43 +0000 (09:00 +0100)]
net: sparx5: Add spinlock for frame transmission from CPU

[ Upstream commit 603ead96582d85903baec2d55f021b8dac5c25d2 ]

Both registers used when doing manual injection or fdma injection are
shared between all the net devices of the switch. It was noticed that
when having two process which each of them trying to inject frames on
different ethernet ports, that the HW started to behave strange, by
sending out more frames then expected. When doing fdma injection it is
required to set the frame in the DCB and then make sure that the next
pointer of the last DCB is invalid. But because there is no locks for
this, then easily this pointer between the DCB can be broken and then it
would create a loop of DCBs. And that means that the HW will
continuously transmit these frames in a loop. Until the SW will break
this loop.
Therefore to fix this issue, add a spin lock for when accessing the
registers for manual or fdma injection.

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Fixes: f3cad2611a77 ("net: sparx5: add hostmode with phylink support")
Link: https://lore.kernel.org/r/20240219080043.1561014-1-horatiu.vultur@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
15 months agonet/sched: flower: Add lock protection when remove filter handle
Jianbo Liu [Tue, 20 Feb 2024 08:59:28 +0000 (08:59 +0000)]
net/sched: flower: Add lock protection when remove filter handle

[ Upstream commit 1fde0ca3a0de7e9f917668941156959dd5e9108b ]

As IDR can't protect itself from the concurrent modification, place
idr_remove() under the protection of tp->lock.

Fixes: 08a0063df3ae ("net/sched: flower: Move filter handle initialization earlier")
Signed-off-by: Jianbo Liu <jianbol@nvidia.com>
Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Link: https://lore.kernel.org/r/20240220085928.9161-1-jianbol@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
15 months agodevlink: fix port dump cmd type
Jiri Pirko [Tue, 20 Feb 2024 07:52:45 +0000 (08:52 +0100)]
devlink: fix port dump cmd type

[ Upstream commit 61c43780e9444123410cd48c2483e01d2b8f75e8 ]

Unlike other commands, due to a c&p error, port dump fills-up cmd with
wrong value, different from port-get request cmd, port-get doit reply
and port notification.

Fix it by filling cmd with value DEVLINK_CMD_PORT_NEW.

Skimmed through devlink userspace implementations, none of them cares
about this cmd value. Only ynl, for which, this is actually a fix, as it
expects doit and dumpit ops rsp_value to be the same.

Omit the fixes tag, even thought this is fix, better to target this for
next release.

Fixes: bfcd3a466172 ("Introduce devlink infrastructure")
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20240220075245.75416-1-jiri@resnulli.us
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
15 months agotools: ynl: don't leak mcast_groups on init error
Jakub Kicinski [Tue, 20 Feb 2024 16:11:12 +0000 (08:11 -0800)]
tools: ynl: don't leak mcast_groups on init error

[ Upstream commit 5d78b73e851455d525a064f3b042b29fdc0c1a4a ]

Make sure to free the already-parsed mcast_groups if
we don't get an ack from the kernel when reading family info.
This is part of the ynl_sock_create() error path, so we won't
get a call to ynl_sock_destroy() to free them later.

Fixes: 86878f14d71a ("tools: ynl: user space helpers")
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Link: https://lore.kernel.org/r/20240220161112.2735195-3-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
15 months agotools: ynl: make sure we always pass yarg to mnl_cb_run
Jakub Kicinski [Tue, 20 Feb 2024 16:11:11 +0000 (08:11 -0800)]
tools: ynl: make sure we always pass yarg to mnl_cb_run

[ Upstream commit e4fe082c38cd74a8fa384bc7542cf3edf1cb7318 ]

There is one common error handler in ynl - ynl_cb_error().
It expects priv to be a pointer to struct ynl_parse_arg AKA yarg.
To avoid potential crashes if we encounter a stray NLMSG_ERROR
always pass yarg as priv (or a struct which has it as the first
member).

ynl_cb_null() has a similar problem directly - it expects yarg
but priv passed by the caller is ys.

Found by code inspection.

Fixes: 86878f14d71a ("tools: ynl: user space helpers")
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Link: https://lore.kernel.org/r/20240220161112.2735195-2-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>