aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/ahci.c3
-rw-r--r--drivers/ata/libata-core.c1
-rw-r--r--drivers/ata/libata-scsi.c24
-rw-r--r--drivers/ata/pata_hpt366.c6
-rw-r--r--drivers/ata/pata_hpt37x.c112
-rw-r--r--drivers/ata/pata_hpt3x2n.c12
-rw-r--r--drivers/ata/pata_mpc52xx.c2
7 files changed, 85 insertions, 75 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 328826381a2d..b8d96ce37fc9 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -260,6 +260,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
260 { PCI_VDEVICE(INTEL, 0x1d02), board_ahci }, /* PBG AHCI */ 260 { PCI_VDEVICE(INTEL, 0x1d02), board_ahci }, /* PBG AHCI */
261 { PCI_VDEVICE(INTEL, 0x1d04), board_ahci }, /* PBG RAID */ 261 { PCI_VDEVICE(INTEL, 0x1d04), board_ahci }, /* PBG RAID */
262 { PCI_VDEVICE(INTEL, 0x1d06), board_ahci }, /* PBG RAID */ 262 { PCI_VDEVICE(INTEL, 0x1d06), board_ahci }, /* PBG RAID */
263 { PCI_VDEVICE(INTEL, 0x2323), board_ahci }, /* DH89xxCC AHCI */
263 264
264 /* JMicron 360/1/3/5/6, match class to avoid IDE function */ 265 /* JMicron 360/1/3/5/6, match class to avoid IDE function */
265 { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 266 { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
@@ -379,6 +380,8 @@ static const struct pci_device_id ahci_pci_tbl[] = {
379 { PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv }, /* 6145 */ 380 { PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv }, /* 6145 */
380 { PCI_VDEVICE(MARVELL, 0x6121), board_ahci_mv }, /* 6121 */ 381 { PCI_VDEVICE(MARVELL, 0x6121), board_ahci_mv }, /* 6121 */
381 { PCI_DEVICE(0x1b4b, 0x9123), 382 { PCI_DEVICE(0x1b4b, 0x9123),
383 .class = PCI_CLASS_STORAGE_SATA_AHCI,
384 .class_mask = 0xffffff,
382 .driver_data = board_ahci_yes_fbs }, /* 88se9128 */ 385 .driver_data = board_ahci_yes_fbs }, /* 88se9128 */
383 386
384 /* Promise */ 387 /* Promise */
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index a31fe96f7de6..d4e52e214859 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4138,6 +4138,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
4138 * device and controller are SATA. 4138 * device and controller are SATA.
4139 */ 4139 */
4140 { "PIONEER DVD-RW DVRTD08", "1.00", ATA_HORKAGE_NOSETXFER }, 4140 { "PIONEER DVD-RW DVRTD08", "1.00", ATA_HORKAGE_NOSETXFER },
4141 { "PIONEER DVD-RW DVR-212D", "1.28", ATA_HORKAGE_NOSETXFER },
4141 4142
4142 /* End Marker */ 4143 /* End Marker */
4143 { } 4144 { }
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 5defc74973d7..600f6353ecf8 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1099,9 +1099,9 @@ static int ata_scsi_dev_config(struct scsi_device *sdev,
1099 struct request_queue *q = sdev->request_queue; 1099 struct request_queue *q = sdev->request_queue;
1100 void *buf; 1100 void *buf;
1101 1101
1102 /* set the min alignment and padding */ 1102 sdev->sector_size = ATA_SECT_SIZE;
1103 blk_queue_update_dma_alignment(sdev->request_queue, 1103
1104 ATA_DMA_PAD_SZ - 1); 1104 /* set DMA padding */
1105 blk_queue_update_dma_pad(sdev->request_queue, 1105 blk_queue_update_dma_pad(sdev->request_queue,
1106 ATA_DMA_PAD_SZ - 1); 1106 ATA_DMA_PAD_SZ - 1);
1107 1107
@@ -1115,13 +1115,25 @@ static int ata_scsi_dev_config(struct scsi_device *sdev,
1115 1115
1116 blk_queue_dma_drain(q, atapi_drain_needed, buf, ATAPI_MAX_DRAIN); 1116 blk_queue_dma_drain(q, atapi_drain_needed, buf, ATAPI_MAX_DRAIN);
1117 } else { 1117 } else {
1118 /* ATA devices must be sector aligned */
1119 sdev->sector_size = ata_id_logical_sector_size(dev->id); 1118 sdev->sector_size = ata_id_logical_sector_size(dev->id);
1120 blk_queue_update_dma_alignment(sdev->request_queue,
1121 sdev->sector_size - 1);
1122 sdev->manage_start_stop = 1; 1119 sdev->manage_start_stop = 1;
1123 } 1120 }
1124 1121
1122 /*
1123 * ata_pio_sectors() expects buffer for each sector to not cross
1124 * page boundary. Enforce it by requiring buffers to be sector
1125 * aligned, which works iff sector_size is not larger than
1126 * PAGE_SIZE. ATAPI devices also need the alignment as
1127 * IDENTIFY_PACKET is executed as ATA_PROT_PIO.
1128 */
1129 if (sdev->sector_size > PAGE_SIZE)
1130 ata_dev_printk(dev, KERN_WARNING,
1131 "sector_size=%u > PAGE_SIZE, PIO may malfunction\n",
1132 sdev->sector_size);
1133
1134 blk_queue_update_dma_alignment(sdev->request_queue,
1135 sdev->sector_size - 1);
1136
1125 if (dev->flags & ATA_DFLAG_AN) 1137 if (dev->flags & ATA_DFLAG_AN)
1126 set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events); 1138 set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events);
1127 1139
diff --git a/drivers/ata/pata_hpt366.c b/drivers/ata/pata_hpt366.c
index d7e57db36bc8..538ec38ba995 100644
--- a/drivers/ata/pata_hpt366.c
+++ b/drivers/ata/pata_hpt366.c
@@ -25,7 +25,7 @@
25#include <linux/libata.h> 25#include <linux/libata.h>
26 26
27#define DRV_NAME "pata_hpt366" 27#define DRV_NAME "pata_hpt366"
28#define DRV_VERSION "0.6.9" 28#define DRV_VERSION "0.6.10"
29 29
30struct hpt_clock { 30struct hpt_clock {
31 u8 xfer_mode; 31 u8 xfer_mode;
@@ -160,8 +160,8 @@ static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr,
160 160
161 while (list[i] != NULL) { 161 while (list[i] != NULL) {
162 if (!strcmp(list[i], model_num)) { 162 if (!strcmp(list[i], model_num)) {
163 printk(KERN_WARNING DRV_NAME ": %s is not supported for %s.\n", 163 pr_warning(DRV_NAME ": %s is not supported for %s.\n",
164 modestr, list[i]); 164 modestr, list[i]);
165 return 1; 165 return 1;
166 } 166 }
167 i++; 167 i++;
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c
index efdd18bc8663..4c5b5183225e 100644
--- a/drivers/ata/pata_hpt37x.c
+++ b/drivers/ata/pata_hpt37x.c
@@ -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.18" 27#define DRV_VERSION "0.6.22"
28 28
29struct hpt_clock { 29struct hpt_clock {
30 u8 xfer_speed; 30 u8 xfer_speed;
@@ -229,8 +229,8 @@ static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr,
229 229
230 while (list[i] != NULL) { 230 while (list[i] != NULL) {
231 if (!strcmp(list[i], model_num)) { 231 if (!strcmp(list[i], model_num)) {
232 printk(KERN_WARNING DRV_NAME ": %s is not supported for %s.\n", 232 pr_warning(DRV_NAME ": %s is not supported for %s.\n",
233 modestr, list[i]); 233 modestr, list[i]);
234 return 1; 234 return 1;
235 } 235 }
236 i++; 236 i++;
@@ -642,7 +642,6 @@ static struct ata_port_operations hpt372_port_ops = {
642static struct ata_port_operations hpt374_fn1_port_ops = { 642static struct ata_port_operations hpt374_fn1_port_ops = {
643 .inherits = &hpt372_port_ops, 643 .inherits = &hpt372_port_ops,
644 .cable_detect = hpt374_fn1_cable_detect, 644 .cable_detect = hpt374_fn1_cable_detect,
645 .prereset = hpt37x_pre_reset,
646}; 645};
647 646
648/** 647/**
@@ -803,7 +802,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
803 .udma_mask = ATA_UDMA6, 802 .udma_mask = ATA_UDMA6,
804 .port_ops = &hpt302_port_ops 803 .port_ops = &hpt302_port_ops
805 }; 804 };
806 /* HPT374 - UDMA100, function 1 uses different prereset method */ 805 /* HPT374 - UDMA100, function 1 uses different cable_detect method */
807 static const struct ata_port_info info_hpt374_fn0 = { 806 static const struct ata_port_info info_hpt374_fn0 = {
808 .flags = ATA_FLAG_SLAVE_POSS, 807 .flags = ATA_FLAG_SLAVE_POSS,
809 .pio_mask = ATA_PIO4, 808 .pio_mask = ATA_PIO4,
@@ -838,7 +837,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
838 if (rc) 837 if (rc)
839 return rc; 838 return rc;
840 839
841 if (dev->device == PCI_DEVICE_ID_TTI_HPT366) { 840 switch (dev->device) {
841 case PCI_DEVICE_ID_TTI_HPT366:
842 /* May be a later chip in disguise. Check */ 842 /* May be a later chip in disguise. Check */
843 /* Older chips are in the HPT366 driver. Ignore them */ 843 /* Older chips are in the HPT366 driver. Ignore them */
844 if (rev < 3) 844 if (rev < 3)
@@ -863,54 +863,50 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
863 chip_table = &hpt372; 863 chip_table = &hpt372;
864 break; 864 break;
865 default: 865 default:
866 printk(KERN_ERR "pata_hpt37x: Unknown HPT366 subtype, " 866 pr_err(DRV_NAME ": Unknown HPT366 subtype, "
867 "please report (%d).\n", rev); 867 "please report (%d).\n", rev);
868 return -ENODEV; 868 return -ENODEV;
869 } 869 }
870 } else { 870 break;
871 switch (dev->device) { 871 case PCI_DEVICE_ID_TTI_HPT372:
872 case PCI_DEVICE_ID_TTI_HPT372: 872 /* 372N if rev >= 2 */
873 /* 372N if rev >= 2 */ 873 if (rev >= 2)
874 if (rev >= 2) 874 return -ENODEV;
875 return -ENODEV; 875 ppi[0] = &info_hpt372;
876 ppi[0] = &info_hpt372; 876 chip_table = &hpt372a;
877 chip_table = &hpt372a; 877 break;
878 break; 878 case PCI_DEVICE_ID_TTI_HPT302:
879 case PCI_DEVICE_ID_TTI_HPT302: 879 /* 302N if rev > 1 */
880 /* 302N if rev > 1 */ 880 if (rev > 1)
881 if (rev > 1) 881 return -ENODEV;
882 return -ENODEV; 882 ppi[0] = &info_hpt302;
883 ppi[0] = &info_hpt302; 883 /* Check this */
884 /* Check this */ 884 chip_table = &hpt302;
885 chip_table = &hpt302; 885 break;
886 break; 886 case PCI_DEVICE_ID_TTI_HPT371:
887 case PCI_DEVICE_ID_TTI_HPT371: 887 if (rev > 1)
888 if (rev > 1) 888 return -ENODEV;
889 return -ENODEV; 889 ppi[0] = &info_hpt302;
890 ppi[0] = &info_hpt302; 890 chip_table = &hpt371;
891 chip_table = &hpt371; 891 /*
892 /* 892 * Single channel device, master is not present but the BIOS
893 * Single channel device, master is not present 893 * (or us for non x86) must mark it absent
894 * but the BIOS (or us for non x86) must mark it 894 */
895 * absent 895 pci_read_config_byte(dev, 0x50, &mcr1);
896 */ 896 mcr1 &= ~0x04;
897 pci_read_config_byte(dev, 0x50, &mcr1); 897 pci_write_config_byte(dev, 0x50, mcr1);
898 mcr1 &= ~0x04; 898 break;
899 pci_write_config_byte(dev, 0x50, mcr1); 899 case PCI_DEVICE_ID_TTI_HPT374:
900 break; 900 chip_table = &hpt374;
901 case PCI_DEVICE_ID_TTI_HPT374: 901 if (!(PCI_FUNC(dev->devfn) & 1))
902 chip_table = &hpt374; 902 *ppi = &info_hpt374_fn0;
903 if (!(PCI_FUNC(dev->devfn) & 1)) 903 else
904 *ppi = &info_hpt374_fn0; 904 *ppi = &info_hpt374_fn1;
905 else 905 break;
906 *ppi = &info_hpt374_fn1; 906 default:
907 break; 907 pr_err(DRV_NAME ": PCI table is bogus, please report (%d).\n",
908 default: 908 dev->device);
909 printk(KERN_ERR 909 return -ENODEV;
910 "pata_hpt37x: PCI table is bogus, please report (%d).\n",
911 dev->device);
912 return -ENODEV;
913 }
914 } 910 }
915 /* Ok so this is a chip we support */ 911 /* Ok so this is a chip we support */
916 912
@@ -957,8 +953,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
957 u8 sr; 953 u8 sr;
958 u32 total = 0; 954 u32 total = 0;
959 955
960 printk(KERN_WARNING 956 pr_warning(DRV_NAME ": BIOS has not set timing clocks.\n");
961 "pata_hpt37x: BIOS has not set timing clocks.\n");
962 957
963 /* This is the process the HPT371 BIOS is reported to use */ 958 /* This is the process the HPT371 BIOS is reported to use */
964 for (i = 0; i < 128; i++) { 959 for (i = 0; i < 128; i++) {
@@ -1014,7 +1009,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
1014 (f_high << 16) | f_low | 0x100); 1009 (f_high << 16) | f_low | 0x100);
1015 } 1010 }
1016 if (adjust == 8) { 1011 if (adjust == 8) {
1017 printk(KERN_ERR "pata_hpt37x: DPLL did not stabilize!\n"); 1012 pr_err(DRV_NAME ": DPLL did not stabilize!\n");
1018 return -ENODEV; 1013 return -ENODEV;
1019 } 1014 }
1020 if (dpll == 3) 1015 if (dpll == 3)
@@ -1022,8 +1017,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
1022 else 1017 else
1023 private_data = (void *)hpt37x_timings_50; 1018 private_data = (void *)hpt37x_timings_50;
1024 1019
1025 printk(KERN_INFO "pata_hpt37x: bus clock %dMHz, using %dMHz DPLL.\n", 1020 pr_info(DRV_NAME ": bus clock %dMHz, using %dMHz DPLL.\n",
1026 MHz[clock_slot], MHz[dpll]); 1021 MHz[clock_slot], MHz[dpll]);
1027 } else { 1022 } else {
1028 private_data = (void *)chip_table->clocks[clock_slot]; 1023 private_data = (void *)chip_table->clocks[clock_slot];
1029 /* 1024 /*
@@ -1036,8 +1031,9 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
1036 ppi[0] = &info_hpt370_33; 1031 ppi[0] = &info_hpt370_33;
1037 if (clock_slot < 2 && ppi[0] == &info_hpt370a) 1032 if (clock_slot < 2 && ppi[0] == &info_hpt370a)
1038 ppi[0] = &info_hpt370a_33; 1033 ppi[0] = &info_hpt370a_33;
1039 printk(KERN_INFO "pata_hpt37x: %s using %dMHz bus clock.\n", 1034
1040 chip_table->name, MHz[clock_slot]); 1035 pr_info(DRV_NAME ": %s using %dMHz bus clock.\n",
1036 chip_table->name, MHz[clock_slot]);
1041 } 1037 }
1042 1038
1043 /* Now kick off ATA set up */ 1039 /* Now kick off ATA set up */
diff --git a/drivers/ata/pata_hpt3x2n.c b/drivers/ata/pata_hpt3x2n.c
index d2239bbdb798..eca68caf5f46 100644
--- a/drivers/ata/pata_hpt3x2n.c
+++ b/drivers/ata/pata_hpt3x2n.c
@@ -25,7 +25,7 @@
25#include <linux/libata.h> 25#include <linux/libata.h>
26 26
27#define DRV_NAME "pata_hpt3x2n" 27#define DRV_NAME "pata_hpt3x2n"
28#define DRV_VERSION "0.3.13" 28#define DRV_VERSION "0.3.14"
29 29
30enum { 30enum {
31 HPT_PCI_FAST = (1 << 31), 31 HPT_PCI_FAST = (1 << 31),
@@ -418,7 +418,7 @@ static int hpt3x2n_pci_clock(struct pci_dev *pdev)
418 u16 sr; 418 u16 sr;
419 u32 total = 0; 419 u32 total = 0;
420 420
421 printk(KERN_WARNING "pata_hpt3x2n: BIOS clock data not set.\n"); 421 pr_warning(DRV_NAME ": BIOS clock data not set.\n");
422 422
423 /* This is the process the HPT371 BIOS is reported to use */ 423 /* This is the process the HPT371 BIOS is reported to use */
424 for (i = 0; i < 128; i++) { 424 for (i = 0; i < 128; i++) {
@@ -528,8 +528,7 @@ hpt372n:
528 ppi[0] = &info_hpt372n; 528 ppi[0] = &info_hpt372n;
529 break; 529 break;
530 default: 530 default:
531 printk(KERN_ERR 531 pr_err(DRV_NAME ": PCI table is bogus, please report (%d).\n",
532 "pata_hpt3x2n: PCI table is bogus please report (%d).\n",
533 dev->device); 532 dev->device);
534 return -ENODEV; 533 return -ENODEV;
535 } 534 }
@@ -579,12 +578,11 @@ hpt372n:
579 pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low); 578 pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low);
580 } 579 }
581 if (adjust == 8) { 580 if (adjust == 8) {
582 printk(KERN_ERR "pata_hpt3x2n: DPLL did not stabilize!\n"); 581 pr_err(DRV_NAME ": DPLL did not stabilize!\n");
583 return -ENODEV; 582 return -ENODEV;
584 } 583 }
585 584
586 printk(KERN_INFO "pata_hpt37x: bus clock %dMHz, using 66MHz DPLL.\n", 585 pr_info(DRV_NAME ": bus clock %dMHz, using 66MHz DPLL.\n", pci_mhz);
587 pci_mhz);
588 586
589 /* 587 /*
590 * Set our private data up. We only need a few flags 588 * Set our private data up. We only need a few flags
diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c
index 8cc536e49a0a..d7d8026cde99 100644
--- a/drivers/ata/pata_mpc52xx.c
+++ b/drivers/ata/pata_mpc52xx.c
@@ -610,7 +610,7 @@ static struct scsi_host_template mpc52xx_ata_sht = {
610}; 610};
611 611
612static struct ata_port_operations mpc52xx_ata_port_ops = { 612static struct ata_port_operations mpc52xx_ata_port_ops = {
613 .inherits = &ata_sff_port_ops, 613 .inherits = &ata_bmdma_port_ops,
614 .sff_dev_select = mpc52xx_ata_dev_select, 614 .sff_dev_select = mpc52xx_ata_dev_select,
615 .set_piomode = mpc52xx_ata_set_piomode, 615 .set_piomode = mpc52xx_ata_set_piomode,
616 .set_dmamode = mpc52xx_ata_set_dmamode, 616 .set_dmamode = mpc52xx_ata_set_dmamode,