diff options
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/Kconfig | 6 | ||||
-rw-r--r-- | drivers/ata/ahci.c | 4 | ||||
-rw-r--r-- | drivers/ata/ahci.h | 7 | ||||
-rw-r--r-- | drivers/ata/ahci_sunxi.c | 2 | ||||
-rw-r--r-- | drivers/ata/pata_atiixp.c | 3 | ||||
-rw-r--r-- | drivers/ata/pata_cs5520.c | 3 | ||||
-rw-r--r-- | drivers/ata/pata_cs5530.c | 3 | ||||
-rw-r--r-- | drivers/ata/pata_cypress.c | 10 | ||||
-rw-r--r-- | drivers/ata/pata_ep93xx.c | 2 | ||||
-rw-r--r-- | drivers/ata/pata_falcon.c | 62 | ||||
-rw-r--r-- | drivers/ata/pata_macio.c | 5 | ||||
-rw-r--r-- | drivers/ata/pata_octeon_cf.c | 5 | ||||
-rw-r--r-- | drivers/ata/pata_rb532_cf.c | 8 | ||||
-rw-r--r-- | drivers/ata/pata_sc1200.c | 3 | ||||
-rw-r--r-- | drivers/ata/pata_serverworks.c | 3 | ||||
-rw-r--r-- | drivers/ata/sata_fsl.c | 2 | ||||
-rw-r--r-- | drivers/ata/sata_highbank.c | 6 | ||||
-rw-r--r-- | drivers/ata/sata_mv.c | 6 | ||||
-rw-r--r-- | drivers/ata/sata_nv.c | 12 | ||||
-rw-r--r-- | drivers/ata/sata_sil24.c | 5 |
20 files changed, 111 insertions, 46 deletions
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index 030cb32da980..b7a5abee2147 100644 --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig @@ -1015,11 +1015,11 @@ config PATA_CMD640_PCI If unsure, say N. config PATA_FALCON - tristate "Atari Falcon PATA support" - depends on M68K && ATARI + tristate "Atari Falcon and Q40/Q60 PATA support" + depends on M68K && (ATARI || Q40) help This option enables support for the on-board IDE - interface on the Atari Falcon. + interface on the Atari Falcon and Q40/Q60. If unsure, say N. diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 33192a8f687d..186cbf90c8ea 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -446,6 +446,10 @@ static const struct pci_device_id ahci_pci_tbl[] = { { PCI_VENDOR_ID_AMD, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_STORAGE_RAID << 8, 0xffffff, board_ahci }, + /* Dell S140/S150 */ + { PCI_VENDOR_ID_INTEL, PCI_ANY_ID, PCI_SUBVENDOR_ID_DELL, PCI_ANY_ID, + PCI_CLASS_STORAGE_RAID << 8, 0xffffff, board_ahci }, + /* VIA */ { PCI_VDEVICE(VIA, 0x3349), board_ahci_vt8251 }, /* VIA VT8251 */ { PCI_VDEVICE(VIA, 0x6287), board_ahci_vt8251 }, /* VIA VT8251 */ diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h index d1f284f0c83d..2e89499bd9c3 100644 --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h @@ -384,12 +384,15 @@ extern struct device_attribute *ahci_sdev_attrs[]; * for ATA_BASE_SHT */ #define AHCI_SHT(drv_name) \ - ATA_NCQ_SHT(drv_name), \ + __ATA_BASE_SHT(drv_name), \ .can_queue = AHCI_MAX_CMDS, \ .sg_tablesize = AHCI_MAX_SG, \ .dma_boundary = AHCI_DMA_BOUNDARY, \ .shost_attrs = ahci_shost_attrs, \ - .sdev_attrs = ahci_sdev_attrs + .sdev_attrs = ahci_sdev_attrs, \ + .change_queue_depth = ata_scsi_change_queue_depth, \ + .tag_alloc_policy = BLK_TAG_ALLOC_RR, \ + .slave_configure = ata_scsi_slave_config extern struct ata_port_operations ahci_ops; extern struct ata_port_operations ahci_platform_ops; diff --git a/drivers/ata/ahci_sunxi.c b/drivers/ata/ahci_sunxi.c index cb69b737cb49..56b695136977 100644 --- a/drivers/ata/ahci_sunxi.c +++ b/drivers/ata/ahci_sunxi.c @@ -200,7 +200,7 @@ static void ahci_sunxi_start_engine(struct ata_port *ap) } static const struct ata_port_info ahci_sunxi_port_info = { - .flags = AHCI_FLAG_COMMON | ATA_FLAG_NCQ, + .flags = AHCI_FLAG_COMMON | ATA_FLAG_NCQ | ATA_FLAG_NO_DIPM, .pio_mask = ATA_PIO4, .udma_mask = ATA_UDMA6, .port_ops = &ahci_platform_ops, diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c index d671d33ef287..c3a65ccd4b79 100644 --- a/drivers/ata/pata_atiixp.c +++ b/drivers/ata/pata_atiixp.c @@ -252,8 +252,9 @@ static void atiixp_bmdma_stop(struct ata_queued_cmd *qc) } static struct scsi_host_template atiixp_sht = { - ATA_BMDMA_SHT(DRV_NAME), + ATA_BASE_SHT(DRV_NAME), .sg_tablesize = LIBATA_DUMB_MAX_PRD, + .dma_boundary = ATA_DMA_BOUNDARY, }; static struct ata_port_operations atiixp_port_ops = { diff --git a/drivers/ata/pata_cs5520.c b/drivers/ata/pata_cs5520.c index d09d432d3c44..247c14702624 100644 --- a/drivers/ata/pata_cs5520.c +++ b/drivers/ata/pata_cs5520.c @@ -95,8 +95,9 @@ static void cs5520_set_piomode(struct ata_port *ap, struct ata_device *adev) } static struct scsi_host_template cs5520_sht = { - ATA_BMDMA_SHT(DRV_NAME), + ATA_BASE_SHT(DRV_NAME), .sg_tablesize = LIBATA_DUMB_MAX_PRD, + .dma_boundary = ATA_DMA_BOUNDARY, }; static struct ata_port_operations cs5520_port_ops = { diff --git a/drivers/ata/pata_cs5530.c b/drivers/ata/pata_cs5530.c index a1b4aaccaa50..d5b7ac14e78f 100644 --- a/drivers/ata/pata_cs5530.c +++ b/drivers/ata/pata_cs5530.c @@ -147,8 +147,9 @@ static unsigned int cs5530_qc_issue(struct ata_queued_cmd *qc) } static struct scsi_host_template cs5530_sht = { - ATA_BMDMA_SHT(DRV_NAME), + ATA_BASE_SHT(DRV_NAME), .sg_tablesize = LIBATA_DUMB_MAX_PRD, + .dma_boundary = ATA_DMA_BOUNDARY, }; static struct ata_port_operations cs5530_port_ops = { diff --git a/drivers/ata/pata_cypress.c b/drivers/ata/pata_cypress.c index e1486fe298ae..5b3a7a8ebef6 100644 --- a/drivers/ata/pata_cypress.c +++ b/drivers/ata/pata_cypress.c @@ -41,6 +41,10 @@ enum { CY82_INDEX_TIMEOUT = 0x32 }; +static bool enable_dma = true; +module_param(enable_dma, bool, 0); +MODULE_PARM_DESC(enable_dma, "Enable bus master DMA operations"); + /** * cy82c693_set_piomode - set initial PIO mode data * @ap: ATA interface @@ -124,14 +128,16 @@ static struct ata_port_operations cy82c693_port_ops = { static int cy82c693_init_one(struct pci_dev *pdev, const struct pci_device_id *id) { - static const struct ata_port_info info = { + static struct ata_port_info info = { .flags = ATA_FLAG_SLAVE_POSS, .pio_mask = ATA_PIO4, - .mwdma_mask = ATA_MWDMA2, .port_ops = &cy82c693_port_ops }; const struct ata_port_info *ppi[] = { &info, &ata_dummy_port_info }; + if (enable_dma) + info.mwdma_mask = ATA_MWDMA2; + /* Devfn 1 is the ATA primary. The secondary is magic and on devfn2. For the moment we don't handle the secondary. FIXME */ diff --git a/drivers/ata/pata_ep93xx.c b/drivers/ata/pata_ep93xx.c index badab6708893..46208ececbb6 100644 --- a/drivers/ata/pata_ep93xx.c +++ b/drivers/ata/pata_ep93xx.c @@ -928,7 +928,7 @@ static int ep93xx_pata_probe(struct platform_device *pdev) /* INT[3] (IRQ_EP93XX_EXT3) line connected as pull down */ irq = platform_get_irq(pdev, 0); if (irq < 0) { - err = -ENXIO; + err = irq; goto err_rel_gpio; } diff --git a/drivers/ata/pata_falcon.c b/drivers/ata/pata_falcon.c index 27b0952fde6b..9d0dd8f4c21c 100644 --- a/drivers/ata/pata_falcon.c +++ b/drivers/ata/pata_falcon.c @@ -33,8 +33,6 @@ #define DRV_NAME "pata_falcon" #define DRV_VERSION "0.1.0" -#define ATA_HD_CONTROL 0x39 - static struct scsi_host_template pata_falcon_sht = { ATA_PIO_SHT(DRV_NAME), }; @@ -121,23 +119,42 @@ static struct ata_port_operations pata_falcon_ops = { static int __init pata_falcon_init_one(struct platform_device *pdev) { - struct resource *res; + struct resource *base_mem_res, *ctl_mem_res; + struct resource *base_res, *ctl_res, *irq_res; struct ata_host *host; struct ata_port *ap; void __iomem *base; + int irq = 0; - dev_info(&pdev->dev, "Atari Falcon PATA controller\n"); + dev_info(&pdev->dev, "Atari Falcon and Q40/Q60 PATA controller\n"); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -ENODEV; + base_res = platform_get_resource(pdev, IORESOURCE_IO, 0); + if (base_res && !devm_request_region(&pdev->dev, base_res->start, + resource_size(base_res), DRV_NAME)) { + dev_err(&pdev->dev, "resources busy\n"); + return -EBUSY; + } - if (!devm_request_mem_region(&pdev->dev, res->start, - resource_size(res), DRV_NAME)) { + ctl_res = platform_get_resource(pdev, IORESOURCE_IO, 1); + if (ctl_res && !devm_request_region(&pdev->dev, ctl_res->start, + resource_size(ctl_res), DRV_NAME)) { dev_err(&pdev->dev, "resources busy\n"); return -EBUSY; } + base_mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!base_mem_res) + return -ENODEV; + if (!devm_request_mem_region(&pdev->dev, base_mem_res->start, + resource_size(base_mem_res), DRV_NAME)) { + dev_err(&pdev->dev, "resources busy\n"); + return -EBUSY; + } + + ctl_mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 1); + if (!ctl_mem_res) + return -ENODEV; + /* allocate host */ host = ata_host_alloc(&pdev->dev, 1); if (!host) @@ -147,10 +164,10 @@ static int __init pata_falcon_init_one(struct platform_device *pdev) ap->ops = &pata_falcon_ops; ap->pio_mask = ATA_PIO4; ap->flags |= ATA_FLAG_SLAVE_POSS | ATA_FLAG_NO_IORDY; - ap->flags |= ATA_FLAG_PIO_POLLING; - base = (void __iomem *)res->start; - ap->ioaddr.data_addr = base; + base = (void __iomem *)base_mem_res->start; + /* N.B. this assumes data_addr will be used for word-sized I/O only */ + ap->ioaddr.data_addr = base + 0 + 0 * 4; ap->ioaddr.error_addr = base + 1 + 1 * 4; ap->ioaddr.feature_addr = base + 1 + 1 * 4; ap->ioaddr.nsect_addr = base + 1 + 2 * 4; @@ -161,14 +178,25 @@ static int __init pata_falcon_init_one(struct platform_device *pdev) ap->ioaddr.status_addr = base + 1 + 7 * 4; ap->ioaddr.command_addr = base + 1 + 7 * 4; - ap->ioaddr.altstatus_addr = base + ATA_HD_CONTROL; - ap->ioaddr.ctl_addr = base + ATA_HD_CONTROL; + base = (void __iomem *)ctl_mem_res->start; + ap->ioaddr.altstatus_addr = base + 1; + ap->ioaddr.ctl_addr = base + 1; - ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx", (unsigned long)base, - (unsigned long)base + ATA_HD_CONTROL); + ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx", + (unsigned long)base_mem_res->start, + (unsigned long)ctl_mem_res->start); + + irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); + if (irq_res && irq_res->start > 0) { + irq = irq_res->start; + } else { + ap->flags |= ATA_FLAG_PIO_POLLING; + ata_port_desc(ap, "no IRQ, using PIO polling"); + } /* activate */ - return ata_host_activate(host, 0, NULL, 0, &pata_falcon_sht); + return ata_host_activate(host, irq, irq ? ata_sff_interrupt : NULL, + IRQF_SHARED, &pata_falcon_sht); } static int __exit pata_falcon_remove_one(struct platform_device *pdev) diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c index e47a28271f5b..be0ca8d5b345 100644 --- a/drivers/ata/pata_macio.c +++ b/drivers/ata/pata_macio.c @@ -914,7 +914,7 @@ static int pata_macio_do_resume(struct pata_macio_priv *priv) #endif /* CONFIG_PM_SLEEP */ static struct scsi_host_template pata_macio_sht = { - ATA_BASE_SHT(DRV_NAME), + __ATA_BASE_SHT(DRV_NAME), .sg_tablesize = MAX_DCMDS, /* We may not need that strict one */ .dma_boundary = ATA_DMA_BOUNDARY, @@ -923,6 +923,9 @@ static struct scsi_host_template pata_macio_sht = { */ .max_segment_size = MAX_DBDMA_SEG, .slave_configure = pata_macio_slave_config, + .sdev_attrs = ata_common_sdev_attrs, + .can_queue = ATA_DEF_QUEUE, + .tag_alloc_policy = BLK_TAG_ALLOC_RR, }; static struct ata_port_operations pata_macio_ops = { diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c index bd87476ab481..b5a3f710d76d 100644 --- a/drivers/ata/pata_octeon_cf.c +++ b/drivers/ata/pata_octeon_cf.c @@ -898,10 +898,11 @@ static int octeon_cf_probe(struct platform_device *pdev) return -EINVAL; } - irq_handler = octeon_cf_interrupt; i = platform_get_irq(dma_dev, 0); - if (i > 0) + if (i > 0) { irq = i; + irq_handler = octeon_cf_interrupt; + } } of_node_put(dma_node); } diff --git a/drivers/ata/pata_rb532_cf.c b/drivers/ata/pata_rb532_cf.c index 479c4b29b856..2e110aefe59b 100644 --- a/drivers/ata/pata_rb532_cf.c +++ b/drivers/ata/pata_rb532_cf.c @@ -115,10 +115,10 @@ static int rb532_pata_driver_probe(struct platform_device *pdev) } irq = platform_get_irq(pdev, 0); - if (irq <= 0) { - dev_err(&pdev->dev, "no IRQ resource found\n"); - return -ENOENT; - } + if (irq < 0) + return irq; + if (!irq) + return -EINVAL; gpiod = devm_gpiod_get(&pdev->dev, NULL, GPIOD_IN); if (IS_ERR(gpiod)) { diff --git a/drivers/ata/pata_sc1200.c b/drivers/ata/pata_sc1200.c index 3b8c111140bd..f28daf62a37d 100644 --- a/drivers/ata/pata_sc1200.c +++ b/drivers/ata/pata_sc1200.c @@ -193,8 +193,9 @@ static int sc1200_qc_defer(struct ata_queued_cmd *qc) } static struct scsi_host_template sc1200_sht = { - ATA_BMDMA_SHT(DRV_NAME), + ATA_BASE_SHT(DRV_NAME), .sg_tablesize = LIBATA_DUMB_MAX_PRD, + .dma_boundary = ATA_DMA_BOUNDARY, }; static struct ata_port_operations sc1200_port_ops = { diff --git a/drivers/ata/pata_serverworks.c b/drivers/ata/pata_serverworks.c index 7511e11eef4d..b602e303fb54 100644 --- a/drivers/ata/pata_serverworks.c +++ b/drivers/ata/pata_serverworks.c @@ -253,8 +253,9 @@ static void serverworks_set_dmamode(struct ata_port *ap, struct ata_device *adev } static struct scsi_host_template serverworks_osb4_sht = { - ATA_BMDMA_SHT(DRV_NAME), + ATA_BASE_SHT(DRV_NAME), .sg_tablesize = LIBATA_DUMB_MAX_PRD, + .dma_boundary = ATA_DMA_BOUNDARY, }; static struct scsi_host_template serverworks_csb_sht = { diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index d55ee244d693..e5838b23c9e0 100644 --- a/drivers/ata/sata_fsl.c +++ b/drivers/ata/sata_fsl.c @@ -313,7 +313,7 @@ static void fsl_sata_set_irq_coalescing(struct ata_host *host, DPRINTK("interrupt coalescing, count = 0x%x, ticks = %x\n", intr_coalescing_count, intr_coalescing_ticks); - DPRINTK("ICC register status: (hcr base: 0x%x) = 0x%x\n", + DPRINTK("ICC register status: (hcr base: %p) = 0x%x\n", hcr_base, ioread32(hcr_base + ICC)); } diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c index 64b2ef15ec19..8440203e835e 100644 --- a/drivers/ata/sata_highbank.c +++ b/drivers/ata/sata_highbank.c @@ -469,10 +469,12 @@ static int ahci_highbank_probe(struct platform_device *pdev) } irq = platform_get_irq(pdev, 0); - if (irq <= 0) { + if (irq < 0) { dev_err(dev, "no irq\n"); - return -EINVAL; + return irq; } + if (!irq) + return -EINVAL; hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL); if (!hpriv) { diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index c8867c12c0b8..9d86203e1e7a 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c @@ -666,10 +666,14 @@ static struct scsi_host_template mv5_sht = { }; #endif static struct scsi_host_template mv6_sht = { - ATA_NCQ_SHT(DRV_NAME), + __ATA_BASE_SHT(DRV_NAME), .can_queue = MV_MAX_Q_DEPTH - 1, .sg_tablesize = MV_MAX_SG_CT / 2, .dma_boundary = MV_DMA_BOUNDARY, + .sdev_attrs = ata_ncq_sdev_attrs, + .change_queue_depth = ata_scsi_change_queue_depth, + .tag_alloc_policy = BLK_TAG_ALLOC_RR, + .slave_configure = ata_scsi_slave_config }; static struct ata_port_operations mv5_ops = { diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index 20190f66ced9..c385d18ce87b 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c @@ -375,19 +375,25 @@ static struct scsi_host_template nv_sht = { }; static struct scsi_host_template nv_adma_sht = { - ATA_NCQ_SHT(DRV_NAME), + __ATA_BASE_SHT(DRV_NAME), .can_queue = NV_ADMA_MAX_CPBS, .sg_tablesize = NV_ADMA_SGTBL_TOTAL_LEN, .dma_boundary = NV_ADMA_DMA_BOUNDARY, .slave_configure = nv_adma_slave_config, + .sdev_attrs = ata_ncq_sdev_attrs, + .change_queue_depth = ata_scsi_change_queue_depth, + .tag_alloc_policy = BLK_TAG_ALLOC_RR, }; static struct scsi_host_template nv_swncq_sht = { - ATA_NCQ_SHT(DRV_NAME), + __ATA_BASE_SHT(DRV_NAME), .can_queue = ATA_MAX_QUEUE - 1, .sg_tablesize = LIBATA_MAX_PRD, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = nv_swncq_slave_config, + .sdev_attrs = ata_ncq_sdev_attrs, + .change_queue_depth = ata_scsi_change_queue_depth, + .tag_alloc_policy = BLK_TAG_ALLOC_RR, }; /* @@ -2118,7 +2124,7 @@ static int nv_swncq_sdbfis(struct ata_port *ap) */ lack_dhfis = 1; - DPRINTK("id 0x%x QC: qc_active 0x%x," + DPRINTK("id 0x%x QC: qc_active 0x%llx," "SWNCQ:qc_active 0x%X defer_bits %X " "dhfis 0x%X dmafis 0x%X last_issue_tag %x\n", ap->print_id, ap->qc_active, pp->qc_active, diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c index 560070d4f1d0..06a1e27c4f84 100644 --- a/drivers/ata/sata_sil24.c +++ b/drivers/ata/sata_sil24.c @@ -374,11 +374,14 @@ static struct pci_driver sil24_pci_driver = { }; static struct scsi_host_template sil24_sht = { - ATA_NCQ_SHT(DRV_NAME), + __ATA_BASE_SHT(DRV_NAME), .can_queue = SIL24_MAX_CMDS, .sg_tablesize = SIL24_MAX_SGE, .dma_boundary = ATA_DMA_BOUNDARY, .tag_alloc_policy = BLK_TAG_ALLOC_FIFO, + .sdev_attrs = ata_ncq_sdev_attrs, + .change_queue_depth = ata_scsi_change_queue_depth, + .slave_configure = ata_scsi_slave_config }; static struct ata_port_operations sil24_ops = { |