1. 08 5月, 2018 12 次提交
  2. 02 5月, 2018 1 次提交
  3. 09 3月, 2018 1 次提交
  4. 07 3月, 2018 2 次提交
    • H
      scsi: mpt3sas: Do not mark fw_event workqueue as WQ_MEM_RECLAIM · 864449ee
      Hannes Reinecke 提交于
      The firmware event workqueue should not be marked as WQ_MEM_RECLAIM
      as it's doesn't need to make forward progress under memory pressure.
      In the current state it will result in a deadlock if the device had been
      forcefully removed.
      
      Cc: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
      Cc: Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>
      Acked-by: NSreekanth Reddy <Sreekanth.Reddy@broadcom.com>
      Signed-off-by: NHannes Reinecke <hare@suse.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      864449ee
    • 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
  5. 28 2月, 2018 7 次提交
  6. 22 2月, 2018 2 次提交
    • S
      scsi: mpt3sas: wait for and flush running commands on shutdown/unload · c666d3be
      Sreekanth Reddy 提交于
      This patch finishes all outstanding SCSI IO commands (but not other commands,
      e.g., task management) in the shutdown and unload paths.
      
      It first waits for the commands to complete (this is done after setting
      'ioc->remove_host = 1 ', which prevents new commands to be queued) then it
      flushes commands that might still be running.
      
      This avoids triggering error handling (e.g., abort command) for all commands
      possibly completed by the adapter after interrupts disabled.
      
      [mauricfo: introduced something in commit message.]
      Signed-off-by: NSreekanth Reddy <sreekanth.reddy@broadcom.com>
      Tested-by: NMauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
      Signed-off-by: NMauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      c666d3be
    • M
      scsi: mpt3sas: fix oops in error handlers after shutdown/unload · 9ff549ff
      Mauricio Faria de Oliveira 提交于
      This patch adds checks for 'ioc->remove_host' in the SCSI error handlers, so
      not to access pointers/resources potentially freed in the PCI shutdown/module
      unload path.  The error handlers may be invoked after shutdown/unload,
      depending on other components.
      
      This problem was observed with kexec on a system with a mpt3sas based adapter
      and an infiniband adapter which takes long enough to shutdown:
      
      The mpt3sas driver finished shutting down / disabled interrupt handling, thus
      some commands have not finished and timed out.
      
      Since the system was still running (waiting for the infiniband adapter to
      shutdown), the scsi error handler for task abort of mpt3sas was invoked, and
      hit an oops -- either in scsih_abort() because 'ioc->scsi_lookup' was NULL
      without commit dbec4c90 ("scsi: mpt3sas: lockless command submission"), or
      later up in scsih_host_reset() (with or without that commit), because it
      eventually called mpt3sas_base_get_iocstate().
      
      After the above commit, the oops in scsih_abort() does not occur anymore
      (_scsih_scsi_lookup_find_by_scmd() is no longer called), but that commit is
      too big and out of the scope of linux-stable, where this patch might help, so
      still go for the changes.
      
      Also, this might help to prevent similar errors in the future, in case code
      changes and possibly tries to access freed stuff.
      
      Note the fix in scsih_host_reset() is still important anyway.
      Signed-off-by: NMauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
      Acked-by: NSreekanth Reddy <Sreekanth.Reddy@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      9ff549ff
  7. 12 2月, 2018 1 次提交
    • L
      vfs: do bulk POLL* -> EPOLL* replacement · a9a08845
      Linus Torvalds 提交于
      This is the mindless scripted replacement of kernel use of POLL*
      variables as described by Al, done by this script:
      
          for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do
              L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'`
              for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done
          done
      
      with de-mangling cleanups yet to come.
      
      NOTE! On almost all architectures, the EPOLL* constants have the same
      values as the POLL* constants do.  But they keyword here is "almost".
      For various bad reasons they aren't the same, and epoll() doesn't
      actually work quite correctly in some cases due to this on Sparc et al.
      
      The next patch from Al will sort out the final differences, and we
      should be all done.
      Scripted-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a9a08845
  8. 31 1月, 2018 1 次提交
  9. 17 1月, 2018 1 次提交
  10. 11 1月, 2018 11 次提交
  11. 04 1月, 2018 1 次提交
    • C
      scsi: mpt3sas: Proper handling of set/clear of "ATA command pending" flag. · f49d4aed
      Chaitra P B 提交于
      1. In IO path, setting of "ATA command pending" flag early before device
         removal, invalid device handle etc., checks causes any new commands
         to be always returned with SAM_STAT_BUSY and when the driver removes
         the drive the SML issues SYNC Cache command and that command is
         always returned with SAM_STAT_BUSY and thus making SYNC Cache command
         to requeued.
      
      2. If the driver gets an ATA PT command for a SATA drive then the driver
         set "ATA command pending" flag in device specific data structure not
         to allow any further commands until the ATA PT command is completed.
         However, after setting the flag if the driver decides to return the
         command back to upper layers without actually issuing to the firmware
         (i.e., returns from qcmd failure return paths) then the corresponding
         flag is not cleared and this prevents the driver from sending any new
         commands to the drive.
      
      This patch fixes above two issues by setting of "ATA command pending"
      flag after checking for whether device deleted, invalid device handle,
      device busy with task management. And by setting "ATA command pending"
      flag to false in all of the qcmd failure return paths after setting the
      flag.
      Signed-off-by: NChaitra P B <chaitra.basappa@broadcom.com>
      Signed-off-by: NSuganath Prabu S <suganath-prabu.subramani@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      f49d4aed