aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-sff.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-08-18 00:14:55 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-12 14:55:37 -0400
commitcbcdd87593a1d85c5c4b259945a3a09eee12814d (patch)
treeee03df963a12ec7f30f6c3a8742421daf2c34f50 /drivers/ata/libata-sff.c
parente923090ddd9fef1d4e06dc6c5295e29baced19f3 (diff)
libata: implement and use ata_port_desc() to report port configuration
Currently, port configuration reporting has the following problems. * iomapped address is reported instead of raw address * report contains irrelevant fields or lacks necessary fields for non-SFF controllers. * host->irq/irq2 are there just for reporting and hacky. This patch implements and uses ata_port_desc() and ata_port_pbar_desc(). ata_port_desc() is almost identical to ata_ehi_push_desc() except that it takes @ap instead of @ehi, has no locking requirement, can only be used during host initialization and " " is used as separator instead of ", ". ata_port_pbar_desc() is a helper to ease reporting of a PCI BAR or an offsetted address into it. LLD pushes whatever description it wants using the above two functions. The accumulated description is printed on host registration after "[S/P]ATA max MAX_XFERMODE ". SFF init helpers and ata_host_activate() automatically add descriptions for addresses and irq respectively, so only LLDs which isn't standard SFF need to add custom descriptions. In many cases, such controllers need to report different things anyway. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-sff.c')
-rw-r--r--drivers/ata/libata-sff.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index ccef99a0337c..026439e05afe 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -567,6 +567,9 @@ int ata_pci_init_bmdma(struct ata_host *host)
567 if ((!(ap->flags & ATA_FLAG_IGN_SIMPLEX)) && 567 if ((!(ap->flags & ATA_FLAG_IGN_SIMPLEX)) &&
568 (ioread8(bmdma + 2) & 0x80)) 568 (ioread8(bmdma + 2) & 0x80))
569 host->flags |= ATA_HOST_SIMPLEX; 569 host->flags |= ATA_HOST_SIMPLEX;
570
571 ata_port_desc(ap, "bmdma 0x%llx",
572 (unsigned long long)pci_resource_start(pdev, 4) + 8 * i);
570 } 573 }
571 574
572 return 0; 575 return 0;
@@ -634,6 +637,10 @@ int ata_pci_init_sff_host(struct ata_host *host)
634 ((unsigned long)iomap[base + 1] | ATA_PCI_CTL_OFS); 637 ((unsigned long)iomap[base + 1] | ATA_PCI_CTL_OFS);
635 ata_std_ports(&ap->ioaddr); 638 ata_std_ports(&ap->ioaddr);
636 639
640 ata_port_desc(ap, "cmd 0x%llx ctl 0x%llx",
641 (unsigned long long)pci_resource_start(pdev, base),
642 (unsigned long long)pci_resource_start(pdev, base + 1));
643
637 mask |= 1 << i; 644 mask |= 1 << i;
638 } 645 }
639 646
@@ -804,24 +811,30 @@ int ata_pci_init_one(struct pci_dev *pdev,
804 IRQF_SHARED, DRV_NAME, host); 811 IRQF_SHARED, DRV_NAME, host);
805 if (rc) 812 if (rc)
806 goto err_out; 813 goto err_out;
807 host->irq = pdev->irq; 814
815 ata_port_desc(host->ports[0], "irq %d", pdev->irq);
816 ata_port_desc(host->ports[1], "irq %d", pdev->irq);
808 } else { 817 } else {
809 if (!ata_port_is_dummy(host->ports[0])) { 818 if (!ata_port_is_dummy(host->ports[0])) {
810 host->irq = ATA_PRIMARY_IRQ(pdev); 819 rc = devm_request_irq(dev, ATA_PRIMARY_IRQ(pdev),
811 rc = devm_request_irq(dev, host->irq,
812 pi->port_ops->irq_handler, 820 pi->port_ops->irq_handler,
813 IRQF_SHARED, DRV_NAME, host); 821 IRQF_SHARED, DRV_NAME, host);
814 if (rc) 822 if (rc)
815 goto err_out; 823 goto err_out;
824
825 ata_port_desc(host->ports[0], "irq %d",
826 ATA_PRIMARY_IRQ(pdev));
816 } 827 }
817 828
818 if (!ata_port_is_dummy(host->ports[1])) { 829 if (!ata_port_is_dummy(host->ports[1])) {
819 host->irq2 = ATA_SECONDARY_IRQ(pdev); 830 rc = devm_request_irq(dev, ATA_SECONDARY_IRQ(pdev),
820 rc = devm_request_irq(dev, host->irq2,
821 pi->port_ops->irq_handler, 831 pi->port_ops->irq_handler,
822 IRQF_SHARED, DRV_NAME, host); 832 IRQF_SHARED, DRV_NAME, host);
823 if (rc) 833 if (rc)
824 goto err_out; 834 goto err_out;
835
836 ata_port_desc(host->ports[1], "irq %d",
837 ATA_SECONDARY_IRQ(pdev));
825 } 838 }
826 } 839 }
827 840