Skip to content

Commit 1024c5f

Browse files
committed
ide: IDE_HFLAG_SERIALIZE_DMA bugfix
Patch re-ordering could be harmful: commit 1fd1890 Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Date: Sat Apr 26 22:25:24 2008 +0200 ide: add IDE_HFLAG_SERIALIZE_DMA host flag ... is buggy because ->init_dma method / ide_hwif_setup_dma() is called before IDE_HFLAG_SERIALIZE_DMA host flag is checked. Fix it by checking IDE_HFLAG_SERIALIZE[_DMA] after DMA initialization. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
1 parent afa26be commit 1024c5f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎drivers/ide/ide-probe.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,12 +1355,6 @@ static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
13551355
if (hwif->chipset != ide_dtc2278 || hwif->channel == 0)
13561356
hwif->port_ops = d->port_ops;
13571357

1358-
if ((d->host_flags & IDE_HFLAG_SERIALIZE) ||
1359-
((d->host_flags & IDE_HFLAG_SERIALIZE_DMA) && hwif->dma_base)) {
1360-
if (hwif->mate)
1361-
hwif->mate->serialized = hwif->serialized = 1;
1362-
}
1363-
13641358
hwif->swdma_mask = d->swdma_mask;
13651359
hwif->mwdma_mask = d->mwdma_mask;
13661360
hwif->ultra_mask = d->udma_mask;
@@ -1382,6 +1376,12 @@ static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
13821376
hwif->dma_ops = d->dma_ops;
13831377
}
13841378

1379+
if ((d->host_flags & IDE_HFLAG_SERIALIZE) ||
1380+
((d->host_flags & IDE_HFLAG_SERIALIZE_DMA) && hwif->dma_base)) {
1381+
if (hwif->mate)
1382+
hwif->mate->serialized = hwif->serialized = 1;
1383+
}
1384+
13851385
if (d->host_flags & IDE_HFLAG_RQSIZE_256)
13861386
hwif->rqsize = 256;
13871387

0 commit comments

Comments
 (0)