]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Aug 2019 12:26:20 +0000 (14:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Aug 2019 12:26:20 +0000 (14:26 +0200)
added patches:
scsi-mpt3sas-use-63-bit-dma-addressing-on-sas35-hba.patch

queue-4.19/gcc-9-properly-declare-the-pv-hv-clock_page-storage.patch
queue-4.19/scsi-mpt3sas-use-63-bit-dma-addressing-on-sas35-hba.patch [new file with mode: 0644]
queue-4.19/series

index a49d049ab438f6829fe6a4de6cacc20c89667078..fdf1a6242d21af4a34045122ed292266c6b5bd56 100644 (file)
@@ -23,7 +23,7 @@ when we then access more than one byte from those variables.
 Fix this by simply making the declaration of the variables match
 reality, which makes the compiler happy too.
 
-Signed-off-by: Linus Torvalds <torvalds@-linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
 ---
diff --git a/queue-4.19/scsi-mpt3sas-use-63-bit-dma-addressing-on-sas35-hba.patch b/queue-4.19/scsi-mpt3sas-use-63-bit-dma-addressing-on-sas35-hba.patch
new file mode 100644 (file)
index 0000000..0ddb047
--- /dev/null
@@ -0,0 +1,80 @@
+From df9a606184bfdb5ae3ca9d226184e9489f5c24f7 Mon Sep 17 00:00:00 2001
+From: Suganath Prabu <suganath-prabu.subramani@broadcom.com>
+Date: Tue, 30 Jul 2019 03:43:57 -0400
+Subject: scsi: mpt3sas: Use 63-bit DMA addressing on SAS35 HBA
+
+From: Suganath Prabu <suganath-prabu.subramani@broadcom.com>
+
+commit df9a606184bfdb5ae3ca9d226184e9489f5c24f7 upstream.
+
+Although SAS3 & SAS3.5 IT HBA controllers support 64-bit DMA addressing, as
+per hardware design, if DMA-able range contains all 64-bits
+set (0xFFFFFFFF-FFFFFFFF) then it results in a firmware fault.
+
+E.g. SGE's start address is 0xFFFFFFFF-FFFF000 and data length is 0x1000
+bytes. when HBA tries to DMA the data at 0xFFFFFFFF-FFFFFFFF location then
+HBA will fault the firmware.
+
+Driver will set 63-bit DMA mask to ensure the above address will not be
+used.
+
+Cc: <stable@vger.kernel.org> # 4.19.63
+Signed-off-by: Suganath Prabu <suganath-prabu.subramani@broadcom.com>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/scsi/mpt3sas/mpt3sas_base.c |   12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
++++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
+@@ -2565,12 +2565,14 @@ _base_config_dma_addressing(struct MPT3S
+ {
+       struct sysinfo s;
+       u64 consistent_dma_mask;
++      /* Set 63 bit DMA mask for all SAS3 and SAS35 controllers */
++      int dma_mask = (ioc->hba_mpi_version_belonged > MPI2_VERSION) ? 63 : 64;
+       if (ioc->is_mcpu_endpoint)
+               goto try_32bit;
+       if (ioc->dma_mask)
+-              consistent_dma_mask = DMA_BIT_MASK(64);
++              consistent_dma_mask = DMA_BIT_MASK(dma_mask);
+       else
+               consistent_dma_mask = DMA_BIT_MASK(32);
+@@ -2578,11 +2580,11 @@ _base_config_dma_addressing(struct MPT3S
+               const uint64_t required_mask =
+                   dma_get_required_mask(&pdev->dev);
+               if ((required_mask > DMA_BIT_MASK(32)) &&
+-                  !pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) &&
++                  !pci_set_dma_mask(pdev, DMA_BIT_MASK(dma_mask)) &&
+                   !pci_set_consistent_dma_mask(pdev, consistent_dma_mask)) {
+                       ioc->base_add_sg_single = &_base_add_sg_single_64;
+                       ioc->sge_size = sizeof(Mpi2SGESimple64_t);
+-                      ioc->dma_mask = 64;
++                      ioc->dma_mask = dma_mask;
+                       goto out;
+               }
+       }
+@@ -2609,7 +2611,7 @@ static int
+ _base_change_consistent_dma_mask(struct MPT3SAS_ADAPTER *ioc,
+                                     struct pci_dev *pdev)
+ {
+-      if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) {
++      if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(ioc->dma_mask))) {
+               if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)))
+                       return -ENODEV;
+       }
+@@ -4545,7 +4547,7 @@ _base_allocate_memory_pools(struct MPT3S
+               total_sz += sz;
+       } while (ioc->rdpq_array_enable && (++i < ioc->reply_queue_count));
+-      if (ioc->dma_mask == 64) {
++      if (ioc->dma_mask > 32) {
+               if (_base_change_consistent_dma_mask(ioc, ioc->pdev) != 0) {
+                       pr_warn(MPT3SAS_FMT
+                           "no suitable consistent DMA mask for %s\n",
index e2bdc535437f5e114bd7fb78567c8776335f2fc5..5cf36a15f04ab263b9138680bf655e7c4ff42cc9 100644 (file)
@@ -71,3 +71,4 @@ arc-enable-uboot-support-unconditionally.patch
 objtool-support-gcc-9-cold-subfunction-naming-scheme.patch
 gcc-9-properly-declare-the-pv-hv-clock_page-storage.patch
 x86-vdso-prevent-segfaults-due-to-hoisted-vclock-reads.patch
+scsi-mpt3sas-use-63-bit-dma-addressing-on-sas35-hba.patch