All of lore.kernel.org
 help / color / mirror / Atom feed
* 2.6.17-rc5-git1: regression: resume from suspend(RAM) fails: libata issue
@ 2006-05-26 19:25 Mark Lord
  2006-05-26 19:44 ` Mark Lord
  0 siblings, 1 reply; 13+ messages in thread
From: Mark Lord @ 2006-05-26 19:25 UTC (permalink / raw)
  To: Linux Kernel, linux-ide-owner, Tejun Heo, Jeff Garzik

My ata_piix based Notebook (Dell i9300) suspends/resumes perfectly (RAM or disk)
with 2.6.16.xx kernels, but fails resume on 2.6.17-rc5-git1 (the first 2.6.17-*
I've attempted on this machine).

On resume from RAM, after a 30-second-ish timeout, the screen comes on
but the hard disk is NOT accessible.  "dmesg" in an already-open window
shows this (typed in from handwritten notes):

sd 0:0:0:0: SCSI error: return code = 0x40000
end_request: I/O error, /dev/sda, sector nnnnnnn
sd 0:0:0:0: SCSI error: return code = 0x40000
end_request: I/O error, /dev/sda, sector nnnnnnn
sd 0:0:0:0: SCSI error: return code = 0x40000
end_request: I/O error, /dev/sda, sector nnnnnnn
sd 0:0:0:0: SCSI error: return code = 0x40000
end_request: I/O error, /dev/sda, sector nnnnnnn
sd 0:0:0:0: SCSI error: return code = 0x40000
end_request: I/O error, /dev/sda, sector nnnnnnn
sd 0:0:0:0: SCSI error: return code = 0x40000
end_request: I/O error, /dev/sda, sector nnnnnnn
sd 0:0:0:0: SCSI error: return code = 0x40000
end_request: I/O error, /dev/sda, sector nnnnnnn

(the nnnnnnn was actually a real number, different on each message).

Is there a fix already floating around for this?

Cheers

^ permalink raw reply	[flat|nested] 13+ messages in thread
* [PATCH] Add ata_piix's own resume function
@ 2006-05-26  9:04 zhao, forrest
  2006-05-26 23:05 ` Jens Axboe
  0 siblings, 1 reply; 13+ messages in thread
From: zhao, forrest @ 2006-05-26  9:04 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Jens Axboe, Tejun Heo, linux-ide

For ata_piix resume operation, it first waits for BUSY bit clear,
then calls ata_device_resume().


The patch is against #upstream 957d2df1801865eb1e63864bc63b970aa9c460ba

Thanks,
Forrest

Signed-off-by: Forrest Zhao <forrest.zhao@intel.com>
---

 drivers/scsi/ata_piix.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

55116b42caac4c48b2b85228e5b961d71266de22
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c
index 1db007f..405f039 100644
--- a/drivers/scsi/ata_piix.c
+++ b/drivers/scsi/ata_piix.c
@@ -90,6 +90,7 @@
 #include <linux/delay.h>
 #include <linux/device.h>
 #include <scsi/scsi_host.h>
+#include <scsi/scsi_device.h>
 #include <linux/libata.h>
 
 #define DRV_NAME	"ata_piix"
@@ -151,6 +152,7 @@ static int piix_pata_probe_reset(struct 
 static int piix_sata_probe_reset(struct ata_port *ap, unsigned int *classes);
 static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev);
 static void piix_set_dmamode (struct ata_port *ap, struct ata_device *adev);
+static int piix_scsi_device_resume(struct scsi_device *sdev);
 
 static unsigned int in_module_init = 1;
 
@@ -220,7 +222,7 @@ static struct scsi_host_template piix_sh
 	.dma_boundary		= ATA_DMA_BOUNDARY,
 	.slave_configure	= ata_scsi_slave_config,
 	.bios_param		= ata_std_bios_param,
-	.resume			= ata_scsi_device_resume,
+	.resume			= piix_scsi_device_resume,
 	.suspend		= ata_scsi_device_suspend,
 };
 
@@ -710,6 +712,21 @@ static void piix_set_dmamode (struct ata
 	}
 }
 
+int piix_scsi_device_resume(struct scsi_device *sdev)
+{
+	struct ata_port *ap = ata_shost_to_port(sdev->host);
+	struct ata_device *dev = &ap->device[sdev->id];
+	u8 status;
+
+	status = ata_busy_wait(ap, ATA_BUSY, 200000);
+	if (status & ATA_BUSY) {
+		ata_port_printk(ap, KERN_ERR, "port failed to resume "
+				"in 2 secs)\n");
+		return 1;
+	}
+	return ata_device_resume(dev);
+}
+
 #define AHCI_PCI_BAR 5
 #define AHCI_GLOBAL_CTL 0x04
 #define AHCI_ENABLE (1 << 31)
-- 
1.2.6

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2006-05-27 18:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-26 19:25 2.6.17-rc5-git1: regression: resume from suspend(RAM) fails: libata issue Mark Lord
2006-05-26 19:44 ` Mark Lord
2006-05-26 23:42   ` Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2006-05-26  9:04 [PATCH] Add ata_piix's own resume function zhao, forrest
2006-05-26 23:05 ` Jens Axboe
2006-05-27  3:22   ` 2.6.17-rc5-git1: regression: resume from suspend(RAM) fails: libata issue Mark Lord
2006-05-27  3:32     ` Linus Torvalds
2006-05-27  3:41       ` Jeff Garzik
2006-05-27  6:29       ` Jens Axboe
2006-05-27  6:36         ` Jeff Garzik
2006-05-27  7:01           ` Jens Axboe
2006-05-27  7:06             ` Jeff Garzik
2006-05-27 18:46         ` Mark Lord
2006-05-27  3:35     ` Jeff Garzik
2006-05-27  6:20     ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.