diff mbox

[v5,1/6] ata: make ata port as parent device of scsi host

Message ID 1323048028-10421-2-git-send-email-ming.m.lin@intel.com
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Lin Ming Dec. 5, 2011, 1:20 a.m. UTC
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: Tejun Heo <tj@kernel.org>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
---
 drivers/ata/libata-scsi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Jeff Garzik Dec. 7, 2011, 8:04 p.m. UTC | #1
On 12/04/2011 08:20 PM, Lin Ming wrote:
> 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: Tejun Heo<tj@kernel.org>
> Signed-off-by: Lin Ming<ming.m.lin@intel.com>
> ---
>   drivers/ata/libata-scsi.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)

applied 1-6, thanks



--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 2a5412e..7ae1e77 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3398,7 +3398,7 @@  int ata_scsi_add_hosts(struct ata_host *host, struct scsi_host_template *sht)
 		 */
 		shost->max_host_blocked = 1;
 
-		rc = scsi_add_host(ap->scsi_host, ap->host->dev);
+		rc = scsi_add_host(ap->scsi_host, &ap->tdev);
 		if (rc)
 			goto err_add;
 	}