]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Apr 2022 15:35:57 +0000 (17:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Apr 2022 15:35:57 +0000 (17:35 +0200)
added patches:
scsi-libsas-fix-sas_ata_qc_issue-handling-of-ncq-non-data-commands.patch

queue-4.9/scsi-libsas-fix-sas_ata_qc_issue-handling-of-ncq-non-data-commands.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/scsi-libsas-fix-sas_ata_qc_issue-handling-of-ncq-non-data-commands.patch b/queue-4.9/scsi-libsas-fix-sas_ata_qc_issue-handling-of-ncq-non-data-commands.patch
new file mode 100644 (file)
index 0000000..09bb5a5
--- /dev/null
@@ -0,0 +1,41 @@
+From 8454563e4c2aafbfb81a383ab423ea8b9b430a25 Mon Sep 17 00:00:00 2001
+From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
+Date: Sun, 20 Feb 2022 12:17:40 +0900
+Subject: scsi: libsas: Fix sas_ata_qc_issue() handling of NCQ NON DATA commands
+
+From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
+
+commit 8454563e4c2aafbfb81a383ab423ea8b9b430a25 upstream.
+
+To detect for the DMA_NONE (no data transfer) DMA direction,
+sas_ata_qc_issue() tests if the command protocol is ATA_PROT_NODATA.  This
+test does not include the ATA_CMD_NCQ_NON_DATA command as this command
+protocol is defined as ATA_PROT_NCQ_NODATA (equal to ATA_PROT_FLAG_NCQ) and
+not as ATA_PROT_NODATA.
+
+To include both NCQ and non-NCQ commands when testing for the DMA_NONE DMA
+direction, use "!ata_is_data()".
+
+Link: https://lore.kernel.org/r/20220220031810.738362-2-damien.lemoal@opensource.wdc.com
+Fixes: 176ddd89171d ("scsi: libsas: Reset num_scatter if libata marks qc as NODATA")
+Cc: stable@vger.kernel.org
+Reviewed-by: John Garry <john.garry@huawei.com>
+Reviewed-by: Jack Wang <jinpu.wang@ionos.com>
+Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/scsi/libsas/sas_ata.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/scsi/libsas/sas_ata.c
++++ b/drivers/scsi/libsas/sas_ata.c
+@@ -220,7 +220,7 @@ static unsigned int sas_ata_qc_issue(str
+               task->total_xfer_len = qc->nbytes;
+               task->num_scatter = qc->n_elem;
+               task->data_dir = qc->dma_dir;
+-      } else if (qc->tf.protocol == ATA_PROT_NODATA) {
++      } else if (!ata_is_data(qc->tf.protocol)) {
+               task->data_dir = DMA_NONE;
+       } else {
+               for_each_sg(qc->sg, sg, qc->n_elem, si)
index 3ccf0f8cc0567e95fedbb18dba2bd1cff6c5b324..4aabbac5c41a3c214a78c3d1a1925acf4bd8bb23 100644 (file)
@@ -20,3 +20,4 @@ jffs2-fix-memory-leak-in-jffs2_do_mount_fs.patch
 jffs2-fix-memory-leak-in-jffs2_scan_medium.patch
 mm-pages_alloc.c-don-t-create-zone_movable-beyond-the-end-of-a-node.patch
 mempolicy-mbind_range-set_policy-after-vma_merge.patch
+scsi-libsas-fix-sas_ata_qc_issue-handling-of-ncq-non-data-commands.patch