• 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
libata-scsi.c 98.7 KB