1. 08 Sep, 2013 1 commit
  2. 10 May, 2013 12 commits
  3. 22 Feb, 2013 1 commit
  4. 03 Jan, 2013 1 commit
    • Greg Kroah-Hartman's avatar
      Drivers: scsi: remove __dev* attributes. · 6f039790
      Greg Kroah-Hartman authored
      CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
      markings need to be removed.
      
      This change removes the use of __devinit, __devexit_p, __devinitdata,
      __devinitconst, and __devexit from these drivers.
      
      Based on patches originally written by Bill Pemberton, but redone by me
      in order to handle some of the coding style issues better, by hand.
      
      Cc: Bill Pemberton <wfp5p@virginia.edu>
      Cc: Adam Radford <linuxraid@lsi.com>
      Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6f039790
  5. 20 Jul, 2012 2 commits
  6. 10 May, 2012 1 commit
    • Mark Salyzyn's avatar
      [SCSI] pm8001: raise host can queue · 99c72ebc
      Mark Salyzyn authored
      This is a followup to a patch provided by Jack Wang on September 21 2011.
      
      After increasing the CAN_QUEUE to 510 in pm8001 we discovered some performance
      degredation from time to time. We needed to increase the MPI queue to
      compensate and ensure we never hit that limit. We also needed to double
      the margin to support event and administrivial commands that take from
      the pool resulting in an occasional largely unproductive command completion
      with soft error to the caller when the command pool is overloaded temporarily.
      Signed-off-by: default avatarMark Salyzyn <mark_salyzyn@xyratex.com>
      Acked-by: default avatarJack Wang <jack_wang@usish.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      99c72ebc
  7. 23 Apr, 2012 1 commit
  8. 28 Mar, 2012 1 commit
  9. 29 Feb, 2012 5 commits
    • Santosh Nayak's avatar
      [SCSI] pm8001: fix endian issue with code optimization. · 8270ee2a
      Santosh Nayak authored
      1. Fix endian issue.
      2. Fix the following warning :
          " drivers/scsi/pm8001/pm8001_hwi.c:2932:32: warning: comparison
            between ‘enum sas_device_type’ and ‘enum sas_dev_type’".
      3. Few code optimization.
      Signed-off-by: default avatarSantosh Nayak <santoshprasadnayak@gmail.com>
      Acked-by: default avatarJack Wang <jack_wang@usish.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      8270ee2a
    • Santosh Nayak's avatar
      [SCSI] pm8001: Fix possible racing condition. · 50ec5bab
      Santosh Nayak authored
      There is a possble racing scenario.
      
      'process_oq' is called by two routines, as shown below.
      
      pm8001_8001_dispatch = {
               .......
      
              .isr             = pm8001_chip_isr --> process_oq,// A
              .isr_process_oq  = process_oq,                   //  B
              .....
      }
      
      process_oq() --> process_one_iomb() --> mpi_sata_completion()
      
      In 'mpi_sata_completion', "pm8001_ha->lock" is first released.
      It means lock is taken before,  which is true for
      the context A, as 'pm8001_ha->lock' is taken in 'pm8001_chip_isr()'
      
      But for context B there is no lock taken before and pm8001_ha->lock
      is unlocked in 'mpi_sata_completion()'. This may unlock the lock
      taken in context A. Possible racing ??
      
      If 'pm8001_ha->lock' is taken in 'process_oq()' instead of
      'pm8001_chip_isr' then the above issue can be avoided.
      Signed-off-by: default avatarSantosh Nayak <santoshprasadnayak@gmail.com>
      Acked-by: default avatarJack Wang <jack_wang@usish.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      50ec5bab
    • Santosh Nayak's avatar
      [SCSI] pm8001: Fix bogus interrupt state flag issue. · bdaefbf5
      Santosh Nayak authored
      Static checker is giving following warning:
      " error: calling 'spin_unlock_irqrestore()' with bogus flags"
      
      The code flow is as shown below:
      process_oq() --> process_one_iomb --> mpi_sata_completion
      
      In 'mpi_sata_completion'
      the first call for 'spin_unlock_irqrestore()' is with flags=0,
      which is as good as 'spin_unlock_irq()' ( unconditional interrupt
      enabling).
      
      So for better performance 'spin_unlock_irqrestore()' can be replaced
      with 'spin_unlock_irq()' and 'spin_lock_irqsave()' can be replaced by
      'spin_lock_irq()'.
      Signed-off-by: default avatarSantosh Nayak <santoshprasadnayak@gmail.com>
      Acked-by: default avatarJack Wang <jack_wang@usish.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      bdaefbf5
    • Dan Williams's avatar
      [SCSI] libsas: async ata scanning · 9508a66f
      Dan Williams authored
      libsas ata error handling is already async but this does not help the
      scan case.  Move initial link recovery out from under host->scan_mutex,
      and delay synchronization with eh until after all port probe/recovery
      work has been queued.
      
      Device ordering is maintained with scan order by still calling
      sas_rphy_add() in order of domain discovery.
      
      Since we now scan the domain list when invoking libata-eh we need to be
      careful to check for fully initialized ata ports.
      Acked-by: default avatarJack Wang <jack_wang@usish.com>
      Acked-by: default avatarJeff Garzik <jgarzik@redhat.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      9508a66f
    • Dan Williams's avatar
      [SCSI] libsas: fix sas_find_local_phy(), take phy references · f41a0c44
      Dan Williams authored
      In the direct-attached case this routine returns the phy on which this
      device was first discovered.  Which is broken if we want to support
      wide-targets, as this phy reference can become stale even though the
      port is still active.
      
      In the expander-attached case this routine tries to lookup the phy by
      scanning the attached sas addresses of the parent expander, and BUG_ONs
      if it can't find it.  However since eh and the libsas workqueue run
      independently we can still be attempting device recovery via eh after
      libsas has recorded the device as detached.  This is even easier to hit
      now that eh is blocked while device domain rediscovery takes place, and
      that libata is fed more timed out commands increasing the chances that
      it will try to recover the ata device.
      
      Arrange for dev->phy to always point to a last known good phy, it may be
      stale after the port is torn down, but it will catch up for wide port
      reconfigurations, and never be NULL.
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      f41a0c44
  10. 19 Feb, 2012 6 commits
    • Dan Williams's avatar
      [SCSI] libsas: remove ata_port.lock management duties from lldds · 312d3e56
      Dan Williams authored
      Each libsas driver (mvsas, pm8001, and isci) has invented a different
      method for managing the ap->lock.  The lock is held by the ata
      ->queuecommand() path.  mvsas drops it prior to acquiring any internal
      locks which allows it to hold its internal lock across calls to
      task->task_done().  This capability is important as it is the only way
      the driver can flush task->task_done() instances to guarantee that it no
      longer has any in-flight references to a domain_device at
      ->lldd_dev_gone() time.
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      312d3e56
    • Dan Williams's avatar
      [SCSI] libsas: introduce sas_drain_work() · b1124cd3
      Dan Williams authored
      When an lldd invokes ->notify_port_event() it can trigger a chain of libsas
      events to:
      
        1/ form the port and find the direct attached device
      
        2/ if the attached device is an expander perform domain discovery
      
      A call to flush_workqueue() will only flush the initial port formation work.
      Currently libsas users need to call scsi_flush_work() up to the max depth of
      chain (which will grow from 2 to 3 when ata discovery is moved to its own
      discovery event).  Instead of open coding multiple calls switch to use
      drain_workqueue() to flush sas work.
      
      drain_workqueue() does not handle new work submitted during the drain so
      libsas needs a bit of infrastructure to hold off unchained work submissions
      while a drain is in flight.  A lldd ->notify() event is considered 'unchained'
      while a sas_discover_event() is 'chained'.  As Tejun notes:
      
        "For now, I think it would be best to add private wrapper in libsas to
         support deferring unchained work items while draining."
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      b1124cd3
    • Dan Williams's avatar
      [SCSI] libsas: kill sas_slave_destroy · 6f4e75a4
      Dan Williams authored
      Per commit 3e4ec344 "libata: kill ATA_FLAG_DISABLED" needing to set
      ATA_DEV_NONE is a holdover from before libsas converted to the
      "new-style" ata-eh.
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      6f4e75a4
    • Mark Salyzyn's avatar
      [SCSI] pm8001: deficient responses to IO_XFER_ERROR_BREAK and IO_XFER_OPEN_RETRY_TIMEOUT · 5954d738
      Mark Salyzyn authored
      IO_XFER_ERROR_BREAK and IO_XFER_OPEN_RETRY_TIMEOUT are deficient of the
      required actions as outlined in the programming manual for the pm8001. Due to
      the overlapping code requirements of these recovery responses, we found it
      necessary to bundle them together into one patch.
      
      When a break is received during the command phase (ssp_completion), this is a
      result of a timeout or interruption on the bus. Logic suggests that we should
      retry the command.
      
      When a break is received during the data-phase (ssp_event), the task must be
      aborted on the target or it will retain a data-phase lock turning the target
      reticent to all future media commands yet will successfully respond to TUR,
      INQUIRY and ABORT leading eventually to target failure through several
      abort-cycle loops.
      
      The open retry interval is exceedingly short resulting in occasional target
      drop-off during expander resets or when targets push-back during bad-block
      remapping. Increased effective timeout from 130ms to 1.5 seconds for each try
      so as to trigger after the administrative inquiry/tur timeout in the scsi
      subsystem to keep error-recovery harmonics to a minimum.
      
      When an open retry timeout event is received, the action required by the
      targets is to issue an abort for the outstanding command then logic suggests
      we retry the command as this state is usually an indication of a credit block
      or busy condition on the target.
      
      We hijacked the pm8001_handle_event work queue handler so that it will handle
      task as an argument instead of device for the workers in support of the
      deferred handling outlined above.
      
      Moderate to Heavy bad-path testing on a 2.6.32 vintage kernel, compile-testing
      on scsi-misc-2.6 kernel ...
      Signed-off-by: default avatarMark Salyzyn <mark_salyzyn@xyratex.com>
      Acked-by: default avatarJack Wang <jack_wang@usish.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      5954d738
    • Mark Salyzyn's avatar
      [SCSI] pm8001: Add FUNC_GET_EVENTS · d95d0001
      Mark Salyzyn authored
      Jack noticed I dropped a patch fragment associated with a flags automatic
      variable in mpi_set_phys_g3_with_ssc (ooops) and that the pre-emptive locking
      that piggy-backed this patch was not in-fact necessary because of underlying
      atomic accesses to the hardware. Here is the updated patch fixing these two
      issues.
      
      The pm8001 driver is missing the FUNC_GET_EVENTS handler in the phy control
      function. Since the pm8001_bar4_shift function was not designed to be called
      at runtime, added locking surrounding the adjustment for all accesses.
      Signed-off-by: default avatarMark Salyzyn <mark_salyzyn@xyratex.com>
      Acked-by: default avatarJack Wang <jack_wang@usish.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      d95d0001
    • Mark Salyzyn's avatar
      [SCSI] pm8001: fix lockup on phy_control hard reset. · 5c4fb76a
      Mark Salyzyn authored
      pm8001_phy_control PHY_FUNC_HARD_RESET locks up on second try via
      smp_phy_control because response HW_EVENT_PHY_START_STATUS fails to complete
      previous command. The PM8001F_RUN_TIME flag is not treated as a bit, but a
      state in all readers, yet once we are operational or in the run time state,
      the flags use a bit-set operation.
      Signed-off-by: default avatarMark Salyzyn <mark_salyzyn@xyratex.com>
      Acked-by: default avatarJack Wang <jack_wang@usish.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      5c4fb76a
  11. 03 Feb, 2012 1 commit
  12. 02 Oct, 2011 4 commits
    • Dan Williams's avatar
      [SCSI] isci: export phy events via ->lldd_control_phy() · ac013ed1
      Dan Williams authored
      Allow the sas-transport-class to update events for local phys via a new
      PHY_FUNC_GET_EVENTS command to ->lldd_control_phy().  Fixup drivers that
      are not prepared for new enum phy_func values, and unify
      ->lldd_control_phy() error codes.
      
      These are the SAS defined phy events that are reported in a
      smp-report-phy-error-log command:
       * /sys/class/sas_phy/<phyX>/invalid_dword_count
       * /sys/class/sas_phy/<phyX>/running_disparity_error_count
       * /sys/class/sas_phy/<phyX>/loss_of_dword_sync_count
       * /sys/class/sas_phy/<phyX>/phy_reset_problem_count
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      ac013ed1
    • Mark Salyzyn's avatar
      [SCSI] pm8001: missing break statements · 6fbc7692
      Mark Salyzyn authored
      Code Inspection: found two missing break directives. First one will
      result in not retrying an a task that report
      IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY, the second will result in cosmetic
      debug printk conflicting statement stutter. Because checkpatch.pl came
      up with a warning regarding unnecessary space before a newline on one of
      the fragments associated with the diff context, I took the liberty of
      fixing all the cases of this issue in the pair of files touched by this
      defect. These cosmetic changes hide the break changes :-(
      
      To help focus, break changes are in pm8001_hwi.c fragment line 1649 for
      the IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY case statement and pm8001_sas.c
      line 1000 deals with the conflicting debug print stutter.
      Signed-off-by: default avatarMark Salyzyn <mark_salyzyn@us.xyratex.com>
      Acked-by: default avatarJack Wang <jack_wang@usish.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      6fbc7692
    • Mark Salyzyn's avatar
      [SCSI] pm8001: fix DEV_IS_GONE infinite retry · b90b378a
      Mark Salyzyn authored
      On the pm8001, when a device is in the process of going away (device
      power off or hot plug), depending on the timing, the driver would return
      SAS_PHY_DOWN as the return value to the queuecommand DEV_IS_GONE logic.
      The net result is an near infinite retry (especially if SAS debugging is
      enabled), the logs will fill with:
      
      kernel: mpi_ssp_completion 2119:e21:SSP IO status 0x13 tag 0xcc1c0000
      dlen=90 param=0xe
      kernel: wwn=5000c50034069e86  cdb=12 00 00 00 5a 00 00 00 00 00 00 00 00
      00 00 00
      kernel: sas: lldd_execute_task returned: 138
      kernel: sas: lldd_execute_task returned: 138
      kernel: sas: lldd_execute_task returned: 138
      kernel: sas: lldd_execute_task returned: 138
      kernel: sas: lldd_execute_task returned: 138
      kernel: sas: lldd_execute_task returned: 138
      kernel: sas: lldd_execute_task returned: 138
      . . .
      
      This patch changes to leverage the port_attached logic to complete the
      command with a status of PHY_DOWN so that the disposition can be handled
      immediately and correctly.
      Signed-off-by: default avatarMark Salyzyn <mark_salyzyn@us.xyratex.com>
      Acked-by: default avatarJack Wang <jack_wang@usish.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      b90b378a
    • Dan Williams's avatar
      [SCSI] pm8001: remove pm8001_slave_{alloc|configure} · 11e16364
      Dan Williams authored
      libsas handles:
      1/ limiting ata scanning to lun0
      2/ changes to /sys/block/<sdX>/device/queue_depth for ata devices
      
      libata handles turning off ncq globally via kernel command line
      (libata.force=noncq) or sysfs (echo 1 >
      /sys/block/<sdX>/device/queue_depth).  A lldd specific compile option is
      not necessary.
      
      Cc: Jack Wang <jack_wang@usish.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      11e16364
  13. 27 Aug, 2011 1 commit
  14. 26 Jul, 2011 1 commit
  15. 10 Apr, 2011 1 commit
  16. 31 Mar, 2011 1 commit