1. 19 6月, 2018 2 次提交
    • C
      scsi: mpt3sas: As per MPI-spec, use combined reply queue for SAS3.5... · 2b48be65
      Chaitra P B 提交于
      scsi: mpt3sas: As per MPI-spec, use combined reply queue for SAS3.5 controllers when HBA supports more than 16 MSI-x vectors.
      
      Presently driver is using combined reply queue feature when MSI-x vectors >
      8 for both SAS3 and SAS3.5 controllers.  But as per MPI-spec,
      
      1. For SAS3 controllers, driver should use combined reply queue when HBA
      supports more than 8 MSI-x vectors.
      
      2. For SAS3.5 controllers, driver should use combined reply queue when HBA
      supports more than 16 MSI-x vectors.
      
      Modified driver code to use combined reply queue for SAS3 controllers when
      HBA supports > 8 MSI-x vectors and for SAS3.5 controllers when HBA supports
      > 16 MSI-x vectors.
      Signed-off-by: NChaitra P B <chaitra.basappa@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      2b48be65
    • C
      scsi: mpt3sas: Fix, False timeout prints for ioctl and other internal commands... · d37306ca
      Chaitra P B 提交于
      scsi: mpt3sas: Fix, False timeout prints for ioctl and other internal commands during controller reset.
      
      When an ioctl is sent to FW, and if there is a controller reset issued
      before ioctl gets completed, then in controller reset path all the pending
      ioctl commands are terminated from "mpt3sas_ctl_reset_handler" function.
      This will wake up the waiting ioctl commands in ioctl path and print
      timeouts which are actually not timeouts.
      
      Introduced "mpt3sas_base_check_cmd_timeout" function to check and print
      whether command got timed out (or) terminated due to Host reset.
      Signed-off-by: NChaitra P B <chaitra.basappa@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      d37306ca
  2. 08 5月, 2018 7 次提交
  3. 07 3月, 2018 1 次提交
    • A
      scsi: mpt3sas: clarify mmio pointer types · 6f9e09fd
      Arnd Bergmann 提交于
      The newly added code mixes up phys_addr_t/resource_size_t with dma_addr_t
      and void pointers, as seen from these compiler warning:
      
      drivers/scsi/mpt3sas/mpt3sas_base.c: In function '_base_get_chain_phys':
      drivers/scsi/mpt3sas/mpt3sas_base.c:235:21: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
        base_chain_phys  = (void *)ioc->chip_phys + MPI_FRAME_START_OFFSET +
                           ^
      drivers/scsi/mpt3sas/mpt3sas_base.c: In function '_clone_sg_entries':
      drivers/scsi/mpt3sas/mpt3sas_base.c:427:20: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
          sgel->Address = (dma_addr_t)dst_addr_phys;
                          ^
      drivers/scsi/mpt3sas/mpt3sas_base.c:438:7: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
             (dma_addr_t)buff_ptr_phys;
             ^
      drivers/scsi/mpt3sas/mpt3sas_base.c:444:10: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
                (dma_addr_t)buff_ptr_phys;
      
      Both dma_addr_t and phys_addr_t may be wider than a pointer, so we must
      avoid the conversion to pointer types. This also helps readability.
      
      A second problem is treating MMIO addresses from a 'struct resource'
      as addresses that can be used for DMA on that device. In almost all
      cases, those are the same, but on some of the more obscure architectures,
      PCI memory address 0 is mapped into the CPU address space at a nonzero
      offset. I don't have a good fix for that, so I'm adding a comment here,
      plus a WARN_ON() that triggers whenever the phys_addr_t number is
      outside of the low 32-bit address space and causes a straight overflow
      when assigned to the 32-bit sgel->Address.
      
      Fixes: 182ac784 ("scsi: mpt3sas: Introduce Base function for cloning.")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NSreekanth Reddy <Sreekanth.Reddy@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      6f9e09fd
  4. 28 2月, 2018 4 次提交
  5. 22 2月, 2018 1 次提交
  6. 11 1月, 2018 3 次提交
  7. 07 11月, 2017 1 次提交
    • A
      scsi: mpt3sas: fix dma_addr_t casts · d8335ae2
      Arnd Bergmann 提交于
      The newly added base_make_prp_nvme function triggers a build warning on
      some 32-bit configurations:
      
      drivers/scsi/mpt3sas/mpt3sas_base.c: In function 'base_make_prp_nvme':
      drivers/scsi/mpt3sas/mpt3sas_base.c:1664:13: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
        msg_phys = (dma_addr_t)mpt3sas_base_get_pcie_sgl_dma(ioc, smid);
      
      After taking a closer look, I found that the problem is that the new
      code mixes up pointers and dma_addr_t values unnecessarily.
      
      This changes it to use the correct types consistently, which lets us get
      rid of a lot of type casts in the process. I'm also renaming some
      variables to avoid confusion between physical and dma address spaces
      that are often distinct.
      
      Fixes: 016d5c35 ("scsi: mpt3sas: SGL to PRP Translation for I/Os to NVMe devices")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NSathya Prakash Veerichetty <sathya.prakash@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      d8335ae2
  8. 04 11月, 2017 6 次提交
  9. 12 10月, 2017 3 次提交
  10. 08 8月, 2017 1 次提交
    • A
      scsi: mpt3sas: fix format overflow warning · bbfd8e8b
      Arnd Bergmann 提交于
      We print the driver name into one string and then add and ID
      and copy it into a second string of the same length, at which
      point gcc complains about a possible overflow:
      
      drivers/scsi/mpt3sas/mpt3sas_scsih.c: In function '_scsih_probe':
      drivers/scsi/mpt3sas/mpt3sas_scsih.c:8884:21: error: '_cm' directive writing 3 bytes into a region of size between 1 and 32 [-Werror=format-overflow=]
      printf(ioc->name, "%s_cm%d", ioc->driver_name, ioc->id);
                        ^~~~~~~~~
      drivers/scsi/mpt3sas/mpt3sas_scsih.c:8884:21: note: directive argument in the range [0, 255]
      drivers/scsi/mpt3sas/mpt3sas_scsih.c:8884:2: note: 'sprintf' output between 5 and 38 bytes into a destination of size 32
        sprintf(ioc->name, "%s_cm%d", ioc->driver_name, ioc->id);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Making the first string shorter is sufficient to avoid the
      warning here, as we know it can only contain either "mpt2sas"
      or "mpt3sas".
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      bbfd8e8b
  11. 09 5月, 2017 1 次提交
  12. 02 3月, 2017 1 次提交
    • B
      scsi: mpt3sas: Avoid sleeping in interrupt context · 8893cf6c
      Bart Van Assche 提交于
      Commit 669f0441 ("scsi: srp_transport: Move queuecommand() wait code
      to SCSI core") can make scsi_internal_device_block() sleep.  However,
      the mpt3sas driver can call this function from an interrupt
      handler. Hence add a second argument to scsi_internal_device_block()
      that restores the old behavior of this function for the mpt3sas handler.
      
      The call chain that triggered an "IRQ handler enabled interrupts"
      complaint is as follows:
      
      _base_interrupt()
      -> _base_async_event()
         -> mpt3sas_scsih_event_callback()
            -> _scsih_check_topo_delete_events()
               -> _scsih_block_io_to_children_attached_directly()
                  -> _scsih_block_io_device()
                     -> _scsih_internal_device_block()
                        -> scsi_internal_device_block()
      Reported-by: NOmar Sandoval <osandov@osandov.com>
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Cc: Omar Sandoval <osandov@osandov.com>
      Cc: Hannes Reinecke <hare@suse.com>
      Cc: Sagi Grimberg <sagi@grimberg.me>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Sathya Prakash <sathya.prakash@broadcom.com>
      Cc: Chaitra P B <chaitra.basappa@broadcom.com>
      Cc: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
      Cc: Sreekanth Reddy <Sreekanth.Reddy@broadcom.com>
      Cc: <stable@vger.kernel.org> # v4.10+
      Tested-by: NOmar Sandoval <osandov@fb.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      8893cf6c
  13. 24 2月, 2017 1 次提交
  14. 01 2月, 2017 2 次提交
  15. 18 1月, 2017 1 次提交
  16. 15 12月, 2016 1 次提交
  17. 09 11月, 2016 4 次提交