Skip to content

Commit ddddefa

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide: cy82c693: fix PCI device selection icside: DMA support fix IDE: Don't powerdown Compaq Triflex IDE device on suspend piix: ICH7 MWDMA1 errata
2 parents e27fc7e + 0ab3d8b commit ddddefa

4 files changed

Lines changed: 29 additions & 13 deletions

File tree

‎drivers/ide/cy82c693.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Copyright (C) 1998-2000 Andreas S. Krebs (akrebs@altavista.net), Maintainer
33
* Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org>, Integrator
4-
* Copyright (C) 2007-2010 Bartlomiej Zolnierkiewicz
4+
* Copyright (C) 2007-2011 Bartlomiej Zolnierkiewicz
55
*
66
* CYPRESS CY82C693 chipset IDE controller
77
*
@@ -90,7 +90,7 @@ static void cy82c693_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
9090
u8 time_16, time_8;
9191

9292
/* select primary or secondary channel */
93-
if (hwif->index > 0) { /* drive is on the secondary channel */
93+
if (drive->dn > 1) { /* drive is on the secondary channel */
9494
dev = pci_get_slot(dev->bus, dev->devfn+1);
9595
if (!dev) {
9696
printk(KERN_ERR "%s: tune_drive: "
@@ -141,7 +141,7 @@ static void cy82c693_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
141141
pci_write_config_byte(dev, CY82_IDE_SLAVE_IOW, time_16);
142142
pci_write_config_byte(dev, CY82_IDE_SLAVE_8BIT, time_8);
143143
}
144-
if (hwif->index > 0)
144+
if (drive->dn > 1)
145145
pci_dev_put(dev);
146146
}
147147

‎drivers/ide/icside.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,8 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
521521
if (ec->dma != NO_DMA && !request_dma(ec->dma, DRV_NAME)) {
522522
d.init_dma = icside_dma_init;
523523
d.port_ops = &icside_v6_port_ops;
524+
} else
524525
d.dma_ops = NULL;
525-
}
526526

527527
ret = ide_host_register(host, &d, hws);
528528
if (ret)

‎drivers/ide/piix.c‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ static const struct ide_port_ops ich_port_ops = {
331331
.udma_mask = udma, \
332332
}
333333

334-
#define DECLARE_ICH_DEV(udma) \
334+
#define DECLARE_ICH_DEV(mwdma, udma) \
335335
{ \
336336
.name = DRV_NAME, \
337337
.init_chipset = init_chipset_ich, \
@@ -340,7 +340,7 @@ static const struct ide_port_ops ich_port_ops = {
340340
.port_ops = &ich_port_ops, \
341341
.pio_mask = ATA_PIO4, \
342342
.swdma_mask = ATA_SWDMA2_ONLY, \
343-
.mwdma_mask = ATA_MWDMA12_ONLY, \
343+
.mwdma_mask = mwdma, \
344344
.udma_mask = udma, \
345345
}
346346

@@ -362,13 +362,15 @@ static const struct ide_port_info piix_pci_info[] __devinitdata = {
362362
/* 2: PIIX4 */
363363
DECLARE_PIIX_DEV(ATA_UDMA2),
364364
/* 3: ICH0 */
365-
DECLARE_ICH_DEV(ATA_UDMA2),
365+
DECLARE_ICH_DEV(ATA_MWDMA12_ONLY, ATA_UDMA2),
366366
/* 4: ICH */
367-
DECLARE_ICH_DEV(ATA_UDMA4),
367+
DECLARE_ICH_DEV(ATA_MWDMA12_ONLY, ATA_UDMA4),
368368
/* 5: PIIX4 */
369369
DECLARE_PIIX_DEV(ATA_UDMA4),
370-
/* 6: ICH[2-7]/ICH[2-3]M/C-ICH/ICH5-SATA/ESB2/ICH8M */
371-
DECLARE_ICH_DEV(ATA_UDMA5),
370+
/* 6: ICH[2-6]/ICH[2-3]M/C-ICH/ICH5-SATA/ESB2/ICH8M */
371+
DECLARE_ICH_DEV(ATA_MWDMA12_ONLY, ATA_UDMA5),
372+
/* 7: ICH7/7-R, no MWDMA1 */
373+
DECLARE_ICH_DEV(ATA_MWDMA2_ONLY, ATA_UDMA5),
372374
};
373375

374376
/**
@@ -438,9 +440,9 @@ static const struct pci_device_id piix_pci_tbl[] = {
438440
#endif
439441
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ESB_2), 6 },
440442
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ICH6_19), 6 },
441-
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ICH7_21), 6 },
443+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ICH7_21), 7 },
442444
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82801DB_1), 6 },
443-
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ESB2_18), 6 },
445+
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ESB2_18), 7 },
444446
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ICH8_6), 6 },
445447
{ 0, },
446448
};

‎drivers/ide/triflex.c‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,26 @@ static const struct pci_device_id triflex_pci_tbl[] = {
113113
};
114114
MODULE_DEVICE_TABLE(pci, triflex_pci_tbl);
115115

116+
#ifdef CONFIG_PM
117+
static int triflex_ide_pci_suspend(struct pci_dev *dev, pm_message_t state)
118+
{
119+
/*
120+
* We must not disable or powerdown the device.
121+
* APM bios refuses to suspend if IDE is not accessible.
122+
*/
123+
pci_save_state(dev);
124+
return 0;
125+
}
126+
#else
127+
#define triflex_ide_pci_suspend NULL
128+
#endif
129+
116130
static struct pci_driver triflex_pci_driver = {
117131
.name = "TRIFLEX_IDE",
118132
.id_table = triflex_pci_tbl,
119133
.probe = triflex_init_one,
120134
.remove = ide_pci_remove,
121-
.suspend = ide_pci_suspend,
135+
.suspend = triflex_ide_pci_suspend,
122136
.resume = ide_pci_resume,
123137
};
124138

0 commit comments

Comments
 (0)