From: Greg Kroah-Hartman Date: Sun, 16 Oct 2022 11:24:52 +0000 (+0200) Subject: 4.19-stable patches X-Git-Tag: v5.4.219~142 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2fb67afe707c9c5c465caa6252b3e25f911e74d8;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: pci-sanitise-firmware-bar-assignments-behind-a-pci-pci-bridge.patch scsi-qedf-populate-sysfs-attributes-for-vport.patch --- diff --git a/queue-4.19/pci-sanitise-firmware-bar-assignments-behind-a-pci-pci-bridge.patch b/queue-4.19/pci-sanitise-firmware-bar-assignments-behind-a-pci-pci-bridge.patch new file mode 100644 index 00000000000..894eeae5542 --- /dev/null +++ b/queue-4.19/pci-sanitise-firmware-bar-assignments-behind-a-pci-pci-bridge.patch @@ -0,0 +1,102 @@ +From 0e32818397426a688f598f35d3bc762eca6d7592 Mon Sep 17 00:00:00 2001 +From: "Maciej W. Rozycki" +Date: Wed, 21 Sep 2022 20:49:16 +0100 +Subject: PCI: Sanitise firmware BAR assignments behind a PCI-PCI bridge + +From: Maciej W. Rozycki + +commit 0e32818397426a688f598f35d3bc762eca6d7592 upstream. + +When pci_assign_resource() is unable to assign resources to a BAR, it uses +pci_revert_fw_address() to fall back to a firmware assignment (if any). +Previously pci_revert_fw_address() assumed all addresses could reach the +device, but this is not true if the device is below a bridge that only +forwards addresses within its windows. + +This problem was observed on a Tyan Tomcat IV S1564D system where the BIOS +did not assign valid addresses to several bridges and USB devices: + + pci 0000:00:11.0: PCI-to-PCIe bridge to [bus 01-ff] + pci 0000:00:11.0: bridge window [io 0xe000-0xefff] + pci 0000:01:00.0: PCIe Upstream Port to [bus 02-ff] + pci 0000:01:00.0: bridge window [io 0x0000-0x0fff] # unreachable + pci 0000:02:02.0: PCIe Downstream Port to [bus 05-ff] + pci 0000:02:02.0: bridge window [io 0x0000-0x0fff] # unreachable + pci 0000:05:00.0: PCIe-to-PCI bridge to [bus 06-ff] + pci 0000:05:00.0: bridge window [io 0x0000-0x0fff] # unreachable + pci 0000:06:08.0: USB UHCI 1.1 + pci 0000:06:08.0: BAR 4: [io 0xfce0-0xfcff] # unreachable + pci 0000:06:08.1: USB UHCI 1.1 + pci 0000:06:08.1: BAR 4: [io 0xfce0-0xfcff] # unreachable + pci 0000:06:08.0: can't claim BAR 4 [io 0xfce0-0xfcff]: no compatible bridge window + pci 0000:06:08.1: can't claim BAR 4 [io 0xfce0-0xfcff]: no compatible bridge window + +During the first pass of assigning unassigned resources, there was not +enough I/O space available, so we couldn't assign the 06:08.0 BAR and +reverted to the firmware assignment (still unreachable). Reverting the +06:08.1 assignment failed because it conflicted with 06:08.0: + + pci 0000:00:11.0: bridge window [io 0xe000-0xefff] + pci 0000:01:00.0: no space for bridge window [io size 0x2000] + pci 0000:02:02.0: no space for bridge window [io size 0x1000] + pci 0000:05:00.0: no space for bridge window [io size 0x1000] + pci 0000:06:08.0: BAR 4: no space for [io size 0x0020] + pci 0000:06:08.0: BAR 4: trying firmware assignment [io 0xfce0-0xfcff] + pci 0000:06:08.1: BAR 4: no space for [io size 0x0020] + pci 0000:06:08.1: BAR 4: trying firmware assignment [io 0xfce0-0xfcff] + pci 0000:06:08.1: BAR 4: [io 0xfce0-0xfcff] conflicts with 0000:06:08.0 [io 0xfce0-0xfcff] + +A subsequent pass assigned valid bridge windows and a valid 06:08.1 BAR, +but left the 06:08.0 BAR alone, so the UHCI device was still unusable: + + pci 0000:00:11.0: bridge window [io 0xe000-0xefff] released + pci 0000:00:11.0: bridge window [io 0x1000-0x2fff] # reassigned + pci 0000:01:00.0: bridge window [io 0x1000-0x2fff] # reassigned + pci 0000:02:02.0: bridge window [io 0x2000-0x2fff] # reassigned + pci 0000:05:00.0: bridge window [io 0x2000-0x2fff] # reassigned + pci 0000:06:08.0: BAR 4: assigned [io 0xfce0-0xfcff] # left alone + pci 0000:06:08.1: BAR 4: assigned [io 0x2000-0x201f] + ... + uhci_hcd 0000:06:08.0: host system error, PCI problems? + uhci_hcd 0000:06:08.0: host controller process error, something bad happened! + uhci_hcd 0000:06:08.0: host controller halted, very bad! + uhci_hcd 0000:06:08.0: HCRESET not completed yet! + uhci_hcd 0000:06:08.0: HC died; cleaning up + +If the address assigned by firmware is not reachable because it's not +within upstream bridge windows, fail instead of assigning the unusable +address from firmware. + +[bhelgaas: commit log, use pci_upstream_bridge()] +Link: https://bugzilla.kernel.org/show_bug.cgi?id=16263 +Link: https://lore.kernel.org/r/alpine.DEB.2.21.2203012338460.46819@angie.orcam.me.uk +Link: https://lore.kernel.org/r/alpine.DEB.2.21.2209211921250.29493@angie.orcam.me.uk +Fixes: 58c84eda0756 ("PCI: fall back to original BIOS BAR addresses") +Signed-off-by: Maciej W. Rozycki +Signed-off-by: Bjorn Helgaas +Cc: stable@vger.kernel.org # v2.6.35+ +Signed-off-by: Greg Kroah-Hartman +--- + drivers/pci/setup-res.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/pci/setup-res.c ++++ b/drivers/pci/setup-res.c +@@ -209,6 +209,17 @@ static int pci_revert_fw_address(struct + + root = pci_find_parent_resource(dev, res); + if (!root) { ++ /* ++ * If dev is behind a bridge, accesses will only reach it ++ * if res is inside the relevant bridge window. ++ */ ++ if (pci_upstream_bridge(dev)) ++ return -ENXIO; ++ ++ /* ++ * On the root bus, assume the host bridge will forward ++ * everything. ++ */ + if (res->flags & IORESOURCE_IO) + root = &ioport_resource; + else diff --git a/queue-4.19/scsi-qedf-populate-sysfs-attributes-for-vport.patch b/queue-4.19/scsi-qedf-populate-sysfs-attributes-for-vport.patch new file mode 100644 index 00000000000..a684cf7d777 --- /dev/null +++ b/queue-4.19/scsi-qedf-populate-sysfs-attributes-for-vport.patch @@ -0,0 +1,54 @@ +From 592642e6b11e620e4b43189f8072752429fc8dc3 Mon Sep 17 00:00:00 2001 +From: Saurav Kashyap +Date: Mon, 19 Sep 2022 06:44:34 -0700 +Subject: scsi: qedf: Populate sysfs attributes for vport + +From: Saurav Kashyap + +commit 592642e6b11e620e4b43189f8072752429fc8dc3 upstream. + +Few vport parameters were displayed by systool as 'Unknown' or 'NULL'. +Copy speed, supported_speed, frame_size and update port_type for NPIV port. + +Link: https://lore.kernel.org/r/20220919134434.3513-1-njavali@marvell.com +Cc: stable@vger.kernel.org +Tested-by: Guangwu Zhang +Reviewed-by: John Meneghini +Signed-off-by: Saurav Kashyap +Signed-off-by: Nilesh Javali +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/qedf/qedf_main.c | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +--- a/drivers/scsi/qedf/qedf_main.c ++++ b/drivers/scsi/qedf/qedf_main.c +@@ -1667,6 +1667,27 @@ static int qedf_vport_create(struct fc_v + fc_vport_setlink(vn_port); + } + ++ /* Set symbolic node name */ ++ if (base_qedf->pdev->device == QL45xxx) ++ snprintf(fc_host_symbolic_name(vn_port->host), 256, ++ "Marvell FastLinQ 45xxx FCoE v%s", QEDF_VERSION); ++ ++ if (base_qedf->pdev->device == QL41xxx) ++ snprintf(fc_host_symbolic_name(vn_port->host), 256, ++ "Marvell FastLinQ 41xxx FCoE v%s", QEDF_VERSION); ++ ++ /* Set supported speed */ ++ fc_host_supported_speeds(vn_port->host) = n_port->link_supported_speeds; ++ ++ /* Set speed */ ++ vn_port->link_speed = n_port->link_speed; ++ ++ /* Set port type */ ++ fc_host_port_type(vn_port->host) = FC_PORTTYPE_NPIV; ++ ++ /* Set maxframe size */ ++ fc_host_maxframe_size(vn_port->host) = n_port->mfs; ++ + QEDF_INFO(&(base_qedf->dbg_ctx), QEDF_LOG_NPIV, "vn_port=%p.\n", + vn_port); + diff --git a/queue-4.19/series b/queue-4.19/series index 2e3af2f8a3a..834be5a463e 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -50,3 +50,5 @@ revert-fs-check-fmode_lseek-to-control-internal-pipe.patch parisc-fbdev-stifb-align-graphics-memory-size-to-4mb.patch riscv-allow-prot_write-only-mmap.patch um-cpuinfo-fix-a-warning-for-config_cpumask_offstack.patch +pci-sanitise-firmware-bar-assignments-behind-a-pci-pci-bridge.patch +scsi-qedf-populate-sysfs-attributes-for-vport.patch