PATCH: Use the fixup layer to fix the various SI3112 hangs
The current driver looks at fields before it is safe too, we move the mod15rm bug handler to be a fixup and this ensures the probe has been completed before we use the ident data.
diff --exclude-from /usr/src/exclude -u --new-file --recursive linux.vanilla-2.6.10rc1/drivers/ide/pci/siimage.c linux-2.6.10rc1/drivers/ide/pci/siimage.c
--- linux.vanilla-2.6.10rc1/drivers/ide/pci/siimage.c 2004-11-05
15:34:47.000000000 +0000
+++ linux-2.6.10rc1/drivers/ide/pci/siimage.c 2004-11-05
16:08:46.000000000 +0000
@@ -988,6 +988,21 @@
}
/**
+ * siimage_fixup - post probe fixups
+ * @hwif: interface to fix up
+ *
+ * Called after drive probe we use this to decide whether the
+ * Seagate fixup must be applied. This used otbe in init_iops but
+ * that can occur before we know what drives are present.
+ */
+
+static void siimage_fixup(ide_hwif_t *hwif) {
+ /* Try and raise the rqsize */
+ if (!is_sata(hwif) || !is_dev_seagate_sata(&hwif->drives[0]))
+ hwif->rqsize = 128;
+}
+
+/**
* init_iops_siimage - set up iops
* @hwif: interface to set up
*
@@ -1007,9 +1022,8 @@
hwif->hwif_data = NULL;
- hwif->rqsize = 128;
- if (is_sata(hwif) && is_dev_seagate_sata(&hwif->drives[0]))
- hwif->rqsize = 15;
+ /* Pessimal until we finish probing */
+ hwif->rqsize = 15;
if (pci_get_drvdata(dev) == NULL)
return;
@@ -1101,6 +1115,7 @@
.channels = 2, \
.autodma = AUTODMA, \
.bootable = ON_BOARD, \
+ .fixup = siimage_fixup \
}
static ide_pci_device_t siimage_chipsets[] __devinitdata = {
all fixup patches applied
(after merging into 2 changesets & cleanup)
Quoted 2 lines · Bartlomiej Zolnierkiewicz
all fixup patches applied
(after merging into 2 changesets & cleanup)
and fixed bug preventing both fixups from correct working, fixup() must be called _before_ hwif_init() call!!!
Quoted 7 lines · Bartlomiej Zolnierkiewicz
Quoted 2 lines · Bartlomiej Zolnierkiewicz
all fixup patches applied
(after merging into 2 changesets & cleanup)and fixed bug preventing both fixups from correct working,
fixup()must be called _before_hwif_init()call!!!
Moving it is definitely better I agree there - it also allows fixup to be used for irq mangling and sg table tweaks which couldn't be done before.
I don't see why ita a bug in the present situation - and the code certainly works against 10rc1 and 2.6.9 that way but since moving it is better I've no problem at all
Quoted 11 lines · Alan Cox
Quoted 7 lines · Bartlomiej Zolnierkiewicz
Quoted 2 lines · Bartlomiej Zolnierkiewicz
all fixup patches applied
(after merging into 2 changesets & cleanup)and fixed bug preventing both fixups from correct working,
fixup()must be called _before_hwif_init()call!!!
Quoted 7 lines
Moving it is definitely better I agree there - it also allows fixup to be used for irq mangling and sg table tweaks which couldn't be done before.
I don't see why ita a bug in the present situation - and the code certainly works against 10rc1 and 2.6.9 that way but since moving it is better I've no problem at all
It depends which fixup you are talking about...
undecoded slave: hwif_init()->init_gendisk()-> drive->present checked (sysfs and devfs entries registered for "ghost" drive but fixup works)
siimage: hwif_init()->init_irq()->ide_init_queue()-> hwif->rqsize used (so fixup was executed too late previously)
Quoted 7 lines · Bartlomiej Zolnierkiewicz
It depends which fixup you are talking about...
undecoded slave: hwif_init()->init_gendisk()->
drive->presentchecked (sysfs and devfs entries registered for "ghost" drive but fixup works)siimage: hwif_init()->init_irq()->ide_init_queue()->
hwif->rqsizeused (so fixup was executed too late previously)
Ok yes I missed that.