1. 08 5月, 2018 3 次提交
    • X
      scsi: hisi_sas: check host frozen before calling "done" function · cd938e53
      Xiang Chen 提交于
      When the host is frozen in SCSI EH state, at any point after the LLDD
      sets SAS_TASK_STATE_DONE for the sas_task task state, libsas may free
      the task; see sas_scsi_find_task().
      
      This puts the LLDD in a difficult position, in that once it sets
      SAS_TASK_STATE_DONE for the task state it should not reference the
      sas_task again. But the LLDD needs will check the sas_task indirectly in
      calling task->task_done()->sas_scsi_task_done() or sas_ata_task_done()
      (to check if the host is frozen state actually).
      
      And the LLDD cannot set SAS_TASK_STATE_DONE for the task state after
      task->task_done() is called (as the sas_task is free'd at this point).
      
      This situation would seem to be a problem made by libsas.
      
      To work around, check in the LLDD whether the host is in frozen state to
      ensure it is ok to call task->task_done() function. If in the frozen
      state, we rely on SCSI EH and libsas to free the sas_task directly.
      
      We do not do this for the following IO types:
      
       - SMP - they are managed in libsas directly, outside SCSI EH
       - Any internally originated IO, for similar reason
      Signed-off-by: NXiang Chen <chenxiang66@hisilicon.com>
      Signed-off-by: NJohn Garry <john.garry@huawei.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      cd938e53
    • X
      scsi: hisi_sas: Add some checks to avoid free'ing a sas_task twice · b81b6cce
      Xiang Chen 提交于
      If the SCSI host enters EH, any pending IO will be processed by SCSI
      EH. However it is possible that SCSI EH will try to abort the IO and
      also at the same time the IO completes in the driver. In this situation
      there is a small chance of freeing the sas_task twice.
      
      Then if another IO re-uses freed sas_task before the second time of
      free'ing sas_task, it is possible to free incorrect sas_task.
      
      To avoid this situation, add some checks to increase reliability.  The
      sas_task task state flag SAS_TASK_STATE_ABORTED is used to mutually
      protect the LLDD and libsas freeing the task.
      Signed-off-by: NXiang Chen <chenxiang66@hisilicon.com>
      Signed-off-by: NJohn Garry <john.garry@huawei.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      b81b6cce
    • X
      scsi: hisi_sas: optimise the usage of DQ locking · 24cf4361
      Xiang Chen 提交于
      In the DQ tasklet processing it is not necessary to take the DQ lock, as
      there is no contention between adding slots to the CQ and removing slots
      from the matching DQ.
      
      In addition, since we run each DQ in a separate tasklet context, there
      would be no possible contention between DQ processing running for the
      same queue in parallel.
      
      It is still necessary to take hisi_hba lock when free'ing slots.
      Signed-off-by: NXiang Chen <chenxiang66@hisilicon.com>
      Signed-off-by: NJohn Garry <john.garry@huawei.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      24cf4361
  2. 19 4月, 2018 3 次提交
  3. 13 3月, 2018 4 次提交
  4. 23 1月, 2018 1 次提交
  5. 11 1月, 2018 1 次提交
  6. 15 12月, 2017 6 次提交
  7. 22 11月, 2017 1 次提交
    • K
      treewide: Remove TIMER_FUNC_TYPE and TIMER_DATA_TYPE casts · 841b86f3
      Kees Cook 提交于
      With all callbacks converted, and the timer callback prototype
      switched over, the TIMER_FUNC_TYPE cast is no longer needed,
      so remove it. Conversion was done with the following scripts:
      
          perl -pi -e 's|\(TIMER_FUNC_TYPE\)||g' \
              $(git grep TIMER_FUNC_TYPE | cut -d: -f1 | sort -u)
      
          perl -pi -e 's|\(TIMER_DATA_TYPE\)||g' \
              $(git grep TIMER_DATA_TYPE | cut -d: -f1 | sort -u)
      
      The now unused macros are also dropped from include/linux/timer.h.
      Signed-off-by: NKees Cook <keescook@chromium.org>
      841b86f3
  8. 02 11月, 2017 1 次提交
    • K
      scsi: sas: Convert timers to use timer_setup() · 77570eed
      Kees Cook 提交于
      In preparation for unconditionally passing the struct timer_list pointer to
      all timer callbacks, switch to using the new timer_setup() and from_timer()
      to pass the timer pointer explicitly. This requires adding a pointer to
      hold the timer's target task, as there isn't a link back from slow_task.
      
      Cc: John Garry <john.garry@huawei.com>
      Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
      Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
      Cc: Jack Wang <jinpu.wang@profitbricks.com>
      Cc: lindar_liu@usish.com
      Cc: Jens Axboe <axboe@fb.com>
      Cc: Hannes Reinecke <hare@suse.com>
      Cc: Johannes Thumshirn <jthumshirn@suse.de>
      Cc: Benjamin Block <bblock@linux.vnet.ibm.com>
      Cc: Baoyou Xie <baoyou.xie@linaro.org>
      Cc: Wei Yongjun <weiyongjun1@huawei.com>
      Cc: linux-scsi@vger.kernel.org
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Reviewed-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Acked-by: John Garry <john.garry@huawei.com> # for hisi_sas part
      Tested-by: John Garry <john.garry@huawei.com> # basic sanity test for hisi_sas
      Reviewed-by: NJack Wang <jinpu.wang@profitbricks.com>
      77570eed
  9. 01 11月, 2017 1 次提交
  10. 25 10月, 2017 4 次提交
  11. 25 8月, 2017 1 次提交
  12. 11 8月, 2017 7 次提交
  13. 13 7月, 2017 1 次提交
  14. 02 7月, 2017 1 次提交
  15. 20 6月, 2017 5 次提交