From 4ddfa59f17c7250f0d7d0eae5a9c6a935a7d19a9 Mon Sep 17 00:00:00 2001 From: Denis Kirjanov Date: Feb 22 2024 13:16:31 +0000 Subject: Merge branch 'users/oneukum/SLE12-SP5/for-next' into SLE12-SP5 Pull usb driver fixes and blacklist update from Oliver Neukum --- diff --git a/blacklist.conf b/blacklist.conf index 69bc745..4e6fbfa 100644 --- a/blacklist.conf +++ b/blacklist.conf @@ -3108,3 +3108,4 @@ ef97e774713fcd34c45f7a7426c7d8845394f7be # documentation only 4a9762aa358ee0e3deb6e759959f092a3cea86be # outdated comments only 3bd57b90554b4bb82dce638e0668ef9dc95d3e96 # not enabled e198987e7dd7d3645a53875151cd6f8fc425b706 # already applied +b2ce5617dad254230551feda3599f2cc68e53ad8 # cleanup designed to break kABI diff --git a/patches.suse/PCI-Prevent-xHCI-driver-from-claiming-AMD-VanGogh-US.patch b/patches.suse/PCI-Prevent-xHCI-driver-from-claiming-AMD-VanGogh-US.patch new file mode 100644 index 0000000..3cacd29 --- /dev/null +++ b/patches.suse/PCI-Prevent-xHCI-driver-from-claiming-AMD-VanGogh-US.patch @@ -0,0 +1,63 @@ +From 7e6f3b6d2c352b5fde37ce3fed83bdf6172eebd4 Mon Sep 17 00:00:00 2001 +From: Vicki Pfau +Date: Wed, 27 Sep 2023 13:22:12 -0700 +Subject: [PATCH] PCI: Prevent xHCI driver from claiming AMD VanGogh USB3 DRD + device +Git-commit: 7e6f3b6d2c352b5fde37ce3fed83bdf6172eebd4 +References: git-fixes +Patch-mainline: v6.7-rc1 + +The AMD VanGogh SoC contains a DesignWare USB3 Dual-Role Device that can be +operated as either a USB Host or a USB Device, similar to on the AMD Nolan +platform. + +be6646bfbaec ("PCI: Prevent xHCI driver from claiming AMD Nolan USB3 DRD +device") added a quirk to let the dwc3 driver claim the Nolan device since +it provides more specific support. + +Extend that quirk to include the VanGogh SoC USB3 device. + +Link: https://lore.kernel.org/r/20230927202212.2388216-1-vi@endrift.com +Signed-off-by: Vicki Pfau +[bhelgaas: include be6646bfbaec reference, add stable tag] +Signed-off-by: Bjorn Helgaas +Cc: stable@vger.kernel.org # v3.19+ +Signed-off-by: Oliver Neukum + +--- + drivers/pci/quirks.c | 6 ++++-- + include/linux/pci_ids.h | 1 + + 2 files changed, 5 insertions(+), 2 deletions(-) + +--- a/drivers/pci/quirks.c ++++ b/drivers/pci/quirks.c +@@ -437,7 +437,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AT + * defines as "USB device (not host controller)". The dwc3 driver can then + * claim it based on its Vendor and Device ID. + */ +-static void quirk_amd_nl_class(struct pci_dev *pdev) ++static void quirk_amd_dwc_class(struct pci_dev *pdev) + { + u32 class = pdev->class; + +@@ -447,7 +447,9 @@ static void quirk_amd_nl_class(struct pc + class, pdev->class); + } + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB, +- quirk_amd_nl_class); ++ quirk_amd_dwc_class); ++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VANGOGH_USB, ++ quirk_amd_dwc_class); + + /* + * Let's make the southbridge information explicit instead +--- a/include/linux/pci_ids.h ++++ b/include/linux/pci_ids.h +@@ -546,6 +546,7 @@ + #define PCI_DEVICE_ID_AMD_17H_M70H_DF_F3 0x1443 + #define PCI_DEVICE_ID_AMD_19H_DF_F3 0x1653 + #define PCI_DEVICE_ID_AMD_CNB17H_F3 0x1703 ++#define PCI_DEVICE_ID_AMD_VANGOGH_USB 0x163a + #define PCI_DEVICE_ID_AMD_LANCE 0x2000 + #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 + #define PCI_DEVICE_ID_AMD_SCSI 0x2020 diff --git a/patches.suse/USB-hub-check-for-alternate-port-before-enabling-A_A.patch b/patches.suse/USB-hub-check-for-alternate-port-before-enabling-A_A.patch new file mode 100644 index 0000000..dd113c8 --- /dev/null +++ b/patches.suse/USB-hub-check-for-alternate-port-before-enabling-A_A.patch @@ -0,0 +1,85 @@ +From f17c34ffc792bbb520e4b61baa16b6cfc7d44b13 Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Mon, 22 Jan 2024 16:35:32 +0100 +Subject: [PATCH] USB: hub: check for alternate port before enabling + A_ALT_HNP_SUPPORT +Mime-version: 1.0 +Content-type: text/plain; charset=UTF-8 +Content-transfer-encoding: 8bit +Git-commit: f17c34ffc792bbb520e4b61baa16b6cfc7d44b13 +References: bsc#1218527 +Patch-mainline: v6.8-rc3 + +The OTG 1.3 spec has the feature A_ALT_HNP_SUPPORT, which tells +a device that it is connected to the wrong port. Some devices +refuse to operate if you enable that feature, because it indicates +to them that they ought to request to be connected to another port. + +According to the spec this feature may be used based only the following +three conditions: + +6.5.3 a_alt_hnp_support +Setting this feature indicates to the B-device that it is connected to +an A-device port that is not capable of HNP, but that the A-device does +have an alternate port that is capable of HNP. +The A-device is required to set this feature under the following conditions: +• the A-device has multiple receptacles +• the A-device port that connects to the B-device does not support HNP +• the A-device has another port that does support HNP + +A check for the third and first condition is missing. Add it. + +Signed-off-by: Oliver Neukum +Cc: stable +Fixes: 7d2d641c44269 ("usb: otg: don't set a_alt_hnp_support feature for OTG 2.0 device") +Link: https://lore.kernel.org/r/20240122153545.12284-1-oneukum@suse.com +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/core/hub.c | 30 +++++++++++++++++++----------- + 1 file changed, 19 insertions(+), 11 deletions(-) + +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c +index 48409d51ea43..e38a4124f610 100644 +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -2398,17 +2398,25 @@ static int usb_enumerate_device_otg(struct usb_device *udev) + } + } else if (desc->bLength == sizeof + (struct usb_otg_descriptor)) { +- /* Set a_alt_hnp_support for legacy otg device */ +- err = usb_control_msg(udev, +- usb_sndctrlpipe(udev, 0), +- USB_REQ_SET_FEATURE, 0, +- USB_DEVICE_A_ALT_HNP_SUPPORT, +- 0, NULL, 0, +- USB_CTRL_SET_TIMEOUT); +- if (err < 0) +- dev_err(&udev->dev, +- "set a_alt_hnp_support failed: %d\n", +- err); ++ /* ++ * We are operating on a legacy OTP device ++ * These should be told that they are operating ++ * on the wrong port if we have another port that does ++ * support HNP ++ */ ++ if (bus->otg_port != 0) { ++ /* Set a_alt_hnp_support for legacy otg device */ ++ err = usb_control_msg(udev, ++ usb_sndctrlpipe(udev, 0), ++ USB_REQ_SET_FEATURE, 0, ++ USB_DEVICE_A_ALT_HNP_SUPPORT, ++ 0, NULL, 0, ++ USB_CTRL_SET_TIMEOUT); ++ if (err < 0) ++ dev_err(&udev->dev, ++ "set a_alt_hnp_support failed: %d\n", ++ err); ++ } + } + } + #endif +-- +2.43.0 + diff --git a/patches.suse/usb-host-fotg210-fix-the-actual_length-of-an-iso-pac.patch b/patches.suse/usb-host-fotg210-fix-the-actual_length-of-an-iso-pac.patch new file mode 100644 index 0000000..ec80861 --- /dev/null +++ b/patches.suse/usb-host-fotg210-fix-the-actual_length-of-an-iso-pac.patch @@ -0,0 +1,60 @@ +From 091cb2f782f32ab68c6f5f326d7868683d3d4875 Mon Sep 17 00:00:00 2001 +From: Kelly Devilliv +Date: Sun, 27 Jun 2021 20:57:47 +0800 +Subject: [PATCH] usb: host: fotg210: fix the actual_length of an iso packet +Git-commit: 091cb2f782f32ab68c6f5f326d7868683d3d4875 +References: git-fixes +Patch-mainline: v5.15-rc1 + +We should acquire the actual_length of an iso packet +from the iTD directly using FOTG210_ITD_LENGTH() macro. + +Signed-off-by: Kelly Devilliv +Link: https://lore.kernel.org/r/20210627125747.127646-4-kelly.devilliv@gmail.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Oliver Neukum + +--- + drivers/usb/host/fotg210-hcd.c | 5 ++--- + drivers/usb/host/fotg210.h | 5 ----- + 2 files changed, 2 insertions(+), 8 deletions(-) + +diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c +index 629b35384e85..4b02ace09f3d 100644 +--- a/drivers/usb/host/fotg210-hcd.c ++++ b/drivers/usb/host/fotg210-hcd.c +@@ -4463,13 +4463,12 @@ static bool itd_complete(struct fotg210_hcd *fotg210, struct fotg210_itd *itd) + + /* HC need not update length with this error */ + if (!(t & FOTG210_ISOC_BABBLE)) { +- desc->actual_length = +- fotg210_itdlen(urb, desc, t); ++ desc->actual_length = FOTG210_ITD_LENGTH(t); + urb->actual_length += desc->actual_length; + } + } else if (likely((t & FOTG210_ISOC_ACTIVE) == 0)) { + desc->status = 0; +- desc->actual_length = fotg210_itdlen(urb, desc, t); ++ desc->actual_length = FOTG210_ITD_LENGTH(t); + urb->actual_length += desc->actual_length; + } else { + /* URB was too late */ +diff --git a/drivers/usb/host/fotg210.h b/drivers/usb/host/fotg210.h +index 0a91061a0551..0781442b7a24 100644 +--- a/drivers/usb/host/fotg210.h ++++ b/drivers/usb/host/fotg210.h +@@ -683,11 +683,6 @@ static inline unsigned fotg210_read_frame_index(struct fotg210_hcd *fotg210) + return fotg210_readl(fotg210, &fotg210->regs->frame_index); + } + +-#define fotg210_itdlen(urb, desc, t) ({ \ +- usb_pipein((urb)->pipe) ? \ +- (desc)->length - FOTG210_ITD_LENGTH(t) : \ +- FOTG210_ITD_LENGTH(t); \ +-}) + /*-------------------------------------------------------------------------*/ + + #endif /* __LINUX_FOTG210_H */ +-- +2.43.0 + diff --git a/patches.suse/usb-host-fotg210-fix-the-endpoint-s-transactional-op.patch b/patches.suse/usb-host-fotg210-fix-the-endpoint-s-transactional-op.patch new file mode 100644 index 0000000..5e8fea4 --- /dev/null +++ b/patches.suse/usb-host-fotg210-fix-the-endpoint-s-transactional-op.patch @@ -0,0 +1,143 @@ +From c2e898764245c852bc8ee4857613ba4f3a6d761d Mon Sep 17 00:00:00 2001 +From: Kelly Devilliv +Date: Sun, 27 Jun 2021 20:57:46 +0800 +Subject: [PATCH] usb: host: fotg210: fix the endpoint's transactional + opportunities calculation +Git-commit: c2e898764245c852bc8ee4857613ba4f3a6d761d +References: git-fixes +Patch-mainline: v5.15-rc1 + +Now that usb_endpoint_maxp() only returns the lowest +11 bits from wMaxPacketSize, we should make use of the +usb_endpoint_* helpers instead and remove the unnecessary +max_packet()/hb_mult() macro. + +Signed-off-by: Kelly Devilliv +Link: https://lore.kernel.org/r/20210627125747.127646-3-kelly.devilliv@gmail.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Oliver Neukum + +--- + drivers/usb/host/fotg210-hcd.c | 36 ++++++++++++++++------------------ + 1 file changed, 17 insertions(+), 19 deletions(-) + +diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c +index 7858e930446a..629b35384e85 100644 +--- a/drivers/usb/host/fotg210-hcd.c ++++ b/drivers/usb/host/fotg210-hcd.c +@@ -2512,11 +2512,6 @@ static unsigned qh_completions(struct fotg210_hcd *fotg210, + return count; + } + +-/* high bandwidth multiplier, as encoded in highspeed endpoint descriptors */ +-#define hb_mult(wMaxPacketSize) (1 + (((wMaxPacketSize) >> 11) & 0x03)) +-/* ... and packet size, for any kind of endpoint descriptor */ +-#define max_packet(wMaxPacketSize) ((wMaxPacketSize) & 0x07ff) +- + /* reverse of qh_urb_transaction: free a list of TDs. + * used for cleanup after errors, before HC sees an URB's TDs. + */ +@@ -2602,7 +2597,7 @@ static struct list_head *qh_urb_transaction(struct fotg210_hcd *fotg210, + token |= (1 /* "in" */ << 8); + /* else it's already initted to "out" pid (0 << 8) */ + +- maxpacket = max_packet(usb_maxpacket(urb->dev, urb->pipe, !is_input)); ++ maxpacket = usb_maxpacket(urb->dev, urb->pipe, !is_input); + + /* + * buffer gets wrapped in one or more qtds; +@@ -2716,9 +2711,11 @@ static struct fotg210_qh *qh_make(struct fotg210_hcd *fotg210, struct urb *urb, + gfp_t flags) + { + struct fotg210_qh *qh = fotg210_qh_alloc(fotg210, flags); ++ struct usb_host_endpoint *ep; + u32 info1 = 0, info2 = 0; + int is_input, type; + int maxp = 0; ++ int mult; + struct usb_tt *tt = urb->dev->tt; + struct fotg210_qh_hw *hw; + +@@ -2733,14 +2730,15 @@ static struct fotg210_qh *qh_make(struct fotg210_hcd *fotg210, struct urb *urb, + + is_input = usb_pipein(urb->pipe); + type = usb_pipetype(urb->pipe); +- maxp = usb_maxpacket(urb->dev, urb->pipe, !is_input); ++ ep = usb_pipe_endpoint(urb->dev, urb->pipe); ++ maxp = usb_endpoint_maxp(&ep->desc); ++ mult = usb_endpoint_maxp_mult(&ep->desc); + + /* 1024 byte maxpacket is a hardware ceiling. High bandwidth + * acts like up to 3KB, but is built from smaller packets. + */ +- if (max_packet(maxp) > 1024) { +- fotg210_dbg(fotg210, "bogus qh maxpacket %d\n", +- max_packet(maxp)); ++ if (maxp > 1024) { ++ fotg210_dbg(fotg210, "bogus qh maxpacket %d\n", maxp); + goto done; + } + +@@ -2754,8 +2752,7 @@ static struct fotg210_qh *qh_make(struct fotg210_hcd *fotg210, struct urb *urb, + */ + if (type == PIPE_INTERRUPT) { + qh->usecs = NS_TO_US(usb_calc_bus_time(USB_SPEED_HIGH, +- is_input, 0, +- hb_mult(maxp) * max_packet(maxp))); ++ is_input, 0, mult * maxp)); + qh->start = NO_FRAME; + + if (urb->dev->speed == USB_SPEED_HIGH) { +@@ -2792,7 +2789,7 @@ static struct fotg210_qh *qh_make(struct fotg210_hcd *fotg210, struct urb *urb, + think_time = tt ? tt->think_time : 0; + qh->tt_usecs = NS_TO_US(think_time + + usb_calc_bus_time(urb->dev->speed, +- is_input, 0, max_packet(maxp))); ++ is_input, 0, maxp)); + qh->period = urb->interval; + if (qh->period > fotg210->periodic_size) { + qh->period = fotg210->periodic_size; +@@ -2855,11 +2852,11 @@ static struct fotg210_qh *qh_make(struct fotg210_hcd *fotg210, struct urb *urb, + * to help them do so. So now people expect to use + * such nonconformant devices with Linux too; sigh. + */ +- info1 |= max_packet(maxp) << 16; ++ info1 |= maxp << 16; + info2 |= (FOTG210_TUNE_MULT_HS << 30); + } else { /* PIPE_INTERRUPT */ +- info1 |= max_packet(maxp) << 16; +- info2 |= hb_mult(maxp) << 30; ++ info1 |= maxp << 16; ++ info2 |= mult << 30; + } + break; + default: +@@ -3929,6 +3926,7 @@ static void iso_stream_init(struct fotg210_hcd *fotg210, + int is_input; + long bandwidth; + unsigned multi; ++ struct usb_host_endpoint *ep; + + /* + * this might be a "high bandwidth" highspeed endpoint, +@@ -3936,14 +3934,14 @@ static void iso_stream_init(struct fotg210_hcd *fotg210, + */ + epnum = usb_pipeendpoint(pipe); + is_input = usb_pipein(pipe) ? USB_DIR_IN : 0; +- maxp = usb_maxpacket(dev, pipe, !is_input); ++ ep = usb_pipe_endpoint(dev, pipe); ++ maxp = usb_endpoint_maxp(&ep->desc); + if (is_input) + buf1 = (1 << 11); + else + buf1 = 0; + +- maxp = max_packet(maxp); +- multi = hb_mult(maxp); ++ multi = usb_endpoint_maxp_mult(&ep->desc); + buf1 |= maxp; + maxp *= multi; + +-- +2.43.0 + diff --git a/patches.suse/usb-musb-dsps-Fix-the-probe-error-path.patch b/patches.suse/usb-musb-dsps-Fix-the-probe-error-path.patch new file mode 100644 index 0000000..ea9a350 --- /dev/null +++ b/patches.suse/usb-musb-dsps-Fix-the-probe-error-path.patch @@ -0,0 +1,71 @@ +From c2115b2b16421d93d4993f3fe4c520e91d6fe801 Mon Sep 17 00:00:00 2001 +From: Miquel Raynal +Date: Wed, 6 Oct 2021 00:16:31 +0200 +Subject: [PATCH] usb: musb: dsps: Fix the probe error path +Git-commit: c2115b2b16421d93d4993f3fe4c520e91d6fe801 +References: git-fixes +Patch-mainline: v5.15-rc6 + +Commit 7c75bde329d7 ("usb: musb: musb_dsps: request_irq() after +initializing musb") has inverted the calls to +dsps_setup_optional_vbus_irq() and dsps_create_musb_pdev() without +updating correctly the error path. dsps_create_musb_pdev() allocates and +registers a new platform device which must be unregistered and freed +with platform_device_unregister(), and this is missing upon +dsps_setup_optional_vbus_irq() error. + +While on the master branch it seems not to trigger any issue, I observed +a kernel crash because of a NULL pointer dereference with a v5.10.70 +stable kernel where the patch mentioned above was backported. With this +kernel version, -EPROBE_DEFER is returned the first time +dsps_setup_optional_vbus_irq() is called which triggers the probe to +error out without unregistering the platform device. Unfortunately, on +the Beagle Bone Black Wireless, the platform device still living in the +system is being used by the USB Ethernet gadget driver, which during the +boot phase triggers the crash. + +My limited knowledge of the musb world prevents me to revert this commit +which was sent to silence a robot warning which, as far as I understand, +does not make sense. The goal of this patch was to prevent an IRQ to +fire before the platform device being registered. I think this cannot +ever happen due to the fact that enabling the interrupts is done by the +->enable() callback of the platform musb device, and this platform +device must be already registered in order for the core or any other +user to use this callback. + +Hence, I decided to fix the error path, which might prevent future +errors on mainline kernels while also fixing older ones. + +Fixes: 7c75bde329d7 ("usb: musb: musb_dsps: request_irq() after initializing musb") +Cc: stable@vger.kernel.org +Signed-off-by: Miquel Raynal +Link: https://lore.kernel.org/r/20211005221631.1529448-1-miquel.raynal@bootlin.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Oliver Neukum + +--- + drivers/usb/musb/musb_dsps.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c +index ce9fc46c9266..b5935834f9d2 100644 +--- a/drivers/usb/musb/musb_dsps.c ++++ b/drivers/usb/musb/musb_dsps.c +@@ -899,11 +899,13 @@ static int dsps_probe(struct platform_device *pdev) + if (usb_get_dr_mode(&pdev->dev) == USB_DR_MODE_PERIPHERAL) { + ret = dsps_setup_optional_vbus_irq(pdev, glue); + if (ret) +- goto err; ++ goto unregister_pdev; + } + + return 0; + ++unregister_pdev: ++ platform_device_unregister(glue->musb); + err: + pm_runtime_disable(&pdev->dev); + iounmap(glue->usbss_base); +-- +2.43.0 + diff --git a/patches.suse/usb-musb-musb_dsps-request_irq-after-initializing-mu.patch b/patches.suse/usb-musb-musb_dsps-request_irq-after-initializing-mu.patch new file mode 100644 index 0000000..174f521 --- /dev/null +++ b/patches.suse/usb-musb-musb_dsps-request_irq-after-initializing-mu.patch @@ -0,0 +1,63 @@ +From 7c75bde329d7e2a93cf86a5c15c61f96f1446cdc Mon Sep 17 00:00:00 2001 +From: Nadezda Lutovinova +Date: Thu, 19 Aug 2021 19:33:23 +0300 +Subject: [PATCH] usb: musb: musb_dsps: request_irq() after initializing musb +Git-commit: 7c75bde329d7e2a93cf86a5c15c61f96f1446cdc +References: git-fixes +Patch-mainline: v5.15-rc1 + +If IRQ occurs between calling dsps_setup_optional_vbus_irq() +and dsps_create_musb_pdev(), then null pointer dereference occurs +since glue->musb wasn't initialized yet. + +The patch puts initializing of neccesery data before registration +of the interrupt handler. + +Found by Linux Driver Verification project (linuxtesting.org). + +Signed-off-by: Nadezda Lutovinova +Link: https://lore.kernel.org/r/20210819163323.17714-1-lutovinova@ispras.ru +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Oliver Neukum + +--- + drivers/usb/musb/musb_dsps.c | 13 ++++++------- + 1 file changed, 6 insertions(+), 7 deletions(-) + +diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c +index 5892f3ce0cdc..ce9fc46c9266 100644 +--- a/drivers/usb/musb/musb_dsps.c ++++ b/drivers/usb/musb/musb_dsps.c +@@ -890,23 +890,22 @@ static int dsps_probe(struct platform_device *pdev) + if (!glue->usbss_base) + return -ENXIO; + +- if (usb_get_dr_mode(&pdev->dev) == USB_DR_MODE_PERIPHERAL) { +- ret = dsps_setup_optional_vbus_irq(pdev, glue); +- if (ret) +- goto err_iounmap; +- } +- + platform_set_drvdata(pdev, glue); + pm_runtime_enable(&pdev->dev); + ret = dsps_create_musb_pdev(glue, pdev); + if (ret) + goto err; + ++ if (usb_get_dr_mode(&pdev->dev) == USB_DR_MODE_PERIPHERAL) { ++ ret = dsps_setup_optional_vbus_irq(pdev, glue); ++ if (ret) ++ goto err; ++ } ++ + return 0; + + err: + pm_runtime_disable(&pdev->dev); +-err_iounmap: + iounmap(glue->usbss_base); + return ret; + } +-- +2.43.0 + diff --git a/patches.suse/usb-musb-tusb6010-check-return-value-after-calling-p.patch b/patches.suse/usb-musb-tusb6010-check-return-value-after-calling-p.patch new file mode 100644 index 0000000..3e505e8 --- /dev/null +++ b/patches.suse/usb-musb-tusb6010-check-return-value-after-calling-p.patch @@ -0,0 +1,40 @@ +From 14651496a3de6807a17c310f63c894ea0c5d858e Mon Sep 17 00:00:00 2001 +From: Yang Yingliang +Date: Wed, 15 Sep 2021 11:49:25 +0800 +Subject: [PATCH] usb: musb: tusb6010: check return value after calling + platform_get_resource() +Git-commit: 14651496a3de6807a17c310f63c894ea0c5d858e +References: git-fixes +Patch-mainline: v5.16-rc1 + +It will cause null-ptr-deref if platform_get_resource() returns NULL, +we need check the return value. + +Signed-off-by: Yang Yingliang +Link: https://lore.kernel.org/r/20210915034925.2399823-1-yangyingliang@huawei.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Oliver Neukum + +--- + drivers/usb/musb/tusb6010.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c +index c42937692207..e0347780907f 100644 +--- a/drivers/usb/musb/tusb6010.c ++++ b/drivers/usb/musb/tusb6010.c +@@ -1103,6 +1103,11 @@ static int tusb_musb_init(struct musb *musb) + + /* dma address for async dma */ + mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ if (!mem) { ++ pr_debug("no async dma resource?\n"); ++ ret = -ENODEV; ++ goto done; ++ } + musb->async = mem->start; + + /* dma address for sync dma */ +-- +2.43.0 + diff --git a/patches.suse/usb-typec-tcpci-clear-the-fault-status-bit.patch b/patches.suse/usb-typec-tcpci-clear-the-fault-status-bit.patch new file mode 100644 index 0000000..262a4b7 --- /dev/null +++ b/patches.suse/usb-typec-tcpci-clear-the-fault-status-bit.patch @@ -0,0 +1,58 @@ +From 23e60c8daf5ec2ab1b731310761b668745fcf6ed Mon Sep 17 00:00:00 2001 +From: Marco Felsch +Date: Wed, 16 Aug 2023 14:25:02 -0300 +Subject: [PATCH] usb: typec: tcpci: clear the fault status bit +Git-commit: 23e60c8daf5ec2ab1b731310761b668745fcf6ed +References: git-fixes +Patch-mainline: v6.6-rc1 + +According the "USB Type-C Port Controller Interface Specification v2.0" +the TCPC sets the fault status register bit-7 +(AllRegistersResetToDefault) once the registers have been reset to +their default values. + +This triggers an alert(-irq) on PTN5110 devices albeit we do mask the +fault-irq, which may cause a kernel hang. Fix this generically by writing +a one to the corresponding bit-7. + +Cc: stable@vger.kernel.org +Fixes: 74e656d6b055 ("staging: typec: Type-C Port Controller Interface driver (tcpci)") +Reported-by: "Angus Ainslie (Purism)" +Closes: https://lore.kernel.org/all/20190508002749.14816-2-angus@akkea.ca/ +Reported-by: Christian Bach +Closes: https://lore.kernel.org/regressions/ZR0P278MB07737E5F1D48632897D51AC3EB329@ZR0P278MB0773.CHEP278.PROD.OUTLOOK.COM/t/ +Signed-off-by: Marco Felsch +Signed-off-by: Fabio Estevam +Reviewed-by: Guenter Roeck +Link: https://lore.kernel.org/r/20230816172502.1155079-1-festevam@gmail.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Oliver Neukum + +--- + drivers/usb/typec/tcpm/tcpci.c | 4 ++++ + drivers/usb/typec/tcpm/tcpci.h | 1 + + 2 files changed, 5 insertions(+) + +--- a/drivers/usb/typec/tcpm/tcpci.c ++++ b/drivers/usb/typec/tcpm/tcpci.c +@@ -376,6 +376,10 @@ static int tcpci_init(struct tcpc_dev *t + if (time_after(jiffies, timeout)) + return -ETIMEDOUT; + ++ ret = tcpci_write16(tcpci, TCPC_FAULT_STATUS, TCPC_FAULT_STATUS_ALL_REG_RST_TO_DEFAULT); ++ if (ret < 0) ++ return ret; ++ + /* Handle vendor init */ + if (tcpci->data->init) { + ret = tcpci->data->init(tcpci, tcpci->data); +--- a/drivers/usb/typec/tcpm/tcpci.h ++++ b/drivers/usb/typec/tcpm/tcpci.h +@@ -80,6 +80,7 @@ + #define TCPC_POWER_STATUS_VBUS_PRES BIT(2) + + #define TCPC_FAULT_STATUS 0x1f ++#define TCPC_FAULT_STATUS_ALL_REG_RST_TO_DEFAULT BIT(7) + + #define TCPC_COMMAND 0x23 + #define TCPC_CMD_WAKE_I2C 0x11 diff --git a/series.conf b/series.conf index 7ebddd2..c94e91d 100644 --- a/series.conf +++ b/series.conf @@ -62013,7 +62013,10 @@ patches.suse/debugfs-Return-error-during-full-open-_proxy_open-on.patch patches.suse/tty-hvc-replace-BUG_ON-with-negative-return-value.patch patches.suse/tty-serial-fsl_lpuart-fix-the-wrong-mapbase-value.patch + patches.suse/usb-host-fotg210-fix-the-endpoint-s-transactional-op.patch + patches.suse/usb-host-fotg210-fix-the-actual_length-of-an-iso-pac.patch patches.suse/Revert-USB-xhci-fix-U1-U2-handling-for-hardware-with.patch + patches.suse/usb-musb-musb_dsps-request_irq-after-initializing-mu.patch patches.suse/usb-host-xhci-rcar-Don-t-reload-firmware-after-the-c.patch patches.suse/media-uvc-don-t-do-DMA-on-stack.patch patches.suse/media-rc-loopback-return-number-of-emitters-rather-t.patch @@ -62313,6 +62316,7 @@ patches.suse/Input-xpad-add-support-for-another-USB-ID-of-Nacon-G.patch patches.suse/USB-xhci-dbc-fix-tty-registration-race.patch patches.suse/xhci-Enable-trust-tx-length-quirk-for-Fresco-FL11-US.patch + patches.suse/usb-musb-dsps-Fix-the-probe-error-path.patch patches.suse/USB-serial-option-add-Telit-LE910Cx-composition-0x12.patch patches.suse/USB-serial-option-add-prod.-id-for-Quectel-EG91.patch patches.suse/USB-serial-option-add-Quectel-EC200S-CN-module-suppo.patch @@ -62437,6 +62441,7 @@ patches.suse/RDMA-bnxt_re-Fix-query-SRQ-failure.patch patches.suse/RDMA-mlx4-Return-missed-an-error-if-device-doesn-t-s.patch patches.suse/RDMA-qedr-Fix-NULL-deref-for-query_qp-on-the-GSI-QP.patch + patches.suse/usb-musb-tusb6010-check-return-value-after-calling-p.patch patches.suse/usb-storage-Add-compatibility-quirk-flags-for-iODD-2.patch patches.suse/USB-chipidea-fix-interrupt-deadlock.patch patches.suse/USB-iowarrior-fix-control-message-timeouts.patch @@ -64695,6 +64700,7 @@ patches.suse/NFSv4-pnfs-minor-fix-for-cleanup-path-in-nfs4_get_de.patch patches.suse/nfs-blocklayout-Use-the-passed-in-gfp-flags.patch patches.suse/NFS-Guard-against-READDIR-loop-when-entry-names-exce.patch + patches.suse/usb-typec-tcpci-clear-the-fault-status-bit.patch patches.suse/USB-serial-option-add-Quectel-EM05G-variant-0x030e.patch patches.suse/USB-serial-option-add-FOXCONN-T99W368-T99W373-produc.patch patches.suse/x86-speculation-Mark-all-Skylake-CPUs-as-vulnerable-to-GDS.patch @@ -64781,6 +64787,7 @@ patches.suse/perf-core-Fix-potential-NULL-deref.patch patches.suse/x86-cpu-hygon-Fix-the-CPU-topology-evaluation-for-real.patch patches.suse/PCI-Disable-ATS-for-specific-Intel-IPU-E2000-devices.patch + patches.suse/PCI-Prevent-xHCI-driver-from-claiming-AMD-VanGogh-US.patch patches.suse/libnvdimm-of_pmem-Use-devm_kstrdup-instead-of-kstrdu-6fd4.patch patches.suse/scsi-qla2xxx-Use-FIELD_GET-to-extract-PCIe-capabilit.patch patches.suse/s390-cmma-fix-initial-kernel-address-space-page-table-walk.patch @@ -64851,6 +64858,7 @@ patches.suse/netfilter-nf_tables-reject-QUEUE-DROP-verdict-parame.patch patches.suse/tracing-trigger-Fix-to-return-error-if-failed-to-alloc-snapshot.patch patches.suse/dm-limit-the-number-of-targets-and-parameter-size-ar.patch + patches.suse/USB-hub-check-for-alternate-port-before-enabling-A_A.patch # dhowells/linux-fs keys-uefi patches.suse/0001-KEYS-Allow-unrestricted-boot-time-addition-of-keys-t.patch