1. 19 Feb, 2012 39 commits
  2. 18 Feb, 2012 1 commit
    • Alan Stern's avatar
      [SCSI] scsi_pm: Fix bug in the SCSI power management handler · fea6d607
      Alan Stern authored
      This patch (as1520) fixes a bug in the SCSI layer's power management
      implementation.
      
      LUN scanning can be carried out asynchronously in do_scan_async(), and
      sd uses an asynchronous thread for the time-consuming parts of disk
      probing in sd_probe_async().  Currently nothing coordinates these
      async threads with system sleep transitions; they can and do attempt
      to continue scanning/probing SCSI devices even after the host adapter
      has been suspended.  As one might expect, the outcome is not ideal.
      
      This is what the "prepare" stage of system suspend was created for.
      After the prepare callback has been called for a host, target, or
      device, drivers are not allowed to register any children underneath
      them.  Currently the SCSI prepare callback is not implemented; this
      patch rectifies that omission.
      
      For SCSI hosts, the prepare routine calls scsi_complete_async_scans()
      to wait until async scanning is finished.  It might be slightly more
      efficient to wait only until the host in question has been scanned,
      but there's currently no way to do that.  Besides, during a sleep
      transition we will ultimately have to wait until all the host scanning
      has finished anyway.
      
      For SCSI devices, the prepare routine calls async_synchronize_full()
      to wait until sd probing is finished.  The routine does nothing for
      SCSI targets, because asynchronous target scanning is done only as
      part of host scanning.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      CC: <stable@kernel.org>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      fea6d607