[ide] siimage: fix the various SI3112 hangs

From: Alan Cox <alan@lxorguk.ukuu.org.uk>
(some changes by me - bart)

The current driver looks at fields before it is safe to, we move the
mod15rm bug handler to be a fixup and this ensures the probe has been
completed before we use the ident data.
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent dc3f1bf7
...@@ -954,6 +954,22 @@ static int is_dev_seagate_sata(ide_drive_t *drive) ...@@ -954,6 +954,22 @@ static int is_dev_seagate_sata(ide_drive_t *drive)
return 0; return 0;
} }
/**
* 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 to be in init_iops but
* that can occur before we know what drives are present.
*/
static void __devinit 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 * init_iops_siimage - set up iops
* @hwif: interface to set up * @hwif: interface to set up
...@@ -974,8 +990,7 @@ static void __devinit init_iops_siimage(ide_hwif_t *hwif) ...@@ -974,8 +990,7 @@ static void __devinit init_iops_siimage(ide_hwif_t *hwif)
hwif->hwif_data = NULL; hwif->hwif_data = NULL;
hwif->rqsize = 128; /* Pessimal until we finish probing */
if (is_sata(hwif) && is_dev_seagate_sata(&hwif->drives[0]))
hwif->rqsize = 15; hwif->rqsize = 15;
if (pci_get_drvdata(dev) == NULL) if (pci_get_drvdata(dev) == NULL)
...@@ -1064,6 +1079,7 @@ static void __devinit init_hwif_siimage(ide_hwif_t *hwif) ...@@ -1064,6 +1079,7 @@ static void __devinit init_hwif_siimage(ide_hwif_t *hwif)
.init_chipset = init_chipset_siimage, \ .init_chipset = init_chipset_siimage, \
.init_iops = init_iops_siimage, \ .init_iops = init_iops_siimage, \
.init_hwif = init_hwif_siimage, \ .init_hwif = init_hwif_siimage, \
.fixup = siimage_fixup, \
.channels = 2, \ .channels = 2, \
.autodma = AUTODMA, \ .autodma = AUTODMA, \
.bootable = ON_BOARD, \ .bootable = ON_BOARD, \
......
...@@ -707,9 +707,9 @@ void ide_setup_pci_device (struct pci_dev *dev, ide_pci_device_t *d) ...@@ -707,9 +707,9 @@ void ide_setup_pci_device (struct pci_dev *dev, ide_pci_device_t *d)
ata_index_t index_list = do_ide_setup_pci_device(dev, d, 1); ata_index_t index_list = do_ide_setup_pci_device(dev, d, 1);
if ((index_list.b.low & 0xf0) != 0xf0) if ((index_list.b.low & 0xf0) != 0xf0)
probe_hwif_init(&ide_hwifs[index_list.b.low]); probe_hwif_init_with_fixup(&ide_hwifs[index_list.b.low], d->fixup);
if ((index_list.b.high & 0xf0) != 0xf0) if ((index_list.b.high & 0xf0) != 0xf0)
probe_hwif_init(&ide_hwifs[index_list.b.high]); probe_hwif_init_with_fixup(&ide_hwifs[index_list.b.high], d->fixup);
create_proc_ide_interfaces(); create_proc_ide_interfaces();
} }
......
...@@ -1428,6 +1428,7 @@ typedef struct ide_pci_device_s { ...@@ -1428,6 +1428,7 @@ typedef struct ide_pci_device_s {
void (*init_iops)(ide_hwif_t *); void (*init_iops)(ide_hwif_t *);
void (*init_hwif)(ide_hwif_t *); void (*init_hwif)(ide_hwif_t *);
void (*init_dma)(ide_hwif_t *, unsigned long); void (*init_dma)(ide_hwif_t *, unsigned long);
void (*fixup)(ide_hwif_t *);
u8 channels; u8 channels;
u8 autodma; u8 autodma;
ide_pci_enablebit_t enablebits[2]; ide_pci_enablebit_t enablebits[2];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment