]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.15
authorSasha Levin <sashal@kernel.org>
Fri, 24 Nov 2023 04:28:41 +0000 (23:28 -0500)
committerSasha Levin <sashal@kernel.org>
Fri, 24 Nov 2023 04:28:41 +0000 (23:28 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
19 files changed:
queue-5.15/arm64-dts-qcom-ipq6018-fix-tcsr_mutex-register-size.patch [new file with mode: 0644]
queue-5.15/arm64-dts-qcom-ipq6018-switch-tcsr-mutex-to-mmio.patch [new file with mode: 0644]
queue-5.15/bluetooth-add-device-0bda-887b-to-device-tables.patch [new file with mode: 0644]
queue-5.15/bluetooth-add-device-13d3-3571-to-device-tables.patch [new file with mode: 0644]
queue-5.15/bluetooth-btusb-add-0bda-b85b-for-fn-link-rtl8852be.patch [new file with mode: 0644]
queue-5.15/bluetooth-btusb-add-realtek-rtl8852be-support-id-0x0.patch [new file with mode: 0644]
queue-5.15/bluetooth-btusb-add-rtw8852be-device-13d3-3570-to-de.patch [new file with mode: 0644]
queue-5.15/cpufreq-stats-fix-buffer-overflow-detection-in-trans.patch [new file with mode: 0644]
queue-5.15/driver-core-add-dma_cleanup-callback-in-bus_type.patch [new file with mode: 0644]
queue-5.15/driver-core-move-driver_sysfs_remove-after-driver_sy.patch [new file with mode: 0644]
queue-5.15/driver-core-refactor-multiple-copies-of-device-clean.patch [new file with mode: 0644]
queue-5.15/driver-core-release-all-resources-during-unbind-befo.patch [new file with mode: 0644]
queue-5.15/ksmbd-fix-slab-out-of-bounds-write-in-smb_inherit_da.patch [new file with mode: 0644]
queue-5.15/powerpc-pseries-ddw-simplify-enable_ddw.patch [new file with mode: 0644]
queue-5.15/powerpc-pseries-iommu-enable_ddw-incorrectly-returns.patch [new file with mode: 0644]
queue-5.15/regmap-ensure-range-selector-registers-are-updated-a.patch [new file with mode: 0644]
queue-5.15/serial-meson-use-platform_get_irq-to-get-the-interru.patch [new file with mode: 0644]
queue-5.15/series
queue-5.15/tty-serial-meson-fix-hard-lockup-on-crtscts-mode.patch [new file with mode: 0644]

diff --git a/queue-5.15/arm64-dts-qcom-ipq6018-fix-tcsr_mutex-register-size.patch b/queue-5.15/arm64-dts-qcom-ipq6018-fix-tcsr_mutex-register-size.patch
new file mode 100644 (file)
index 0000000..08e39a7
--- /dev/null
@@ -0,0 +1,45 @@
+From b320a6fab8a13f95cd736a0c2355ceac8c0239c8 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 5 Sep 2023 15:25:34 +0530
+Subject: arm64: dts: qcom: ipq6018: Fix tcsr_mutex register size
+
+From: Vignesh Viswanathan <quic_viswanat@quicinc.com>
+
+[ Upstream commit 72fc3d58b87b0d622039c6299b89024fbb7b420f ]
+
+IPQ6018's TCSR Mutex HW lock register has 32 locks of size 4KB each.
+Total size of the TCSR Mutex registers is 128KB.
+
+Fix size of the tcsr_mutex hwlock register to 0x20000.
+
+Changes in v2:
+ - Drop change to remove qcom,ipq6018-tcsr-mutex compatible string
+ - Added Fixes and stable tags
+
+Cc: stable@vger.kernel.org
+Fixes: 5bf635621245 ("arm64: dts: ipq6018: Add a few device nodes")
+Signed-off-by: Vignesh Viswanathan <quic_viswanat@quicinc.com>
+Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
+Link: https://lore.kernel.org/r/20230905095535.1263113-2-quic_viswanat@quicinc.com
+Signed-off-by: Bjorn Andersson <andersson@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/arm64/boot/dts/qcom/ipq6018.dtsi | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arm64/boot/dts/qcom/ipq6018.dtsi b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+index 43339557d7e5a..dde6fde10f8d3 100644
+--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
++++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+@@ -249,7 +249,7 @@
+               tcsr_mutex: hwlock@1905000 {
+                       compatible = "qcom,ipq6018-tcsr-mutex", "qcom,tcsr-mutex";
+-                      reg = <0x0 0x01905000 0x0 0x1000>;
++                      reg = <0x0 0x01905000 0x0 0x20000>;
+                       #hwlock-cells = <1>;
+               };
+-- 
+2.42.0
+
diff --git a/queue-5.15/arm64-dts-qcom-ipq6018-switch-tcsr-mutex-to-mmio.patch b/queue-5.15/arm64-dts-qcom-ipq6018-switch-tcsr-mutex-to-mmio.patch
new file mode 100644 (file)
index 0000000..cdfb119
--- /dev/null
@@ -0,0 +1,60 @@
+From 86c32aa55abcbc17b89d612029a81bc594f74ace Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 9 Sep 2022 11:20:31 +0200
+Subject: arm64: dts: qcom: ipq6018: switch TCSR mutex to MMIO
+
+From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
+
+[ Upstream commit f5e303aefc06b7508d7a490f9a2d80e4dc134c70 ]
+
+The TCSR mutex bindings allow device to be described only with address
+space (so it uses MMIO, not syscon regmap).  This seems reasonable as
+TCSR mutex is actually a dedicated IO address space and it also fixes DT
+schema checks:
+
+  qcom/ipq6018-cp01-c1.dtb: hwlock: 'reg' is a required property
+  qcom/ipq6018-cp01-c1.dtb: hwlock: 'syscon' does not match any of the regexes: 'pinctrl-[0-9]+'
+
+Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
+Signed-off-by: Bjorn Andersson <andersson@kernel.org>
+Link: https://lore.kernel.org/r/20220909092035.223915-12-krzysztof.kozlowski@linaro.org
+Stable-dep-of: 72fc3d58b87b ("arm64: dts: qcom: ipq6018: Fix tcsr_mutex register size")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/arm64/boot/dts/qcom/ipq6018.dtsi | 13 ++++---------
+ 1 file changed, 4 insertions(+), 9 deletions(-)
+
+diff --git a/arch/arm64/boot/dts/qcom/ipq6018.dtsi b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+index 13651a5ac5a69..43339557d7e5a 100644
+--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
++++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+@@ -129,12 +129,6 @@
+               };
+       };
+-      tcsr_mutex: hwlock {
+-              compatible = "qcom,tcsr-mutex";
+-              syscon = <&tcsr_mutex_regs 0 0x80>;
+-              #hwlock-cells = <1>;
+-      };
+-
+       pmuv8: pmu {
+               compatible = "arm,cortex-a53-pmu";
+               interrupts = <GIC_PPI 7 (GIC_CPU_MASK_SIMPLE(4) |
+@@ -253,9 +247,10 @@
+                       #reset-cells = <1>;
+               };
+-              tcsr_mutex_regs: syscon@1905000 {
+-                      compatible = "syscon";
+-                      reg = <0x0 0x01905000 0x0 0x8000>;
++              tcsr_mutex: hwlock@1905000 {
++                      compatible = "qcom,ipq6018-tcsr-mutex", "qcom,tcsr-mutex";
++                      reg = <0x0 0x01905000 0x0 0x1000>;
++                      #hwlock-cells = <1>;
+               };
+               tcsr: syscon@1937000 {
+-- 
+2.42.0
+
diff --git a/queue-5.15/bluetooth-add-device-0bda-887b-to-device-tables.patch b/queue-5.15/bluetooth-add-device-0bda-887b-to-device-tables.patch
new file mode 100644 (file)
index 0000000..c98ca31
--- /dev/null
@@ -0,0 +1,67 @@
+From a2a8e4ec74d5ef71081d246e29da4896591b5ef6 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 22 Mar 2023 19:52:02 -0500
+Subject: bluetooth: Add device 0bda:887b to device tables
+
+From: Larry Finger <Larry.Finger@lwfinger.net>
+
+[ Upstream commit 730a1d1a93a3e30c3723f87af97a8517334b2203 ]
+
+This device is part of a Realtek RTW8852BE chip.
+
+The device table entry is as follows:
+
+T:  Bus=03 Lev=01 Prnt=01 Port=12 Cnt=02 Dev#=  3 Spd=12   MxCh= 0
+D:  Ver= 1.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
+P:  Vendor=0bda ProdID=887b Rev= 0.00
+S:  Manufacturer=Realtek
+S:  Product=Bluetooth Radio
+S:  SerialNumber=00e04c000001
+C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA
+I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
+E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
+E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
+I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
+I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
+I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
+I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
+I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
+I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
+
+Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
+Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+Stable-dep-of: da06ff1f585e ("Bluetooth: btusb: Add 0bda:b85b for Fn-Link RTL8852BE")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/bluetooth/btusb.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
+index c1ce5592921af..5b905f1501578 100644
+--- a/drivers/bluetooth/btusb.c
++++ b/drivers/bluetooth/btusb.c
+@@ -439,6 +439,8 @@ static const struct usb_device_id blacklist_table[] = {
+       /* Realtek 8852BE Bluetooth devices */
+       { USB_DEVICE(0x0cb8, 0xc559), .driver_info = BTUSB_REALTEK |
+                                                    BTUSB_WIDEBAND_SPEECH },
++      { USB_DEVICE(0x0bda, 0x887b), .driver_info = BTUSB_REALTEK |
++                                                   BTUSB_WIDEBAND_SPEECH },
+       /* Realtek Bluetooth devices */
+       { USB_VENDOR_AND_INTERFACE_INFO(0x0bda, 0xe0, 0x01, 0x01),
+-- 
+2.42.0
+
diff --git a/queue-5.15/bluetooth-add-device-13d3-3571-to-device-tables.patch b/queue-5.15/bluetooth-add-device-13d3-3571-to-device-tables.patch
new file mode 100644 (file)
index 0000000..30c6531
--- /dev/null
@@ -0,0 +1,65 @@
+From 77fc9cabd92a93fa31fe3a1be3b8c9b3bc303d92 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 22 Mar 2023 19:52:03 -0500
+Subject: bluetooth: Add device 13d3:3571 to device tables
+
+From: Larry Finger <Larry.Finger@lwfinger.net>
+
+[ Upstream commit 069f534247bb6db4f8c2c2ea8e9155abf495c37e ]
+
+This device is part of a Realtek RTW8852BE chip. The device table is as follows:
+
+T:  Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=12   MxCh= 0
+D:  Ver= 1.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
+P:  Vendor=13d3 ProdID=3571 Rev= 0.00
+S:  Manufacturer=Realtek
+S:  Product=Bluetooth Radio
+S:  SerialNumber=00e04c000001
+C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA
+I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
+E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
+E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
+I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
+I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
+I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
+I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
+I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
+I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
+
+Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
+Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+Stable-dep-of: da06ff1f585e ("Bluetooth: btusb: Add 0bda:b85b for Fn-Link RTL8852BE")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/bluetooth/btusb.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
+index 5b905f1501578..363642eda5323 100644
+--- a/drivers/bluetooth/btusb.c
++++ b/drivers/bluetooth/btusb.c
+@@ -441,6 +441,8 @@ static const struct usb_device_id blacklist_table[] = {
+                                                    BTUSB_WIDEBAND_SPEECH },
+       { USB_DEVICE(0x0bda, 0x887b), .driver_info = BTUSB_REALTEK |
+                                                    BTUSB_WIDEBAND_SPEECH },
++      { USB_DEVICE(0x13d3, 0x3571), .driver_info = BTUSB_REALTEK |
++                                                   BTUSB_WIDEBAND_SPEECH },
+       /* Realtek Bluetooth devices */
+       { USB_VENDOR_AND_INTERFACE_INFO(0x0bda, 0xe0, 0x01, 0x01),
+-- 
+2.42.0
+
diff --git a/queue-5.15/bluetooth-btusb-add-0bda-b85b-for-fn-link-rtl8852be.patch b/queue-5.15/bluetooth-btusb-add-0bda-b85b-for-fn-link-rtl8852be.patch
new file mode 100644 (file)
index 0000000..a5b4838
--- /dev/null
@@ -0,0 +1,75 @@
+From cb8bcb15f4a2def0fb1a3fe26ae0c60ee5cdd2a3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 12 Oct 2023 19:21:17 +0800
+Subject: Bluetooth: btusb: Add 0bda:b85b for Fn-Link RTL8852BE
+
+From: Guan Wentao <guanwentao@uniontech.com>
+
+[ Upstream commit da06ff1f585ea784c79f80e7fab0e0c4ebb49c1c ]
+
+Add PID/VID 0bda:b85b for Realtek RTL8852BE USB bluetooth part.
+The PID/VID was reported by the patch last year. [1]
+Some SBCs like rockpi 5B A8 module contains the device.
+And it`s founded in website. [2] [3]
+
+Here is the device tables in /sys/kernel/debug/usb/devices .
+
+T:  Bus=07 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=12   MxCh= 0
+D:  Ver= 1.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
+P:  Vendor=0bda ProdID=b85b Rev= 0.00
+S:  Manufacturer=Realtek
+S:  Product=Bluetooth Radio
+S:  SerialNumber=00e04c000001
+C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA
+I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
+E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
+E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
+I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
+I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
+I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
+I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
+I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
+I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
+
+Link: https://lore.kernel.org/all/20220420052402.19049-1-tangmeng@uniontech.com/ [1]
+Link: https://forum.radxa.com/t/bluetooth-on-ubuntu/13051/4 [2]
+Link: https://ubuntuforums.org/showthread.php?t=2489527 [3]
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Meng Tang <tangmeng@uniontech.com>
+Signed-off-by: Guan Wentao <guanwentao@uniontech.com>
+Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/bluetooth/btusb.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
+index ea0ab93097905..a862f859f7a50 100644
+--- a/drivers/bluetooth/btusb.c
++++ b/drivers/bluetooth/btusb.c
+@@ -441,6 +441,8 @@ static const struct usb_device_id blacklist_table[] = {
+                                                    BTUSB_WIDEBAND_SPEECH },
+       { USB_DEVICE(0x0bda, 0x887b), .driver_info = BTUSB_REALTEK |
+                                                    BTUSB_WIDEBAND_SPEECH },
++      { USB_DEVICE(0x0bda, 0xb85b), .driver_info = BTUSB_REALTEK |
++                                                   BTUSB_WIDEBAND_SPEECH },
+       { USB_DEVICE(0x13d3, 0x3570), .driver_info = BTUSB_REALTEK |
+                                                    BTUSB_WIDEBAND_SPEECH },
+       { USB_DEVICE(0x13d3, 0x3571), .driver_info = BTUSB_REALTEK |
+-- 
+2.42.0
+
diff --git a/queue-5.15/bluetooth-btusb-add-realtek-rtl8852be-support-id-0x0.patch b/queue-5.15/bluetooth-btusb-add-realtek-rtl8852be-support-id-0x0.patch
new file mode 100644 (file)
index 0000000..63ca9fb
--- /dev/null
@@ -0,0 +1,70 @@
+From 00460075492d004a8b7c237e73660f353973748f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 23 Nov 2022 11:10:05 +0300
+Subject: Bluetooth: btusb: Add Realtek RTL8852BE support ID 0x0cb8:0xc559
+
+From: Artem Lukyanov <dukzcry@ya.ru>
+
+[ Upstream commit 393b4916b7b5b94faf5c6a7c68df1c62d17e4f38 ]
+
+Add the support ID(0x0cb8, 0xc559) to usb_device_id table for
+Realtek RTL8852BE.
+
+The device info from /sys/kernel/debug/usb/devices as below.
+
+T:  Bus=03 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#=  2 Spd=12   MxCh= 0
+D:  Ver= 1.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
+P:  Vendor=0cb8 ProdID=c559 Rev= 0.00
+S:  Manufacturer=Realtek
+S:  Product=Bluetooth Radio
+S:  SerialNumber=00e04c000001
+C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA
+I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
+E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
+E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
+I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
+I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
+I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
+I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
+I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
+I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
+
+Signed-off-by: Artem Lukyanov <dukzcry@ya.ru>
+Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+Stable-dep-of: da06ff1f585e ("Bluetooth: btusb: Add 0bda:b85b for Fn-Link RTL8852BE")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/bluetooth/btusb.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
+index 91a08892df223..c1ce5592921af 100644
+--- a/drivers/bluetooth/btusb.c
++++ b/drivers/bluetooth/btusb.c
+@@ -436,6 +436,10 @@ static const struct usb_device_id blacklist_table[] = {
+       { USB_DEVICE(0x13d3, 0x3586), .driver_info = BTUSB_REALTEK |
+                                                    BTUSB_WIDEBAND_SPEECH },
++      /* Realtek 8852BE Bluetooth devices */
++      { USB_DEVICE(0x0cb8, 0xc559), .driver_info = BTUSB_REALTEK |
++                                                   BTUSB_WIDEBAND_SPEECH },
++
+       /* Realtek Bluetooth devices */
+       { USB_VENDOR_AND_INTERFACE_INFO(0x0bda, 0xe0, 0x01, 0x01),
+         .driver_info = BTUSB_REALTEK },
+-- 
+2.42.0
+
diff --git a/queue-5.15/bluetooth-btusb-add-rtw8852be-device-13d3-3570-to-de.patch b/queue-5.15/bluetooth-btusb-add-rtw8852be-device-13d3-3570-to-de.patch
new file mode 100644 (file)
index 0000000..41776ae
--- /dev/null
@@ -0,0 +1,68 @@
+From fadc942e654e7c36b7e665f45503fee8e136fbb5 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 24 Sep 2023 16:46:55 +0530
+Subject: Bluetooth: btusb: Add RTW8852BE device 13d3:3570 to device tables
+
+From: Masum Reza <masumrezarock100@gmail.com>
+
+[ Upstream commit 02be109d3a405dbc4d53fb4b4473d7a113548088 ]
+
+This device is used in TP-Link TX20E WiFi+Bluetooth adapter.
+
+Relevant information in /sys/kernel/debug/usb/devices
+about the Bluetooth device is listed as the below.
+
+T:  Bus=01 Lev=01 Prnt=01 Port=08 Cnt=01 Dev#=  2 Spd=12   MxCh= 0
+D:  Ver= 1.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
+P:  Vendor=13d3 ProdID=3570 Rev= 0.00
+S:  Manufacturer=Realtek
+S:  Product=Bluetooth Radio
+S:  SerialNumber=00e04c000001
+C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA
+I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
+E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
+E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
+I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
+I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
+I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
+I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
+I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
+I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
+E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
+E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
+
+Signed-off-by: Masum Reza <masumrezarock100@gmail.com>
+Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
+Stable-dep-of: da06ff1f585e ("Bluetooth: btusb: Add 0bda:b85b for Fn-Link RTL8852BE")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/bluetooth/btusb.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
+index 363642eda5323..ea0ab93097905 100644
+--- a/drivers/bluetooth/btusb.c
++++ b/drivers/bluetooth/btusb.c
+@@ -441,6 +441,8 @@ static const struct usb_device_id blacklist_table[] = {
+                                                    BTUSB_WIDEBAND_SPEECH },
+       { USB_DEVICE(0x0bda, 0x887b), .driver_info = BTUSB_REALTEK |
+                                                    BTUSB_WIDEBAND_SPEECH },
++      { USB_DEVICE(0x13d3, 0x3570), .driver_info = BTUSB_REALTEK |
++                                                   BTUSB_WIDEBAND_SPEECH },
+       { USB_DEVICE(0x13d3, 0x3571), .driver_info = BTUSB_REALTEK |
+                                                    BTUSB_WIDEBAND_SPEECH },
+-- 
+2.42.0
+
diff --git a/queue-5.15/cpufreq-stats-fix-buffer-overflow-detection-in-trans.patch b/queue-5.15/cpufreq-stats-fix-buffer-overflow-detection-in-trans.patch
new file mode 100644 (file)
index 0000000..c4cf572
--- /dev/null
@@ -0,0 +1,87 @@
+From 9d11dd94d7935f22ae587f36e54103d22ee89296 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 24 Oct 2023 20:30:14 +0200
+Subject: cpufreq: stats: Fix buffer overflow detection in trans_stats()
+
+From: Christian Marangi <ansuelsmth@gmail.com>
+
+[ Upstream commit ea167a7fc2426f7685c3735e104921c1a20a6d3f ]
+
+Commit 3c0897c180c6 ("cpufreq: Use scnprintf() for avoiding potential
+buffer overflow") switched from snprintf to the more secure scnprintf
+but never updated the exit condition for PAGE_SIZE.
+
+As the commit say and as scnprintf document, what scnprintf returns what
+is actually written not counting the '\0' end char. This results in the
+case of len exceeding the size, len set to PAGE_SIZE - 1, as it can be
+written at max PAGE_SIZE - 1 (as '\0' is not counted)
+
+Because of len is never set to PAGE_SIZE, the function never break early,
+never prints the warning and never return -EFBIG.
+
+Fix this by changing the condition to PAGE_SIZE - 1 to correctly trigger
+the error.
+
+Cc: 5.10+ <stable@vger.kernel.org> # 5.10+
+Fixes: 3c0897c180c6 ("cpufreq: Use scnprintf() for avoiding potential buffer overflow")
+Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+[ rjw: Subject and changelog edits ]
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/cpufreq/cpufreq_stats.c | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
+index 1570d6f3e75d3..6e57df7a2249f 100644
+--- a/drivers/cpufreq/cpufreq_stats.c
++++ b/drivers/cpufreq/cpufreq_stats.c
+@@ -131,25 +131,25 @@ static ssize_t show_trans_table(struct cpufreq_policy *policy, char *buf)
+       len += scnprintf(buf + len, PAGE_SIZE - len, "   From  :    To\n");
+       len += scnprintf(buf + len, PAGE_SIZE - len, "         : ");
+       for (i = 0; i < stats->state_num; i++) {
+-              if (len >= PAGE_SIZE)
++              if (len >= PAGE_SIZE - 1)
+                       break;
+               len += scnprintf(buf + len, PAGE_SIZE - len, "%9u ",
+                               stats->freq_table[i]);
+       }
+-      if (len >= PAGE_SIZE)
+-              return PAGE_SIZE;
++      if (len >= PAGE_SIZE - 1)
++              return PAGE_SIZE - 1;
+       len += scnprintf(buf + len, PAGE_SIZE - len, "\n");
+       for (i = 0; i < stats->state_num; i++) {
+-              if (len >= PAGE_SIZE)
++              if (len >= PAGE_SIZE - 1)
+                       break;
+               len += scnprintf(buf + len, PAGE_SIZE - len, "%9u: ",
+                               stats->freq_table[i]);
+               for (j = 0; j < stats->state_num; j++) {
+-                      if (len >= PAGE_SIZE)
++                      if (len >= PAGE_SIZE - 1)
+                               break;
+                       if (pending)
+@@ -159,12 +159,12 @@ static ssize_t show_trans_table(struct cpufreq_policy *policy, char *buf)
+                       len += scnprintf(buf + len, PAGE_SIZE - len, "%9u ", count);
+               }
+-              if (len >= PAGE_SIZE)
++              if (len >= PAGE_SIZE - 1)
+                       break;
+               len += scnprintf(buf + len, PAGE_SIZE - len, "\n");
+       }
+-      if (len >= PAGE_SIZE) {
++      if (len >= PAGE_SIZE - 1) {
+               pr_warn_once("cpufreq transition table exceeds PAGE_SIZE. Disabling\n");
+               return -EFBIG;
+       }
+-- 
+2.42.0
+
diff --git a/queue-5.15/driver-core-add-dma_cleanup-callback-in-bus_type.patch b/queue-5.15/driver-core-add-dma_cleanup-callback-in-bus_type.patch
new file mode 100644 (file)
index 0000000..050f106
--- /dev/null
@@ -0,0 +1,89 @@
+From e19e821c42d0f37d64153517b29687d3819dc188 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 18 Apr 2022 08:49:51 +0800
+Subject: driver core: Add dma_cleanup callback in bus_type
+
+From: Lu Baolu <baolu.lu@linux.intel.com>
+
+[ Upstream commit 25f3bcfc54bcf7b0e45d140ec8bfbbf10ba11869 ]
+
+The bus_type structure defines dma_configure() callback for bus drivers
+to configure DMA on the devices. This adds the paired dma_cleanup()
+callback and calls it during driver unbinding so that bus drivers can do
+some cleanup work.
+
+One use case for this paired DMA callbacks is for the bus driver to check
+for DMA ownership conflicts during driver binding, where multiple devices
+belonging to a same IOMMU group (the minimum granularity of isolation and
+protection) may be assigned to kernel drivers or user space respectively.
+
+Without this change, for example, the vfio driver has to listen to a bus
+BOUND_DRIVER event and then BUG_ON() in case of dma ownership conflict.
+This leads to bad user experience since careless driver binding operation
+may crash the system if the admin overlooks the group restriction. Aside
+from bad design, this leads to a security problem as a root user, even with
+lockdown=integrity, can force the kernel to BUG.
+
+With this change, the bus driver could check and set the DMA ownership in
+driver binding process and fail on ownership conflicts. The DMA ownership
+should be released during driver unbinding.
+
+Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
+Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
+Link: https://lore.kernel.org/r/20220418005000.897664-3-baolu.lu@linux.intel.com
+Signed-off-by: Joerg Roedel <jroedel@suse.de>
+Stable-dep-of: 2e84dc379200 ("driver core: Release all resources during unbind before updating device links")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/base/dd.c          | 5 +++++
+ include/linux/device/bus.h | 3 +++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/drivers/base/dd.c b/drivers/base/dd.c
+index 81683c99d6293..394ef41d732a9 100644
+--- a/drivers/base/dd.c
++++ b/drivers/base/dd.c
+@@ -669,6 +669,8 @@ static int really_probe(struct device *dev, struct device_driver *drv)
+       if (dev->bus)
+               blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
+                                            BUS_NOTIFY_DRIVER_NOT_BOUND, dev);
++      if (dev->bus && dev->bus->dma_cleanup)
++              dev->bus->dma_cleanup(dev);
+ pinctrl_bind_failed:
+       device_links_no_driver(dev);
+       device_unbind_cleanup(dev);
+@@ -1225,6 +1227,9 @@ static void __device_release_driver(struct device *dev, struct device *parent)
+               else if (drv->remove)
+                       drv->remove(dev);
++              if (dev->bus && dev->bus->dma_cleanup)
++                      dev->bus->dma_cleanup(dev);
++
+               device_links_driver_cleanup(dev);
+               device_unbind_cleanup(dev);
+diff --git a/include/linux/device/bus.h b/include/linux/device/bus.h
+index 062777a45a74d..a52a6fe39eec9 100644
+--- a/include/linux/device/bus.h
++++ b/include/linux/device/bus.h
+@@ -59,6 +59,8 @@ struct fwnode_handle;
+  *            bus supports.
+  * @dma_configure:    Called to setup DMA configuration on a device on
+  *                    this bus.
++ * @dma_cleanup:      Called to cleanup DMA configuration on a device on
++ *                    this bus.
+  * @pm:               Power management operations of this bus, callback the specific
+  *            device driver's pm-ops.
+  * @iommu_ops:  IOMMU specific operations for this bus, used to attach IOMMU
+@@ -103,6 +105,7 @@ struct bus_type {
+       int (*num_vf)(struct device *dev);
+       int (*dma_configure)(struct device *dev);
++      void (*dma_cleanup)(struct device *dev);
+       const struct dev_pm_ops *pm;
+-- 
+2.42.0
+
diff --git a/queue-5.15/driver-core-move-driver_sysfs_remove-after-driver_sy.patch b/queue-5.15/driver-core-move-driver_sysfs_remove-after-driver_sy.patch
new file mode 100644 (file)
index 0000000..b325ea6
--- /dev/null
@@ -0,0 +1,64 @@
+From 1e0d9ee2546f9ee4faf204e4e944f24773e472ac Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 31 Dec 2021 11:39:00 +0800
+Subject: driver core: Move driver_sysfs_remove() after driver_sysfs_add()
+
+From: Lu Baolu <baolu.lu@linux.intel.com>
+
+[ Upstream commit 885e50253bfd6750327a265405461496d6af1639 ]
+
+The driver_sysfs_remove() should be called after driver_sysfs_add() in
+really_probe(). The out-of-order driver_sysfs_remove() tries to remove
+some nonexistent nodes under the device and driver sysfs nodes. This is
+allowed, hence this change doesn't fix any problem, just a cleanup.
+
+Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
+Link: https://lore.kernel.org/r/20211231033901.2168664-2-baolu.lu@linux.intel.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Stable-dep-of: 2e84dc379200 ("driver core: Release all resources during unbind before updating device links")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/base/dd.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/base/dd.c b/drivers/base/dd.c
+index ab0b2eb5fa07f..f5371daf4fd29 100644
+--- a/drivers/base/dd.c
++++ b/drivers/base/dd.c
+@@ -576,14 +576,14 @@ static int really_probe(struct device *dev, struct device_driver *drv)
+       if (dev->bus->dma_configure) {
+               ret = dev->bus->dma_configure(dev);
+               if (ret)
+-                      goto probe_failed;
++                      goto sysfs_failed;
+       }
+       ret = driver_sysfs_add(dev);
+       if (ret) {
+               pr_err("%s: driver_sysfs_add(%s) failed\n",
+                      __func__, dev_name(dev));
+-              goto probe_failed;
++              goto sysfs_failed;
+       }
+       if (dev->pm_domain && dev->pm_domain->activate) {
+@@ -659,6 +659,8 @@ static int really_probe(struct device *dev, struct device_driver *drv)
+       else if (drv->remove)
+               drv->remove(dev);
+ probe_failed:
++      driver_sysfs_remove(dev);
++sysfs_failed:
+       if (dev->bus)
+               blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
+                                            BUS_NOTIFY_DRIVER_NOT_BOUND, dev);
+@@ -668,7 +670,6 @@ static int really_probe(struct device *dev, struct device_driver *drv)
+       arch_teardown_dma_ops(dev);
+       kfree(dev->dma_range_map);
+       dev->dma_range_map = NULL;
+-      driver_sysfs_remove(dev);
+       dev->driver = NULL;
+       dev_set_drvdata(dev, NULL);
+       if (dev->pm_domain && dev->pm_domain->dismiss)
+-- 
+2.42.0
+
diff --git a/queue-5.15/driver-core-refactor-multiple-copies-of-device-clean.patch b/queue-5.15/driver-core-refactor-multiple-copies-of-device-clean.patch
new file mode 100644 (file)
index 0000000..916988b
--- /dev/null
@@ -0,0 +1,108 @@
+From 7026884fd91f17a98191dca0a3b00cce394226d4 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 23 Feb 2022 16:52:56 -0600
+Subject: driver core: Refactor multiple copies of device cleanup
+
+From: Rob Herring <robh@kernel.org>
+
+[ Upstream commit 9ad307213fa4081f4bc2f2daa31d4f2d35d7a213 ]
+
+There are 3 copies of the same device cleanup code used for probe failure,
+testing re-probing, and device unbinding. Changes to this code often miss
+at least one of the copies of the code. See commits d0243bbd5dd3 ("drivers
+core: Free dma_range_map when driver probe failed") and d8f7a5484f21
+("driver core: Free DMA range map when device is released") for example.
+
+Let's refactor the code to its own function.
+
+Signed-off-by: Rob Herring <robh@kernel.org>
+Link: https://lore.kernel.org/r/20220223225257.1681968-2-robh@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Stable-dep-of: 2e84dc379200 ("driver core: Release all resources during unbind before updating device links")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/base/dd.c | 46 ++++++++++++++++------------------------------
+ 1 file changed, 16 insertions(+), 30 deletions(-)
+
+diff --git a/drivers/base/dd.c b/drivers/base/dd.c
+index f5371daf4fd29..81683c99d6293 100644
+--- a/drivers/base/dd.c
++++ b/drivers/base/dd.c
+@@ -505,6 +505,19 @@ static ssize_t state_synced_show(struct device *dev,
+ }
+ static DEVICE_ATTR_RO(state_synced);
++static void device_unbind_cleanup(struct device *dev)
++{
++      devres_release_all(dev);
++      arch_teardown_dma_ops(dev);
++      kfree(dev->dma_range_map);
++      dev->dma_range_map = NULL;
++      dev->driver = NULL;
++      dev_set_drvdata(dev, NULL);
++      if (dev->pm_domain && dev->pm_domain->dismiss)
++              dev->pm_domain->dismiss(dev);
++      pm_runtime_reinit(dev);
++      dev_pm_set_driver_flags(dev, 0);
++}
+ static int call_driver_probe(struct device *dev, struct device_driver *drv)
+ {
+@@ -627,16 +640,8 @@ static int really_probe(struct device *dev, struct device_driver *drv)
+               else if (drv->remove)
+                       drv->remove(dev);
+-              devres_release_all(dev);
+-              arch_teardown_dma_ops(dev);
+-              kfree(dev->dma_range_map);
+-              dev->dma_range_map = NULL;
+               driver_sysfs_remove(dev);
+-              dev->driver = NULL;
+-              dev_set_drvdata(dev, NULL);
+-              if (dev->pm_domain && dev->pm_domain->dismiss)
+-                      dev->pm_domain->dismiss(dev);
+-              pm_runtime_reinit(dev);
++              device_unbind_cleanup(dev);
+               goto re_probe;
+       }
+@@ -666,16 +671,7 @@ static int really_probe(struct device *dev, struct device_driver *drv)
+                                            BUS_NOTIFY_DRIVER_NOT_BOUND, dev);
+ pinctrl_bind_failed:
+       device_links_no_driver(dev);
+-      devres_release_all(dev);
+-      arch_teardown_dma_ops(dev);
+-      kfree(dev->dma_range_map);
+-      dev->dma_range_map = NULL;
+-      dev->driver = NULL;
+-      dev_set_drvdata(dev, NULL);
+-      if (dev->pm_domain && dev->pm_domain->dismiss)
+-              dev->pm_domain->dismiss(dev);
+-      pm_runtime_reinit(dev);
+-      dev_pm_set_driver_flags(dev, 0);
++      device_unbind_cleanup(dev);
+ done:
+       return ret;
+ }
+@@ -1230,17 +1226,7 @@ static void __device_release_driver(struct device *dev, struct device *parent)
+                       drv->remove(dev);
+               device_links_driver_cleanup(dev);
+-
+-              devres_release_all(dev);
+-              arch_teardown_dma_ops(dev);
+-              kfree(dev->dma_range_map);
+-              dev->dma_range_map = NULL;
+-              dev->driver = NULL;
+-              dev_set_drvdata(dev, NULL);
+-              if (dev->pm_domain && dev->pm_domain->dismiss)
+-                      dev->pm_domain->dismiss(dev);
+-              pm_runtime_reinit(dev);
+-              dev_pm_set_driver_flags(dev, 0);
++              device_unbind_cleanup(dev);
+               klist_remove(&dev->p->knode_driver);
+               device_pm_check_callbacks(dev);
+-- 
+2.42.0
+
diff --git a/queue-5.15/driver-core-release-all-resources-during-unbind-befo.patch b/queue-5.15/driver-core-release-all-resources-during-unbind-befo.patch
new file mode 100644 (file)
index 0000000..b887047
--- /dev/null
@@ -0,0 +1,56 @@
+From 5ed42eeb1f404d6f001d14a3b0351142aae3119c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 17 Oct 2023 18:38:50 -0700
+Subject: driver core: Release all resources during unbind before updating
+ device links
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Saravana Kannan <saravanak@google.com>
+
+[ Upstream commit 2e84dc37920012b458e9458b19fc4ed33f81bc74 ]
+
+This commit fixes a bug in commit 9ed9895370ae ("driver core: Functional
+dependencies tracking support") where the device link status was
+incorrectly updated in the driver unbind path before all the device's
+resources were released.
+
+Fixes: 9ed9895370ae ("driver core: Functional dependencies tracking support")
+Cc: stable <stable@kernel.org>
+Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+Closes: https://lore.kernel.org/all/20231014161721.f4iqyroddkcyoefo@pengutronix.de/
+Signed-off-by: Saravana Kannan <saravanak@google.com>
+Cc: Thierry Reding <thierry.reding@gmail.com>
+Cc: Yang Yingliang <yangyingliang@huawei.com>
+Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Cc: Mark Brown <broonie@kernel.org>
+Cc: Matti Vaittinen <mazziesaccount@gmail.com>
+Cc: James Clark <james.clark@arm.com>
+Acked-by: "Rafael J. Wysocki" <rafael@kernel.org>
+Tested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+Link: https://lore.kernel.org/r/20231018013851.3303928-1-saravanak@google.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/base/dd.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/base/dd.c b/drivers/base/dd.c
+index 394ef41d732a9..5f521def6b7c0 100644
+--- a/drivers/base/dd.c
++++ b/drivers/base/dd.c
+@@ -1230,8 +1230,8 @@ static void __device_release_driver(struct device *dev, struct device *parent)
+               if (dev->bus && dev->bus->dma_cleanup)
+                       dev->bus->dma_cleanup(dev);
+-              device_links_driver_cleanup(dev);
+               device_unbind_cleanup(dev);
++              device_links_driver_cleanup(dev);
+               klist_remove(&dev->p->knode_driver);
+               device_pm_check_callbacks(dev);
+-- 
+2.42.0
+
diff --git a/queue-5.15/ksmbd-fix-slab-out-of-bounds-write-in-smb_inherit_da.patch b/queue-5.15/ksmbd-fix-slab-out-of-bounds-write-in-smb_inherit_da.patch
new file mode 100644 (file)
index 0000000..2cbb43d
--- /dev/null
@@ -0,0 +1,79 @@
+From 39f78a5d57bb55ee12a1b3306265f45050124fcb Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 5 Nov 2023 12:46:24 +0900
+Subject: ksmbd: fix slab out of bounds write in smb_inherit_dacl()
+
+From: Namjae Jeon <linkinjeon@kernel.org>
+
+[ Upstream commit eebff19acaa35820cb09ce2ccb3d21bee2156ffb ]
+
+slab out-of-bounds write is caused by that offsets is bigger than pntsd
+allocation size. This patch add the check to validate 3 offsets using
+allocation size.
+
+Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-22271
+Cc: stable@vger.kernel.org
+Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
+Signed-off-by: Steve French <stfrench@microsoft.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/ksmbd/smbacl.c | 29 ++++++++++++++++++++++++++---
+ 1 file changed, 26 insertions(+), 3 deletions(-)
+
+diff --git a/fs/ksmbd/smbacl.c b/fs/ksmbd/smbacl.c
+index 3781bca2c8fc4..83f805248a814 100644
+--- a/fs/ksmbd/smbacl.c
++++ b/fs/ksmbd/smbacl.c
+@@ -1105,6 +1105,7 @@ int smb_inherit_dacl(struct ksmbd_conn *conn,
+               struct smb_acl *pdacl;
+               struct smb_sid *powner_sid = NULL, *pgroup_sid = NULL;
+               int powner_sid_size = 0, pgroup_sid_size = 0, pntsd_size;
++              int pntsd_alloc_size;
+               if (parent_pntsd->osidoffset) {
+                       powner_sid = (struct smb_sid *)((char *)parent_pntsd +
+@@ -1117,9 +1118,10 @@ int smb_inherit_dacl(struct ksmbd_conn *conn,
+                       pgroup_sid_size = 1 + 1 + 6 + (pgroup_sid->num_subauth * 4);
+               }
+-              pntsd = kzalloc(sizeof(struct smb_ntsd) + powner_sid_size +
+-                              pgroup_sid_size + sizeof(struct smb_acl) +
+-                              nt_size, GFP_KERNEL);
++              pntsd_alloc_size = sizeof(struct smb_ntsd) + powner_sid_size +
++                      pgroup_sid_size + sizeof(struct smb_acl) + nt_size;
++
++              pntsd = kzalloc(pntsd_alloc_size, GFP_KERNEL);
+               if (!pntsd) {
+                       rc = -ENOMEM;
+                       goto free_aces_base;
+@@ -1134,6 +1136,27 @@ int smb_inherit_dacl(struct ksmbd_conn *conn,
+               pntsd->gsidoffset = parent_pntsd->gsidoffset;
+               pntsd->dacloffset = parent_pntsd->dacloffset;
++              if ((u64)le32_to_cpu(pntsd->osidoffset) + powner_sid_size >
++                  pntsd_alloc_size) {
++                      rc = -EINVAL;
++                      kfree(pntsd);
++                      goto free_aces_base;
++              }
++
++              if ((u64)le32_to_cpu(pntsd->gsidoffset) + pgroup_sid_size >
++                  pntsd_alloc_size) {
++                      rc = -EINVAL;
++                      kfree(pntsd);
++                      goto free_aces_base;
++              }
++
++              if ((u64)le32_to_cpu(pntsd->dacloffset) + sizeof(struct smb_acl) + nt_size >
++                  pntsd_alloc_size) {
++                      rc = -EINVAL;
++                      kfree(pntsd);
++                      goto free_aces_base;
++              }
++
+               if (pntsd->osidoffset) {
+                       struct smb_sid *owner_sid = (struct smb_sid *)((char *)pntsd +
+                                       le32_to_cpu(pntsd->osidoffset));
+-- 
+2.42.0
+
diff --git a/queue-5.15/powerpc-pseries-ddw-simplify-enable_ddw.patch b/queue-5.15/powerpc-pseries-ddw-simplify-enable_ddw.patch
new file mode 100644 (file)
index 0000000..90b0a79
--- /dev/null
@@ -0,0 +1,80 @@
+From 43c7548c2667c29992a03b80208d4d73beab7daa Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 8 Nov 2021 15:03:18 +1100
+Subject: powerpc/pseries/ddw: simplify enable_ddw()
+
+From: Alexey Kardashevskiy <aik@ozlabs.ru>
+
+[ Upstream commit fb4ee2b30cd09e95524640149e4ee0d7f22c3e7b ]
+
+This drops rather useless ddw_enabled flag as direct_mapping implies
+it anyway.
+
+While at this, fix indents in enable_ddw().
+
+This should not cause any behavioral change.
+
+Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Link: https://lore.kernel.org/r/20211108040320.3857636-3-aik@ozlabs.ru
+Stable-dep-of: 3bf983e4e93c ("powerpc/pseries/iommu: enable_ddw incorrectly returns direct mapping for SR-IOV device")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/powerpc/platforms/pseries/iommu.c | 11 ++++-------
+ 1 file changed, 4 insertions(+), 7 deletions(-)
+
+diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
+index ec5d84b4958c5..aa5f8074e9b10 100644
+--- a/arch/powerpc/platforms/pseries/iommu.c
++++ b/arch/powerpc/platforms/pseries/iommu.c
+@@ -1241,7 +1241,6 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn)
+       u32 ddw_avail[DDW_APPLICABLE_SIZE];
+       struct dma_win *window;
+       struct property *win64;
+-      bool ddw_enabled = false;
+       struct failed_ddw_pdn *fpdn;
+       bool default_win_removed = false, direct_mapping = false;
+       bool pmem_present;
+@@ -1256,7 +1255,6 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn)
+       if (find_existing_ddw(pdn, &dev->dev.archdata.dma_offset, &len)) {
+               direct_mapping = (len >= max_ram_len);
+-              ddw_enabled = true;
+               goto out_unlock;
+       }
+@@ -1411,8 +1409,8 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn)
+                       dev_info(&dev->dev, "failed to map DMA window for %pOF: %d\n",
+                                dn, ret);
+-              /* Make sure to clean DDW if any TCE was set*/
+-              clean_dma_window(pdn, win64->value);
++                      /* Make sure to clean DDW if any TCE was set*/
++                      clean_dma_window(pdn, win64->value);
+                       goto out_del_list;
+               }
+       } else {
+@@ -1459,7 +1457,6 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn)
+       spin_unlock(&dma_win_list_lock);
+       dev->dev.archdata.dma_offset = win_addr;
+-      ddw_enabled = true;
+       goto out_unlock;
+ out_del_list:
+@@ -1495,10 +1492,10 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn)
+        * as RAM, then we failed to create a window to cover persistent
+        * memory and need to set the DMA limit.
+        */
+-      if (pmem_present && ddw_enabled && direct_mapping && len == max_ram_len)
++      if (pmem_present && direct_mapping && len == max_ram_len)
+               dev->dev.bus_dma_limit = dev->dev.archdata.dma_offset + (1ULL << len);
+-    return ddw_enabled && direct_mapping;
++      return direct_mapping;
+ }
+ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
+-- 
+2.42.0
+
diff --git a/queue-5.15/powerpc-pseries-iommu-enable_ddw-incorrectly-returns.patch b/queue-5.15/powerpc-pseries-iommu-enable_ddw-incorrectly-returns.patch
new file mode 100644 (file)
index 0000000..278d044
--- /dev/null
@@ -0,0 +1,74 @@
+From df6fb58a767fd174a6fdcc76ce2b86124b567419 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 2 Oct 2023 22:08:02 -0500
+Subject: powerpc/pseries/iommu: enable_ddw incorrectly returns direct mapping
+ for SR-IOV device
+
+From: Gaurav Batra <gbatra@linux.vnet.ibm.com>
+
+[ Upstream commit 3bf983e4e93ce8e6d69e9d63f52a66ec0856672e ]
+
+When a device is initialized, the driver invokes dma_supported() twice -
+first for streaming mappings followed by coherent mappings. For an
+SR-IOV device, default window is deleted and DDW created. With vPMEM
+enabled, TCE mappings are dynamically created for both vPMEM and SR-IOV
+device.  There are no direct mappings.
+
+First time when dma_supported() is called with 64 bit mask, DDW is created
+and marked as dynamic window. The second time dma_supported() is called,
+enable_ddw() finds existing window for the device and incorrectly returns
+it as "direct mapping".
+
+This only happens when size of DDW is big enough to map max LPAR memory.
+
+This results in streaming TCEs to not get dynamically mapped, since code
+incorrently assumes these are already pre-mapped. The adapter initially
+comes up but goes down due to EEH.
+
+Fixes: 381ceda88c4c ("powerpc/pseries/iommu: Make use of DDW for indirect mapping")
+Cc: stable@vger.kernel.org # v5.15+
+Signed-off-by: Gaurav Batra <gbatra@linux.vnet.ibm.com>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Link: https://msgid.link/20231003030802.47914-1-gbatra@linux.vnet.ibm.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/powerpc/platforms/pseries/iommu.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
+index aa5f8074e9b10..bee61292de23b 100644
+--- a/arch/powerpc/platforms/pseries/iommu.c
++++ b/arch/powerpc/platforms/pseries/iommu.c
+@@ -891,7 +891,8 @@ static int remove_ddw(struct device_node *np, bool remove_prop, const char *win_
+       return 0;
+ }
+-static bool find_existing_ddw(struct device_node *pdn, u64 *dma_addr, int *window_shift)
++static bool find_existing_ddw(struct device_node *pdn, u64 *dma_addr, int *window_shift,
++                            bool *direct_mapping)
+ {
+       struct dma_win *window;
+       const struct dynamic_dma_window_prop *dma64;
+@@ -904,6 +905,7 @@ static bool find_existing_ddw(struct device_node *pdn, u64 *dma_addr, int *windo
+                       dma64 = window->prop;
+                       *dma_addr = be64_to_cpu(dma64->dma_base);
+                       *window_shift = be32_to_cpu(dma64->window_shift);
++                      *direct_mapping = window->direct;
+                       found = true;
+                       break;
+               }
+@@ -1253,10 +1255,8 @@ static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn)
+       mutex_lock(&dma_win_init_mutex);
+-      if (find_existing_ddw(pdn, &dev->dev.archdata.dma_offset, &len)) {
+-              direct_mapping = (len >= max_ram_len);
++      if (find_existing_ddw(pdn, &dev->dev.archdata.dma_offset, &len, &direct_mapping))
+               goto out_unlock;
+-      }
+       /*
+        * If we already went through this for a previous function of
+-- 
+2.42.0
+
diff --git a/queue-5.15/regmap-ensure-range-selector-registers-are-updated-a.patch b/queue-5.15/regmap-ensure-range-selector-registers-are-updated-a.patch
new file mode 100644 (file)
index 0000000..e267f71
--- /dev/null
@@ -0,0 +1,95 @@
+From 7fd9b1e6246b0853d02e64b75cde5631d134a5cc Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 26 Oct 2023 16:49:19 +0100
+Subject: regmap: Ensure range selector registers are updated after cache sync
+
+From: Mark Brown <broonie@kernel.org>
+
+[ Upstream commit 0ec7731655de196bc1e4af99e495b38778109d22 ]
+
+When we sync the register cache we do so with the cache bypassed in order
+to avoid overhead from writing the synced values back into the cache. If
+the regmap has ranges and the selector register for those ranges is in a
+register which is cached this has the unfortunate side effect of meaning
+that the physical and cached copies of the selector register can be out of
+sync after a cache sync. The cache will have whatever the selector was when
+the sync started and the hardware will have the selector for the register
+that was synced last.
+
+Fix this by rewriting all cached selector registers after every sync,
+ensuring that the hardware and cache have the same content. This will
+result in extra writes that wouldn't otherwise be needed but is simple
+so hopefully robust. We don't read from the hardware since not all
+devices have physical read support.
+
+Given that nobody noticed this until now it is likely that we are rarely if
+ever hitting this case.
+
+Reported-by: Hector Martin <marcan@marcan.st>
+Cc: stable@vger.kernel.org
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Link: https://lore.kernel.org/r/20231026-regmap-fix-selector-sync-v1-1-633ded82770d@kernel.org
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/base/regmap/regcache.c | 30 ++++++++++++++++++++++++++++++
+ 1 file changed, 30 insertions(+)
+
+diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
+index 0b517a83c4493..b04e8c90aca20 100644
+--- a/drivers/base/regmap/regcache.c
++++ b/drivers/base/regmap/regcache.c
+@@ -325,6 +325,11 @@ static int regcache_default_sync(struct regmap *map, unsigned int min,
+       return 0;
+ }
++static int rbtree_all(const void *key, const struct rb_node *node)
++{
++      return 0;
++}
++
+ /**
+  * regcache_sync - Sync the register cache with the hardware.
+  *
+@@ -342,6 +347,7 @@ int regcache_sync(struct regmap *map)
+       unsigned int i;
+       const char *name;
+       bool bypass;
++      struct rb_node *node;
+       if (WARN_ON(map->cache_type == REGCACHE_NONE))
+               return -EINVAL;
+@@ -386,6 +392,30 @@ int regcache_sync(struct regmap *map)
+       map->async = false;
+       map->cache_bypass = bypass;
+       map->no_sync_defaults = false;
++
++      /*
++       * If we did any paging with cache bypassed and a cached
++       * paging register then the register and cache state might
++       * have gone out of sync, force writes of all the paging
++       * registers.
++       */
++      rb_for_each(node, 0, &map->range_tree, rbtree_all) {
++              struct regmap_range_node *this =
++                      rb_entry(node, struct regmap_range_node, node);
++
++              /* If there's nothing in the cache there's nothing to sync */
++              ret = regcache_read(map, this->selector_reg, &i);
++              if (ret != 0)
++                      continue;
++
++              ret = _regmap_write(map, this->selector_reg, i);
++              if (ret != 0) {
++                      dev_err(map->dev, "Failed to write %x = %x: %d\n",
++                              this->selector_reg, i, ret);
++                      break;
++              }
++      }
++
+       map->unlock(map->lock_arg);
+       regmap_async_complete(map);
+-- 
+2.42.0
+
diff --git a/queue-5.15/serial-meson-use-platform_get_irq-to-get-the-interru.patch b/queue-5.15/serial-meson-use-platform_get_irq-to-get-the-interru.patch
new file mode 100644 (file)
index 0000000..4a4a500
--- /dev/null
@@ -0,0 +1,69 @@
+From f365a310f65daf3666352285250605530f4ebebe Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 24 Dec 2021 14:29:10 +0000
+Subject: serial: meson: Use platform_get_irq() to get the interrupt
+
+From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
+
+[ Upstream commit 5b68061983471470d4109bac776145245f06bc09 ]
+
+platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
+allocation of IRQ resources in DT core code, this causes an issue
+when using hierarchical interrupt domains using "interrupts" property
+in the node as this bypasses the hierarchical setup and messes up the
+irq chaining.
+
+In preparation for removal of static setup of IRQ resource from DT core
+code use platform_get_irq().
+
+Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
+Link: https://lore.kernel.org/r/20211224142917.6966-5-prabhakar.mahadev-lad.rj@bp.renesas.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Stable-dep-of: 2a1d728f20ed ("tty: serial: meson: fix hard LOCKUP on crtscts mode")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/tty/serial/meson_uart.c | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
+index 62e6c1af13445..b6e8db0ddf065 100644
+--- a/drivers/tty/serial/meson_uart.c
++++ b/drivers/tty/serial/meson_uart.c
+@@ -726,10 +726,11 @@ static int meson_uart_probe_clocks(struct platform_device *pdev,
+ static int meson_uart_probe(struct platform_device *pdev)
+ {
+-      struct resource *res_mem, *res_irq;
++      struct resource *res_mem;
+       struct uart_port *port;
+       u32 fifosize = 64; /* Default is 64, 128 for EE UART_0 */
+       int ret = 0;
++      int irq;
+       if (pdev->dev.of_node)
+               pdev->id = of_alias_get_id(pdev->dev.of_node, "serial");
+@@ -752,9 +753,9 @@ static int meson_uart_probe(struct platform_device *pdev)
+       if (!res_mem)
+               return -ENODEV;
+-      res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+-      if (!res_irq)
+-              return -ENODEV;
++      irq = platform_get_irq(pdev, 0);
++      if (irq < 0)
++              return irq;
+       of_property_read_u32(pdev->dev.of_node, "fifo-size", &fifosize);
+@@ -779,7 +780,7 @@ static int meson_uart_probe(struct platform_device *pdev)
+       port->iotype = UPIO_MEM;
+       port->mapbase = res_mem->start;
+       port->mapsize = resource_size(res_mem);
+-      port->irq = res_irq->start;
++      port->irq = irq;
+       port->flags = UPF_BOOT_AUTOCONF | UPF_LOW_LATENCY;
+       port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_MESON_CONSOLE);
+       port->dev = &pdev->dev;
+-- 
+2.42.0
+
index c0ef5c42e23524d01292e583ab5670e4f6db6321..359f99ac95ddd47d36e984113c2efe1e1030db05 100644 (file)
@@ -233,3 +233,21 @@ i3c-master-svc-fix-wrong-data-return-when-ibi-happen-during-start-frame.patch
 i3c-master-svc-fix-ibi-may-not-return-mandatory-data-byte.patch
 i3c-master-svc-fix-check-wrong-status-register-in-irq-handler.patch
 i3c-master-svc-fix-sda-keep-low-when-polling-ibiwon-timeout-happen.patch
+serial-meson-use-platform_get_irq-to-get-the-interru.patch
+tty-serial-meson-fix-hard-lockup-on-crtscts-mode.patch
+regmap-ensure-range-selector-registers-are-updated-a.patch
+cpufreq-stats-fix-buffer-overflow-detection-in-trans.patch
+bluetooth-btusb-add-realtek-rtl8852be-support-id-0x0.patch
+bluetooth-add-device-0bda-887b-to-device-tables.patch
+bluetooth-add-device-13d3-3571-to-device-tables.patch
+bluetooth-btusb-add-rtw8852be-device-13d3-3570-to-de.patch
+bluetooth-btusb-add-0bda-b85b-for-fn-link-rtl8852be.patch
+ksmbd-fix-slab-out-of-bounds-write-in-smb_inherit_da.patch
+arm64-dts-qcom-ipq6018-switch-tcsr-mutex-to-mmio.patch
+arm64-dts-qcom-ipq6018-fix-tcsr_mutex-register-size.patch
+driver-core-move-driver_sysfs_remove-after-driver_sy.patch
+driver-core-refactor-multiple-copies-of-device-clean.patch
+driver-core-add-dma_cleanup-callback-in-bus_type.patch
+driver-core-release-all-resources-during-unbind-befo.patch
+powerpc-pseries-ddw-simplify-enable_ddw.patch
+powerpc-pseries-iommu-enable_ddw-incorrectly-returns.patch
diff --git a/queue-5.15/tty-serial-meson-fix-hard-lockup-on-crtscts-mode.patch b/queue-5.15/tty-serial-meson-fix-hard-lockup-on-crtscts-mode.patch
new file mode 100644 (file)
index 0000000..28fd626
--- /dev/null
@@ -0,0 +1,101 @@
+From a31fb8d08fe9f59d0644ae1905ecee43634ae89a Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 14 Oct 2023 11:39:26 +0000
+Subject: tty: serial: meson: fix hard LOCKUP on crtscts mode
+
+From: Pavel Krasavin <pkrasavin@imaqliq.com>
+
+[ Upstream commit 2a1d728f20edeee7f26dc307ed9df4e0d23947ab ]
+
+There might be hard lockup if we set crtscts mode on port without RTS/CTS configured:
+
+# stty -F /dev/ttyAML6 crtscts; echo 1 > /dev/ttyAML6; echo 2 > /dev/ttyAML6
+[   95.890386] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
+[   95.890857] rcu:     3-...0: (201 ticks this GP) idle=e33c/1/0x4000000000000000 softirq=5844/5846 fqs=4984
+[   95.900212] rcu:     (detected by 2, t=21016 jiffies, g=7753, q=296 ncpus=4)
+[   95.906972] Task dump for CPU 3:
+[   95.910178] task:bash            state:R  running task     stack:0     pid:205   ppid:1      flags:0x00000202
+[   95.920059] Call trace:
+[   95.922485]  __switch_to+0xe4/0x168
+[   95.925951]  0xffffff8003477508
+[   95.974379] watchdog: Watchdog detected hard LOCKUP on cpu 3
+[   95.974424] Modules linked in: 88x2cs(O) rtc_meson_vrtc
+
+Possible solution would be to not allow to setup crtscts on such port.
+
+Tested on S905X3 based board.
+
+Fixes: ff7693d079e5 ("ARM: meson: serial: add MesonX SoC on-chip uart driver")
+Cc: stable@vger.kernel.org
+Signed-off-by: Pavel Krasavin <pkrasavin@imaqliq.com>
+Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
+Reviewed-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
+
+v6: stable tag added
+v5: https://lore.kernel.org/lkml/OF43DA36FF.2BD3BB21-ON00258A47.005A8125-00258A47.005A9513@gdc.ru/
+added missed Reviewed-by tags, Fixes tag added according to Dmitry and Neil notes
+v4: https://lore.kernel.org/lkml/OF55521400.7512350F-ON00258A47.003F7254-00258A47.0040E15C@gdc.ru/
+More correct patch subject according to Jiri's note
+v3: https://lore.kernel.org/lkml/OF6CF5FFA0.CCFD0E8E-ON00258A46.00549EDF-00258A46.0054BB62@gdc.ru/
+"From:" line added to the mail
+v2: https://lore.kernel.org/lkml/OF950BEF72.7F425944-ON00258A46.00488A76-00258A46.00497D44@gdc.ru/
+braces for single statement removed according to Dmitry's note
+v1: https://lore.kernel.org/lkml/OF28B2B8C9.5BC0CD28-ON00258A46.0037688F-00258A46.0039155B@gdc.ru/
+Link: https://lore.kernel.org/r/OF66360032.51C36182-ON00258A48.003F656B-00258A48.0040092C@gdc.ru
+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/tty/serial/meson_uart.c | 14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
+index b6e8db0ddf065..7e653d681ac01 100644
+--- a/drivers/tty/serial/meson_uart.c
++++ b/drivers/tty/serial/meson_uart.c
+@@ -368,10 +368,14 @@ static void meson_uart_set_termios(struct uart_port *port,
+       else
+               val |= AML_UART_STOP_BIT_1SB;
+-      if (cflags & CRTSCTS)
+-              val &= ~AML_UART_TWO_WIRE_EN;
+-      else
++      if (cflags & CRTSCTS) {
++              if (port->flags & UPF_HARD_FLOW)
++                      val &= ~AML_UART_TWO_WIRE_EN;
++              else
++                      termios->c_cflag &= ~CRTSCTS;
++      } else {
+               val |= AML_UART_TWO_WIRE_EN;
++      }
+       writel(val, port->membase + AML_UART_CONTROL);
+@@ -731,6 +735,7 @@ static int meson_uart_probe(struct platform_device *pdev)
+       u32 fifosize = 64; /* Default is 64, 128 for EE UART_0 */
+       int ret = 0;
+       int irq;
++      bool has_rtscts;
+       if (pdev->dev.of_node)
+               pdev->id = of_alias_get_id(pdev->dev.of_node, "serial");
+@@ -758,6 +763,7 @@ static int meson_uart_probe(struct platform_device *pdev)
+               return irq;
+       of_property_read_u32(pdev->dev.of_node, "fifo-size", &fifosize);
++      has_rtscts = of_property_read_bool(pdev->dev.of_node, "uart-has-rtscts");
+       if (meson_ports[pdev->id]) {
+               dev_err(&pdev->dev, "port %d already allocated\n", pdev->id);
+@@ -782,6 +788,8 @@ static int meson_uart_probe(struct platform_device *pdev)
+       port->mapsize = resource_size(res_mem);
+       port->irq = irq;
+       port->flags = UPF_BOOT_AUTOCONF | UPF_LOW_LATENCY;
++      if (has_rtscts)
++              port->flags |= UPF_HARD_FLOW;
+       port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_MESON_CONSOLE);
+       port->dev = &pdev->dev;
+       port->line = pdev->id;
+-- 
+2.42.0
+