Re: [PATCH 3/4] libata: reimplement suspend/resume support using sdev->manage_start_stop

2007-03-20 Thread Oliver Neukum
Am Dienstag, 20. März 2007 17:39 schrieb Alan Cox:
> > * sdev->manage_start_stop is set to 1 in ata_scsi_slave_config().
> >   This fixes spindown on shutdown and suspend-to-disk.
> 
> Yay

Which kernel version is this?

Regards
Oliver
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/4] libata: reimplement suspend/resume support using sdev->manage_start_stop

2007-03-20 Thread Alan Cox
> * DPM is dropped.  This also simplifies code a lot.  Suspend/resume
>   status is port-wide now.

Makes sense

> * sdev->manage_start_stop is set to 1 in ata_scsi_slave_config().
>   This fixes spindown on shutdown and suspend-to-disk.

Yay
 
> Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>

Acked-by: Alan Cox <[EMAIL PROTECTED]>

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/4] libata: reimplement suspend/resume support using sdev->manage_start_stop

2007-03-20 Thread Christoph Hellwig
On Wed, Mar 21, 2007 at 12:25:33AM +0900, Tejun Heo wrote:
> Reimplement suspend/resume support using sdev->manage_start_stop.
> 
> * Device suspend/resume is now SCSI layer's responsibility and the
>   code is simplified a lot.

Finally.  I've been telling people to do it this way forever.

Can you please also kill the braindead suspend and resume scsi_host_template
methods now?

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/4] libata: reimplement suspend/resume support using sdev->manage_start_stop

2007-03-20 Thread Tejun Heo
Reimplement suspend/resume support using sdev->manage_start_stop.

* Device suspend/resume is now SCSI layer's responsibility and the
  code is simplified a lot.

* DPM is dropped.  This also simplifies code a lot.  Suspend/resume
  status is port-wide now.

* ata_scsi_device_suspend/resume() and ata_dev_ready() removed.

* Resume now has to wait for disk to spin up before proceeding.  I
  couldn't find easy way out as libata is in EH waiting for the
  disk to be ready and sd is waiting for EH to complete to issue
  START_STOP.

* sdev->manage_start_stop is set to 1 in ata_scsi_slave_config().
  This fixes spindown on shutdown and suspend-to-disk.

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
---
 drivers/ata/ahci.c  |4 
 drivers/ata/ata_generic.c   |6 -
 drivers/ata/ata_piix.c  |4 
 drivers/ata/libata-core.c   |   39 --
 drivers/ata/libata-eh.c |  237 
 drivers/ata/libata-scsi.c   |  129 -
 drivers/ata/pata_ali.c  |4 
 drivers/ata/pata_amd.c  |4 
 drivers/ata/pata_atiixp.c   |4 
 drivers/ata/pata_cmd640.c   |2 
 drivers/ata/pata_cmd64x.c   |4 
 drivers/ata/pata_cs5520.c   |4 
 drivers/ata/pata_cs5530.c   |4 
 drivers/ata/pata_cs5535.c   |4 
 drivers/ata/pata_cypress.c  |4 
 drivers/ata/pata_efar.c |4 
 drivers/ata/pata_hpt366.c   |4 
 drivers/ata/pata_hpt3x3.c   |4 
 drivers/ata/pata_it8213.c   |4 
 drivers/ata/pata_it821x.c   |4 
 drivers/ata/pata_ixp4xx_cf.c|2 
 drivers/ata/pata_jmicron.c  |4 
 drivers/ata/pata_marvell.c  |4 
 drivers/ata/pata_mpc52xx.c  |4 
 drivers/ata/pata_mpiix.c|4 
 drivers/ata/pata_netcell.c  |4 
 drivers/ata/pata_ns87410.c  |4 
 drivers/ata/pata_oldpiix.c  |4 
 drivers/ata/pata_opti.c |4 
 drivers/ata/pata_optidma.c  |4 
 drivers/ata/pata_pdc202xx_old.c |4 
 drivers/ata/pata_radisys.c  |4 
 drivers/ata/pata_rz1000.c   |6 -
 drivers/ata/pata_sc1200.c   |4 
 drivers/ata/pata_scc.c  |4 
 drivers/ata/pata_serverworks.c  |4 
 drivers/ata/pata_sil680.c   |4 
 drivers/ata/pata_sis.c  |4 
 drivers/ata/pata_triflex.c  |4 
 drivers/ata/pata_via.c  |4 
 drivers/ata/sata_inic162x.c |4 
 drivers/ata/sata_nv.c   |8 -
 drivers/ata/sata_sil.c  |4 
 drivers/ata/sata_sil24.c|4 
 include/linux/libata.h  |   14 --
 45 files changed, 14 insertions(+), 573 deletions(-)

Index: work/drivers/ata/ahci.c
===
--- work.orig/drivers/ata/ahci.c
+++ work/drivers/ata/ahci.c
@@ -243,10 +243,6 @@ static struct scsi_host_template ahci_sh
.slave_configure= ata_scsi_slave_config,
.slave_destroy  = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
-#ifdef CONFIG_PM
-   .suspend= ata_scsi_device_suspend,
-   .resume = ata_scsi_device_resume,
-#endif
 };
 
 static const struct ata_port_operations ahci_ops = {
Index: work/drivers/ata/ata_generic.c
===
--- work.orig/drivers/ata/ata_generic.c
+++ work/drivers/ata/ata_generic.c
@@ -83,7 +83,7 @@ static int generic_set_mode(struct ata_p
 
for (i = 0; i < ATA_MAX_DEVICES; i++) {
struct ata_device *dev = &ap->device[i];
-   if (ata_dev_ready(dev)) {
+   if (ata_dev_enabled(dev)) {
/* We don't really care */
dev->pio_mode = XFER_PIO_0;
dev->dma_mode = XFER_MW_DMA_0;
@@ -119,10 +119,6 @@ static struct scsi_host_template generic
.slave_configure= ata_scsi_slave_config,
.slave_destroy  = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
-#ifdef CONFIG_PM
-   .resume = ata_scsi_device_resume,
-   .suspend= ata_scsi_device_suspend,
-#endif
 };
 
 static struct ata_port_operations generic_port_ops = {
Index: work/drivers/ata/ata_piix.c
===
--- work.orig/drivers/ata/ata_piix.c
+++ work/drivers/ata/ata_piix.c
@@ -275,10 +275,6 @@ static struct scsi_host_template piix_sh
.slave_configure= ata_scsi_slave_config,
.slave_destroy  = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
-#ifdef CONFIG_PM
-   .resume = ata_scsi_device_resume,
-   .suspend= ata_scsi_device_suspend,
-#endif
 };
 
 static const struct ata_port_operations piix_pata_ops = {
Index: work/drivers/ata/libata-core.c
===