From: Greg Kroah-Hartman Date: Sun, 9 Mar 2025 20:31:04 +0000 (+0100) Subject: 5.4-stable patches X-Git-Tag: v5.4.291~87 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b1e203ae478a4d2cc0586703937a9c0531bc1adc;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: revert-drivers-card_reader-rtsx_usb-restore-interrupt-based-detection.patch usb-atm-cxacru-fix-a-flaw-in-existing-endpoint-checks.patch usb-gadget-check-bmattributes-only-if-configuration-is-valid.patch usb-gadget-fix-setting-self-powered-state-on-suspend.patch usb-gadget-set-self-powered-based-on-maxpower-and-bmattributes.patch usb-quirks-add-delay_init-and-no_lpm-for-prolific-mass-storage-card-reader.patch usb-renesas_usbhs-call-clk_put.patch usb-renesas_usbhs-flush-the-notify_hotplug_work.patch usb-renesas_usbhs-use-devm_usb_get_phy.patch usb-typec-tcpci_rt1711h-unmask-alert-interrupts-to-fix-functionality.patch usb-typec-ucsi-increase-timeout-for-ppm-reset-operations.patch --- diff --git a/queue-5.4/revert-drivers-card_reader-rtsx_usb-restore-interrupt-based-detection.patch b/queue-5.4/revert-drivers-card_reader-rtsx_usb-restore-interrupt-based-detection.patch new file mode 100644 index 0000000000..2685345d88 --- /dev/null +++ b/queue-5.4/revert-drivers-card_reader-rtsx_usb-restore-interrupt-based-detection.patch @@ -0,0 +1,59 @@ +From 2397d61ee45cddb8f3bd3a3a9840ef0f0b5aa843 Mon Sep 17 00:00:00 2001 +From: Christian Heusel +Date: Mon, 24 Feb 2025 09:32:59 +0100 +Subject: Revert "drivers/card_reader/rtsx_usb: Restore interrupt based detection" + +From: Christian Heusel + +commit 2397d61ee45cddb8f3bd3a3a9840ef0f0b5aa843 upstream. + +This reverts commit 235b630eda072d7e7b102ab346d6b8a2c028a772. + +This commit was found responsible for issues with SD card recognition, +as users had to re-insert their cards in the readers and wait for a +while. As for some people the SD card was involved in the boot process +it also caused boot failures. + +Cc: stable@vger.kernel.org +Link: https://bbs.archlinux.org/viewtopic.php?id=303321 +Fixes: 235b630eda07 ("drivers/card_reader/rtsx_usb: Restore interrupt based detection") +Reported-by: qf +Closes: https://lore.kernel.org/all/1de87dfa-1e81-45b7-8dcb-ad86c21d5352@heusel.eu +Signed-off-by: Christian Heusel +Link: https://lore.kernel.org/r/20250224-revert-sdcard-patch-v1-1-d1a457fbb796@heusel.eu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/misc/cardreader/rtsx_usb.c | 15 --------------- + 1 file changed, 15 deletions(-) + +--- a/drivers/misc/cardreader/rtsx_usb.c ++++ b/drivers/misc/cardreader/rtsx_usb.c +@@ -286,7 +286,6 @@ static int rtsx_usb_get_status_with_bulk + int rtsx_usb_get_card_status(struct rtsx_ucr *ucr, u16 *status) + { + int ret; +- u8 interrupt_val = 0; + u16 *buf; + + if (!status) +@@ -309,20 +308,6 @@ int rtsx_usb_get_card_status(struct rtsx + ret = rtsx_usb_get_status_with_bulk(ucr, status); + } + +- rtsx_usb_read_register(ucr, CARD_INT_PEND, &interrupt_val); +- /* Cross check presence with interrupts */ +- if (*status & XD_CD) +- if (!(interrupt_val & XD_INT)) +- *status &= ~XD_CD; +- +- if (*status & SD_CD) +- if (!(interrupt_val & SD_INT)) +- *status &= ~SD_CD; +- +- if (*status & MS_CD) +- if (!(interrupt_val & MS_INT)) +- *status &= ~MS_CD; +- + /* usb_control_msg may return positive when success */ + if (ret < 0) + return ret; diff --git a/queue-5.4/series b/queue-5.4/series index 0d890181a4..c474085771 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -307,3 +307,14 @@ net-timestamp-support-tcp-gso-case-for-a-few-missing.patch net-ipv6-fix-dst-ref-loop-in-ila-lwtunnel.patch net-ipv6-fix-missing-dst-ref-drop-in-ila-lwtunnel.patch gpio-rcar-fix-missing-of_node_put-call.patch +revert-drivers-card_reader-rtsx_usb-restore-interrupt-based-detection.patch +usb-renesas_usbhs-call-clk_put.patch +usb-renesas_usbhs-use-devm_usb_get_phy.patch +usb-quirks-add-delay_init-and-no_lpm-for-prolific-mass-storage-card-reader.patch +usb-renesas_usbhs-flush-the-notify_hotplug_work.patch +usb-atm-cxacru-fix-a-flaw-in-existing-endpoint-checks.patch +usb-typec-ucsi-increase-timeout-for-ppm-reset-operations.patch +usb-typec-tcpci_rt1711h-unmask-alert-interrupts-to-fix-functionality.patch +usb-gadget-set-self-powered-based-on-maxpower-and-bmattributes.patch +usb-gadget-fix-setting-self-powered-state-on-suspend.patch +usb-gadget-check-bmattributes-only-if-configuration-is-valid.patch diff --git a/queue-5.4/usb-atm-cxacru-fix-a-flaw-in-existing-endpoint-checks.patch b/queue-5.4/usb-atm-cxacru-fix-a-flaw-in-existing-endpoint-checks.patch new file mode 100644 index 0000000000..41019c62f1 --- /dev/null +++ b/queue-5.4/usb-atm-cxacru-fix-a-flaw-in-existing-endpoint-checks.patch @@ -0,0 +1,83 @@ +From c90aad369899a607cfbc002bebeafd51e31900cd Mon Sep 17 00:00:00 2001 +From: Nikita Zhandarovich +Date: Thu, 13 Feb 2025 15:22:57 +0300 +Subject: usb: atm: cxacru: fix a flaw in existing endpoint checks + +From: Nikita Zhandarovich + +commit c90aad369899a607cfbc002bebeafd51e31900cd upstream. + +Syzbot once again identified a flaw in usb endpoint checking, see [1]. +This time the issue stems from a commit authored by me (2eabb655a968 +("usb: atm: cxacru: fix endpoint checking in cxacru_bind()")). + +While using usb_find_common_endpoints() may usually be enough to +discard devices with wrong endpoints, in this case one needs more +than just finding and identifying the sufficient number of endpoints +of correct types - one needs to check the endpoint's address as well. + +Since cxacru_bind() fills URBs with CXACRU_EP_CMD address in mind, +switch the endpoint verification approach to usb_check_XXX_endpoints() +instead to fix incomplete ep testing. + +[1] Syzbot report: +usb 5-1: BOGUS urb xfer, pipe 3 != type 1 +WARNING: CPU: 0 PID: 1378 at drivers/usb/core/urb.c:504 usb_submit_urb+0xc4e/0x18c0 drivers/usb/core/urb.c:503 +... +RIP: 0010:usb_submit_urb+0xc4e/0x18c0 drivers/usb/core/urb.c:503 +... +Call Trace: + + cxacru_cm+0x3c8/0xe50 drivers/usb/atm/cxacru.c:649 + cxacru_card_status drivers/usb/atm/cxacru.c:760 [inline] + cxacru_bind+0xcf9/0x1150 drivers/usb/atm/cxacru.c:1223 + usbatm_usb_probe+0x314/0x1d30 drivers/usb/atm/usbatm.c:1058 + cxacru_usb_probe+0x184/0x220 drivers/usb/atm/cxacru.c:1377 + usb_probe_interface+0x641/0xbb0 drivers/usb/core/driver.c:396 + really_probe+0x2b9/0xad0 drivers/base/dd.c:658 + __driver_probe_device+0x1a2/0x390 drivers/base/dd.c:800 + driver_probe_device+0x50/0x430 drivers/base/dd.c:830 +... + +Reported-and-tested-by: syzbot+ccbbc229a024fa3e13b5@syzkaller.appspotmail.com +Closes: https://syzkaller.appspot.com/bug?extid=ccbbc229a024fa3e13b5 +Fixes: 2eabb655a968 ("usb: atm: cxacru: fix endpoint checking in cxacru_bind()") +Cc: stable@kernel.org +Signed-off-by: Nikita Zhandarovich +Link: https://lore.kernel.org/r/20250213122259.730772-1-n.zhandarovich@fintech.ru +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/atm/cxacru.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +--- a/drivers/usb/atm/cxacru.c ++++ b/drivers/usb/atm/cxacru.c +@@ -1135,7 +1135,10 @@ static int cxacru_bind(struct usbatm_dat + struct cxacru_data *instance; + struct usb_device *usb_dev = interface_to_usbdev(intf); + struct usb_host_endpoint *cmd_ep = usb_dev->ep_in[CXACRU_EP_CMD]; +- struct usb_endpoint_descriptor *in, *out; ++ static const u8 ep_addrs[] = { ++ CXACRU_EP_CMD + USB_DIR_IN, ++ CXACRU_EP_CMD + USB_DIR_OUT, ++ 0}; + int ret; + + /* instance init */ +@@ -1183,13 +1186,11 @@ static int cxacru_bind(struct usbatm_dat + } + + if (usb_endpoint_xfer_int(&cmd_ep->desc)) +- ret = usb_find_common_endpoints(intf->cur_altsetting, +- NULL, NULL, &in, &out); ++ ret = usb_check_int_endpoints(intf, ep_addrs); + else +- ret = usb_find_common_endpoints(intf->cur_altsetting, +- &in, &out, NULL, NULL); ++ ret = usb_check_bulk_endpoints(intf, ep_addrs); + +- if (ret) { ++ if (!ret) { + usb_err(usbatm_instance, "cxacru_bind: interface has incorrect endpoints\n"); + ret = -ENODEV; + goto fail; diff --git a/queue-5.4/usb-gadget-check-bmattributes-only-if-configuration-is-valid.patch b/queue-5.4/usb-gadget-check-bmattributes-only-if-configuration-is-valid.patch new file mode 100644 index 0000000000..54549f124e --- /dev/null +++ b/queue-5.4/usb-gadget-check-bmattributes-only-if-configuration-is-valid.patch @@ -0,0 +1,32 @@ +From 8e812e9355a6f14dffd54a33d951ca403b9732f5 Mon Sep 17 00:00:00 2001 +From: Prashanth K +Date: Mon, 24 Feb 2025 14:26:04 +0530 +Subject: usb: gadget: Check bmAttributes only if configuration is valid + +From: Prashanth K + +commit 8e812e9355a6f14dffd54a33d951ca403b9732f5 upstream. + +If the USB configuration is not valid, then avoid checking for +bmAttributes to prevent null pointer deference. + +Cc: stable +Fixes: 40e89ff5750f ("usb: gadget: Set self-powered based on MaxPower and bmAttributes") +Signed-off-by: Prashanth K +Link: https://lore.kernel.org/r/20250224085604.417327-1-prashanth.k@oss.qualcomm.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/gadget/composite.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/gadget/composite.c ++++ b/drivers/usb/gadget/composite.c +@@ -916,7 +916,7 @@ static int set_config(struct usb_composi + power = min(power, 900U); + done: + if (power > USB_SELF_POWER_VBUS_MAX_DRAW || +- !(c->bmAttributes & USB_CONFIG_ATT_SELFPOWER)) ++ (c && !(c->bmAttributes & USB_CONFIG_ATT_SELFPOWER))) + usb_gadget_clear_selfpowered(gadget); + else + usb_gadget_set_selfpowered(gadget); diff --git a/queue-5.4/usb-gadget-fix-setting-self-powered-state-on-suspend.patch b/queue-5.4/usb-gadget-fix-setting-self-powered-state-on-suspend.patch new file mode 100644 index 0000000000..59c87559a6 --- /dev/null +++ b/queue-5.4/usb-gadget-fix-setting-self-powered-state-on-suspend.patch @@ -0,0 +1,32 @@ +From c783e1258f29c5caac9eea0aea6b172870f1baf8 Mon Sep 17 00:00:00 2001 +From: Marek Szyprowski +Date: Thu, 20 Feb 2025 13:03:14 +0100 +Subject: usb: gadget: Fix setting self-powered state on suspend + +From: Marek Szyprowski + +commit c783e1258f29c5caac9eea0aea6b172870f1baf8 upstream. + +cdev->config might be NULL, so check it before dereferencing. + +CC: stable +Fixes: 40e89ff5750f ("usb: gadget: Set self-powered based on MaxPower and bmAttributes") +Signed-off-by: Marek Szyprowski +Link: https://lore.kernel.org/r/20250220120314.3614330-1-m.szyprowski@samsung.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/gadget/composite.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/usb/gadget/composite.c ++++ b/drivers/usb/gadget/composite.c +@@ -2366,7 +2366,8 @@ void composite_suspend(struct usb_gadget + + cdev->suspended = 1; + +- if (cdev->config->bmAttributes & USB_CONFIG_ATT_SELFPOWER) ++ if (cdev->config && ++ cdev->config->bmAttributes & USB_CONFIG_ATT_SELFPOWER) + usb_gadget_set_selfpowered(gadget); + + usb_gadget_vbus_draw(gadget, 2); diff --git a/queue-5.4/usb-gadget-set-self-powered-based-on-maxpower-and-bmattributes.patch b/queue-5.4/usb-gadget-set-self-powered-based-on-maxpower-and-bmattributes.patch new file mode 100644 index 0000000000..b438844f39 --- /dev/null +++ b/queue-5.4/usb-gadget-set-self-powered-based-on-maxpower-and-bmattributes.patch @@ -0,0 +1,68 @@ +From 40e89ff5750fca2c1d6da93f98a2038716bba86c Mon Sep 17 00:00:00 2001 +From: Prashanth K +Date: Mon, 17 Feb 2025 17:33:28 +0530 +Subject: usb: gadget: Set self-powered based on MaxPower and bmAttributes + +From: Prashanth K + +commit 40e89ff5750fca2c1d6da93f98a2038716bba86c upstream. + +Currently the USB gadget will be set as bus-powered based solely +on whether its bMaxPower is greater than 100mA, but this may miss +devices that may legitimately draw less than 100mA but still want +to report as bus-powered. Similarly during suspend & resume, USB +gadget is incorrectly marked as bus/self powered without checking +the bmAttributes field. Fix these by configuring the USB gadget +as self or bus powered based on bmAttributes, and explicitly set +it as bus-powered if it draws more than 100mA. + +Cc: stable +Fixes: 5e5caf4fa8d3 ("usb: gadget: composite: Inform controller driver of self-powered") +Signed-off-by: Prashanth K +Link: https://lore.kernel.org/r/20250217120328.2446639-1-prashanth.k@oss.qualcomm.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/gadget/composite.c | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +--- a/drivers/usb/gadget/composite.c ++++ b/drivers/usb/gadget/composite.c +@@ -915,10 +915,11 @@ static int set_config(struct usb_composi + else + power = min(power, 900U); + done: +- if (power <= USB_SELF_POWER_VBUS_MAX_DRAW) +- usb_gadget_set_selfpowered(gadget); +- else ++ if (power > USB_SELF_POWER_VBUS_MAX_DRAW || ++ !(c->bmAttributes & USB_CONFIG_ATT_SELFPOWER)) + usb_gadget_clear_selfpowered(gadget); ++ else ++ usb_gadget_set_selfpowered(gadget); + + usb_gadget_vbus_draw(gadget, power); + if (result >= 0 && cdev->delayed_status) +@@ -2365,7 +2366,9 @@ void composite_suspend(struct usb_gadget + + cdev->suspended = 1; + +- usb_gadget_set_selfpowered(gadget); ++ if (cdev->config->bmAttributes & USB_CONFIG_ATT_SELFPOWER) ++ usb_gadget_set_selfpowered(gadget); ++ + usb_gadget_vbus_draw(gadget, 2); + } + +@@ -2394,8 +2397,11 @@ void composite_resume(struct usb_gadget + else + maxpower = min(maxpower, 900U); + +- if (maxpower > USB_SELF_POWER_VBUS_MAX_DRAW) ++ if (maxpower > USB_SELF_POWER_VBUS_MAX_DRAW || ++ !(cdev->config->bmAttributes & USB_CONFIG_ATT_SELFPOWER)) + usb_gadget_clear_selfpowered(gadget); ++ else ++ usb_gadget_set_selfpowered(gadget); + + usb_gadget_vbus_draw(gadget, maxpower); + } diff --git a/queue-5.4/usb-quirks-add-delay_init-and-no_lpm-for-prolific-mass-storage-card-reader.patch b/queue-5.4/usb-quirks-add-delay_init-and-no_lpm-for-prolific-mass-storage-card-reader.patch new file mode 100644 index 0000000000..7e08068f31 --- /dev/null +++ b/queue-5.4/usb-quirks-add-delay_init-and-no_lpm-for-prolific-mass-storage-card-reader.patch @@ -0,0 +1,36 @@ +From ff712188daa3fe3ce7e11e530b4dca3826dae14a Mon Sep 17 00:00:00 2001 +From: Miao Li +Date: Tue, 4 Mar 2025 15:07:57 +0800 +Subject: usb: quirks: Add DELAY_INIT and NO_LPM for Prolific Mass Storage Card Reader + +From: Miao Li + +commit ff712188daa3fe3ce7e11e530b4dca3826dae14a upstream. + +When used on Huawei hisi platforms, Prolific Mass Storage Card Reader +which the VID:PID is in 067b:2731 might fail to enumerate at boot time +and doesn't work well with LPM enabled, combination quirks: + USB_QUIRK_DELAY_INIT + USB_QUIRK_NO_LPM +fixed the problems. + +Signed-off-by: Miao Li +Cc: stable +Link: https://lore.kernel.org/r/20250304070757.139473-1-limiao870622@163.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/core/quirks.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/usb/core/quirks.c ++++ b/drivers/usb/core/quirks.c +@@ -338,6 +338,10 @@ static const struct usb_device_id usb_qu + { USB_DEVICE(0x0638, 0x0a13), .driver_info = + USB_QUIRK_STRING_FETCH_255 }, + ++ /* Prolific Single-LUN Mass Storage Card Reader */ ++ { USB_DEVICE(0x067b, 0x2731), .driver_info = USB_QUIRK_DELAY_INIT | ++ USB_QUIRK_NO_LPM }, ++ + /* Saitek Cyborg Gold Joystick */ + { USB_DEVICE(0x06a3, 0x0006), .driver_info = + USB_QUIRK_CONFIG_INTF_STRINGS }, diff --git a/queue-5.4/usb-renesas_usbhs-call-clk_put.patch b/queue-5.4/usb-renesas_usbhs-call-clk_put.patch new file mode 100644 index 0000000000..fc9cd3aafb --- /dev/null +++ b/queue-5.4/usb-renesas_usbhs-call-clk_put.patch @@ -0,0 +1,37 @@ +From b5ea08aa883da05106fcc683d12489a4292d1122 Mon Sep 17 00:00:00 2001 +From: Claudiu Beznea +Date: Tue, 25 Feb 2025 13:02:46 +0200 +Subject: usb: renesas_usbhs: Call clk_put() + +From: Claudiu Beznea + +commit b5ea08aa883da05106fcc683d12489a4292d1122 upstream. + +Clocks acquired with of_clk_get() need to be freed with clk_put(). Call +clk_put() on priv->clks[0] on error path. + +Fixes: 3df0e240caba ("usb: renesas_usbhs: Add multiple clocks management") +Cc: stable +Reviewed-by: Yoshihiro Shimoda +Tested-by: Yoshihiro Shimoda +Signed-off-by: Claudiu Beznea +Link: https://lore.kernel.org/r/20250225110248.870417-2-claudiu.beznea.uj@bp.renesas.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/renesas_usbhs/common.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/usb/renesas_usbhs/common.c ++++ b/drivers/usb/renesas_usbhs/common.c +@@ -313,8 +313,10 @@ static int usbhsc_clk_get(struct device + priv->clks[1] = of_clk_get(dev_of_node(dev), 1); + if (PTR_ERR(priv->clks[1]) == -ENOENT) + priv->clks[1] = NULL; +- else if (IS_ERR(priv->clks[1])) ++ else if (IS_ERR(priv->clks[1])) { ++ clk_put(priv->clks[0]); + return PTR_ERR(priv->clks[1]); ++ } + + return 0; + } diff --git a/queue-5.4/usb-renesas_usbhs-flush-the-notify_hotplug_work.patch b/queue-5.4/usb-renesas_usbhs-flush-the-notify_hotplug_work.patch new file mode 100644 index 0000000000..45523972e0 --- /dev/null +++ b/queue-5.4/usb-renesas_usbhs-flush-the-notify_hotplug_work.patch @@ -0,0 +1,39 @@ +From 552ca6b87e3778f3dd5b87842f95138162e16c82 Mon Sep 17 00:00:00 2001 +From: Claudiu Beznea +Date: Tue, 25 Feb 2025 13:02:48 +0200 +Subject: usb: renesas_usbhs: Flush the notify_hotplug_work + +From: Claudiu Beznea + +commit 552ca6b87e3778f3dd5b87842f95138162e16c82 upstream. + +When performing continuous unbind/bind operations on the USB drivers +available on the Renesas RZ/G2L SoC, a kernel crash with the message +"Unable to handle kernel NULL pointer dereference at virtual address" +may occur. This issue points to the usbhsc_notify_hotplug() function. + +Flush the delayed work to avoid its execution when driver resources are +unavailable. + +Fixes: bc57381e6347 ("usb: renesas_usbhs: use delayed_work instead of work_struct") +Cc: stable +Reviewed-by: Yoshihiro Shimoda +Tested-by: Yoshihiro Shimoda +Signed-off-by: Claudiu Beznea +Link: https://lore.kernel.org/r/20250225110248.870417-4-claudiu.beznea.uj@bp.renesas.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/renesas_usbhs/common.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/renesas_usbhs/common.c ++++ b/drivers/usb/renesas_usbhs/common.c +@@ -779,6 +779,8 @@ static int usbhs_remove(struct platform_ + + dev_dbg(&pdev->dev, "usb remove\n"); + ++ flush_delayed_work(&priv->notify_hotplug_work); ++ + /* power off */ + if (!usbhs_get_dparam(priv, runtime_pwctrl)) + usbhsc_power_ctrl(priv, 0); diff --git a/queue-5.4/usb-renesas_usbhs-use-devm_usb_get_phy.patch b/queue-5.4/usb-renesas_usbhs-use-devm_usb_get_phy.patch new file mode 100644 index 0000000000..d082afd190 --- /dev/null +++ b/queue-5.4/usb-renesas_usbhs-use-devm_usb_get_phy.patch @@ -0,0 +1,37 @@ +From e0c92440938930e7fa7aa6362780d39cdea34449 Mon Sep 17 00:00:00 2001 +From: Claudiu Beznea +Date: Tue, 25 Feb 2025 13:02:47 +0200 +Subject: usb: renesas_usbhs: Use devm_usb_get_phy() + +From: Claudiu Beznea + +commit e0c92440938930e7fa7aa6362780d39cdea34449 upstream. + +The gpriv->transceiver is retrieved in probe() through usb_get_phy() but +never released. Use devm_usb_get_phy() to handle this scenario. + +This issue was identified through code investigation. No issue was found +without this change. + +Fixes: b5a2875605ca ("usb: renesas_usbhs: Allow an OTG PHY driver to provide VBUS") +Cc: stable +Reviewed-by: Yoshihiro Shimoda +Tested-by: Yoshihiro Shimoda +Signed-off-by: Claudiu Beznea +Link: https://lore.kernel.org/r/20250225110248.870417-3-claudiu.beznea.uj@bp.renesas.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/renesas_usbhs/mod_gadget.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/renesas_usbhs/mod_gadget.c ++++ b/drivers/usb/renesas_usbhs/mod_gadget.c +@@ -1094,7 +1094,7 @@ int usbhs_mod_gadget_probe(struct usbhs_ + goto usbhs_mod_gadget_probe_err_gpriv; + } + +- gpriv->transceiver = usb_get_phy(USB_PHY_TYPE_UNDEFINED); ++ gpriv->transceiver = devm_usb_get_phy(dev, USB_PHY_TYPE_UNDEFINED); + dev_info(dev, "%stransceiver found\n", + !IS_ERR(gpriv->transceiver) ? "" : "no "); + diff --git a/queue-5.4/usb-typec-tcpci_rt1711h-unmask-alert-interrupts-to-fix-functionality.patch b/queue-5.4/usb-typec-tcpci_rt1711h-unmask-alert-interrupts-to-fix-functionality.patch new file mode 100644 index 0000000000..90bfd5aa08 --- /dev/null +++ b/queue-5.4/usb-typec-tcpci_rt1711h-unmask-alert-interrupts-to-fix-functionality.patch @@ -0,0 +1,55 @@ +From d6b82dafd17db0658f089b9cdec573982ca82bc5 Mon Sep 17 00:00:00 2001 +From: AngeloGioacchino Del Regno +Date: Wed, 19 Feb 2025 12:47:00 +0100 +Subject: usb: typec: tcpci_rt1711h: Unmask alert interrupts to fix functionality + +From: AngeloGioacchino Del Regno + +commit d6b82dafd17db0658f089b9cdec573982ca82bc5 upstream. + +During probe, the TCPC alert interrupts are getting masked to +avoid unwanted interrupts during chip setup: this is ok to do +but there is no unmasking happening at any later time, which +means that the chip will not raise any interrupt, essentially +making it not functional as, while internally it does perform +all of the intended functions, it won't signal anything to the +outside. + +Unmask the alert interrupts to fix functionality. + +Fixes: ce08eaeb6388 ("staging: typec: rt1711h typec chip driver") +Cc: stable +Signed-off-by: AngeloGioacchino Del Regno +Link: https://lore.kernel.org/r/20250219114700.41700-1-angelogioacchino.delregno@collabora.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/typec/tcpm/tcpci_rt1711h.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/usb/typec/tcpm/tcpci_rt1711h.c ++++ b/drivers/usb/typec/tcpm/tcpci_rt1711h.c +@@ -217,6 +217,11 @@ static int rt1711h_probe(struct i2c_clie + { + int ret; + struct rt1711h_chip *chip; ++ const u16 alert_mask = TCPC_ALERT_TX_SUCCESS | TCPC_ALERT_TX_DISCARDED | ++ TCPC_ALERT_TX_FAILED | TCPC_ALERT_RX_HARD_RST | ++ TCPC_ALERT_RX_STATUS | TCPC_ALERT_POWER_STATUS | ++ TCPC_ALERT_CC_STATUS | TCPC_ALERT_RX_BUF_OVF | ++ TCPC_ALERT_FAULT; + + ret = rt1711h_check_revision(client); + if (ret < 0) { +@@ -258,6 +263,12 @@ static int rt1711h_probe(struct i2c_clie + dev_name(chip->dev), chip); + if (ret < 0) + return ret; ++ ++ /* Enable alert interrupts */ ++ ret = rt1711h_write16(chip, TCPC_ALERT_MASK, alert_mask); ++ if (ret < 0) ++ return ret; ++ + enable_irq_wake(client->irq); + + return 0; diff --git a/queue-5.4/usb-typec-ucsi-increase-timeout-for-ppm-reset-operations.patch b/queue-5.4/usb-typec-ucsi-increase-timeout-for-ppm-reset-operations.patch new file mode 100644 index 0000000000..c2b72013aa --- /dev/null +++ b/queue-5.4/usb-typec-ucsi-increase-timeout-for-ppm-reset-operations.patch @@ -0,0 +1,51 @@ +From bf4f9ae1cb08ccaafbe6874be6c46f59b83ae778 Mon Sep 17 00:00:00 2001 +From: Fedor Pchelkin +Date: Mon, 17 Feb 2025 13:54:40 +0300 +Subject: usb: typec: ucsi: increase timeout for PPM reset operations + +From: Fedor Pchelkin + +commit bf4f9ae1cb08ccaafbe6874be6c46f59b83ae778 upstream. + +It is observed that on some systems an initial PPM reset during the boot +phase can trigger a timeout: + +[ 6.482546] ucsi_acpi USBC000:00: failed to reset PPM! +[ 6.482551] ucsi_acpi USBC000:00: error -ETIMEDOUT: PPM init failed + +Still, increasing the timeout value, albeit being the most straightforward +solution, eliminates the problem: the initial PPM reset may take up to +~8000-10000ms on some Lenovo laptops. When it is reset after the above +period of time (or even if ucsi_reset_ppm() is not called overall), UCSI +works as expected. + +Moreover, if the ucsi_acpi module is loaded/unloaded manually after the +system has booted, reading the CCI values and resetting the PPM works +perfectly, without any timeout. Thus it's only a boot-time issue. + +The reason for this behavior is not clear but it may be the consequence +of some tricks that the firmware performs or be an actual firmware bug. +As a workaround, increase the timeout to avoid failing the UCSI +initialization prematurely. + +Fixes: b1b59e16075f ("usb: typec: ucsi: Increase command completion timeout value") +Cc: stable +Signed-off-by: Fedor Pchelkin +Reviewed-by: Heikki Krogerus +Link: https://lore.kernel.org/r/20250217105442.113486-3-boddah8794@gmail.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/typec/ucsi/ucsi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/typec/ucsi/ucsi.c ++++ b/drivers/usb/typec/ucsi/ucsi.c +@@ -28,7 +28,7 @@ + * difficult to estimate the time it takes for the system to process the command + * before it is actually passed to the PPM. + */ +-#define UCSI_TIMEOUT_MS 5000 ++#define UCSI_TIMEOUT_MS 10000 + + /* + * UCSI_SWAP_TIMEOUT_MS - Timeout for role swap requests