]> Git Repo - linux.git/commitdiff
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
authorLinus Torvalds <[email protected]>
Sat, 2 Mar 2019 19:39:54 +0000 (11:39 -0800)
committerLinus Torvalds <[email protected]>
Sat, 2 Mar 2019 19:39:54 +0000 (11:39 -0800)
Pull SCSI fixes from James Bottomley:
 "Nine small fixes.

  The resume fix is a cosmetic removal of a warning with an incorrect
  condition causing it to alarm people wrongly.

  The other eight patches correct a thinko in Christoph Hellwig's DMA
  conversion series. Without it all these drivers end up with 32 bit DMA
  masks meaning they bounce any page over 4GB before sending it to the
  controller.

  Nowadays, even laptops mostly have memory above 4GB, so this can lead
  to significant performance degradation with all the bouncing"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: core: Avoid that system resume triggers a kernel warning
  scsi: hptiop: fix calls to dma_set_mask()
  scsi: hisi_sas: fix calls to dma_set_mask_and_coherent()
  scsi: csiostor: fix calls to dma_set_mask_and_coherent()
  scsi: bfa: fix calls to dma_set_mask_and_coherent()
  scsi: aic94xx: fix calls to dma_set_mask_and_coherent()
  scsi: 3w-sas: fix calls to dma_set_mask_and_coherent()
  scsi: 3w-9xxx: fix calls to dma_set_mask_and_coherent()
  scsi: lpfc: fix calls to dma_set_mask_and_coherent()

1  2 
drivers/scsi/3w-sas.c
drivers/scsi/lpfc/lpfc_init.c

diff --combined drivers/scsi/3w-sas.c
index cd096104bcec18d2f25eea1e64effe560ea38c29,2d15b878bd948dddb34f449151062fbf31d15206..dda6fa8577093d6302f35fbd9fd7a9c51eeed115
@@@ -646,9 -646,8 +646,9 @@@ static int twl_allocate_memory(TW_Devic
        unsigned long *cpu_addr;
        int retval = 1;
  
 -      cpu_addr = dma_zalloc_coherent(&tw_dev->tw_pci_dev->dev,
 -                      size * TW_Q_LENGTH, &dma_handle, GFP_KERNEL);
 +      cpu_addr = dma_alloc_coherent(&tw_dev->tw_pci_dev->dev,
 +                                    size * TW_Q_LENGTH, &dma_handle,
 +                                    GFP_KERNEL);
        if (!cpu_addr) {
                TW_PRINTK(tw_dev->host, TW_DRIVER, 0x5, "Memory allocation failed");
                goto out;
@@@ -1573,8 -1572,10 +1573,10 @@@ static int twl_probe(struct pci_dev *pd
        pci_set_master(pdev);
        pci_try_set_mwi(pdev);
  
-       if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
-           dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
+       retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+       if (retval)
+               retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+       if (retval) {
                TW_PRINTK(host, TW_DRIVER, 0x18, "Failed to set dma mask");
                retval = -ENODEV;
                goto out_disable_device;
@@@ -1805,8 -1806,10 +1807,10 @@@ static int twl_resume(struct pci_dev *p
        pci_set_master(pdev);
        pci_try_set_mwi(pdev);
  
-       if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
-           dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
+       retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+       if (retval)
+               retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+       if (retval) {
                TW_PRINTK(host, TW_DRIVER, 0x25, "Failed to set dma mask during resume");
                retval = -ENODEV;
                goto out_disable_device;
index bede11e163499641716c664e56d9e8a32d7de849,a588dfad4b119fbe2d2a487e3d11763d6859feb2..e1129260ed18175da0a944d4e257e2b9a684e036
@@@ -6973,9 -6973,9 +6973,9 @@@ lpfc_sli4_create_rpi_hdr(struct lpfc_hb
        if (!dmabuf)
                return NULL;
  
 -      dmabuf->virt = dma_zalloc_coherent(&phba->pcidev->dev,
 -                                         LPFC_HDR_TEMPLATE_SIZE,
 -                                         &dmabuf->phys, GFP_KERNEL);
 +      dmabuf->virt = dma_alloc_coherent(&phba->pcidev->dev,
 +                                        LPFC_HDR_TEMPLATE_SIZE,
 +                                        &dmabuf->phys, GFP_KERNEL);
        if (!dmabuf->virt) {
                rpi_hdr = NULL;
                goto err_free_dmabuf;
@@@ -7361,15 -7361,18 +7361,18 @@@ lpfc_sli_pci_mem_setup(struct lpfc_hba 
        unsigned long bar0map_len, bar2map_len;
        int i, hbq_count;
        void *ptr;
-       int error = -ENODEV;
+       int error;
  
        if (!pdev)
-               return error;
+               return -ENODEV;
  
        /* Set the device DMA mask size */
-       if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
-           dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)))
+       error = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+       if (error)
+               error = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+       if (error)
                return error;
+       error = -ENODEV;
  
        /* Get the bus address of Bar0 and Bar2 and the number of bytes
         * required by each mapping.
        }
  
        /* Allocate memory for SLI-2 structures */
 -      phba->slim2p.virt = dma_zalloc_coherent(&pdev->dev, SLI2_SLIM_SIZE,
 -                                              &phba->slim2p.phys, GFP_KERNEL);
 +      phba->slim2p.virt = dma_alloc_coherent(&pdev->dev, SLI2_SLIM_SIZE,
 +                                             &phba->slim2p.phys, GFP_KERNEL);
        if (!phba->slim2p.virt)
                goto out_iounmap;
  
@@@ -7816,8 -7819,8 +7819,8 @@@ lpfc_create_bootstrap_mbox(struct lpfc_
         * plus an alignment restriction of 16 bytes.
         */
        bmbx_size = sizeof(struct lpfc_bmbx_create) + (LPFC_ALIGN_16_BYTE - 1);
 -      dmabuf->virt = dma_zalloc_coherent(&phba->pcidev->dev, bmbx_size,
 -                                         &dmabuf->phys, GFP_KERNEL);
 +      dmabuf->virt = dma_alloc_coherent(&phba->pcidev->dev, bmbx_size,
 +                                        &dmabuf->phys, GFP_KERNEL);
        if (!dmabuf->virt) {
                kfree(dmabuf);
                return -ENOMEM;
@@@ -9742,11 -9745,13 +9745,13 @@@ lpfc_sli4_pci_mem_setup(struct lpfc_hb
        uint32_t if_type;
  
        if (!pdev)
-               return error;
+               return -ENODEV;
  
        /* Set the device DMA mask size */
-       if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
-           dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)))
+       error = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+       if (error)
+               error = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+       if (error)
                return error;
  
        /*
This page took 0.091938 seconds and 4 git commands to generate.