From: Sasha Levin Date: Wed, 4 Sep 2024 10:27:30 +0000 (-0400) Subject: Fixes for 4.19 X-Git-Tag: v6.1.109~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cd2b74b3d9c295284e128fca65d626f4714d1588;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/net-usb-qmi_wwan-add-meig-smart-srm825l.patch b/queue-4.19/net-usb-qmi_wwan-add-meig-smart-srm825l.patch new file mode 100644 index 00000000000..ca471b322d1 --- /dev/null +++ b/queue-4.19/net-usb-qmi_wwan-add-meig-smart-srm825l.patch @@ -0,0 +1,64 @@ +From 4bab5722d44dbf0924afa6f65574ceb5f9831c34 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 3 Aug 2024 15:46:51 +0800 +Subject: net: usb: qmi_wwan: add MeiG Smart SRM825L + +From: ZHANG Yuntian + +[ Upstream commit 1ca645a2f74a4290527ae27130c8611391b07dbf ] + +Add support for MeiG Smart SRM825L which is based on Qualcomm 315 chip. + +T: Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=5000 MxCh= 0 +D: Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 1 +P: Vendor=2dee ProdID=4d22 Rev= 4.14 +S: Manufacturer=MEIG +S: Product=LTE-A Module +S: SerialNumber=6f345e48 +C:* #Ifs= 6 Cfg#= 1 Atr=80 MxPwr=896mA +I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option +E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option +E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms +E: Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option +E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms +E: Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option +E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms +E: Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none) +E: Ad=05(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=88(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=50 Driver=qmi_wwan +E: Ad=89(I) Atr=03(Int.) MxPS= 8 Ivl=32ms +E: Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms + +Signed-off-by: ZHANG Yuntian +Link: https://patch.msgid.link/D1EB81385E405DFE+20240803074656.567061-1-yt@radxa.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/usb/qmi_wwan.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c +index 881240d939564..bbd5183e5e635 100644 +--- a/drivers/net/usb/qmi_wwan.c ++++ b/drivers/net/usb/qmi_wwan.c +@@ -1390,6 +1390,7 @@ static const struct usb_device_id products[] = { + {QMI_FIXED_INTF(0x2692, 0x9025, 4)}, /* Cellient MPL200 (rebranded Qualcomm 05c6:9025) */ + {QMI_QUIRK_SET_DTR(0x1546, 0x1342, 4)}, /* u-blox LARA-L6 */ + {QMI_QUIRK_SET_DTR(0x33f8, 0x0104, 4)}, /* Rolling RW101 RMNET */ ++ {QMI_FIXED_INTF(0x2dee, 0x4d22, 5)}, /* MeiG Smart SRM825L */ + + /* 4. Gobi 1000 devices */ + {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ +-- +2.43.0 + diff --git a/queue-4.19/series b/queue-4.19/series new file mode 100644 index 00000000000..45a3d11b145 --- /dev/null +++ b/queue-4.19/series @@ -0,0 +1,3 @@ +net-usb-qmi_wwan-add-meig-smart-srm825l.patch +usb-dwc3-st-add-of_node_put-before-return-in-probe-f.patch +usb-dwc3-st-add-missing-depopulate-in-probe-error-pa.patch diff --git a/queue-4.19/usb-dwc3-st-add-missing-depopulate-in-probe-error-pa.patch b/queue-4.19/usb-dwc3-st-add-missing-depopulate-in-probe-error-pa.patch new file mode 100644 index 00000000000..469bad2f193 --- /dev/null +++ b/queue-4.19/usb-dwc3-st-add-missing-depopulate-in-probe-error-pa.patch @@ -0,0 +1,57 @@ +From 8be9af81b03b44a79b2592f280b711c1ce10ed6b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 14 Aug 2024 11:39:57 +0200 +Subject: usb: dwc3: st: add missing depopulate in probe error path + +From: Krzysztof Kozlowski + +[ Upstream commit cd4897bfd14f6a5388b21ba45a066541a0425199 ] + +Depopulate device in probe error paths to fix leak of children +resources. + +Fixes: f83fca0707c6 ("usb: dwc3: add ST dwc3 glue layer to manage dwc3 HC") +Cc: stable@vger.kernel.org +Signed-off-by: Krzysztof Kozlowski +Reviewed-by: Patrice Chotard +Acked-by: Thinh Nguyen +Link: https://lore.kernel.org/r/20240814093957.37940-2-krzysztof.kozlowski@linaro.org +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/usb/dwc3/dwc3-st.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c +index 770f80f53c356..d355c784f1f18 100644 +--- a/drivers/usb/dwc3/dwc3-st.c ++++ b/drivers/usb/dwc3/dwc3-st.c +@@ -266,7 +266,7 @@ static int st_dwc3_probe(struct platform_device *pdev) + if (!child_pdev) { + dev_err(dev, "failed to find dwc3 core device\n"); + ret = -ENODEV; +- goto err_node_put; ++ goto depopulate; + } + + dwc3_data->dr_mode = usb_get_dr_mode(&child_pdev->dev); +@@ -281,6 +281,7 @@ static int st_dwc3_probe(struct platform_device *pdev) + ret = st_dwc3_drd_init(dwc3_data); + if (ret) { + dev_err(dev, "drd initialisation failed\n"); ++ of_platform_depopulate(dev); + goto undo_softreset; + } + +@@ -290,6 +291,8 @@ static int st_dwc3_probe(struct platform_device *pdev) + platform_set_drvdata(pdev, dwc3_data); + return 0; + ++depopulate: ++ of_platform_depopulate(dev); + err_node_put: + of_node_put(child); + undo_softreset: +-- +2.43.0 + diff --git a/queue-4.19/usb-dwc3-st-add-of_node_put-before-return-in-probe-f.patch b/queue-4.19/usb-dwc3-st-add-of_node_put-before-return-in-probe-f.patch new file mode 100644 index 00000000000..c001cf22f9a --- /dev/null +++ b/queue-4.19/usb-dwc3-st-add-of_node_put-before-return-in-probe-f.patch @@ -0,0 +1,74 @@ +From e37f6d26ab324bef5c69e4b7b20614c5f476e050 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 19 Aug 2019 12:54:35 +0530 +Subject: usb: dwc3: st: Add of_node_put() before return in probe function + +From: Nishka Dasgupta + +[ Upstream commit e36721b90144bb46e1b6477be3ab63439c7fb79b ] + +The local variable child in the function st_dwc3_probe takes the return +value of of_get_child_by_name, which gets a node and does not put it. If +the function returns without releasing child, this could cause a memory +error. Hence put child as soon as there is no more use for it. Also +create a new label, err_node_put, just before label undo_softreset; so +that err_node_put puts child. In between initialisation of child and its +first put, modify all statements that go to undo_softreset to now go to +err_node_put instead, from where they can fall through to +undo_softreset. +Issue found with Coccinelle. + +Reviewed-by: Patrice Chotard +Signed-off-by: Nishka Dasgupta +Signed-off-by: Felipe Balbi +Stable-dep-of: cd4897bfd14f ("usb: dwc3: st: add missing depopulate in probe error path") +Signed-off-by: Sasha Levin +--- + drivers/usb/dwc3/dwc3-st.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c +index 6127505770cec..770f80f53c356 100644 +--- a/drivers/usb/dwc3/dwc3-st.c ++++ b/drivers/usb/dwc3/dwc3-st.c +@@ -252,24 +252,25 @@ static int st_dwc3_probe(struct platform_device *pdev) + if (!child) { + dev_err(&pdev->dev, "failed to find dwc3 core node\n"); + ret = -ENODEV; +- goto undo_softreset; ++ goto err_node_put; + } + + /* Allocate and initialize the core */ + ret = of_platform_populate(node, NULL, NULL, dev); + if (ret) { + dev_err(dev, "failed to add dwc3 core\n"); +- goto undo_softreset; ++ goto err_node_put; + } + + child_pdev = of_find_device_by_node(child); + if (!child_pdev) { + dev_err(dev, "failed to find dwc3 core device\n"); + ret = -ENODEV; +- goto undo_softreset; ++ goto err_node_put; + } + + dwc3_data->dr_mode = usb_get_dr_mode(&child_pdev->dev); ++ of_node_put(child); + + /* + * Configure the USB port as device or host according to the static +@@ -289,6 +290,8 @@ static int st_dwc3_probe(struct platform_device *pdev) + platform_set_drvdata(pdev, dwc3_data); + return 0; + ++err_node_put: ++ of_node_put(child); + undo_softreset: + reset_control_assert(dwc3_data->rstc_rst); + undo_powerdown: +-- +2.43.0 +