1. 09 1月, 2018 3 次提交
    • J
      scsi: libsas: make the event threshold configurable · 8eea9dd8
      Jason Yan 提交于
      Add a sysfs attr that LLDD can configure it for every host. We made an
      example in hisi_sas. Other LLDDs using libsas can implement it if they
      want.
      Suggested-by: NHannes Reinecke <hare@suse.com>
      Signed-off-by: NJason Yan <yanaijie@huawei.com>
      CC: John Garry <john.garry@huawei.com>
      CC: Johannes Thumshirn <jthumshirn@suse.de>
      CC: Ewan Milne <emilne@redhat.com>
      CC: Christoph Hellwig <hch@lst.de>
      CC: Tomas Henzl <thenzl@redhat.com>
      CC: Dan Williams <dan.j.williams@intel.com>
      Acked-by: John Garry <john.garry@huawei.com> #for hisi_sas part
      Reviewed-by: NHannes Reinecke <hare@suse.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      8eea9dd8
    • J
      scsi: libsas: shut down the PHY if events reached the threshold · f12486e0
      Jason Yan 提交于
      If the PHY burst too many events, we will alloc a lot of events for the
      worker. This may leads to memory exhaustion.
      
      Dan Williams suggested to shut down the PHY if the events reached the
      threshold, because in this case the PHY may have gone into some
      erroneous state. Users can re-enable the PHY by sysfs if they want.
      
      We cannot use the fixed memory pool because if we run out of events, the
      shut down event and loss of signal event will lost too. The events still
      need to be allocated and processed in this case.
      Suggested-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NJason Yan <yanaijie@huawei.com>
      CC: John Garry <john.garry@huawei.com>
      CC: Johannes Thumshirn <jthumshirn@suse.de>
      CC: Ewan Milne <emilne@redhat.com>
      CC: Christoph Hellwig <hch@lst.de>
      CC: Tomas Henzl <thenzl@redhat.com>
      Reviewed-by: NHannes Reinecke <hare@suse.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      f12486e0
    • J
      scsi: libsas: Use dynamic alloced work to avoid sas event lost · 1c393b97
      Jason Yan 提交于
      Now libsas hotplug work is static, every sas event type has its own
      static work, LLDD driver queues the hotplug work into shost->work_q.  If
      LLDD driver burst posts lots hotplug events to libsas, the hotplug
      events may pending in the workqueue like
      
      shost->work_q
      new work[PORTE_BYTES_DMAED] --> |[PHYE_LOSS_OF_SIGNAL][PORTE_BYTES_DMAED] -> processing
                                      |<-------wait worker to process-------->|
      
      In this case, a new PORTE_BYTES_DMAED event coming, libsas try to queue
      it to shost->work_q, but this work is already pending, so it would be
      lost. Finally, libsas delete the related sas port and sas devices, but
      LLDD driver expect libsas add the sas port and devices(last sas event).
      
      This patch use dynamic allocated work to avoid this issue.
      Signed-off-by: NYijing Wang <wangyijing@huawei.com>
      CC: John Garry <john.garry@huawei.com>
      CC: Johannes Thumshirn <jthumshirn@suse.de>
      CC: Ewan Milne <emilne@redhat.com>
      CC: Christoph Hellwig <hch@lst.de>
      CC: Tomas Henzl <thenzl@redhat.com>
      CC: Dan Williams <dan.j.williams@intel.com>
      Reviewed-by: NHannes Reinecke <hare@suse.com>
      Signed-off-by: NJason Yan <yanaijie@huawei.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      1c393b97
  2. 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
  3. 16 9月, 2017 3 次提交
  4. 30 8月, 2017 1 次提交
  5. 26 8月, 2017 1 次提交
  6. 28 6月, 2017 1 次提交
  7. 05 4月, 2017 1 次提交
  8. 04 12月, 2014 1 次提交
  9. 27 11月, 2014 1 次提交
    • C
      libsas: remove task_collector mode · 79855d17
      Christoph Hellwig 提交于
      The task_collector mode (or "latency_injector", (C) Dan Willians) is an
      optional I/O path in libsas that queues up scsi commands instead of
      directly sending it to the hardware.  It generall increases latencies
      to in the optiomal case slightly reduce mmio traffic to the hardware.
      
      Only the obsolete aic94xx driver and the mvsas driver allowed to use
      it without recompiling the kernel, and most drivers didn't support it
      at all.
      
      Remove the giant blob of code to allow better optimizations for scsi-mq
      in the future.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Acked-by: NDan Williams <dan.j.williams@intel.com>
      79855d17
  10. 24 11月, 2014 1 次提交
  11. 06 11月, 2014 1 次提交
  12. 19 3月, 2014 1 次提交
    • D
      libata, libsas: kill pm_result and related cleanup · bc6e7c4b
      Dan Williams 提交于
      Tejun says:
        "At least for libata, worrying about suspend/resume failures don't make
         whole lot of sense.  If suspend failed, just proceed with suspend.  If
         the device can't be woken up afterwards, that's that.  There isn't
         anything we could have done differently anyway.  The same for resume, if
         spinup fails, the device is dud and the following commands will invoke
         EH actions and will eventually fail.  Again, there really isn't any
         *choice* to make.  Just making sure the errors are handled gracefully
         (ie. don't crash) and the following commands are handled correctly
         should be enough."
      
      The only libata user that actually cares about the result from a suspend
      operation is libsas.  However, it only cares about whether queuing a new
      operation collides with an in-flight one.  All libsas does with the
      error is retry, but we can just let libata wait for the previous
      operation before continuing.
      
      Other cleanups include:
      1/ Unifying all ata port pm operations on an ata_port_pm_ prefix
      2/ Marking all ata port pm helper routines as returning void, only
         ata_port_pm_ entry points need to fake a 0 return value.
      3/ Killing ata_port_{suspend|resume}_common() in favor of calling
         ata_port_request_pm() directly
      4/ Killing the wrappers that just do a to_ata_port() conversion
      5/ Clearly marking the entry points that do async operations with an
        _async suffix.
      
      Reference: http://marc.info/?l=linux-scsi&m=138995409532286&w=2
      
      Cc: Phillip Susi <psusi@ubuntu.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Suggested-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NTodd Brandt <todd.e.brandt@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      bc6e7c4b
  13. 05 6月, 2013 1 次提交
    • J
      [SCSI] libsas: implement > 16 byte CDB support · e73823f7
      James Bottomley 提交于
      Remove the arbitrary expectation in libsas that all SCSI commands are 16 bytes
      or less.  Instead do all copies via cmd->cmd_len (and use a pointer to this in
      the libsas task instead of a copy).  Note that this still doesn't enable > 16
      byte CDB support in the underlying drivers because their internal format has
      to be fixed and the wire format of > 16 byte CDBs according to the SAS spec is
      different.  the libsas drivers (isci, aic94xx, mvsas and pm8xxx are all
      updated for this change.
      
      Cc: Lukasz Dorau <lukasz.dorau@intel.com>
      Cc: Maciej Patelczyk <maciej.patelczyk@intel.com>
      Cc: Dave Jiang <dave.jiang@intel.com>
      Cc: Jack Wang <xjtuwjp@gmail.com>
      Cc: Lindar Liu <lindar_liu@usish.com>
      Cc: Xiangliang Yu <yuxiangl@marvell.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      e73823f7
  14. 10 5月, 2013 1 次提交
    • J
      [SCSI] sas: unify the pointlessly separated enums sas_dev_type and sas_device_type · aa9f8328
      James Bottomley 提交于
      These enums have been separate since the dawn of SAS, mainly because the
      latter is a procotol only enum and the former includes additional state
      for libsas.  The dichotomy causes endless confusion about which one you
      should use where and leads to pointless warnings like this:
      
      drivers/scsi/mvsas/mv_sas.c: In function 'mvs_update_phyinfo':
      drivers/scsi/mvsas/mv_sas.c:1162:34: warning: comparison between 'enum sas_device_type' and 'enum sas_dev_type' [-Wenum-compare]
      
      Fix by eliminating one of them.  The one kept is effectively the sas.h
      one, but call it sas_device_type and make sure the enums are all
      properly namespaced with the SAS_ prefix.
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      aa9f8328
  15. 24 8月, 2012 1 次提交
    • D
      [SCSI] libsas: suspend / resume support · 303694ee
      Dan Williams 提交于
      libsas power management routines to suspend and recover the sas domain
      based on a model where the lldd is allowed and expected to be
      "forgetful".
      
      sas_suspend_ha - disable event processing allowing the lldd to take down
                       links without concern for causing hotplug events.
                       Regardless of whether the lldd actually posts link down
                       messages libsas notifies the lldd that all
                       domain_devices are gone.
      
      sas_prep_resume_ha - on the way back up before the lldd starts link
                           training clean out any spurious events that were
                           generated on the way down, and re-enable event
                           processing
      
      sas_resume_ha - after the lldd has started and decided that all phys
      		have posted link-up events this routine is called to let
      		libsas start it's own timeout of any phys that did not
      		resume.  After the timeout an lldd can cancel the
                      phy teardown by posting a link-up event.
      
      Storage for ex_change_count (u16) and phy_change_count (u8) are changed
      to int so they can be set to -1 to indicate 'invalidated'.
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Reviewed-by: NJacek Danecki <jacek.danecki@intel.com>
      Tested-by: NMaciej Patelczyk <maciej.patelczyk@intel.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      303694ee
  16. 20 7月, 2012 5 次提交
  17. 08 7月, 2012 1 次提交
  18. 23 4月, 2012 1 次提交
  19. 01 3月, 2012 5 次提交
  20. 20 2月, 2012 9 次提交