Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
libata: set queue DMA alignment to sector size for ATAPI too
libata: DVR-212D can't do SETXFER DVD-RW DVR-212D
ahci: add HFLAG_YES_FBS and apply it to 88SE9128
pata_hpt37x: inherit prereset() method for HPT374
ahci: AHCI mode SATA patch for Intel DH89xxCC DeviceIDs
pata_hpt37x: fold 'if' statement into 'switch'
pata_hpt{37x|3x2n}: use pr_*(DRV_NAME ...) instead of printk(KERN_* ...)
pata_hpt{366|37x}: use pr_warning(...) instead of printk(KERN_WARNING ...)
pata_mpc52xx: inherit from ata_bmdma_port_ops

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