Skip to content

Commit 1fd1890

Browse files
committed
ide: add IDE_HFLAG_SERIALIZE_DMA host flag
* Add IDE_HFLAG_SERIALIZE_DMA host flag to serialize ports if DMA is available and handle it in ide_init_port(). * Convert sl82c105 host driver to use this new flag. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
1 parent 6c61064 commit 1fd1890

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

‎drivers/ide/ide-probe.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,8 +1367,11 @@ static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
13671367
if (hwif->chipset != ide_dtc2278 || hwif->channel == 0)
13681368
hwif->port_ops = d->port_ops;
13691369

1370-
if ((d->host_flags & IDE_HFLAG_SERIALIZE) && hwif->mate)
1371-
hwif->mate->serialized = hwif->serialized = 1;
1370+
if ((d->host_flags & IDE_HFLAG_SERIALIZE) ||
1371+
((d->host_flags & IDE_HFLAG_SERIALIZE_DMA) && hwif->dma_base)) {
1372+
if (hwif->mate)
1373+
hwif->mate->serialized = hwif->serialized = 1;
1374+
}
13721375

13731376
hwif->swdma_mask = d->swdma_mask;
13741377
hwif->mwdma_mask = d->mwdma_mask;

‎drivers/ide/pci/sl82c105.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,6 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
296296
hwif->dma_start = &sl82c105_dma_start;
297297
hwif->ide_dma_end = &sl82c105_dma_end;
298298
hwif->dma_timeout = &sl82c105_dma_timeout;
299-
300-
if (hwif->mate)
301-
hwif->serialized = hwif->mate->serialized = 1;
302299
}
303300

304301
static const struct ide_port_ops sl82c105_port_ops = {
@@ -319,6 +316,7 @@ static const struct ide_port_info sl82c105_chipset __devinitdata = {
319316
#if defined(CONFIG_LOPEC) || defined(CONFIG_SANDPOINT)
320317
IDE_HFLAG_FORCE_LEGACY_IRQS |
321318
#endif
319+
IDE_HFLAG_SERIALIZE_DMA |
322320
IDE_HFLAG_NO_AUTODMA,
323321
.pio_mask = ATA_PIO5,
324322
.mwdma_mask = ATA_MWDMA2,
@@ -338,6 +336,7 @@ static int __devinit sl82c105_init_one(struct pci_dev *dev, const struct pci_dev
338336
"revision %d, BM-DMA disabled\n", rev);
339337
d.init_hwif = NULL;
340338
d.mwdma_mask = 0;
339+
d.host_flags &= ~IDE_HFLAG_SERIALIZE_DMA;
341340
}
342341

343342
return ide_setup_pci_device(dev, &d);

‎include/linux/ide.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,8 @@ enum {
10871087
/* unmask IRQs */
10881088
IDE_HFLAG_UNMASK_IRQS = (1 << 25),
10891089
IDE_HFLAG_ABUSE_SET_DMA_MODE = (1 << 26),
1090+
/* serialize ports if DMA is possible (for sl82c105) */
1091+
IDE_HFLAG_SERIALIZE_DMA = (1 << 27),
10901092
/* force host out of "simplex" mode */
10911093
IDE_HFLAG_CLEAR_SIMPLEX = (1 << 28),
10921094
/* DSC overlap is unsupported */

0 commit comments

Comments
 (0)