1. 08 5月, 2018 3 次提交
  2. 09 3月, 2018 1 次提交
  3. 07 3月, 2018 1 次提交
  4. 28 2月, 2018 3 次提交
  5. 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
  6. 11 1月, 2018 6 次提交
  7. 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
  8. 05 12月, 2017 1 次提交
  9. 09 11月, 2017 2 次提交
  10. 04 11月, 2017 10 次提交
  11. 31 10月, 2017 1 次提交
    • K
      treewide: Fix function prototypes for module_param_call() · e4dca7b7
      Kees Cook 提交于
      Several function prototypes for the set/get functions defined by
      module_param_call() have a slightly wrong argument types. This fixes
      those in an effort to clean up the calls when running under type-enforced
      compiler instrumentation for CFI. This is the result of running the
      following semantic patch:
      
      @match_module_param_call_function@
      declarer name module_param_call;
      identifier _name, _set_func, _get_func;
      expression _arg, _mode;
      @@
      
       module_param_call(_name, _set_func, _get_func, _arg, _mode);
      
      @fix_set_prototype
       depends on match_module_param_call_function@
      identifier match_module_param_call_function._set_func;
      identifier _val, _param;
      type _val_type, _param_type;
      @@
      
       int _set_func(
      -_val_type _val
      +const char * _val
       ,
      -_param_type _param
      +const struct kernel_param * _param
       ) { ... }
      
      @fix_get_prototype
       depends on match_module_param_call_function@
      identifier match_module_param_call_function._get_func;
      identifier _val, _param;
      type _val_type, _param_type;
      @@
      
       int _get_func(
      -_val_type _val
      +char * _val
       ,
      -_param_type _param
      +const struct kernel_param * _param
       ) { ... }
      
      Two additional by-hand changes are included for places where the above
      Coccinelle script didn't notice them:
      
      	drivers/platform/x86/thinkpad_acpi.c
      	fs/lockd/svc.c
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NJessica Yu <jeyu@kernel.org>
      e4dca7b7
  12. 12 10月, 2017 7 次提交
  13. 13 6月, 2017 2 次提交