1. 29 Feb, 2012 8 commits
    • Dan Williams's avatar
      [SCSI] isci: fix interpretation of "hard" reset · 92776991
      Dan Williams authored
      A hard reset to isci in the direct-attached case is one where the driver
      internally manages debouncing the link.  In the sas-expander-attached
      case a hard reset is one that clears affiliations.  The driver should
      not be prematurely dropping affiliations at run time, that decision (to
      force expander hard resets to ata devices) is left to userspace to
      manage.  So, arrange for I_T_nexus resets to be sas-link-resets in the
      expander-attached case and isci-hard-resets in the direct-attached case.
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      92776991
    • Dan Williams's avatar
      [SCSI] isci: kill isci_port->status · fca4ecbd
      Dan Williams authored
      It only tracks whether the port is stopping in order to gate new devices
      being discovered while the port is stopping.  However, since the check
      and subsequent handling is unlocked there is nothing to stop the port
      from going down immediately after the check.
      
      Driver is already prepared to handle devices arriving on stale ports,
      and those will be cleaned up by an eventual ->lldd_dev_gone()
      notification.
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      fca4ecbd
    • Dan Williams's avatar
      [SCSI] isci: kill iphy->isci_port lookups · c132f692
      Dan Williams authored
      This field is a holdover from the OS abstraction conversion.  The stable
      phy to port lookups are done via iphy->ownining_port under scic_lock.
      After this conversion to use port->lldd_port the only volatile lookup is
      the initial lookup in isci_port_formed().  After that point any lookup
      via a successfully notified domain_device is guaranteed to be valid
      until the domain_device is destroyed.
      
      Delete ->start_complete as it is only set once and is set as a
      consequence of the port going link up, by definition of getting a port
      formed event the port is "ready".
      
      While we are correcting port lookups also move the asd_sas_port table
      out from under the isci_port.  This is to preclude any temptation to use
      container_of() to convert an asd_sas_port to an isci_port, the
      association is dynamic and under libsas control.
      Tested-by: default avatarMaciej Trela <maciej.trela@intel.com>
      [dmilburn@redhat.com: fix i686 compile error]
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      c132f692
    • Dan Williams's avatar
      [SCSI] libsas: don't recover 'gone' devices in sas_ata_hard_reset() · cb48d672
      Dan Williams authored
      The commands that timeout when a disk is forcibly removed may trigger
      libata to attempt recovery of the device.  If libsas has decided to
      remove the device don't permit ata to continue to issue resets to its
      last known phy.
      
      The primary motivation for this patch is hotplug testing by writing 0 to
      /sys/class/sas_phy/phyX/enable.  Without this check this test leads to
      libata issuing a reset and re-enabling the device that wants to be torn
      down.
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      cb48d672
    • 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
    • Dan Williams's avatar
      [SCSI] libsas: check for 'gone' expanders in smp_execute_task() · 3a9c5560
      Dan Williams authored
      No sense in issuing or retrying commands to an expander that has been
      removed.
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      3a9c5560
    • Dan Williams's avatar
      [SCSI] libsas: don't mark expanders as gone when a child device is removed · 0508c2f3
      Dan Williams authored
      Commit 56dd2c06 "[SCSI] libsas: Don't issue commands to devices that
      have been hot-removed" marked the parent device of an end-device as gone
      when all the phys to the end device have been deleted.
      
      The expander device is still present until its parent is removed.  This
      is a benign change until the smp_execute_task() path is taught to check
      ->gone.
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      0508c2f3
    • Dan Williams's avatar
      [SCSI] libsas: poll for ata device readiness after reset · 36a39947
      Dan Williams authored
      Use ata_wait_after_reset() to poll for link recovery after a reset.
      This combined with sas_ha->eh_mutex prevents expander rediscovery from
      probing phys in an intermediate state.  Local discovery does not have a
      mechanism to filter link status changes during this timeout, so it
      remains the responsibility of lldds to prevent premature port teardown.
      Although once all lldd's support ->lldd_ata_check_ready() that could be
      used as a gate to local port teardown.
      
      The signature fis is re-transmitted when the link comes back so we
      should be revalidating the ata device class, but that is left to a future
      patch.
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      36a39947
  2. 19 Feb, 2012 32 commits