diff options
-rw-r--r-- | drivers/ata/libata-core.c | 25 | ||||
-rw-r--r-- | drivers/ata/libata-scsi.c | 30 | ||||
-rw-r--r-- | drivers/ata/libata-sff.c | 27 | ||||
-rw-r--r-- | drivers/ata/pata_hpt37x.c | 22 | ||||
-rw-r--r-- | drivers/ata/pata_legacy.c | 34 | ||||
-rw-r--r-- | drivers/ata/pata_ninja32.c | 4 | ||||
-rw-r--r-- | include/linux/libata.h | 8 |
7 files changed, 107 insertions, 43 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 065507c46644..17c5d48a75d2 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -1231,6 +1231,9 @@ unsigned int ata_dev_classify(const struct ata_taskfile *tf) | |||
1231 | * | 1231 | * |
1232 | * We follow the current spec and consider that 0x69/0x96 | 1232 | * We follow the current spec and consider that 0x69/0x96 |
1233 | * identifies a port multiplier and 0x3c/0xc3 a SEMB device. | 1233 | * identifies a port multiplier and 0x3c/0xc3 a SEMB device. |
1234 | * Unfortunately, WDC WD1600JS-62MHB5 (a hard drive) reports | ||
1235 | * SEMB signature. This is worked around in | ||
1236 | * ata_dev_read_id(). | ||
1234 | */ | 1237 | */ |
1235 | if ((tf->lbam == 0) && (tf->lbah == 0)) { | 1238 | if ((tf->lbam == 0) && (tf->lbah == 0)) { |
1236 | DPRINTK("found ATA device by sig\n"); | 1239 | DPRINTK("found ATA device by sig\n"); |
@@ -1248,8 +1251,8 @@ unsigned int ata_dev_classify(const struct ata_taskfile *tf) | |||
1248 | } | 1251 | } |
1249 | 1252 | ||
1250 | if ((tf->lbam == 0x3c) && (tf->lbah == 0xc3)) { | 1253 | if ((tf->lbam == 0x3c) && (tf->lbah == 0xc3)) { |
1251 | printk(KERN_INFO "ata: SEMB device ignored\n"); | 1254 | DPRINTK("found SEMB device by sig (could be ATA device)\n"); |
1252 | return ATA_DEV_SEMB_UNSUP; /* not yet */ | 1255 | return ATA_DEV_SEMB; |
1253 | } | 1256 | } |
1254 | 1257 | ||
1255 | DPRINTK("unknown device\n"); | 1258 | DPRINTK("unknown device\n"); |
@@ -1653,8 +1656,8 @@ unsigned long ata_id_xfermask(const u16 *id) | |||
1653 | /* | 1656 | /* |
1654 | * Process compact flash extended modes | 1657 | * Process compact flash extended modes |
1655 | */ | 1658 | */ |
1656 | int pio = id[163] & 0x7; | 1659 | int pio = (id[ATA_ID_CFA_MODES] >> 0) & 0x7; |
1657 | int dma = (id[163] >> 3) & 7; | 1660 | int dma = (id[ATA_ID_CFA_MODES] >> 3) & 0x7; |
1658 | 1661 | ||
1659 | if (pio) | 1662 | if (pio) |
1660 | pio_mask |= (1 << 5); | 1663 | pio_mask |= (1 << 5); |
@@ -2080,6 +2083,7 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class, | |||
2080 | struct ata_taskfile tf; | 2083 | struct ata_taskfile tf; |
2081 | unsigned int err_mask = 0; | 2084 | unsigned int err_mask = 0; |
2082 | const char *reason; | 2085 | const char *reason; |
2086 | bool is_semb = class == ATA_DEV_SEMB; | ||
2083 | int may_fallback = 1, tried_spinup = 0; | 2087 | int may_fallback = 1, tried_spinup = 0; |
2084 | int rc; | 2088 | int rc; |
2085 | 2089 | ||
@@ -2090,6 +2094,8 @@ retry: | |||
2090 | ata_tf_init(dev, &tf); | 2094 | ata_tf_init(dev, &tf); |
2091 | 2095 | ||
2092 | switch (class) { | 2096 | switch (class) { |
2097 | case ATA_DEV_SEMB: | ||
2098 | class = ATA_DEV_ATA; /* some hard drives report SEMB sig */ | ||
2093 | case ATA_DEV_ATA: | 2099 | case ATA_DEV_ATA: |
2094 | tf.command = ATA_CMD_ID_ATA; | 2100 | tf.command = ATA_CMD_ID_ATA; |
2095 | break; | 2101 | break; |
@@ -2126,6 +2132,14 @@ retry: | |||
2126 | return -ENOENT; | 2132 | return -ENOENT; |
2127 | } | 2133 | } |
2128 | 2134 | ||
2135 | if (is_semb) { | ||
2136 | ata_dev_printk(dev, KERN_INFO, "IDENTIFY failed on " | ||
2137 | "device w/ SEMB sig, disabled\n"); | ||
2138 | /* SEMB is not supported yet */ | ||
2139 | *p_class = ATA_DEV_SEMB_UNSUP; | ||
2140 | return 0; | ||
2141 | } | ||
2142 | |||
2129 | if ((err_mask == AC_ERR_DEV) && (tf.feature & ATA_ABORTED)) { | 2143 | if ((err_mask == AC_ERR_DEV) && (tf.feature & ATA_ABORTED)) { |
2130 | /* Device or controller might have reported | 2144 | /* Device or controller might have reported |
2131 | * the wrong device class. Give a shot at the | 2145 | * the wrong device class. Give a shot at the |
@@ -2412,7 +2426,8 @@ int ata_dev_configure(struct ata_device *dev) | |||
2412 | /* ATA-specific feature tests */ | 2426 | /* ATA-specific feature tests */ |
2413 | if (dev->class == ATA_DEV_ATA) { | 2427 | if (dev->class == ATA_DEV_ATA) { |
2414 | if (ata_id_is_cfa(id)) { | 2428 | if (ata_id_is_cfa(id)) { |
2415 | if (id[162] & 1) /* CPRM may make this media unusable */ | 2429 | /* CPRM may make this media unusable */ |
2430 | if (id[ATA_ID_CFA_KEY_MGMT] & 1) | ||
2416 | ata_dev_printk(dev, KERN_WARNING, | 2431 | ata_dev_printk(dev, KERN_WARNING, |
2417 | "supports DRM functions and may " | 2432 | "supports DRM functions and may " |
2418 | "not be fully accessable.\n"); | 2433 | "not be fully accessable.\n"); |
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index b9747fa59e54..2733b0c90b75 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -647,23 +647,45 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg) | |||
647 | return rc; | 647 | return rc; |
648 | } | 648 | } |
649 | 649 | ||
650 | static int ata_ioc32(struct ata_port *ap) | ||
651 | { | ||
652 | if (ap->flags & ATA_FLAG_PIO_DMA) | ||
653 | return 1; | ||
654 | if (ap->pflags & ATA_PFLAG_PIO32) | ||
655 | return 1; | ||
656 | return 0; | ||
657 | } | ||
658 | |||
650 | int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *scsidev, | 659 | int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *scsidev, |
651 | int cmd, void __user *arg) | 660 | int cmd, void __user *arg) |
652 | { | 661 | { |
653 | int val = -EINVAL, rc = -EINVAL; | 662 | int val = -EINVAL, rc = -EINVAL; |
663 | unsigned long flags; | ||
654 | 664 | ||
655 | switch (cmd) { | 665 | switch (cmd) { |
656 | case ATA_IOC_GET_IO32: | 666 | case ATA_IOC_GET_IO32: |
657 | val = 0; | 667 | spin_lock_irqsave(ap->lock, flags); |
668 | val = ata_ioc32(ap); | ||
669 | spin_unlock_irqrestore(ap->lock, flags); | ||
658 | if (copy_to_user(arg, &val, 1)) | 670 | if (copy_to_user(arg, &val, 1)) |
659 | return -EFAULT; | 671 | return -EFAULT; |
660 | return 0; | 672 | return 0; |
661 | 673 | ||
662 | case ATA_IOC_SET_IO32: | 674 | case ATA_IOC_SET_IO32: |
663 | val = (unsigned long) arg; | 675 | val = (unsigned long) arg; |
664 | if (val != 0) | 676 | rc = 0; |
665 | return -EINVAL; | 677 | spin_lock_irqsave(ap->lock, flags); |
666 | return 0; | 678 | if (ap->pflags & ATA_PFLAG_PIO32CHANGE) { |
679 | if (val) | ||
680 | ap->pflags |= ATA_PFLAG_PIO32; | ||
681 | else | ||
682 | ap->pflags &= ~ATA_PFLAG_PIO32; | ||
683 | } else { | ||
684 | if (val != ata_ioc32(ap)) | ||
685 | rc = -EINVAL; | ||
686 | } | ||
687 | spin_unlock_irqrestore(ap->lock, flags); | ||
688 | return rc; | ||
667 | 689 | ||
668 | case HDIO_GET_IDENTITY: | 690 | case HDIO_GET_IDENTITY: |
669 | return ata_get_identity(ap, scsidev, arg); | 691 | return ata_get_identity(ap, scsidev, arg); |
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index 8332e97a9de3..bb18415d3d63 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c | |||
@@ -87,6 +87,7 @@ const struct ata_port_operations ata_bmdma32_port_ops = { | |||
87 | .inherits = &ata_bmdma_port_ops, | 87 | .inherits = &ata_bmdma_port_ops, |
88 | 88 | ||
89 | .sff_data_xfer = ata_sff_data_xfer32, | 89 | .sff_data_xfer = ata_sff_data_xfer32, |
90 | .port_start = ata_sff_port_start32, | ||
90 | }; | 91 | }; |
91 | EXPORT_SYMBOL_GPL(ata_bmdma32_port_ops); | 92 | EXPORT_SYMBOL_GPL(ata_bmdma32_port_ops); |
92 | 93 | ||
@@ -769,6 +770,9 @@ unsigned int ata_sff_data_xfer32(struct ata_device *dev, unsigned char *buf, | |||
769 | void __iomem *data_addr = ap->ioaddr.data_addr; | 770 | void __iomem *data_addr = ap->ioaddr.data_addr; |
770 | unsigned int words = buflen >> 2; | 771 | unsigned int words = buflen >> 2; |
771 | int slop = buflen & 3; | 772 | int slop = buflen & 3; |
773 | |||
774 | if (!(ap->pflags & ATA_PFLAG_PIO32)) | ||
775 | return ata_sff_data_xfer(dev, buf, buflen, rw); | ||
772 | 776 | ||
773 | /* Transfer multiple of 4 bytes */ | 777 | /* Transfer multiple of 4 bytes */ |
774 | if (rw == READ) | 778 | if (rw == READ) |
@@ -2402,6 +2406,29 @@ int ata_sff_port_start(struct ata_port *ap) | |||
2402 | EXPORT_SYMBOL_GPL(ata_sff_port_start); | 2406 | EXPORT_SYMBOL_GPL(ata_sff_port_start); |
2403 | 2407 | ||
2404 | /** | 2408 | /** |
2409 | * ata_sff_port_start32 - Set port up for dma. | ||
2410 | * @ap: Port to initialize | ||
2411 | * | ||
2412 | * Called just after data structures for each port are | ||
2413 | * initialized. Allocates space for PRD table if the device | ||
2414 | * is DMA capable SFF. | ||
2415 | * | ||
2416 | * May be used as the port_start() entry in ata_port_operations for | ||
2417 | * devices that are capable of 32bit PIO. | ||
2418 | * | ||
2419 | * LOCKING: | ||
2420 | * Inherited from caller. | ||
2421 | */ | ||
2422 | int ata_sff_port_start32(struct ata_port *ap) | ||
2423 | { | ||
2424 | ap->pflags |= ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32CHANGE; | ||
2425 | if (ap->ioaddr.bmdma_addr) | ||
2426 | return ata_port_start(ap); | ||
2427 | return 0; | ||
2428 | } | ||
2429 | EXPORT_SYMBOL_GPL(ata_sff_port_start32); | ||
2430 | |||
2431 | /** | ||
2405 | * ata_sff_std_ports - initialize ioaddr with standard port offsets. | 2432 | * ata_sff_std_ports - initialize ioaddr with standard port offsets. |
2406 | * @ioaddr: IO address structure to be initialized | 2433 | * @ioaddr: IO address structure to be initialized |
2407 | * | 2434 | * |
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c index 81ab57003aba..122c786449a9 100644 --- a/drivers/ata/pata_hpt37x.c +++ b/drivers/ata/pata_hpt37x.c | |||
@@ -8,7 +8,7 @@ | |||
8 | * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org> | 8 | * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org> |
9 | * Portions Copyright (C) 2001 Sun Microsystems, Inc. | 9 | * Portions Copyright (C) 2001 Sun Microsystems, Inc. |
10 | * Portions Copyright (C) 2003 Red Hat Inc | 10 | * Portions Copyright (C) 2003 Red Hat Inc |
11 | * Portions Copyright (C) 2005-2007 MontaVista Software, Inc. | 11 | * Portions Copyright (C) 2005-2009 MontaVista Software, Inc. |
12 | * | 12 | * |
13 | * TODO | 13 | * TODO |
14 | * Look into engine reset on timeout errors. Should not be required. | 14 | * Look into engine reset on timeout errors. Should not be required. |
@@ -24,7 +24,7 @@ | |||
24 | #include <linux/libata.h> | 24 | #include <linux/libata.h> |
25 | 25 | ||
26 | #define DRV_NAME "pata_hpt37x" | 26 | #define DRV_NAME "pata_hpt37x" |
27 | #define DRV_VERSION "0.6.11" | 27 | #define DRV_VERSION "0.6.12" |
28 | 28 | ||
29 | struct hpt_clock { | 29 | struct hpt_clock { |
30 | u8 xfer_speed; | 30 | u8 xfer_speed; |
@@ -445,23 +445,6 @@ static void hpt370_set_dmamode(struct ata_port *ap, struct ata_device *adev) | |||
445 | } | 445 | } |
446 | 446 | ||
447 | /** | 447 | /** |
448 | * hpt370_bmdma_start - DMA engine begin | ||
449 | * @qc: ATA command | ||
450 | * | ||
451 | * The 370 and 370A want us to reset the DMA engine each time we | ||
452 | * use it. The 372 and later are fine. | ||
453 | */ | ||
454 | |||
455 | static void hpt370_bmdma_start(struct ata_queued_cmd *qc) | ||
456 | { | ||
457 | struct ata_port *ap = qc->ap; | ||
458 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | ||
459 | pci_write_config_byte(pdev, 0x50 + 4 * ap->port_no, 0x37); | ||
460 | udelay(10); | ||
461 | ata_bmdma_start(qc); | ||
462 | } | ||
463 | |||
464 | /** | ||
465 | * hpt370_bmdma_end - DMA engine stop | 448 | * hpt370_bmdma_end - DMA engine stop |
466 | * @qc: ATA command | 449 | * @qc: ATA command |
467 | * | 450 | * |
@@ -598,7 +581,6 @@ static struct scsi_host_template hpt37x_sht = { | |||
598 | static struct ata_port_operations hpt370_port_ops = { | 581 | static struct ata_port_operations hpt370_port_ops = { |
599 | .inherits = &ata_bmdma_port_ops, | 582 | .inherits = &ata_bmdma_port_ops, |
600 | 583 | ||
601 | .bmdma_start = hpt370_bmdma_start, | ||
602 | .bmdma_stop = hpt370_bmdma_stop, | 584 | .bmdma_stop = hpt370_bmdma_stop, |
603 | 585 | ||
604 | .mode_filter = hpt370_filter, | 586 | .mode_filter = hpt370_filter, |
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c index 3f830f0fe2cc..6f985bed8cbb 100644 --- a/drivers/ata/pata_legacy.c +++ b/drivers/ata/pata_legacy.c | |||
@@ -108,6 +108,7 @@ struct legacy_controller { | |||
108 | struct ata_port_operations *ops; | 108 | struct ata_port_operations *ops; |
109 | unsigned int pio_mask; | 109 | unsigned int pio_mask; |
110 | unsigned int flags; | 110 | unsigned int flags; |
111 | unsigned int pflags; | ||
111 | int (*setup)(struct platform_device *, struct legacy_probe *probe, | 112 | int (*setup)(struct platform_device *, struct legacy_probe *probe, |
112 | struct legacy_data *data); | 113 | struct legacy_data *data); |
113 | }; | 114 | }; |
@@ -285,7 +286,8 @@ static unsigned int pdc_data_xfer_vlb(struct ata_device *dev, | |||
285 | { | 286 | { |
286 | int slop = buflen & 3; | 287 | int slop = buflen & 3; |
287 | /* 32bit I/O capable *and* we need to write a whole number of dwords */ | 288 | /* 32bit I/O capable *and* we need to write a whole number of dwords */ |
288 | if (ata_id_has_dword_io(dev->id) && (slop == 0 || slop == 3)) { | 289 | if (ata_id_has_dword_io(dev->id) && (slop == 0 || slop == 3) |
290 | && (ap->pflags & ATA_PFLAG_PIO32)) { | ||
289 | struct ata_port *ap = dev->link->ap; | 291 | struct ata_port *ap = dev->link->ap; |
290 | unsigned long flags; | 292 | unsigned long flags; |
291 | 293 | ||
@@ -736,7 +738,8 @@ static unsigned int vlb32_data_xfer(struct ata_device *adev, unsigned char *buf, | |||
736 | struct ata_port *ap = adev->link->ap; | 738 | struct ata_port *ap = adev->link->ap; |
737 | int slop = buflen & 3; | 739 | int slop = buflen & 3; |
738 | 740 | ||
739 | if (ata_id_has_dword_io(adev->id) && (slop == 0 || slop == 3)) { | 741 | if (ata_id_has_dword_io(adev->id) && (slop == 0 || slop == 3) |
742 | && (ap->pflags & ATA_PFLAG_PIO32)) { | ||
740 | if (rw == WRITE) | 743 | if (rw == WRITE) |
741 | iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2); | 744 | iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2); |
742 | else | 745 | else |
@@ -858,27 +861,30 @@ static struct ata_port_operations winbond_port_ops = { | |||
858 | 861 | ||
859 | static struct legacy_controller controllers[] = { | 862 | static struct legacy_controller controllers[] = { |
860 | {"BIOS", &legacy_port_ops, 0x1F, | 863 | {"BIOS", &legacy_port_ops, 0x1F, |
861 | ATA_FLAG_NO_IORDY, NULL }, | 864 | ATA_FLAG_NO_IORDY, 0, NULL }, |
862 | {"Snooping", &simple_port_ops, 0x1F, | 865 | {"Snooping", &simple_port_ops, 0x1F, |
863 | 0 , NULL }, | 866 | 0, 0, NULL }, |
864 | {"PDC20230", &pdc20230_port_ops, 0x7, | 867 | {"PDC20230", &pdc20230_port_ops, 0x7, |
865 | ATA_FLAG_NO_IORDY, NULL }, | 868 | ATA_FLAG_NO_IORDY, |
869 | ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32_CHANGE, NULL }, | ||
866 | {"HT6560A", &ht6560a_port_ops, 0x07, | 870 | {"HT6560A", &ht6560a_port_ops, 0x07, |
867 | ATA_FLAG_NO_IORDY, NULL }, | 871 | ATA_FLAG_NO_IORDY, 0, NULL }, |
868 | {"HT6560B", &ht6560b_port_ops, 0x1F, | 872 | {"HT6560B", &ht6560b_port_ops, 0x1F, |
869 | ATA_FLAG_NO_IORDY, NULL }, | 873 | ATA_FLAG_NO_IORDY, 0, NULL }, |
870 | {"OPTI82C611A", &opti82c611a_port_ops, 0x0F, | 874 | {"OPTI82C611A", &opti82c611a_port_ops, 0x0F, |
871 | 0 , NULL }, | 875 | 0, 0, NULL }, |
872 | {"OPTI82C46X", &opti82c46x_port_ops, 0x0F, | 876 | {"OPTI82C46X", &opti82c46x_port_ops, 0x0F, |
873 | 0 , NULL }, | 877 | 0, 0, NULL }, |
874 | {"QDI6500", &qdi6500_port_ops, 0x07, | 878 | {"QDI6500", &qdi6500_port_ops, 0x07, |
875 | ATA_FLAG_NO_IORDY, qdi_port }, | 879 | ATA_FLAG_NO_IORDY, |
880 | ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32_CHANGE, qdi_port }, | ||
876 | {"QDI6580", &qdi6580_port_ops, 0x1F, | 881 | {"QDI6580", &qdi6580_port_ops, 0x1F, |
877 | 0 , qdi_port }, | 882 | 0, ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32_CHANGE, qdi_port }, |
878 | {"QDI6580DP", &qdi6580dp_port_ops, 0x1F, | 883 | {"QDI6580DP", &qdi6580dp_port_ops, 0x1F, |
879 | 0 , qdi_port }, | 884 | 0, ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32_CHANGE, qdi_port }, |
880 | {"W83759A", &winbond_port_ops, 0x1F, | 885 | {"W83759A", &winbond_port_ops, 0x1F, |
881 | 0 , winbond_port } | 886 | 0, ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32_CHANGE, |
887 | winbond_port } | ||
882 | }; | 888 | }; |
883 | 889 | ||
884 | /** | 890 | /** |
@@ -1008,6 +1014,7 @@ static __init int legacy_init_one(struct legacy_probe *probe) | |||
1008 | ap->ops = ops; | 1014 | ap->ops = ops; |
1009 | ap->pio_mask = pio_modes; | 1015 | ap->pio_mask = pio_modes; |
1010 | ap->flags |= ATA_FLAG_SLAVE_POSS | iordy; | 1016 | ap->flags |= ATA_FLAG_SLAVE_POSS | iordy; |
1017 | ap->pflags |= controller->pflags; | ||
1011 | ap->ioaddr.cmd_addr = io_addr; | 1018 | ap->ioaddr.cmd_addr = io_addr; |
1012 | ap->ioaddr.altstatus_addr = ctrl_addr; | 1019 | ap->ioaddr.altstatus_addr = ctrl_addr; |
1013 | ap->ioaddr.ctl_addr = ctrl_addr; | 1020 | ap->ioaddr.ctl_addr = ctrl_addr; |
@@ -1032,6 +1039,7 @@ static __init int legacy_init_one(struct legacy_probe *probe) | |||
1032 | return 0; | 1039 | return 0; |
1033 | } | 1040 | } |
1034 | } | 1041 | } |
1042 | ata_host_detach(host); | ||
1035 | fail: | 1043 | fail: |
1036 | platform_device_unregister(pdev); | 1044 | platform_device_unregister(pdev); |
1037 | return ret; | 1045 | return ret; |
diff --git a/drivers/ata/pata_ninja32.c b/drivers/ata/pata_ninja32.c index 0fb6b1b1e634..dd53a66b19e3 100644 --- a/drivers/ata/pata_ninja32.c +++ b/drivers/ata/pata_ninja32.c | |||
@@ -44,7 +44,7 @@ | |||
44 | #include <linux/libata.h> | 44 | #include <linux/libata.h> |
45 | 45 | ||
46 | #define DRV_NAME "pata_ninja32" | 46 | #define DRV_NAME "pata_ninja32" |
47 | #define DRV_VERSION "0.1.3" | 47 | #define DRV_VERSION "0.1.5" |
48 | 48 | ||
49 | 49 | ||
50 | /** | 50 | /** |
@@ -86,6 +86,7 @@ static struct ata_port_operations ninja32_port_ops = { | |||
86 | .sff_dev_select = ninja32_dev_select, | 86 | .sff_dev_select = ninja32_dev_select, |
87 | .cable_detect = ata_cable_40wire, | 87 | .cable_detect = ata_cable_40wire, |
88 | .set_piomode = ninja32_set_piomode, | 88 | .set_piomode = ninja32_set_piomode, |
89 | .sff_data_xfer = ata_sff_data_xfer32 | ||
89 | }; | 90 | }; |
90 | 91 | ||
91 | static void ninja32_program(void __iomem *base) | 92 | static void ninja32_program(void __iomem *base) |
@@ -144,6 +145,7 @@ static int ninja32_init_one(struct pci_dev *dev, const struct pci_device_id *id) | |||
144 | ap->ioaddr.altstatus_addr = base + 0x1E; | 145 | ap->ioaddr.altstatus_addr = base + 0x1E; |
145 | ap->ioaddr.bmdma_addr = base; | 146 | ap->ioaddr.bmdma_addr = base; |
146 | ata_sff_std_ports(&ap->ioaddr); | 147 | ata_sff_std_ports(&ap->ioaddr); |
148 | ap->pflags = ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32CHANGE; | ||
147 | 149 | ||
148 | ninja32_program(base); | 150 | ninja32_program(base); |
149 | /* FIXME: Should we disable them at remove ? */ | 151 | /* FIXME: Should we disable them at remove ? */ |
diff --git a/include/linux/libata.h b/include/linux/libata.h index b450a2628855..3d501db36a26 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -209,6 +209,7 @@ enum { | |||
209 | 209 | ||
210 | /* bits 24:31 of ap->flags are reserved for LLD specific flags */ | 210 | /* bits 24:31 of ap->flags are reserved for LLD specific flags */ |
211 | 211 | ||
212 | |||
212 | /* struct ata_port pflags */ | 213 | /* struct ata_port pflags */ |
213 | ATA_PFLAG_EH_PENDING = (1 << 0), /* EH pending */ | 214 | ATA_PFLAG_EH_PENDING = (1 << 0), /* EH pending */ |
214 | ATA_PFLAG_EH_IN_PROGRESS = (1 << 1), /* EH in progress */ | 215 | ATA_PFLAG_EH_IN_PROGRESS = (1 << 1), /* EH in progress */ |
@@ -225,6 +226,9 @@ enum { | |||
225 | ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */ | 226 | ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */ |
226 | ATA_PFLAG_INIT_GTM_VALID = (1 << 19), /* initial gtm data valid */ | 227 | ATA_PFLAG_INIT_GTM_VALID = (1 << 19), /* initial gtm data valid */ |
227 | 228 | ||
229 | ATA_PFLAG_PIO32 = (1 << 20), /* 32bit PIO */ | ||
230 | ATA_PFLAG_PIO32CHANGE = (1 << 21), /* 32bit PIO can be turned on/off */ | ||
231 | |||
228 | /* struct ata_queued_cmd flags */ | 232 | /* struct ata_queued_cmd flags */ |
229 | ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */ | 233 | ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */ |
230 | ATA_QCFLAG_DMAMAP = (1 << 1), /* SG table is DMA mapped */ | 234 | ATA_QCFLAG_DMAMAP = (1 << 1), /* SG table is DMA mapped */ |
@@ -689,7 +693,10 @@ struct ata_port { | |||
689 | struct Scsi_Host *scsi_host; /* our co-allocated scsi host */ | 693 | struct Scsi_Host *scsi_host; /* our co-allocated scsi host */ |
690 | struct ata_port_operations *ops; | 694 | struct ata_port_operations *ops; |
691 | spinlock_t *lock; | 695 | spinlock_t *lock; |
696 | /* Flags owned by the EH context. Only EH should touch these once the | ||
697 | port is active */ | ||
692 | unsigned long flags; /* ATA_FLAG_xxx */ | 698 | unsigned long flags; /* ATA_FLAG_xxx */ |
699 | /* Flags that change dynamically, protected by ap->lock */ | ||
693 | unsigned int pflags; /* ATA_PFLAG_xxx */ | 700 | unsigned int pflags; /* ATA_PFLAG_xxx */ |
694 | unsigned int print_id; /* user visible unique port ID */ | 701 | unsigned int print_id; /* user visible unique port ID */ |
695 | unsigned int port_no; /* 0 based port no. inside the host */ | 702 | unsigned int port_no; /* 0 based port no. inside the host */ |
@@ -1595,6 +1602,7 @@ extern void ata_sff_drain_fifo(struct ata_queued_cmd *qc); | |||
1595 | extern void ata_sff_error_handler(struct ata_port *ap); | 1602 | extern void ata_sff_error_handler(struct ata_port *ap); |
1596 | extern void ata_sff_post_internal_cmd(struct ata_queued_cmd *qc); | 1603 | extern void ata_sff_post_internal_cmd(struct ata_queued_cmd *qc); |
1597 | extern int ata_sff_port_start(struct ata_port *ap); | 1604 | extern int ata_sff_port_start(struct ata_port *ap); |
1605 | extern int ata_sff_port_start32(struct ata_port *ap); | ||
1598 | extern void ata_sff_std_ports(struct ata_ioports *ioaddr); | 1606 | extern void ata_sff_std_ports(struct ata_ioports *ioaddr); |
1599 | extern unsigned long ata_bmdma_mode_filter(struct ata_device *dev, | 1607 | extern unsigned long ata_bmdma_mode_filter(struct ata_device *dev, |
1600 | unsigned long xfer_mask); | 1608 | unsigned long xfer_mask); |