From: Bartlomiej Zolnierkiewicz <bzolnier@xxxxxxxxx>
Subject: [PATCH] ide: rework handling of serialized ports
* hpt366: set IDE_HFLAG_SERIALIZE in hwif->host_flags if needed
in init_hwif_hpt366(). Remove HPT_SERIALIZE_IO while at it.
* Set IDE_HFLAG_SERIALIZE in hwif->host_flags if needed in
ide_init_port().
* Convert init_irq() to use IDE_HFLAG_SERIALIZE together with
hwif->host to find out ports which need to be serialized.
* Remove no longer needed save_match() and ide_hwif_t.serialized.
This patch should fix the incorrect grouping of port(s) from
host(s) that need serialization with port(s) that happen to use
the same IRQ(s) but are from the host(s) that don't need it.
Cc: Sergei Shtylyov <sshtylyov@xxxxxxxxxxxxx>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@xxxxxxxxx>
static int __devinit init_dma_hpt366(ide_hwif_t *hwif,[...]
Index: b/drivers/ide/ide-probe.c
===================================================================
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
+ if (hwif->host_flags & IDE_HFLAG_SERIALIZE) {
+ if (hwif->host == h->host)
+ match = h;
@@ -1436,10 +1398,8 @@ static void ide_init_port(ide_hwif_t *hw
}
if ((d->host_flags & IDE_HFLAG_SERIALIZE) ||
- ((d->host_flags & IDE_HFLAG_SERIALIZE_DMA) && hwif->dma_base)) {
- if (hwif->mate)
- hwif->mate->serialized = hwif->serialized = 1;
- }
+ ((d->host_flags & IDE_HFLAG_SERIALIZE_DMA) && hwif->dma_base))
+ hwif->host_flags |= IDE_HFLAG_SERIALIZE;