libata fixes
PATCH 1/1 libata fixes
Please pull from 'upstream-linus' branch of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git upstream-linus
to receive the following updates:
drivers/ata/Kconfig | 5 ++++ drivers/ata/libata-core.c | 3 +- drivers/ata/pata_pdc2027x.c | 11 ++++++++- drivers/ata/pata_sis.c | 46 +++++++++++++++++++++++++++++++++++++++++- drivers/ata/sata_inic162x.c | 7 ++++++ drivers/ata/sata_nv.c | 2 + drivers/ata/sata_sis.c | 39 +++++++++++++++++------------------ drivers/ata/sis.h | 2 +- drivers/scsi/Kconfig | 1 + 9 files changed, 89 insertions(+), 27 deletions(-)
Albert Lee (2):
libata: pata_pdc2027x PLL input clock fix
libata: remove reading alt_status from ata_hsm_qc_complete()
Randy Dunlap (1):
scsi disk help file is not complete
Robert Hancock (1):
sata_nv: allow changing queue depth
Tejun Heo (2):
sata_inic162x: disable LBA48 devices
libata: add HTS541616J9SA00 to NCQ blacklist
Uwe Koziolek (1):
libata: PATA-mode fixes for sis_sata
drivers/ata/Kconfig +5 -0
@@ -16,6 +16,11 @@ menuconfig ATA that "speaks" the ATA protocol, also called ATA controller), because you will be asked for it. + NOTE: ATA enables basic SCSI support; *however*, + 'SCSI disk support', 'SCSI tape support', or + 'SCSI CDROM support' may also be needed, + depending on your hardware configuration. + if ATA config ATA_NONSTANDARD
drivers/ata/libata-core.c +1 -2
@@ -3798,6 +3798,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {/* Drives which do spurious command completion */ { "HTS541680J9SA00", "SB2IC7EP", ATA_HORKAGE_NONCQ, }, { "HTS541612J9SA00", "SBDIC7JP", ATA_HORKAGE_NONCQ, }, + { "Hitachi HTS541616J9SA00", "SB4OC70P", ATA_HORKAGE_NONCQ, }, { "WDC WD740ADFD-00NLR1", NULL, ATA_HORKAGE_NONCQ, },/* Devices with NCQ limits */
@@ -4781,8 +4782,6 @@ static void ata_hsm_qc_complete(struct ata_queued_cmd *qc, int in_wq) }else ata_qc_complete (qc); } - -ata_altstatus (ap);/* flush */ }/**
drivers/ata/pata_pdc2027x.c +9 -2
@@ -689,10 +689,12 @@ static long pdc_detect_pll_input_clock(struct ata_host *host)void __iomem *mmio_base = host->iomap[PDC_MMIO_BAR ];u32 scr;long start_count, end_count; -long pll_clock; +struct timeval start_time, end_time; +long pll_clock, usec_elapsed;/* Read current counter value */ start_count =pdc_read_counter (host); +do_gettimeofday (&start_time);/* Start the test mode */ scr =readl (mmio_base +PDC_SYS_CTL );
@@ -705,6 +707,7 @@ static long pdc_detect_pll_input_clock(struct ata_host *host)/* Read the counter values again */ end_count =pdc_read_counter (host); +do_gettimeofday (&end_time);/* Stop the test mode */ scr =readl (mmio_base +PDC_SYS_CTL );
@@ -713,7 +716,11 @@ static long pdc_detect_pll_input_clock(struct ata_host *host)readl (mmio_base +PDC_SYS_CTL );/* flush */ /* calculate the input clock in Hz */ - pll_clock = (start_count - end_count) *10 ; + usec_elapsed = (end_time.tv_sec - start_time.tv_sec) *1000000 + + (end_time.tv_usec - start_time.tv_usec); + + pll_clock = (start_count - end_count) /100 * + (100000000 / usec_elapsed);PDPRINTK ("start[%ld] end[%ld] \n" , start_count, end_count);PDPRINTK ("PLL input clock[%ld]Hz\n" , pll_clock);
drivers/ata/pata_sis.c +44 -2
76 lines not on this page · raw message
drivers/ata/sata_inic162x.c +7 -0
@@ -496,6 +496,13 @@ static void inic_dev_config(struct ata_device *dev)/* inic can only handle upto LBA28 max sectors */ if (dev->max_sectors >ATA_MAX_SECTORS ) dev->max_sectors =ATA_MAX_SECTORS ; + +if (dev->n_sectors >=1 <<28 ) { +ata_dev_printk (dev,KERN_ERR , +"ERROR: This driver doesn't support LBA48 yet and may cause\n" +" data corruption on such devices. Disabling.\n" ); +ata_dev_disable (dev); + } }static void init_port (struct ata_port *ap)
drivers/ata/sata_nv.c +2 -0
@@ -307,6 +307,7 @@ static struct scsi_host_template nv_sht = { .name = DRV_NAME, .ioctl = ata_scsi_ioctl, .queuecommand = ata_scsi_queuecmd, + .change_queue_depth = ata_scsi_change_queue_depth, .can_queue = ATA_DEF_QUEUE, .this_id = ATA_SHT_THIS_ID, .sg_tablesize = LIBATA_MAX_PRD,
@@ -325,6 +326,7 @@ static struct scsi_host_template nv_adma_sht = { .name = DRV_NAME, .ioctl = ata_scsi_ioctl, .queuecommand = ata_scsi_queuecmd, + .change_queue_depth = ata_scsi_change_queue_depth, .can_queue = NV_ADMA_MAX_CPBS, .this_id = ATA_SHT_THIS_ID, .sg_tablesize = NV_ADMA_SGTBL_TOTAL_LEN,
drivers/ata/sata_sis.c +19 -20
@@ -72,8 +72,8 @@ static const struct pci_device_id sis_pci_tbl[] = { { PCI_VDEVICE(SI, 0x0181), sis_180 }, /* SiS 964/180 */ { PCI_VDEVICE(SI, 0x0182), sis_180 }, /* SiS 965/965L */ { PCI_VDEVICE(SI, 0x0183), sis_180 }, /* SiS 965/965L */ - { PCI_VDEVICE(SI, 0x1182), sis_180 }, /* SiS 966/966L */ - { PCI_VDEVICE(SI, 0x1183), sis_180 }, /* SiS 966/966L */ + { PCI_VDEVICE(SI, 0x1182), sis_180 }, /* SiS 966/680 */ + { PCI_VDEVICE(SI, 0x1183), sis_180 }, /* SiS 966/966L/968/680 */ { } /* terminate list */ };
@@ -161,7 +161,6 @@ static unsigned int get_scr_cfg_addr(struct ata_port *ap, unsigned int sc_reg)case 0x0182 :case 0x0183 :case 0x1182 : -case 0x1183 : addr +=SIS182_SATA1_OFS ;break ; }
@@ -183,8 +182,8 @@ static u32 sis_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg)pci_read_config_dword (pdev, cfg_addr, &val); -if ((pdev->device ==0x0182 ) || (pdev->device ==0x0183 ) || (pdev->device ==0x1182 ) || - (pdev->device ==0x1183 ) || (pmr &SIS_PMR_COMBINED )) +if ((pdev->device ==0x0182 ) || (pdev->device ==0x0183 ) || + (pdev->device ==0x1182 ) || (pmr &SIS_PMR_COMBINED ))pci_read_config_dword (pdev, cfg_addr+0x10 , &val2);return (val|val2) &0xfffffffb ;/* avoid problems with powerdowned ports */
@@ -203,8 +202,8 @@ static void sis_scr_cfg_write (struct ata_port *ap, unsigned int sc_reg, u32 valpci_write_config_dword (pdev, cfg_addr, val); -if ((pdev->device ==0x0182 ) || (pdev->device ==0x0183 ) || (pdev->device ==0x1182 ) || - (pdev->device ==0x1183 ) || (pmr &SIS_PMR_COMBINED )) +if ((pdev->device ==0x0182 ) || (pdev->device ==0x0183 ) || + (pdev->device ==0x1182 ) || (pmr &SIS_PMR_COMBINED ))pci_write_config_dword (pdev, cfg_addr+0x10 , val); }
@@ -224,8 +223,8 @@ static u32 sis_scr_read (struct ata_port *ap, unsigned int sc_reg) val =ioread32 (ap->ioaddr.scr_addr + (sc_reg *4 )); -if ((pdev->device ==0x0182 ) || (pdev->device ==0x0183 ) || (pdev->device ==0x1182 ) || - (pdev->device ==0x1183 ) || (pmr &SIS_PMR_COMBINED )) +if ((pdev->device ==0x0182 ) || (pdev->device ==0x0183 ) || + (pdev->device ==0x1182 ) || (pmr &SIS_PMR_COMBINED )) val2 =ioread32 (ap->ioaddr.scr_addr + (sc_reg *4 ) +0x10 );return (val | val2) &0xfffffffb ;
@@ -245,8 +244,8 @@ static void sis_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val)sis_scr_cfg_write (ap, sc_reg, val); else {iowrite32 (val, ap->ioaddr.scr_addr + (sc_reg *4 )); -if ((pdev->device ==0x0182 ) || (pdev->device ==0x0183 ) || (pdev->device ==0x1182 ) || - (pdev->device ==0x1183 ) || (pmr &SIS_PMR_COMBINED )) +if ((pdev->device ==0x0182 ) || (pdev->device ==0x0183 ) || + (pdev->device ==0x1182 ) || (pmr &SIS_PMR_COMBINED ))iowrite32 (val, ap->ioaddr.scr_addr + (sc_reg *4 )+0x10 ); } }
@@ -293,11 +292,11 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)/* The PATA-handling is provided by pata_sis */ switch (pmr &0x30 ) {case 0x10 : - ppi[1 ] = &sis_info133; + ppi[1 ] = &sis_info133_for_sata;break ;case 0x30 : - ppi[0 ] = &sis_info133; + ppi[0 ] = &sis_info133_for_sata;break ; }if ((pmr &SIS_PMR_COMBINED ) ==0 ) {
@@ -324,14 +323,14 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)break ;case 0x1182 : +dev_printk (KERN_INFO , &pdev->dev,"Detected SiS 1182/966/680 SATA controller\n" ); + pi.flags |=ATA_FLAG_SLAVE_POSS ; +break ; +case 0x1183 : -pci_read_config_dword (pdev,0x64 , &val); -if (val &0x10000000 ) { -dev_printk (KERN_INFO , &pdev->dev,"Detected SiS 1182/1183/966L SATA controller\n" ); - }else { -dev_printk (KERN_INFO , &pdev->dev,"Detected SiS 1182/1183/966 SATA controller\n" ); - pi.flags |=ATA_FLAG_SLAVE_POSS ; - } +dev_printk (KERN_INFO , &pdev->dev,"Detected SiS 1183/966/966L/968/680 controller in PATA mode\n" ); + ppi[0 ] = &sis_info133_for_sata; + ppi[1 ] = &sis_info133_for_sata;break ; }
drivers/ata/sis.h +1 -1
@@ -2,4 +2,4 @@struct ata_port_info ;/* pata_sis.c */ -extern const struct ata_port_info sis_info133; +extern const struct ata_port_info sis_info133_for_sata;
drivers/scsi/Kconfig +1 -0
@@ -60,6 +60,7 @@ config BLK_DEV_SD depends on SCSI ---help--- If you want to use SCSI hard disks, Fibre Channel disks, + Serial ATA (SATA) or Parallel ATA (PATA) hard disks, USB storage or the SCSI or parallel port version of the IOMEGA ZIP drive, say Y and read the SCSI-HOWTO, the Disk-HOWTO and the Multi-Disk-HOWTO, available from