1. 09 Jan, 2012 5 commits
    • Lin Ming's avatar
      [SCSI] sd: check runtime PM status in sd_shutdown · 54f57588
      Lin Ming authored
      sd_shutdown is called during reboot/poweroff.
      It may fail if parent device, for example, ata port, was runtime suspended.
      
      Fix it by checking runtime PM status of sd.
      Exit immediately if sd was runtime suspended already.
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarLin Ming <ming.m.lin@intel.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      54f57588
    • Lin Ming's avatar
      [SCSI] check runtime PM status in system PM · 28640516
      Lin Ming authored
      The only high-level SCSI driver that currently implements runtime PM is
      sd, and sd treats runtime suspend exactly the same as the SUSPEND and
      HIBERNATE stages of system sleep, but not the same as the FREEZE stage.
      
      Therefore, when entering the SUSPEND or HIBERNATE stages of system
      sleep, we can skip the callback to the driver if the device is already
      in runtime suspend.  When entering the FREEZE stage, however, we should
      first issue a runtime resume.  The overhead of doing this is
      negligible, because a suspended drive would be spun up during the THAW
      stage of hibernation anyway.
      Signed-off-by: default avatarLin Ming <ming.m.lin@intel.com>
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      28640516
    • Lin Ming's avatar
      [SCSI] add flag to skip the runtime PM calls on the host · ae0751ff
      Lin Ming authored
      With previous change, now the ata port runtime suspend will happen as:
      
      disk suspend --> scsi target suspend --> scsi host suspend --> ata port
      suspend
      
      ata port(parent device) suspend need to schedule scsi EH which will resume
      scsi host(child device). Then the child device resume will in turn make
      parent device resume first. This is kind of recursive.
      
      This patch adds a new flag Scsi_Host::eh_noresume.
      ata port will set this flag to skip the runtime PM calls on scsi host.
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarLin Ming <ming.m.lin@intel.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      ae0751ff
    • Lin Ming's avatar
      ata: make ata port as parent device of scsi host · 9a6d6a2d
      Lin Ming authored
      Currently, the device tree of ata port and scsi host looks as below,
      
              /sys/devices/pci0000:00/0000:00:1f.2    (ahci controller)
              |-- ata1                                (ata port)
              |-- host0                               (scsi host)
                 |-- target0:0:0                      (scsi target)
                     |-- 0:0:0:0                      (disk)
      
      This patch makes ata port as parent device of scsi host, then it becomes
      
              /sys/devices/pci0000:00/0000:00:1f.2    (ahci controller)
              |-- ata1                                (ata port)
                  |-- host0                           (scsi host)
                      |-- target0:0:0                 (scsi target)
                          |-- 0:0:0:0                 (disk)
      
      With this change, the ata port runtime PM is easier.
      For example, the ata port runtime suspend will happen as,
      
      disk suspend --> scsi target suspend --> scsi host suspend --> ata port
      suspend.
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarLin Ming <ming.m.lin@intel.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      9a6d6a2d
    • Tejun Heo's avatar
      ahci: start engine only during soft/hard resets · 7faa33da
      Tejun Heo authored
      This is another attempt at fixing the same problem that 270dac35
      (libata: ahci_start_engine compliant to AHCI spec) tried to solve.
      Unfortunately, 270dac35 created regressions for a lot more common
      controllers and got reverted.
      
      This specific AHCI IP block becomes a brick if the DMA engine is
      started while DRQ is set.  It is not possible to avoid the condition
      completely but the most common occurrence is caused by spurious use of
      ahci_start_engine() from ahci_start_port() during init sequence.
      
      DMA engine is started after both soft and hard resets and
      ahci_start_port() is always followed by resets, so there is no reason
      to start DMA engine from ahci_start_port().
      
      This patch removes ahci_start_engine() invocation from
      ahci_start_port().  This change makes failure path of
      ahci_port_suspend() leave engine stopped without following resets.
      This is resolved by replacing ahci_start_port() call with
      ata_port_freeze() which forces resets afterwards, which is the better
      behavior anyway.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reported-by: default avatarBrian Norris <computersforpeace@gmail.com>
      Reported-by: default avatarJian Peng <jipeng2005@gmail.com>
      Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
      7faa33da
  2. 04 Jan, 2012 13 commits
  3. 03 Jan, 2012 9 commits
  4. 02 Jan, 2012 2 commits
  5. 31 Dec, 2011 6 commits
  6. 30 Dec, 2011 5 commits