Re: disk restart failure after suspend

Tino Keitel
2009-10-19T18:05:09Z

[-- Attachment #1: Type: text/plain, Size: 81 bytes --]

Hi,

for reference, I attach the patch I used to workaround this.

Regards,
Tino

[-- Attachment #2: retry_restart_disk.diff --]
[-- Type: text/x-diff, Size: 789 bytes --]

--- sd.c 2009-10-19 14:19:20.199156476 +0200
+++ linux-2.6.31/drivers/scsi/sd.c 2009-10-14 22:38:27.922974268 +0200
@@ -2183,6 +2185,7 @@
struct scsi_sense_hdr sshdr;
struct scsi_device *sdp = sdkp->device;
int res;
+ int i = 0;

if (start)
cmd[4] |= 1; /* START */
@@ -2193,8 +2196,13 @@
if (!scsi_device_online(sdp))
return -ENODEV;

- res = scsi_execute_req(sdp, cmd, DMA_NONE, NULL, 0, &sshdr,
- SD_TIMEOUT, SD_MAX_RETRIES, NULL);
+ while (res = scsi_execute_req(sdp, cmd, DMA_NONE, NULL, 0, &sshdr,
+ SD_TIMEOUT, SD_MAX_RETRIES, NULL) && i < 10) {
+ i++;
+ sd_printk(KERN_WARNING, sdkp, "START_STOP FAILED, retrying.\n");
+ msleep(2000);
+ }
+
if (res) {
sd_printk(KERN_WARNING, sdkp, "START_STOP FAILED\n");
sd_print_result(sdkp, res);

[-- Attachment #3: Type: text/plain, Size: 399 bytes --]

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference

[-- Attachment #4: Type: text/plain, Size: 0 bytes --]