Commit 1fd1890594bd355a4217f5658a34763e77decee3

Authored by Bartlomiej Zolnierkiewicz
1 parent 6c61064162

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>

Showing 3 changed files with 9 additions and 5 deletions Side-by-side Diff

drivers/ide/ide-probe.c
... ... @@ -1367,8 +1367,11 @@
1367 1367 if (hwif->chipset != ide_dtc2278 || hwif->channel == 0)
1368 1368 hwif->port_ops = d->port_ops;
1369 1369  
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 + }
1372 1375  
1373 1376 hwif->swdma_mask = d->swdma_mask;
1374 1377 hwif->mwdma_mask = d->mwdma_mask;
drivers/ide/pci/sl82c105.c
... ... @@ -296,9 +296,6 @@
296 296 hwif->dma_start = &sl82c105_dma_start;
297 297 hwif->ide_dma_end = &sl82c105_dma_end;
298 298 hwif->dma_timeout = &sl82c105_dma_timeout;
299   -
300   - if (hwif->mate)
301   - hwif->serialized = hwif->mate->serialized = 1;
302 299 }
303 300  
304 301 static const struct ide_port_ops sl82c105_port_ops = {
... ... @@ -319,6 +316,7 @@
319 316 #if defined(CONFIG_LOPEC) || defined(CONFIG_SANDPOINT)
320 317 IDE_HFLAG_FORCE_LEGACY_IRQS |
321 318 #endif
  319 + IDE_HFLAG_SERIALIZE_DMA |
322 320 IDE_HFLAG_NO_AUTODMA,
323 321 .pio_mask = ATA_PIO5,
324 322 .mwdma_mask = ATA_MWDMA2,
... ... @@ -338,6 +336,7 @@
338 336 "revision %d, BM-DMA disabled\n", rev);
339 337 d.init_hwif = NULL;
340 338 d.mwdma_mask = 0;
  339 + d.host_flags &= ~IDE_HFLAG_SERIALIZE_DMA;
341 340 }
342 341  
343 342 return ide_setup_pci_device(dev, &d);
... ... @@ -1087,6 +1087,8 @@
1087 1087 /* unmask IRQs */
1088 1088 IDE_HFLAG_UNMASK_IRQS = (1 << 25),
1089 1089 IDE_HFLAG_ABUSE_SET_DMA_MODE = (1 << 26),
  1090 + /* serialize ports if DMA is possible (for sl82c105) */
  1091 + IDE_HFLAG_SERIALIZE_DMA = (1 << 27),
1090 1092 /* force host out of "simplex" mode */
1091 1093 IDE_HFLAG_CLEAR_SIMPLEX = (1 << 28),
1092 1094 /* DSC overlap is unsupported */