1. 13 Feb, 2011 4 commits
    • James Bottomley's avatar
      [SCSI] libata: separate error handler into usable components · 64878c0e
      James Bottomley authored
      Right at the moment, the libata error handler is incredibly
      monolithic.  This makes it impossible to use from composite drivers
      like libsas and ipr which have to handle error themselves in the first
      instance.
      
      The essence of the change is to split the monolithic error handler
      into two components: one which handles a queue of ata commands for
      processing and the other which handles the back end of readying a
      port.  This allows the upper error handler fine grained control in
      calling libsas functions (and making sure they only get called for ATA
      commands whose lower errors have been fixed up).
      
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Jeff Garzik <jeff@garzik.org>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      64878c0e
    • James Bottomley's avatar
      [SCSI] libata: fix eh locking · 4451ef63
      James Bottomley authored
      The SCSI host eh_cmd_q should be protected by the host lock (not the
      port lock).  This probably doesn't matter that much at the moment,
      since we try to serialise the add and eh pieces, but it might matter
      in future for more convenient error handling.  Plus this switches
      libata to the standard eh pattern where you lock, remove from the cmd
      queue to a local list and unlock and then operate on the local list.
      
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Jeff Garzik <jeff@garzik.org>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      4451ef63
    • James Bottomley's avatar
      [SCSI] libata: fix locking for sas paths · b8784f77
      James Bottomley authored
      For historical reasons, libsas uses the scsi host lock as the ata port
      lock, and libata always uses the ata host.  For the old eh, this was
      largely irrelevant since the two locks were never mixed inside the
      code.  However, the new eh has a case where it nests acquisition of
      the host lock inside the port lock (this does look rather deadlock
      prone).  Obviously this would be an instant deadlock if the port lock
      were the host lock, so switch the libsas paths to use the ata host
      lock as well.
      
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Jeff Garzik <jeff@garzik.org>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      b8784f77
    • James Bottomley's avatar
      [SCSI] libata: plumb sas port scan into standard libata paths · 1f723867
      James Bottomley authored
      The function ata_sas_port_init() has always really done its own thing.
      However, as a precursor to moving to the libata new eh, it has to be
      properly using the standard libata scan paths.  This means separating
      the current libata scan paths into pieces which can be shared with
      libsas and pieces which cant (really just the async call and the host
      scan).
      
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Jeff Garzik <jeff@garzik.org>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      1f723867
  2. 12 Feb, 2011 36 commits