Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6
Browse files Browse the repository at this point in the history
* master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6: (37 commits)
  ide: set drive->autotune in ide_pci_setup_ports()
  triflex: always tune PIO
  opti621: always tune PIO
  cy82c693: always tune PIO
  cs5520: always tune PIO
  alim15x3: always tune PIO
  ide: add IDE_HFLAG_LEGACY_IRQS host flag
  ide: add IDE_HFLAG_SERIALIZE host flag
  ide: add IDE_HFLAG_ERROR_STOPS_FIFO host flag
  piix: add DECLARE_ICH_DEV() macro
  pdc202xx_old: add DECLARE_PDC2026X_DEV() macro
  pdc202xx_new: add DECLARE_PDCNEW_DEV() macro
  aec62xx: no need to disable UDMA in ->init_hwif method for ATP850UF
  ide: remove .init_setup from ide_pci_device_t
  serverworks: remove ->init_setup
  scc_pata: remove ->init_setup
  pdc202xx_old: remove ->init_setup
  pdc202xx_new: remove ->init_setup
  hpt366: remove ->init_setup
  cmd64x: remove ->init_setup
  ...
  • Loading branch information
Linus Torvalds committed Oct 18, 2007
2 parents 58f9b52 + 85ad93a commit a9e82d3
Show file tree
Hide file tree
Showing 44 changed files with 760 additions and 1,211 deletions.
1 change: 0 additions & 1 deletion drivers/ide/arm/icside.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,6 @@ static void icside_dma_lost_irq(ide_drive_t *drive)

static void icside_dma_init(ide_hwif_t *hwif)
{
hwif->atapi_dma = 1;
hwif->mwdma_mask = 7; /* MW0..2 */
hwif->swdma_mask = 7; /* SW0..2 */

Expand Down
1 change: 1 addition & 0 deletions drivers/ide/cris/ide-cris.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,7 @@ init_e100_ide (void)
hwif->dma_host_on = &cris_dma_on;
hwif->dma_off_quietly = &cris_dma_off;
hwif->cbl = ATA_CBL_PATA40;
hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA;
hwif->pio_mask = ATA_PIO4,
hwif->drives[0].autotune = 1;
hwif->drives[1].autotune = 1;
Expand Down
8 changes: 4 additions & 4 deletions drivers/ide/ide-disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq,

nsectors.all = (u16) rq->nr_sectors;

if (hwif->no_lba48_dma && lba48 && dma) {
if ((hwif->host_flags & IDE_HFLAG_NO_LBA48_DMA) && lba48 && dma) {
if (block + rq->nr_sectors > 1ULL << 28)
dma = 0;
else
Expand Down Expand Up @@ -856,7 +856,7 @@ static int set_lba_addressing(ide_drive_t *drive, int arg)

drive->addressing = 0;

if (HWIF(drive)->no_lba48)
if (drive->hwif->host_flags & IDE_HFLAG_NO_LBA48)
return 0;

if (!idedisk_supports_lba48(drive->id))
Expand Down Expand Up @@ -889,6 +889,7 @@ static inline void idedisk_add_settings(ide_drive_t *drive) { ; }

static void idedisk_setup (ide_drive_t *drive)
{
ide_hwif_t *hwif = drive->hwif;
struct hd_driveid *id = drive->id;
unsigned long long capacity;

Expand All @@ -909,7 +910,6 @@ static void idedisk_setup (ide_drive_t *drive)
(void)set_lba_addressing(drive, 1);

if (drive->addressing == 1) {
ide_hwif_t *hwif = HWIF(drive);
int max_s = 2048;

if (max_s > hwif->rqsize)
Expand All @@ -932,7 +932,7 @@ static void idedisk_setup (ide_drive_t *drive)
drive->capacity64 = 1ULL << 28;
}

if (drive->hwif->no_lba48_dma && drive->addressing) {
if ((hwif->host_flags & IDE_HFLAG_NO_LBA48_DMA) && drive->addressing) {
if (drive->capacity64 > 1ULL << 28) {
printk(KERN_INFO "%s: cannot use LBA48 DMA - PIO mode will"
" be used for accessing sectors > %u\n",
Expand Down
12 changes: 8 additions & 4 deletions drivers/ide/ide-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,10 @@ static int config_drive_for_dma (ide_drive_t *drive)
ide_hwif_t *hwif = drive->hwif;
struct hd_driveid *id = drive->id;

if (drive->media != ide_disk && hwif->atapi_dma == 0)
return 0;
if (drive->media != ide_disk) {
if (hwif->host_flags & IDE_HFLAG_NO_ATAPI_DMA)
return -1;
}

/*
* Enable DMA on any drive that has
Expand Down Expand Up @@ -726,8 +728,10 @@ u8 ide_find_dma_mode(ide_drive_t *drive, u8 req_mode)
int x, i;
u8 mode = 0;

if (drive->media != ide_disk && hwif->atapi_dma == 0)
return 0;
if (drive->media != ide_disk) {
if (hwif->host_flags & IDE_HFLAG_NO_ATAPI_DMA)
return 0;
}

for (i = 0; i < ARRAY_SIZE(xfer_mode_bases); i++) {
if (req_mode < xfer_mode_bases[i])
Expand Down
3 changes: 2 additions & 1 deletion drivers/ide/ide-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,8 @@ static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, u8
}
}

if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ && hwif->err_stops_fifo == 0)
if ((stat & DRQ_STAT) && rq_data_dir(rq) == READ &&
(hwif->host_flags & IDE_HFLAG_ERROR_STOPS_FIFO) == 0)
try_to_flush_leftover_data(drive);

if (rq->errors >= ERROR_MAX || blk_noretry_request(rq)) {
Expand Down
3 changes: 2 additions & 1 deletion drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,8 @@ static int ide_init_queue(ide_drive_t *drive)
blk_queue_segment_boundary(q, 0xffff);

if (!hwif->rqsize) {
if (hwif->no_lba48 || hwif->no_lba48_dma)
if ((hwif->host_flags & IDE_HFLAG_NO_LBA48) ||
(hwif->host_flags & IDE_HFLAG_NO_LBA48_DMA))
hwif->rqsize = 256;
else
hwif->rqsize = 65536;
Expand Down
4 changes: 0 additions & 4 deletions drivers/ide/ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ static void init_hwif_data(ide_hwif_t *hwif, unsigned int index)

hwif->bus_state = BUSSTATE_ON;

hwif->atapi_dma = 0; /* disable all atapi dma */

init_completion(&hwif->gendev_rel_comp);

default_hwif_iops(hwif);
Expand Down Expand Up @@ -379,7 +377,6 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif)

hwif->pio_mask = tmp_hwif->pio_mask;

hwif->atapi_dma = tmp_hwif->atapi_dma;
hwif->ultra_mask = tmp_hwif->ultra_mask;
hwif->mwdma_mask = tmp_hwif->mwdma_mask;
hwif->swdma_mask = tmp_hwif->swdma_mask;
Expand Down Expand Up @@ -440,7 +437,6 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif)

hwif->mmio = tmp_hwif->mmio;
hwif->rqsize = tmp_hwif->rqsize;
hwif->no_lba48 = tmp_hwif->no_lba48;

#ifndef CONFIG_BLK_DEV_IDECS
hwif->irq = tmp_hwif->irq;
Expand Down
3 changes: 0 additions & 3 deletions drivers/ide/mips/au1xxx-ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,9 +699,6 @@ static int au_ide_probe(struct device *dev)
hwif->dma_host_on = &auide_dma_host_on;
hwif->dma_lost_irq = &auide_dma_lost_irq;
hwif->ide_dma_on = &auide_dma_on;

hwif->atapi_dma = 1;

#else /* !CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */
hwif->channel = 0;
hwif->hold = 1;
Expand Down
97 changes: 39 additions & 58 deletions drivers/ide/pci/aec62xx.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* linux/drivers/ide/pci/aec62xx.c Version 0.25 Aug 1, 2007
* linux/drivers/ide/pci/aec62xx.c Version 0.26 Sep 1, 2007
*
* Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org>
* Copyright (C) 2007 MontaVista Software, Inc. <source@mvista.com>
Expand Down Expand Up @@ -184,34 +184,23 @@ static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev, const ch
static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif)
{
struct pci_dev *dev = hwif->pci_dev;
u8 reg54 = 0, mask = hwif->channel ? 0xf0 : 0x0f;
unsigned long flags;

hwif->set_pio_mode = &aec_set_pio_mode;

if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) {
if(hwif->mate)
hwif->mate->serialized = hwif->serialized = 1;
if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF)
hwif->set_dma_mode = &aec6210_set_mode;
} else
else
hwif->set_dma_mode = &aec6260_set_mode;

hwif->drives[0].autotune = hwif->drives[1].autotune = 1;

if (hwif->dma_base == 0)
return;

hwif->ultra_mask = hwif->cds->udma_mask;
hwif->mwdma_mask = 0x07;

hwif->dma_lost_irq = &aec62xx_dma_lost_irq;

if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) {
spin_lock_irqsave(&ide_lock, flags);
pci_read_config_byte (dev, 0x54, &reg54);
pci_write_config_byte(dev, 0x54, (reg54 & ~mask));
spin_unlock_irqrestore(&ide_lock, flags);
} else if (hwif->cbl != ATA_CBL_PATA40_SHORT) {
if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF)
return;

if (hwif->cbl != ATA_CBL_PATA40_SHORT) {
u8 ata66 = 0, mask = hwif->channel ? 0x02 : 0x01;

pci_read_config_byte(hwif->pci_dev, 0x49, &ata66);
Expand All @@ -220,73 +209,53 @@ static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif)
}
}

static int __devinit init_setup_aec62xx(struct pci_dev *dev, ide_pci_device_t *d)
{
return ide_setup_pci_device(dev, d);
}

static int __devinit init_setup_aec6x80(struct pci_dev *dev, ide_pci_device_t *d)
{
unsigned long dma_base = pci_resource_start(dev, 4);

if (inb(dma_base + 2) & 0x10) {
d->name = (dev->device == PCI_DEVICE_ID_ARTOP_ATP865R) ?
"AEC6880R" : "AEC6880";
d->udma_mask = 0x7f; /* udma0-6 */
}

return ide_setup_pci_device(dev, d);
}

static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
{ /* 0 */
.name = "AEC6210",
.init_setup = init_setup_aec62xx,
.init_chipset = init_chipset_aec62xx,
.init_hwif = init_hwif_aec62xx,
.autodma = AUTODMA,
.enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
.bootable = OFF_BOARD,
.host_flags = IDE_HFLAG_SERIALIZE |
IDE_HFLAG_NO_ATAPI_DMA |
IDE_HFLAG_OFF_BOARD,
.pio_mask = ATA_PIO4,
.udma_mask = 0x07, /* udma0-2 */
.mwdma_mask = ATA_MWDMA2,
.udma_mask = ATA_UDMA2,
},{ /* 1 */
.name = "AEC6260",
.init_setup = init_setup_aec62xx,
.init_chipset = init_chipset_aec62xx,
.init_hwif = init_hwif_aec62xx,
.autodma = NOAUTODMA,
.bootable = OFF_BOARD,
.host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_NO_AUTODMA |
IDE_HFLAG_OFF_BOARD,
.pio_mask = ATA_PIO4,
.udma_mask = 0x1f, /* udma0-4 */
.mwdma_mask = ATA_MWDMA2,
.udma_mask = ATA_UDMA4,
},{ /* 2 */
.name = "AEC6260R",
.init_setup = init_setup_aec62xx,
.init_chipset = init_chipset_aec62xx,
.init_hwif = init_hwif_aec62xx,
.autodma = AUTODMA,
.enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
.bootable = NEVER_BOARD,
.host_flags = IDE_HFLAG_NO_ATAPI_DMA,
.pio_mask = ATA_PIO4,
.udma_mask = 0x1f, /* udma0-4 */
.mwdma_mask = ATA_MWDMA2,
.udma_mask = ATA_UDMA4,
},{ /* 3 */
.name = "AEC6280",
.init_setup = init_setup_aec6x80,
.init_chipset = init_chipset_aec62xx,
.init_hwif = init_hwif_aec62xx,
.autodma = AUTODMA,
.bootable = OFF_BOARD,
.host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD,
.pio_mask = ATA_PIO4,
.udma_mask = 0x3f, /* udma0-5 */
.mwdma_mask = ATA_MWDMA2,
.udma_mask = ATA_UDMA5,
},{ /* 4 */
.name = "AEC6280R",
.init_setup = init_setup_aec6x80,
.init_chipset = init_chipset_aec62xx,
.init_hwif = init_hwif_aec62xx,
.autodma = AUTODMA,
.enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
.bootable = OFF_BOARD,
.host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_OFF_BOARD,
.pio_mask = ATA_PIO4,
.udma_mask = 0x3f, /* udma0-5 */
.mwdma_mask = ATA_MWDMA2,
.udma_mask = ATA_UDMA5,
}
};

Expand All @@ -304,9 +273,21 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {

static int __devinit aec62xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{
ide_pci_device_t d = aec62xx_chipsets[id->driver_data];
ide_pci_device_t d;
u8 idx = id->driver_data;

d = aec62xx_chipsets[idx];

if (idx == 3 || idx == 4) {
unsigned long dma_base = pci_resource_start(dev, 4);

if (inb(dma_base + 2) & 0x10) {
d.name = (idx == 4) ? "AEC6880R" : "AEC6880";
d.udma_mask = ATA_UDMA6;
}
}

return d.init_setup(dev, &d);
return ide_setup_pci_device(dev, &d);
}

static const struct pci_device_id aec62xx_pci_tbl[] = {
Expand Down
30 changes: 13 additions & 17 deletions drivers/ide/pci/alim15x3.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* linux/drivers/ide/pci/alim15x3.c Version 0.26 Jul 14 2007
* linux/drivers/ide/pci/alim15x3.c Version 0.27 Aug 27 2007
*
* Copyright (C) 1998-2000 Michel Aubry, Maintainer
* Copyright (C) 1998-2000 Andrzej Krzysztofowicz, Maintainer
Expand Down Expand Up @@ -665,34 +665,29 @@ static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif)
hwif->udma_filter = &ali_udma_filter;

/* don't use LBA48 DMA on ALi devices before rev 0xC5 */
hwif->no_lba48_dma = (m5229_revision <= 0xC4) ? 1 : 0;
if (m5229_revision <= 0xC4)
hwif->host_flags |= IDE_HFLAG_NO_LBA48_DMA;

if (!hwif->dma_base) {
hwif->drives[0].autotune = 1;
hwif->drives[1].autotune = 1;
if (hwif->dma_base == 0)
return;
}

/*
* check in ->init_dma guarantees m5229_revision >= 0x20 here
*/

if (m5229_revision > 0x20)
hwif->atapi_dma = 1;
if (m5229_revision == 0x20)
hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA;

if (m5229_revision <= 0x20)
hwif->ultra_mask = 0x00; /* no udma */
else if (m5229_revision < 0xC2)
hwif->ultra_mask = 0x07; /* udma0-2 */
hwif->ultra_mask = ATA_UDMA2;
else if (m5229_revision == 0xC2 || m5229_revision == 0xC3)
hwif->ultra_mask = 0x1f; /* udma0-4 */
hwif->ultra_mask = ATA_UDMA4;
else if (m5229_revision == 0xC4)
hwif->ultra_mask = 0x3f; /* udma0-5 */
hwif->ultra_mask = ATA_UDMA5;
else
hwif->ultra_mask = 0x7f; /* udma0-6 */

hwif->mwdma_mask = 0x07;
hwif->swdma_mask = 0x07;
hwif->ultra_mask = ATA_UDMA6;

hwif->dma_setup = &ali15x3_dma_setup;

Expand Down Expand Up @@ -776,9 +771,10 @@ static ide_pci_device_t ali15x3_chipset __devinitdata = {
.init_chipset = init_chipset_ali15x3,
.init_hwif = init_hwif_ali15x3,
.init_dma = init_dma_ali15x3,
.autodma = AUTODMA,
.bootable = ON_BOARD,
.host_flags = IDE_HFLAG_BOOTABLE,
.pio_mask = ATA_PIO5,
.swdma_mask = ATA_SWDMA2,
.mwdma_mask = ATA_MWDMA2,
};

/**
Expand Down
Loading

0 comments on commit a9e82d3

Please sign in to comment.