[patch] Minor IDE addition (resetproc)

Benjamin Herrenschmidt (bh40@calva.net)
Tue, 31 Aug 1999 17:17:12 +0200


Greetings !

Here's a small patch that adds a "reset" callback to the hwif structure.
This callback can be set by the controller's init function and should (If
I wasn't too blind) be initialized to NULL by default.

The reason for that is that I encountered at least 1 controller (the
Winbond xx553) which, according to the doc, will reset some internal
parameters (like switching to 8 bits IDE) when an IDE reset occurs via
the control register. So those controllers need a way to set things back
up to useable values when this happens.

I'll post some improved Winbond driver later, when I have completely
cleaned it and tested it on another machine. (Mostly based on the ARM
code with a couple of fixes).

Regards,
Benjamin.

--- cvs2.2/drivers/block/ide.h Sat May 29 19:10:16 1999
+++ linux.ben2/drivers/block/ide.h Thu Aug 26 16:31:42 1999
@@ -325,6 +325,7 @@
* This is used to provide support for strange interfaces
*/
typedef void (ide_selectproc_t) (ide_drive_t *);
+typedef void (ide_resetproc_t) (ide_drive_t *);

/*
* hwif_chipset_t is used to keep track of the specific hardware
@@ -353,6 +354,7 @@
struct gendisk *gd; /* gendisk structure */
ide_tuneproc_t *tuneproc; /* routine to tune PIO mode for drives */
ide_selectproc_t *selectproc; /* tweaks hardware to select drive */
+ ide_resetproc_t *resetproc; /* routine to reset controller after a disk
reset */
ide_dmaproc_t *dmaproc; /* dma read/write/abort routine */
unsigned long *dmatable; /* dma physical region descriptor table */
struct hwif_s *mate; /* other hwif from same PCI chip */

--- cvs2.2/drivers/block/ide.c Mon Aug 30 17:15:41 1999
+++ linux.ben2/drivers/block/ide.c Thu Aug 26 15:24:59 1999
@@ -677,6 +677,14 @@
udelay(10); /* more than enough time */
hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE;
ide_set_handler (drive, &reset_pollfunc, HZ/20);
+
+
+ /* Some weird controller like resetting themselves to a strange
+ state when the disks are reset this way. At least, the Winbond
+ 553 documentation says that */
+ if (hwif->resetproc != NULL)
+ hwif->resetproc(drive);
+
#endif /* OK_TO_RESET_CONTROLLER */

-- 
           Perso. e-mail: <mailto:bh40@calva.net>
           Work   e-mail: <mailto:benh@mipsys.com>
BenH.      Web   : <http://calvaweb.calvacom.fr/bh40/>

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/