From: Sasha Levin Date: Sat, 23 Sep 2023 12:16:20 +0000 (-0400) Subject: Fixes for 4.19 X-Git-Tag: v6.5.6~110 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f869081fc3b766df66c81033fc6dd196eb031065;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/ata-ahci-drop-pointless-vprintk-calls-and-convert-th.patch b/queue-4.19/ata-ahci-drop-pointless-vprintk-calls-and-convert-th.patch new file mode 100644 index 00000000000..c957f3c6bc8 --- /dev/null +++ b/queue-4.19/ata-ahci-drop-pointless-vprintk-calls-and-convert-th.patch @@ -0,0 +1,155 @@ +From 05db94f3a48285696a34e8438a7cf77ffd404010 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 21 Dec 2021 08:20:47 +0100 +Subject: ata: ahci: Drop pointless VPRINTK() calls and convert the remaining + ones + +From: Hannes Reinecke + +[ Upstream commit 93c7711494f47f9c829321e2a8711671b02f6e4c ] + +Drop pointless VPRINTK() calls for entering and existing interrupt +routines and convert the remaining calls to dev_dbg(). + +Signed-off-by: Hannes Reinecke +Signed-off-by: Damien Le Moal +Stable-dep-of: 737dd811a3db ("ata: libahci: clear pending interrupt status") +Signed-off-by: Sasha Levin +--- + drivers/ata/ahci.c | 4 +--- + drivers/ata/ahci_xgene.c | 4 ---- + drivers/ata/libahci.c | 18 ++++-------------- + 3 files changed, 5 insertions(+), 21 deletions(-) + +diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c +index 13fb983b3413e..2e4bcf2d0a514 100644 +--- a/drivers/ata/ahci.c ++++ b/drivers/ata/ahci.c +@@ -694,7 +694,7 @@ static void ahci_pci_init_controller(struct ata_host *host) + + /* clear port IRQ */ + tmp = readl(port_mmio + PORT_IRQ_STAT); +- VPRINTK("PORT_IRQ_STAT 0x%x\n", tmp); ++ dev_dbg(&pdev->dev, "PORT_IRQ_STAT 0x%x\n", tmp); + if (tmp) + writel(tmp, port_mmio + PORT_IRQ_STAT); + } +@@ -1504,7 +1504,6 @@ static irqreturn_t ahci_thunderx_irq_handler(int irq, void *dev_instance) + u32 irq_stat, irq_masked; + unsigned int handled = 1; + +- VPRINTK("ENTER\n"); + hpriv = host->private_data; + mmio = hpriv->mmio; + irq_stat = readl(mmio + HOST_IRQ_STAT); +@@ -1521,7 +1520,6 @@ static irqreturn_t ahci_thunderx_irq_handler(int irq, void *dev_instance) + irq_stat = readl(mmio + HOST_IRQ_STAT); + spin_unlock(&host->lock); + } while (irq_stat); +- VPRINTK("EXIT\n"); + + return IRQ_RETVAL(handled); + } +diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c +index 7e157e1bf65e4..04ad6a2250145 100644 +--- a/drivers/ata/ahci_xgene.c ++++ b/drivers/ata/ahci_xgene.c +@@ -601,8 +601,6 @@ static irqreturn_t xgene_ahci_irq_intr(int irq, void *dev_instance) + void __iomem *mmio; + u32 irq_stat, irq_masked; + +- VPRINTK("ENTER\n"); +- + hpriv = host->private_data; + mmio = hpriv->mmio; + +@@ -625,8 +623,6 @@ static irqreturn_t xgene_ahci_irq_intr(int irq, void *dev_instance) + + spin_unlock(&host->lock); + +- VPRINTK("EXIT\n"); +- + return IRQ_RETVAL(rc); + } + +diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c +index f1153e7ba3b3a..00eef92e91e57 100644 +--- a/drivers/ata/libahci.c ++++ b/drivers/ata/libahci.c +@@ -1226,12 +1226,12 @@ static void ahci_port_init(struct device *dev, struct ata_port *ap, + + /* clear SError */ + tmp = readl(port_mmio + PORT_SCR_ERR); +- VPRINTK("PORT_SCR_ERR 0x%x\n", tmp); ++ dev_dbg(dev, "PORT_SCR_ERR 0x%x\n", tmp); + writel(tmp, port_mmio + PORT_SCR_ERR); + + /* clear port IRQ */ + tmp = readl(port_mmio + PORT_IRQ_STAT); +- VPRINTK("PORT_IRQ_STAT 0x%x\n", tmp); ++ dev_dbg(dev, "PORT_IRQ_STAT 0x%x\n", tmp); + if (tmp) + writel(tmp, port_mmio + PORT_IRQ_STAT); + +@@ -1262,10 +1262,10 @@ void ahci_init_controller(struct ata_host *host) + } + + tmp = readl(mmio + HOST_CTL); +- VPRINTK("HOST_CTL 0x%x\n", tmp); ++ dev_dbg(host->dev, "HOST_CTL 0x%x\n", tmp); + writel(tmp | HOST_IRQ_EN, mmio + HOST_CTL); + tmp = readl(mmio + HOST_CTL); +- VPRINTK("HOST_CTL 0x%x\n", tmp); ++ dev_dbg(host->dev, "HOST_CTL 0x%x\n", tmp); + } + EXPORT_SYMBOL_GPL(ahci_init_controller); + +@@ -1916,8 +1916,6 @@ static irqreturn_t ahci_multi_irqs_intr_hard(int irq, void *dev_instance) + void __iomem *port_mmio = ahci_port_base(ap); + u32 status; + +- VPRINTK("ENTER\n"); +- + status = readl(port_mmio + PORT_IRQ_STAT); + writel(status, port_mmio + PORT_IRQ_STAT); + +@@ -1925,8 +1923,6 @@ static irqreturn_t ahci_multi_irqs_intr_hard(int irq, void *dev_instance) + ahci_handle_port_interrupt(ap, port_mmio, status); + spin_unlock(ap->lock); + +- VPRINTK("EXIT\n"); +- + return IRQ_HANDLED; + } + +@@ -1943,9 +1939,7 @@ u32 ahci_handle_port_intr(struct ata_host *host, u32 irq_masked) + ap = host->ports[i]; + if (ap) { + ahci_port_intr(ap); +- VPRINTK("port %u\n", i); + } else { +- VPRINTK("port %u (no irq)\n", i); + if (ata_ratelimit()) + dev_warn(host->dev, + "interrupt on disabled port %u\n", i); +@@ -1966,8 +1960,6 @@ static irqreturn_t ahci_single_level_irq_intr(int irq, void *dev_instance) + void __iomem *mmio; + u32 irq_stat, irq_masked; + +- VPRINTK("ENTER\n"); +- + hpriv = host->private_data; + mmio = hpriv->mmio; + +@@ -1995,8 +1987,6 @@ static irqreturn_t ahci_single_level_irq_intr(int irq, void *dev_instance) + + spin_unlock(&host->lock); + +- VPRINTK("EXIT\n"); +- + return IRQ_RETVAL(rc); + } + +-- +2.40.1 + diff --git a/queue-4.19/ata-libahci-clear-pending-interrupt-status.patch b/queue-4.19/ata-libahci-clear-pending-interrupt-status.patch new file mode 100644 index 00000000000..3765fa89c3b --- /dev/null +++ b/queue-4.19/ata-libahci-clear-pending-interrupt-status.patch @@ -0,0 +1,101 @@ +From 1c8ccf25c37e1cb26067a070e6a654f22c4bcdf1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 7 Sep 2023 16:17:10 +0800 +Subject: ata: libahci: clear pending interrupt status + +From: Szuying Chen + +[ Upstream commit 737dd811a3dbfd7edd4ad2ba5152e93d99074f83 ] + +When a CRC error occurs, the HBA asserts an interrupt to indicate an +interface fatal error (PxIS.IFS). The ISR clears PxIE and PxIS, then +does error recovery. If the adapter receives another SDB FIS +with an error (PxIS.TFES) from the device before the start of the EH +recovery process, the interrupt signaling the new SDB cannot be +serviced as PxIE was cleared already. This in turn results in the HBA +inability to issue any command during the error recovery process after +setting PxCMD.ST to 1 because PxIS.TFES is still set. + +According to AHCI 1.3.1 specifications section 6.2.2, fatal errors +notified by setting PxIS.HBFS, PxIS.HBDS, PxIS.IFS or PxIS.TFES will +cause the HBA to enter the ERR:Fatal state. In this state, the HBA +shall not issue any new commands. + +To avoid this situation, introduce the function +ahci_port_clear_pending_irq() to clear pending interrupts before +executing a COMRESET. This follows the AHCI 1.3.1 - section 6.2.2.2 +specification. + +Signed-off-by: Szuying Chen +Fixes: e0bfd149973d ("[PATCH] ahci: stop engine during hard reset") +Cc: stable@vger.kernel.org +Reviewed-by: Niklas Cassel +Signed-off-by: Damien Le Moal +Signed-off-by: Sasha Levin +--- + drivers/ata/libahci.c | 35 +++++++++++++++++++++++------------ + 1 file changed, 23 insertions(+), 12 deletions(-) + +diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c +index 00eef92e91e57..b93fad6939dac 100644 +--- a/drivers/ata/libahci.c ++++ b/drivers/ata/libahci.c +@@ -1210,6 +1210,26 @@ static ssize_t ahci_activity_show(struct ata_device *dev, char *buf) + return sprintf(buf, "%d\n", emp->blink_policy); + } + ++static void ahci_port_clear_pending_irq(struct ata_port *ap) ++{ ++ struct ahci_host_priv *hpriv = ap->host->private_data; ++ void __iomem *port_mmio = ahci_port_base(ap); ++ u32 tmp; ++ ++ /* clear SError */ ++ tmp = readl(port_mmio + PORT_SCR_ERR); ++ dev_dbg(ap->host->dev, "PORT_SCR_ERR 0x%x\n", tmp); ++ writel(tmp, port_mmio + PORT_SCR_ERR); ++ ++ /* clear port IRQ */ ++ tmp = readl(port_mmio + PORT_IRQ_STAT); ++ dev_dbg(ap->host->dev, "PORT_IRQ_STAT 0x%x\n", tmp); ++ if (tmp) ++ writel(tmp, port_mmio + PORT_IRQ_STAT); ++ ++ writel(1 << ap->port_no, hpriv->mmio + HOST_IRQ_STAT); ++} ++ + static void ahci_port_init(struct device *dev, struct ata_port *ap, + int port_no, void __iomem *mmio, + void __iomem *port_mmio) +@@ -1224,18 +1244,7 @@ static void ahci_port_init(struct device *dev, struct ata_port *ap, + if (rc) + dev_warn(dev, "%s (%d)\n", emsg, rc); + +- /* clear SError */ +- tmp = readl(port_mmio + PORT_SCR_ERR); +- dev_dbg(dev, "PORT_SCR_ERR 0x%x\n", tmp); +- writel(tmp, port_mmio + PORT_SCR_ERR); +- +- /* clear port IRQ */ +- tmp = readl(port_mmio + PORT_IRQ_STAT); +- dev_dbg(dev, "PORT_IRQ_STAT 0x%x\n", tmp); +- if (tmp) +- writel(tmp, port_mmio + PORT_IRQ_STAT); +- +- writel(1 << port_no, mmio + HOST_IRQ_STAT); ++ ahci_port_clear_pending_irq(ap); + + /* mark esata ports */ + tmp = readl(port_mmio + PORT_CMD); +@@ -1565,6 +1574,8 @@ int ahci_do_hardreset(struct ata_link *link, unsigned int *class, + tf.command = ATA_BUSY; + ata_tf_to_fis(&tf, 0, 0, d2h_fis); + ++ ahci_port_clear_pending_irq(ap); ++ + rc = sata_link_hardreset(link, timing, deadline, online, + ahci_check_ready); + +-- +2.40.1 + diff --git a/queue-4.19/nfs-pnfs-report-einval-errors-from-connect-to-the-se.patch b/queue-4.19/nfs-pnfs-report-einval-errors-from-connect-to-the-se.patch new file mode 100644 index 00000000000..e1adc097e51 --- /dev/null +++ b/queue-4.19/nfs-pnfs-report-einval-errors-from-connect-to-the-se.patch @@ -0,0 +1,36 @@ +From e801a8f5f574f5624dd2aa9489c2fad7dc762e32 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 4 Sep 2023 12:43:58 -0400 +Subject: NFS/pNFS: Report EINVAL errors from connect() to the server + +From: Trond Myklebust + +[ Upstream commit dd7d7ee3ba2a70d12d02defb478790cf57d5b87b ] + +With IPv6, connect() can occasionally return EINVAL if a route is +unavailable. If this happens during I/O to a data server, we want to +report it using LAYOUTERROR as an inability to connect. + +Fixes: dd52128afdde ("NFSv4.1/pnfs Ensure flexfiles reports all connection related errors") +Signed-off-by: Trond Myklebust +Signed-off-by: Anna Schumaker +Signed-off-by: Sasha Levin +--- + fs/nfs/flexfilelayout/flexfilelayout.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c +index fee421da21975..bb10f2b21cc1d 100644 +--- a/fs/nfs/flexfilelayout/flexfilelayout.c ++++ b/fs/nfs/flexfilelayout/flexfilelayout.c +@@ -1189,6 +1189,7 @@ static void ff_layout_io_track_ds_error(struct pnfs_layout_segment *lseg, + case -EPFNOSUPPORT: + case -EPROTONOSUPPORT: + case -EOPNOTSUPP: ++ case -EINVAL: + case -ECONNREFUSED: + case -ECONNRESET: + case -EHOSTDOWN: +-- +2.40.1 + diff --git a/queue-4.19/series b/queue-4.19/series new file mode 100644 index 00000000000..7392b38919f --- /dev/null +++ b/queue-4.19/series @@ -0,0 +1,3 @@ +nfs-pnfs-report-einval-errors-from-connect-to-the-se.patch +ata-ahci-drop-pointless-vprintk-calls-and-convert-th.patch +ata-libahci-clear-pending-interrupt-status.patch