From 0e4a052cc516ee841ecc6505cd6fdcc97e455dbe Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 19 Dec 2022 16:23:07 +0100 Subject: [PATCH] 5.10-stable patches added patches: igb-initialize-mailbox-message-for-vf-reset.patch usb-ulpi-defer-ulpi_register-on-ulpi_read_id-timeout.patch xhci-apply-xhci_reset_to_default-quirk-to-adl-n.patch --- ...tialize-mailbox-message-for-vf-reset.patch | 38 +++++++++++++++ queue-5.10/series | 3 ++ ...lpi_register-on-ulpi_read_id-timeout.patch | 43 +++++++++++++++++ ...xhci_reset_to_default-quirk-to-adl-n.patch | 48 +++++++++++++++++++ 4 files changed, 132 insertions(+) create mode 100644 queue-5.10/igb-initialize-mailbox-message-for-vf-reset.patch create mode 100644 queue-5.10/usb-ulpi-defer-ulpi_register-on-ulpi_read_id-timeout.patch create mode 100644 queue-5.10/xhci-apply-xhci_reset_to_default-quirk-to-adl-n.patch diff --git a/queue-5.10/igb-initialize-mailbox-message-for-vf-reset.patch b/queue-5.10/igb-initialize-mailbox-message-for-vf-reset.patch new file mode 100644 index 00000000000..98fd54a31f7 --- /dev/null +++ b/queue-5.10/igb-initialize-mailbox-message-for-vf-reset.patch @@ -0,0 +1,38 @@ +From de5dc44370fbd6b46bd7f1a1e00369be54a041c8 Mon Sep 17 00:00:00 2001 +From: Tony Nguyen +Date: Mon, 12 Dec 2022 11:00:31 -0800 +Subject: igb: Initialize mailbox message for VF reset + +From: Tony Nguyen + +commit de5dc44370fbd6b46bd7f1a1e00369be54a041c8 upstream. + +When a MAC address is not assigned to the VF, that portion of the message +sent to the VF is not set. The memory, however, is allocated from the +stack meaning that information may be leaked to the VM. Initialize the +message buffer to 0 so that no information is passed to the VM in this +case. + +Fixes: 6ddbc4cf1f4d ("igb: Indicate failure on vf reset for empty mac address") +Reported-by: Akihiko Odaki +Signed-off-by: Tony Nguyen +Reviewed-by: Akihiko Odaki +Reviewed-by: Leon Romanovsky +Link: https://lore.kernel.org/r/20221212190031.3983342-1-anthony.l.nguyen@intel.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/intel/igb/igb_main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/intel/igb/igb_main.c ++++ b/drivers/net/ethernet/intel/igb/igb_main.c +@@ -7416,7 +7416,7 @@ static void igb_vf_reset_msg(struct igb_ + { + struct e1000_hw *hw = &adapter->hw; + unsigned char *vf_mac = adapter->vf_data[vf].vf_mac_addresses; +- u32 reg, msgbuf[3]; ++ u32 reg, msgbuf[3] = {}; + u8 *addr = (u8 *)(&msgbuf[1]); + + /* process all the same items cleared in a function level reset */ diff --git a/queue-5.10/series b/queue-5.10/series index 15dfb79a8dc..4d0adcbfa3c 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -7,3 +7,6 @@ usb-serial-option-add-quectel-em05-g-modem.patch usb-serial-cp210x-add-kamstrup-rf-sniffer-pids.patch usb-serial-f81232-fix-division-by-zero-on-line-speed-change.patch usb-serial-f81534-fix-division-by-zero-on-line-speed-change.patch +xhci-apply-xhci_reset_to_default-quirk-to-adl-n.patch +igb-initialize-mailbox-message-for-vf-reset.patch +usb-ulpi-defer-ulpi_register-on-ulpi_read_id-timeout.patch diff --git a/queue-5.10/usb-ulpi-defer-ulpi_register-on-ulpi_read_id-timeout.patch b/queue-5.10/usb-ulpi-defer-ulpi_register-on-ulpi_read_id-timeout.patch new file mode 100644 index 00000000000..72401eba74e --- /dev/null +++ b/queue-5.10/usb-ulpi-defer-ulpi_register-on-ulpi_read_id-timeout.patch @@ -0,0 +1,43 @@ +From 8a7b31d545d3a15f0e6f5984ae16f0ca4fd76aac Mon Sep 17 00:00:00 2001 +From: Ferry Toth +Date: Mon, 5 Dec 2022 21:15:26 +0100 +Subject: usb: ulpi: defer ulpi_register on ulpi_read_id timeout + +From: Ferry Toth + +commit 8a7b31d545d3a15f0e6f5984ae16f0ca4fd76aac upstream. + +Since commit 0f0101719138 ("usb: dwc3: Don't switch OTG -> peripheral +if extcon is present") Dual Role support on Intel Merrifield platform +broke due to rearranging the call to dwc3_get_extcon(). + +It appears to be caused by ulpi_read_id() on the first test write failing +with -ETIMEDOUT. Currently ulpi_read_id() expects to discover the phy via +DT when the test write fails and returns 0 in that case, even if DT does not +provide the phy. As a result usb probe completes without phy. + +Make ulpi_read_id() return -ETIMEDOUT to its user if the first test write +fails. The user should then handle it appropriately. A follow up patch +will make dwc3_core_init() set -EPROBE_DEFER in this case and bail out. + +Fixes: ef6a7bcfb01c ("usb: ulpi: Support device discovery via DT") +Cc: stable@vger.kernel.org +Acked-by: Heikki Krogerus +Signed-off-by: Ferry Toth +Link: https://lore.kernel.org/r/20221205201527.13525-2-ftoth@exalondelft.nl +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/common/ulpi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/common/ulpi.c ++++ b/drivers/usb/common/ulpi.c +@@ -208,7 +208,7 @@ static int ulpi_read_id(struct ulpi *ulp + /* Test the interface */ + ret = ulpi_write(ulpi, ULPI_SCRATCH, 0xaa); + if (ret < 0) +- goto err; ++ return ret; + + ret = ulpi_read(ulpi, ULPI_SCRATCH); + if (ret < 0) diff --git a/queue-5.10/xhci-apply-xhci_reset_to_default-quirk-to-adl-n.patch b/queue-5.10/xhci-apply-xhci_reset_to_default-quirk-to-adl-n.patch new file mode 100644 index 00000000000..97719156cb9 --- /dev/null +++ b/queue-5.10/xhci-apply-xhci_reset_to_default-quirk-to-adl-n.patch @@ -0,0 +1,48 @@ +From fed70b61ef2c0aed54456db3d485b215f6cc3209 Mon Sep 17 00:00:00 2001 +From: Reka Norman +Date: Wed, 30 Nov 2022 11:19:40 +0200 +Subject: xhci: Apply XHCI_RESET_TO_DEFAULT quirk to ADL-N + +From: Reka Norman + +commit fed70b61ef2c0aed54456db3d485b215f6cc3209 upstream. + +ADL-N systems have the same issue as ADL-P, where a large boot firmware +delay is seen if USB ports are left in U3 at shutdown. So apply the +XHCI_RESET_TO_DEFAULT quirk to ADL-N as well. + +This patch depends on commit 34cd2db408d5 ("xhci: Add quirk to reset +host back to default state at shutdown"). + +The issue it fixes is a ~20s boot time delay when booting from S5. It +affects ADL-N devices, and ADL-N support was added starting from v5.16. + +Cc: stable@vger.kernel.org +Signed-off-by: Reka Norman +Signed-off-by: Mathias Nyman +Link: https://lore.kernel.org/r/20221130091944.2171610-3-mathias.nyman@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/host/xhci-pci.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/usb/host/xhci-pci.c ++++ b/drivers/usb/host/xhci-pci.c +@@ -59,6 +59,7 @@ + #define PCI_DEVICE_ID_INTEL_TIGER_LAKE_XHCI 0x9a13 + #define PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_XHCI 0x1138 + #define PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI 0x51ed ++#define PCI_DEVICE_ID_INTEL_ALDER_LAKE_N_PCH_XHCI 0x54ed + + #define PCI_DEVICE_ID_AMD_PROMONTORYA_4 0x43b9 + #define PCI_DEVICE_ID_AMD_PROMONTORYA_3 0x43ba +@@ -242,7 +243,8 @@ static void xhci_pci_quirks(struct devic + xhci->quirks |= XHCI_MISSING_CAS; + + if (pdev->vendor == PCI_VENDOR_ID_INTEL && +- pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI) ++ (pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI || ++ pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_N_PCH_XHCI)) + xhci->quirks |= XHCI_RESET_TO_DEFAULT; + + if (pdev->vendor == PCI_VENDOR_ID_INTEL && -- 2.47.3