Update to ide-scsi error handling
PATCH 1/1 Update to ide-scsi error handling
One of my ATAPI drives developed a real dislike to 2.5.55 and above, which gave me plenty of opportunity to improve ide-scsi's error handling :-) .
To handle ide device resets and be able to wait for them in the scsi context, I have changed ide_do_reset and friends in drivers/ide/ide-iops.c to set the busy flag on the hwgroup while the reset is in progress.
I noticed, that ide-scsi didn't consistently use the printk priorities, so I touched that up while I was at it.
The resulting changes (also attached as two separate files - I expect different owners will have to apply them - ide-iops is a prerequisite for the ide-scsi patch to work):
ide/ide-iops.c renamed from ide/ide-iops.c.l2559 +5 -0
@@ -986,6 +986,7 @@ }/* done polling */ hwgroup->poll_timeout =0 ; + hwgroup->busy--;return ide_stopped; }
@@ -1005,6 +1006,7 @@if (hwif->reset_poll (drive)) {printk (KERN_ERR "%s: host reset_poll failure for %s.\n" , hwif->name, drive->name); + hwgroup->busy--;return ide_stopped; } }
@@ -1050,6 +1052,7 @@ } } hwgroup->poll_timeout =0 ;/* done polling */ + hwgroup->busy--;return ide_stopped; }
@@ -1135,6 +1138,7 @@#if OK_TO_RESET_CONTROLLER if (!IDE_CONTROL_REG ) {local_irq_restore (flags); + hwgroup->busy--;return ide_stopped; }
@@ -1217,6 +1221,7 @@u8 unmask = drive->unmask;# endif +HWGROUP (drive)->busy++;if (HWGROUP (drive)->handler !=NULL ) {unsigned long flags;spin_lock_irqsave (&ide_lock, flags);
scsi/ide-scsi.c renamed from scsi/ide-scsi.c.l2559 +117 -48
308 lines not on this page · raw message
Works well for me now, though with some of the timeouts being substantial it can appear slow. Feedback welcome.
Thanks, Willem Riede.
Quoted 2 lines · Willem Riede
One of my ATAPI drives developed a real dislike to 2.5.55 and above, which gave me plenty of opportunity to improve ide-scsi's error handling :-) .
Cool. I've rewritten the do_reset logic in the 2.5.64-ac code so that it has a few less races
Quoted 3 lines
To handle ide device resets and be able to wait for them in the scsi context, I have changed
ide_do_resetand friends indrivers/ide/ide-iops.cto set the busy flag on the hwgroup while the reset is in progress.
Duplicated work, but I'm kind of happy because we both agreed on that part of the solution being safe 8)
Quoted 2 lines
I noticed, that ide-scsi didn't consistently use the printk priorities, so I touched that up while I was at it.
Thanks