libata updates for 2.6.34
Subsystems (3)
PATCH 1/1 libata updates for 2.6.34
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 | 4 +- drivers/ata/ahci.c | 235 +++++++++++++++++++++++++++++++++++---- drivers/ata/ata_generic.c | 2 +- drivers/ata/ata_piix.c | 28 ++++- drivers/ata/libata-core.c | 17 ++- drivers/ata/libata-sff.c | 50 +++++++-- drivers/ata/pata_acpi.c | 2 +- drivers/ata/pata_ali.c | 10 +- drivers/ata/pata_amd.c | 2 +- drivers/ata/pata_artop.c | 2 +- drivers/ata/pata_at91.c | 4 +- drivers/ata/pata_atiixp.c | 14 ++- drivers/ata/pata_cmd640.c | 2 +- drivers/ata/pata_cmd64x.c | 27 ++--- drivers/ata/pata_cs5530.c | 2 +- drivers/ata/pata_cs5535.c | 4 +- drivers/ata/pata_cs5536.c | 2 +- drivers/ata/pata_cypress.c | 12 +- drivers/ata/pata_efar.c | 22 +++- drivers/ata/pata_hpt366.c | 23 +--- drivers/ata/pata_hpt37x.c | 189 ++++++++++++++----------------- drivers/ata/pata_hpt3x2n.c | 120 +++++++++----------- drivers/ata/pata_it8213.c | 2 +- drivers/ata/pata_it821x.c | 2 +- drivers/ata/pata_jmicron.c | 2 +- drivers/ata/pata_marvell.c | 4 +- drivers/ata/pata_netcell.c | 2 +- drivers/ata/pata_ns87410.c | 2 +- drivers/ata/pata_ns87415.c | 2 +- drivers/ata/pata_oldpiix.c | 2 +- drivers/ata/pata_opti.c | 2 +- drivers/ata/pata_optidma.c | 2 +- drivers/ata/pata_pcmcia.c | 2 +- drivers/ata/pata_pdc202xx_old.c | 17 +++- drivers/ata/pata_piccolo.c | 2 +- drivers/ata/pata_radisys.c | 2 +- drivers/ata/pata_rz1000.c | 2 +- drivers/ata/pata_sc1200.c | 2 +- drivers/ata/pata_serverworks.c | 7 +- drivers/ata/pata_sil680.c | 2 +- drivers/ata/pata_sis.c | 2 +- drivers/ata/pata_sl82c105.c | 2 +- drivers/ata/pata_triflex.c | 2 +- drivers/ata/pata_via.c | 210 ++++++++++++++++------------------- drivers/ata/sata_via.c | 23 ++++- drivers/staging/phison/phison.c | 2 +- include/linux/ata.h | 3 +- include/linux/libata.h | 5 +- 48 files changed, 663 insertions(+), 417 deletions(-)
Alan Cox (4):
libata: Allow pata_legacy to be built on non-ISA but PCI systems
libata: Pass host flags into the pci helper
pata_atiixp: enable parallel scan
pata_efar: Enable parallel scanning
Bart Hartgers (2):
sata_via: Correctly setup PIO/DMA for pata slave on vt6421.
sata_via: Delay on vt6420 when starting ATAPI DMA write
Bartlomiej Zolnierkiewicz (17):
libata: fix CFA handling in ide_timing_compute()
pata_ali: documentation fixes
pata_cmd64x: fix PIO setup
pata_cmd64x: fix handling of address setup timings
pata_cmd64x: cmd648_bmdma_stop() fix
pata_cmd64x: remove unused definitions
pata_cs5535: use correct values for PIO1 and PIO2 data timings
pata_cypress: fix PIO timings underclocking
pata_efar: fix secondary port support
pata_serverworks: fix PIO setup for the second channel
pata_serverworks: fix error message
pata_via: fix address setup timings underlocking
pata_via: store UDMA masks in via_isa_bridges table
pata_pdc202xx_old: fix UDMA mode for Promise UDMA33 cards
pata_pdc202xx_old: fix UDMA mode for PDC2026x chipsets [libata] pata_efar: add locking for parallel scanning [libata] pata_atiixp: add locking for parallel scanning
Ben Gardner (1):
ata: Detect Delkin Devices compact flash
Christoph Egger (1):
[libata] pata_marvell: CONFIG_AHCI is really CONFIG_SATA_AHCI
Jeff Garzik (1):
[libata] pata_at91: fix backslash-continued string
Robert Hancock (1):
libata: make functions/variables static
Sergei Shtylyov (6):
pata_hpt37x: use ATA_DMA_* constants
pata_hpt3x2n: always stretch UltraDMA timing pata_hpt{37x|3x2n}: unify mode programming
pata_hpt366: remove redundant code pata_hpt{37x|3x2n}: improve timing register documentation
pata_hpt366: remove irrelevant TODO
Seth Heasley (2):
ahci: AHCI and RAID mode SATA patch for Intel Cougar Point DeviceIDs
ata_piix: IDE Mode SATA patch for Intel Cougar Point DeviceIDs
Shane Huang (1):
ahci: Implement SATA AHCI FIS-based switching support
Tejun Heo (2):
libata: cleanup ata_sff_interrupt()
libata: implement spurious irq handling for SFF and apply it to piix
drivers/ata/Kconfig +2 -2
@@ -446,9 +446,9 @@ config PATA_JMICRON config PATA_LEGACY tristate "Legacy ISA PATA support (Experimental)" - depends on ISA && EXPERIMENTAL + depends on (ISA || PCI) && EXPERIMENTAL help - This option enables support for ISA/VLB bus legacy PATA + This option enables support for ISA/VLB/PCI bus legacy PATA ports and allows them to be accessed via the new ATA layer. If unsure, say N.
drivers/ata/ahci.c +213 -22
384 lines not on this page · raw message
drivers/ata/ata_generic.c +1 -1
@@ -155,7 +155,7 @@ static int ata_generic_init_one(struct pci_dev *dev, const struct pci_device_idreturn rc;pcim_pin_device (dev); } -return ata_pci_sff_init_one (dev, ppi, &generic_sht,NULL ); +return ata_pci_sff_init_one (dev, ppi, &generic_sht,NULL ,0 ); }static struct pci_device_id ata_generic[] = {
drivers/ata/ata_piix.c +23 -5
@@ -173,6 +173,7 @@ static int piix_sidpr_scr_read(struct ata_link *link, unsigned int reg, u32 *val);static int piix_sidpr_scr_write (struct ata_link *link,unsigned int reg,u32 val); +static bool piix_irq_check (struct ata_port *ap);#ifdef CONFIG_PM static int piix_pci_device_suspend (struct pci_dev *pdev,pm_message_t mesg);static int piix_pci_device_resume (struct pci_dev *pdev);
@@ -291,6 +292,14 @@ static const struct pci_device_id piix_pci_tbl[] = { { 0x8086, 0x3b2d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },/* SATA Controller IDE (PCH) */ { 0x8086, 0x3b2e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata }, +/* SATA Controller IDE (CPT) */ + { 0x8086, 0x1c00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata }, +/* SATA Controller IDE (CPT) */ + { 0x8086, 0x1c01, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata }, +/* SATA Controller IDE (CPT) */ + { 0x8086, 0x1c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, +/* SATA Controller IDE (CPT) */ + { 0x8086, 0x1c09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, { } /* terminate list */ };
@@ -309,8 +318,13 @@ static struct scsi_host_template piix_sht = { ATA_BMDMA_SHT(DRV_NAME), }; -static struct ata_port_operations piix_pata_ops = { +static struct ata_port_operations piix_sata_ops = { .inherits = &ata_bmdma32_port_ops, + .sff_irq_check = piix_irq_check, +}; + +static struct ata_port_operations piix_pata_ops = { + .inherits = &piix_sata_ops, .cable_detect = ata_cable_40wire, .set_piomode = piix_set_piomode, .set_dmamode = piix_set_dmamode,
@@ -328,10 +342,6 @@ static struct ata_port_operations ich_pata_ops = { .set_dmamode = ich_set_dmamode, }; -static struct ata_port_operations piix_sata_ops = { - .inherits = &ata_bmdma32_port_ops, -}; -static struct ata_port_operations piix_sidpr_sata_ops = { .inherits = &piix_sata_ops, .hardreset = sata_std_hardreset,
@@ -962,6 +972,14 @@ static int piix_sidpr_scr_write(struct ata_link *link,return 0 ; } +static bool piix_irq_check (struct ata_port *ap) +{ +if (unlikely (!ap->ioaddr.bmdma_addr)) +return false; + +return ap->ops->bmdma_status (ap) &ATA_DMA_INTR ; +} +#ifdef CONFIG_PM static int piix_broken_suspend (void ) {
drivers/ata/libata-core.c +11 -6
@@ -3211,6 +3211,7 @@ const struct ata_timing *ata_timing_find_mode(u8 xfer_mode)int ata_timing_compute (struct ata_device *adev,unsigned short speed,struct ata_timing *t,int T ,int UT ) { +const u16 *id = adev->id;const struct ata_timing *s;struct ata_timing p;
@@ -3228,14 +3229,18 @@ int ata_timing_compute(struct ata_device *adev, unsigned short speed,* PIO/MW_DMA cycle timing. */ -if (adev->id[ATA_ID_FIELD_VALID ] &2 ) {/* EIDE drive */ +if (id[ATA_ID_FIELD_VALID ] &2 ) {/* EIDE drive */ memset (&p,0 ,sizeof (p)); +if (speed >=XFER_PIO_0 && speed <=XFER_SW_DMA_0 ) { -if (speed <=XFER_PIO_2 ) p.cycle = p.cyc8b = adev->id[ATA_ID_EIDE_PIO ]; -else p.cycle = p.cyc8b = adev->id[ATA_ID_EIDE_PIO_IORDY ]; - }else if (speed >=XFER_MW_DMA_0 && speed <=XFER_MW_DMA_2 ) { - p.cycle = adev->id[ATA_ID_EIDE_DMA_MIN ]; - } +if (speed <=XFER_PIO_2 ) + p.cycle = p.cyc8b = id[ATA_ID_EIDE_PIO ]; +else if ((speed <=XFER_PIO_4 ) || + (speed ==XFER_PIO_5 && !ata_id_is_cfa (id))) + p.cycle = p.cyc8b = id[ATA_ID_EIDE_PIO_IORDY ]; + }else if (speed >=XFER_MW_DMA_0 && speed <=XFER_MW_DMA_2 ) + p.cycle = id[ATA_ID_EIDE_DMA_MIN ]; +ata_timing_merge (&p, t, t,ATA_TIMING_CYCLE |ATA_TIMING_CYC8B ); }
drivers/ata/libata-sff.c +39 -11
83 lines not on this page · raw message
drivers/ata/pata_acpi.c +1 -1
@@ -259,7 +259,7 @@ static int pacpi_init_one (struct pci_dev *pdev, const struct pci_device_id *id)return rc;pcim_pin_device (pdev); } -return ata_pci_sff_init_one (pdev, ppi, &pacpi_sht,NULL ); +return ata_pci_sff_init_one (pdev, ppi, &pacpi_sht,NULL ,0 ); }static const struct pci_device_id pacpi_pci_tbl[] = {
drivers/ata/pata_ali.c +4 -6
@@ -159,8 +159,7 @@ static void ali_fifo_control(struct ata_port *ap, struct ata_device *adev, int o* ali_program_modes - load mode registers * @ap: ALi channel to load * @adev: Device the timing is for -* @cmd: Command timing -* @data: Data timing +* @t: timing data * @ultra: UDMA timing or zero for off * * Loads the timing registers for cmd/data and disable UDMA if
@@ -202,8 +201,7 @@ static void ali_program_modes(struct ata_port *ap, struct ata_device *adev, stru* @ap: ATA interface * @adev: ATA device * -* Program the ALi registers for PIO mode. FIXME: add timings for -* PIO5. +* Program the ALi registers for PIO mode. */ static void ali_set_piomode (struct ata_port *ap,struct ata_device *adev)
@@ -237,7 +235,7 @@ static void ali_set_piomode(struct ata_port *ap, struct ata_device *adev)* @ap: ATA interface * @adev: ATA device * -* FIXME: MWDMA timings +* Program the ALi registers for DMA mode. */ static void ali_set_dmamode (struct ata_port *ap,struct ata_device *adev)
@@ -585,7 +583,7 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id) ppi[0 ] = &info_20_udma; } -return ata_pci_sff_init_one (pdev, ppi, &ali_sht,NULL ); +return ata_pci_sff_init_one (pdev, ppi, &ali_sht,NULL ,0 ); }#ifdef CONFIG_PM
drivers/ata/pata_amd.c +1 -1
@@ -574,7 +574,7 @@ static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id) }/* And fire it up */ -return ata_pci_sff_init_one (pdev, ppi, &amd_sht, hpriv); +return ata_pci_sff_init_one (pdev, ppi, &amd_sht, hpriv,0 ); }#ifdef CONFIG_PM
drivers/ata/pata_artop.c +1 -1
@@ -421,7 +421,7 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)BUG_ON (ppi[0 ] ==NULL ); -return ata_pci_sff_init_one (pdev, ppi, &artop_sht,NULL ); +return ata_pci_sff_init_one (pdev, ppi, &artop_sht,NULL ,0 ); }static const struct pci_device_id artop_pci_tbl[] = {
drivers/ata/pata_at91.c +2 -2
@@ -153,8 +153,8 @@ static void pata_at91_set_piomode(struct ata_port *ap, struct ata_device *adev)/* Compute ATA timing and set it to SMC */ ret =ata_timing_compute (adev, adev->pio_mode, &timing,1000 ,0 );if (ret) { -dev_warn (ap->dev,"Failed to compute ATA timing %d, \ -set PIO_0 timing\n" , ret); +dev_warn (ap->dev,"Failed to compute ATA timing %d, " +"set PIO_0 timing\n" , ret);set_smc_timing (ap->dev, info, &initial_timing); }else {set_smc_timing (ap->dev, info, &timing);
drivers/ata/pata_atiixp.c +12 -2
@@ -1,7 +1,7 @@/* * pata_atiixp.c - ATI PATA for new ATA layer * (C) 2005 Red Hat Inc -* (C) 2009 Bartlomiej Zolnierkiewicz +* (C) 2009-2010 Bartlomiej Zolnierkiewicz * * Based on *
@@ -46,6 +46,8 @@ static int atiixp_cable_detect(struct ata_port *ap)return ATA_CBL_PATA40 ; } +static DEFINE_SPINLOCK (atiixp_lock); +/** * atiixp_set_pio_timing - set initial PIO mode data * @ap: ATA interface
@@ -88,7 +90,10 @@ static void atiixp_set_pio_timing(struct ata_port *ap, struct ata_device *adev,static void atiixp_set_piomode (struct ata_port *ap,struct ata_device *adev) { +unsigned long flags; +spin_lock_irqsave (&atiixp_lock, flags);atiixp_set_pio_timing (ap, adev, adev->pio_mode -XFER_PIO_0 ); +spin_unlock_irqrestore (&atiixp_lock, flags); }/**
@@ -108,6 +113,9 @@ static void atiixp_set_dmamode(struct ata_port *ap, struct ata_device *adev)int dma = adev->dma_mode;int dn =2 * ap->port_no + adev->devno;int wanted_pio; +unsigned long flags; + +spin_lock_irqsave (&atiixp_lock, flags);if (adev->dma_mode >=XFER_UDMA_0 ) {u16 udma_mode_data;
@@ -145,6 +153,7 @@ static void atiixp_set_dmamode(struct ata_port *ap, struct ata_device *adev)if (adev->pio_mode != wanted_pio)atiixp_set_pio_timing (ap, adev, wanted_pio); +spin_unlock_irqrestore (&atiixp_lock, flags); }/**
@@ -237,7 +246,8 @@ static int atiixp_init_one(struct pci_dev *pdev, const struct pci_device_id *id)if (!pci_test_config_bits (pdev, &atiixp_enable_bits[i])) ppi[i] = &ata_dummy_port_info; -return ata_pci_sff_init_one (pdev, ppi, &atiixp_sht,NULL ); +return ata_pci_sff_init_one (pdev, ppi, &atiixp_sht,NULL , +ATA_HOST_PARALLEL_SCAN ); }static const struct pci_device_id atiixp[] = {
drivers/ata/pata_cmd640.c +1 -1
@@ -223,7 +223,7 @@ static int cmd640_init_one(struct pci_dev *pdev, const struct pci_device_id *id)cmd640_hardware_init (pdev); -return ata_pci_sff_init_one (pdev, ppi, &cmd640_sht,NULL ); +return ata_pci_sff_init_one (pdev, ppi, &cmd640_sht,NULL ,0 ); }#ifdef CONFIG_PM
drivers/ata/pata_cmd64x.c +13 -14
@@ -2,6 +2,7 @@* pata_cmd64x.c - CMD64x PATA for new ATA layer * (C) 2005 Red Hat Inc * Alan Cox <[email protected]> +* (C) 2009-2010 Bartlomiej Zolnierkiewicz * * Based upon * linux/drivers/ide/pci/cmd64x.c Version 1.30 Sept 10, 2002
@@ -39,11 +40,7 @@enum {CFR =0x50 , -CFR_INTR_CH0 =0x02 , -CNTRL =0x51 , -CNTRL_DIS_RA0 =0x40 , -CNTRL_DIS_RA1 =0x80 , -CNTRL_ENA_2ND =0x08 , +CFR_INTR_CH0 =0x04 ,CMDTIM =0x52 ,ARTTIM0 =0x53 ,DRWTIM0 =0x54 ,
@@ -53,9 +50,6 @@ enum {ARTTIM23_DIS_RA2 =0x04 ,ARTTIM23_DIS_RA3 =0x08 ,ARTTIM23_INTR_CH1 =0x10 , -ARTTIM2 =0x57 , -ARTTIM3 =0x57 , -DRWTIM23 =0x58 ,DRWTIM2 =0x58 ,BRST =0x59 , DRWTIM3 = 0x5b,
@@ -63,14 +57,11 @@ enum {MRDMODE =0x71 ,MRDMODE_INTR_CH0 =0x04 ,MRDMODE_INTR_CH1 =0x08 , -MRDMODE_BLK_CH0 =0x10 , -MRDMODE_BLK_CH1 =0x20 ,BMIDESR0 =0x72 ,UDIDETCR0 =0x73 ,DTPR0 =0x74 ,BMIDECR1 =0x78 ,BMIDECSR =0x79 , -BMIDESR1 =0x7A ,UDIDETCR1 =0x7B ,DTPR1 =0x7C };
@@ -130,8 +121,14 @@ static void cmd64x_set_timing(struct ata_port *ap, struct ata_device *adev, u8 mif (pair) {struct ata_timing tp; +ata_timing_compute (pair, pair->pio_mode, &tp,T ,0 );ata_timing_merge (&t, &tp, &t,ATA_TIMING_SETUP ); +if (pair->dma_mode) { +ata_timing_compute (pair, pair->dma_mode, + &tp,T ,0 ); +ata_timing_merge (&tp, &t, &t,ATA_TIMING_SETUP ); + } } }
@@ -147,7 +144,9 @@ static void cmd64x_set_timing(struct ata_port *ap, struct ata_device *adev, u8 m/* Now convert the clocks into values we can actually stuff into the chip */ -if (t.recover >1 ) +if (t.recover ==16 ) + t.recover =0 ; +else if (t.recover >1 ) t.recover--;else t.recover =15 ;
@@ -245,7 +244,7 @@ static void cmd648_bmdma_stop(struct ata_queued_cmd *qc)struct pci_dev *pdev =to_pci_dev (ap->host->dev);u8 dma_intr;int dma_mask = ap->port_no ?ARTTIM23_INTR_CH1 :CFR_INTR_CH0 ; -int dma_reg = ap->port_no ?ARTTIM2 :CFR ; +int dma_reg = ap->port_no ?ARTTIM23 :CFR ;ata_bmdma_stop (qc);
@@ -368,7 +367,7 @@ static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)pci_write_config_byte (pdev,UDIDETCR0 ,0xF0 );#endif -return ata_pci_sff_init_one (pdev, ppi, &cmd64x_sht,NULL ); +return ata_pci_sff_init_one (pdev, ppi, &cmd64x_sht,NULL ,0 ); }#ifdef CONFIG_PM
drivers/ata/pata_cs5530.c +1 -1
@@ -324,7 +324,7 @@ static int cs5530_init_one(struct pci_dev *pdev, const struct pci_device_id *id) ppi[1 ] = &info_palmax_secondary;/* Now kick off ATA set up */ -return ata_pci_sff_init_one (pdev, ppi, &cs5530_sht,NULL ); +return ata_pci_sff_init_one (pdev, ppi, &cs5530_sht,NULL ,0 ); }#ifdef CONFIG_PM
drivers/ata/pata_cs5535.c +2 -2
@@ -100,7 +100,7 @@ static int cs5535_cable_detect(struct ata_port *ap)static void cs5535_set_piomode (struct ata_port *ap,struct ata_device *adev) {static const u16 pio_timings[5 ] = { -0xF7F4 ,0x53F3 ,0x13F1 ,0x5131 ,0x1131 +0xF7F4 ,0xF173 ,0x8141 ,0x5131 ,0x1131 };static const u16 pio_cmd_timings[5 ] = {0xF7F4 ,0x53F3 ,0x13F1 ,0x5131 ,0x1131
@@ -198,7 +198,7 @@ static int cs5535_init_one(struct pci_dev *dev, const struct pci_device_id *id)rdmsr (ATAC_CH0D1_PIO , timings, dummy);if (CS5535_BAD_PIO (timings))wrmsr (ATAC_CH0D1_PIO ,0xF7F4F7F4UL ,0 ); -return ata_pci_sff_init_one (dev, ppi, &cs5535_sht,NULL ); +return ata_pci_sff_init_one (dev, ppi, &cs5535_sht,NULL ,0 ); }static const struct pci_device_id cs5535[] = {
drivers/ata/pata_cs5536.c +1 -1
@@ -260,7 +260,7 @@ static int cs5536_init_one(struct pci_dev *dev, const struct pci_device_id *id)return -ENODEV ; } -return ata_pci_sff_init_one (dev, ppi, &cs5536_sht,NULL ); +return ata_pci_sff_init_one (dev, ppi, &cs5536_sht,NULL ,0 ); }static const struct pci_device_id cs5536[] = {
drivers/ata/pata_cypress.c +7 -5
@@ -62,14 +62,16 @@ static void cy82c693_set_piomode(struct ata_port *ap, struct ata_device *adev)return ; } - time_16 =clamp_val (t.recover,0 ,15 ) | (clamp_val (t.active,0 ,15 ) <<4 ); - time_8 =clamp_val (t.act8b,0 ,15 ) | (clamp_val (t.rec8b,0 ,15 ) <<4 ); + time_16 =clamp_val (t.recover -1 ,0 ,15 ) | + (clamp_val (t.active -1 ,0 ,15 ) <<4 ); + time_8 =clamp_val (t.act8b -1 ,0 ,15 ) | + (clamp_val (t.rec8b -1 ,0 ,15 ) <<4 );if (adev->devno ==0 ) {pci_read_config_dword (pdev,CY82_IDE_ADDRSETUP , &addr); addr &= ~0x0F ;/* Mask bits */ - addr |=clamp_val (t.setup,0 ,15 ); + addr |=clamp_val (t.setup -1 ,0 ,15 );pci_write_config_dword (pdev,CY82_IDE_ADDRSETUP , addr);pci_write_config_byte (pdev,CY82_IDE_MASTER_IOR , time_16);
@@ -79,7 +81,7 @@ static void cy82c693_set_piomode(struct ata_port *ap, struct ata_device *adev)pci_read_config_dword (pdev,CY82_IDE_ADDRSETUP , &addr); addr &= ~0xF0 ;/* Mask bits */ - addr |= (clamp_val (t.setup,0 ,15 ) <<4 ); + addr |= (clamp_val (t.setup -1 ,0 ,15 ) <<4 );pci_write_config_dword (pdev,CY82_IDE_ADDRSETUP , addr);pci_write_config_byte (pdev,CY82_IDE_SLAVE_IOR , time_16);
@@ -136,7 +138,7 @@ static int cy82c693_init_one(struct pci_dev *pdev, const struct pci_device_id *iif (PCI_FUNC (pdev->devfn) !=1 )return -ENODEV ; -return ata_pci_sff_init_one (pdev, ppi, &cy82c693_sht,NULL ); +return ata_pci_sff_init_one (pdev, ppi, &cy82c693_sht,NULL ,0 ); }static const struct pci_device_id cy82c693[] = {
drivers/ata/pata_efar.c +19 -3
@@ -2,7 +2,7 @@* pata_efar.c - EFAR PIIX clone controller driver * * (C) 2005 Red Hat -* (C) 2009 Bartlomiej Zolnierkiewicz +* (C) 2009-2010 Bartlomiej Zolnierkiewicz * * Some parts based on ata_piix.c by Jeff Garzik and others. *
@@ -68,6 +68,8 @@ static int efar_cable_detect(struct ata_port *ap)return ATA_CBL_PATA80 ; } +static DEFINE_SPINLOCK (efar_lock); +/** * efar_set_piomode - Initialize host controller PATA PIO timings * @ap: Port whose timings we are configuring
@@ -84,7 +86,9 @@ static void efar_set_piomode (struct ata_port *ap, struct ata_device *adev)unsigned int pio = adev->pio_mode -XFER_PIO_0 ;struct pci_dev *dev =to_pci_dev (ap->host->dev);unsigned int idetm_port= ap->port_no ?0x42 :0x40 ; +unsigned long flags;u16 idetm_data; +u8 udma_enable;int control =0 ;/*
@@ -107,6 +111,8 @@ static void efar_set_piomode (struct ata_port *ap, struct ata_device *adev)if (adev->class ==ATA_DEV_ATA ) control |=4 ;/* PPE */ +spin_lock_irqsave (&efar_lock, flags); +pci_read_config_word (dev, idetm_port, &idetm_data);/* Set PPE, IE, and TIME as appropriate */
@@ -131,6 +137,11 @@ static void efar_set_piomode (struct ata_port *ap, struct ata_device *adev) idetm_data |=0x4000 ;/* Ensure SITRE is set */ pci_write_config_word (dev, idetm_port, idetm_data); + +pci_read_config_byte (dev,0x48 , &udma_enable); + udma_enable &= ~(1 << (2 * ap->port_no + adev->devno)); +pci_write_config_byte (dev,0x48 , udma_enable); +spin_unlock_irqrestore (&efar_lock, flags); }/**
@@ -151,6 +162,7 @@ static void efar_set_dmamode (struct ata_port *ap, struct ata_device *adev)u16 master_data;u8 speed = adev->dma_mode;int devid = adev->devno +2 * ap->port_no; +unsigned long flags;u8 udma_enable; static const /* ISP RTC */
@@ -160,6 +172,8 @@ static void efar_set_dmamode (struct ata_port *ap, struct ata_device *adev) { 2, 1 }, { 2, 3 }, }; +spin_lock_irqsave (&efar_lock, flags); +pci_read_config_word (dev, master_port, &master_data);pci_read_config_byte (dev,0x48 , &udma_enable);
@@ -217,6 +231,7 @@ static void efar_set_dmamode (struct ata_port *ap, struct ata_device *adev)pci_write_config_word (dev, master_port, master_data); }pci_write_config_byte (dev,0x48 , udma_enable); +spin_unlock_irqrestore (&efar_lock, flags); }static struct scsi_host_template efar_sht = {
@@ -256,13 +271,14 @@ static int efar_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) .udma_mask = ATA_UDMA4, .port_ops = &efar_ops, }; -const struct ata_port_info *ppi[] = { &info,NULL }; +const struct ata_port_info *ppi[] = { &info, &info };if (!printed_version++)dev_printk (KERN_DEBUG , &pdev->dev,"version " DRV_VERSION "\n" ); -return ata_pci_sff_init_one (pdev, ppi, &efar_sht,NULL ); +return ata_pci_sff_init_one (pdev, ppi, &efar_sht,NULL , +ATA_HOST_PARALLEL_SCAN ); }static const struct pci_device_id efar_pci_tbl[] = {
drivers/ata/pata_hpt366.c +6 -17
@@ -11,9 +11,7 @@* * * TODO -* Maybe PLL mode -* Look into engine reset on timeout errors. Should not be -* required. +* Look into engine reset on timeout errors. Should not be required. */
@@ -27,7 +25,7 @@#include <linux/libata.h> #define DRV_NAME "pata_hpt366" -#define DRV_VERSION "0.6.7" +#define DRV_VERSION "0.6.8"struct hpt_clock {u8 xfer_mode;
@@ -207,17 +205,8 @@ static void hpt366_set_mode(struct ata_port *ap, struct ata_device *adev, {struct hpt_clock *clocks = ap->host->private_data;struct pci_dev *pdev =to_pci_dev (ap->host->dev); -u32 addr1 =0x40 +4 * (adev->devno +2 * ap->port_no); -u32 addr2 =0x51 +4 * ap->port_no; +u32 addr =0x40 +4 * adev->devno;u32 mask, reg; -u8 fast; - -/* Fast interrupt prediction disable, hold off interrupt disable */ -pci_read_config_byte (pdev, addr2, &fast); -if (fast &0x80 ) { - fast &= ~0x80 ; -pci_write_config_byte (pdev, addr2, fast); - }/* determine timing mask and find matching clock entry */ if (mode <XFER_MW_DMA_0 )
@@ -240,9 +229,9 @@ static void hpt366_set_mode(struct ata_port *ap, struct ata_device *adev,* on-chip PIO FIFO/buffer (and PIO MST mode as well) to avoid * problems handling I/O errors later. */ -pci_read_config_dword (pdev, addr1, ®); +pci_read_config_dword (pdev, addr, ®); reg = ((reg & ~mask) | (clocks->timing & mask)) & ~0xc0000000 ; -pci_write_config_dword (pdev, addr1, reg); +pci_write_config_dword (pdev, addr, reg); }/**
@@ -372,7 +361,7 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id)break ; }/* Now kick off ATA set up */ -return ata_pci_sff_init_one (dev, ppi, &hpt36x_sht, hpriv); +return ata_pci_sff_init_one (dev, ppi, &hpt36x_sht, hpriv,0 ); }#ifdef CONFIG_PM
drivers/ata/pata_hpt37x.c +85 -104
278 lines not on this page · raw message
drivers/ata/pata_hpt3x2n.c +56 -64
170 lines not on this page · raw message
drivers/ata/pata_it8213.c +1 -1
@@ -273,7 +273,7 @@ static int it8213_init_one (struct pci_dev *pdev, const struct pci_device_id *endev_printk (KERN_DEBUG , &pdev->dev,"version " DRV_VERSION "\n" ); -return ata_pci_sff_init_one (pdev, ppi, &it8213_sht,NULL ); +return ata_pci_sff_init_one (pdev, ppi, &it8213_sht,NULL ,0 ); }static const struct pci_device_id it8213_pci_tbl[] = {
drivers/ata/pata_it821x.c +1 -1
@@ -932,7 +932,7 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)else ppi[0 ] = &info_smart; } -return ata_pci_sff_init_one (pdev, ppi, &it821x_sht,NULL ); +return ata_pci_sff_init_one (pdev, ppi, &it821x_sht,NULL ,0 ); }#ifdef CONFIG_PM
drivers/ata/pata_jmicron.c +1 -1
@@ -144,7 +144,7 @@ static int jmicron_init_one (struct pci_dev *pdev, const struct pci_device_id *i };const struct ata_port_info *ppi[] = { &info,NULL }; -return ata_pci_sff_init_one (pdev, ppi, &jmicron_sht,NULL ); +return ata_pci_sff_init_one (pdev, ppi, &jmicron_sht,NULL ,0 ); }static const struct pci_device_id jmicron_pci_tbl[] = {
drivers/ata/pata_marvell.c +2 -2
@@ -147,13 +147,13 @@ static int marvell_init_one (struct pci_dev *pdev, const struct pci_device_id *iif (pdev->device ==0x6101 ) ppi[1 ] = &ata_dummy_port_info; -#if defined(CONFIG_AHCI ) || defined(CONFIG_AHCI_MODULE ) +#if defined(CONFIG_SATA_AHCI ) || defined(CONFIG_SATA_AHCI_MODULE )if (!marvell_pata_active (pdev)) { printk(KERN_INFO DRV_NAME ": PATA port not active, deferring to AHCI driver.\n");return -ENODEV ; }#endif -return ata_pci_sff_init_one (pdev, ppi, &marvell_sht,NULL ); +return ata_pci_sff_init_one (pdev, ppi, &marvell_sht,NULL ,0 ); }static const struct pci_device_id marvell_pci_tbl[] = {
drivers/ata/pata_netcell.c +1 -1
@@ -82,7 +82,7 @@ static int netcell_init_one (struct pci_dev *pdev, const struct pci_device_id *eata_pci_bmdma_clear_simplex (pdev);/* And let the library code do the work */ -return ata_pci_sff_init_one (pdev, port_info, &netcell_sht,NULL ); +return ata_pci_sff_init_one (pdev, port_info, &netcell_sht,NULL ,0 ); }static const struct pci_device_id netcell_pci_tbl[] = {
drivers/ata/pata_ns87410.c +1 -1
@@ -148,7 +148,7 @@ static int ns87410_init_one(struct pci_dev *dev, const struct pci_device_id *id) .port_ops = &ns87410_port_ops };const struct ata_port_info *ppi[] = { &info,NULL }; -return ata_pci_sff_init_one (dev, ppi, &ns87410_sht,NULL ); +return ata_pci_sff_init_one (dev, ppi, &ns87410_sht,NULL ,0 ); }static const struct pci_device_id ns87410[] = {
drivers/ata/pata_ns87415.c +1 -1
@@ -380,7 +380,7 @@ static int ns87415_init_one (struct pci_dev *pdev, const struct pci_device_id *ens87415_fixup (pdev); -return ata_pci_sff_init_one (pdev, ppi, &ns87415_sht,NULL ); +return ata_pci_sff_init_one (pdev, ppi, &ns87415_sht,NULL ,0 ); }static const struct pci_device_id ns87415_pci_tbl[] = {
drivers/ata/pata_oldpiix.c +1 -1
@@ -248,7 +248,7 @@ static int oldpiix_init_one (struct pci_dev *pdev, const struct pci_device_id *edev_printk (KERN_DEBUG , &pdev->dev,"version " DRV_VERSION "\n" ); -return ata_pci_sff_init_one (pdev, ppi, &oldpiix_sht,NULL ); +return ata_pci_sff_init_one (pdev, ppi, &oldpiix_sht,NULL ,0 ); }static const struct pci_device_id oldpiix_pci_tbl[] = {
drivers/ata/pata_opti.c +1 -1
@@ -172,7 +172,7 @@ static int opti_init_one(struct pci_dev *dev, const struct pci_device_id *id)if (!printed_version++)dev_printk (KERN_DEBUG , &dev->dev,"version " DRV_VERSION "\n" ); -return ata_pci_sff_init_one (dev, ppi, &opti_sht,NULL ); +return ata_pci_sff_init_one (dev, ppi, &opti_sht,NULL ,0 ); }static const struct pci_device_id opti[] = {
drivers/ata/pata_optidma.c +1 -1
@@ -429,7 +429,7 @@ static int optidma_init_one(struct pci_dev *dev, const struct pci_device_id *id)if (optiplus_with_udma (dev)) ppi[0 ] = &info_82c700_udma; -return ata_pci_sff_init_one (dev, ppi, &optidma_sht,NULL ); +return ata_pci_sff_init_one (dev, ppi, &optidma_sht,NULL ,0 ); }static const struct pci_device_id optidma[] = {
drivers/ata/pata_pcmcia.c +1 -1
@@ -136,7 +136,7 @@ static unsigned int ata_data_xfer_8bit(struct ata_device *dev,* */ -void pcmcia_8bit_drain_fifo (struct ata_queued_cmd *qc) +static void pcmcia_8bit_drain_fifo (struct ata_queued_cmd *qc) {int count;struct ata_port *ap;
drivers/ata/pata_pdc202xx_old.c +15 -2
@@ -2,7 +2,7 @@* pata_pdc202xx_old.c - Promise PDC202xx PATA for new ATA layer * (C) 2005 Red Hat Inc * Alan Cox <[email protected]> -* (C) 2007,2009 Bartlomiej Zolnierkiewicz +* (C) 2007,2009,2010 Bartlomiej Zolnierkiewicz * * Based in part on linux/drivers/ide/pci/pdc202xx_old.c *
@@ -35,6 +35,15 @@ static int pdc2026x_cable_detect(struct ata_port *ap)return ATA_CBL_PATA80 ; } +static void pdc202xx_exec_command (struct ata_port *ap, +const struct ata_taskfile *tf) +{ +DPRINTK ("ata%u: cmd 0x%X\n" , ap->print_id, tf->command); + +iowrite8 (tf->command, ap->ioaddr.command_addr); +ndelay (400 ); +} +/** * pdc202xx_configure_piomode - set chip PIO timing * @ap: ATA interface
@@ -271,6 +280,8 @@ static struct ata_port_operations pdc2024x_port_ops = { .cable_detect = ata_cable_40wire, .set_piomode = pdc202xx_set_piomode, .set_dmamode = pdc202xx_set_dmamode, + + .sff_exec_command = pdc202xx_exec_command, };static struct ata_port_operations pdc2026x_port_ops = {
@@ -284,6 +295,8 @@ static struct ata_port_operations pdc2026x_port_ops = { .dev_config = pdc2026x_dev_config, .port_start = pdc2026x_port_start, + + .sff_exec_command = pdc202xx_exec_command, };static int pdc202xx_init_one (struct pci_dev *dev,const struct pci_device_id *id)
@@ -324,7 +337,7 @@ static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *idreturn -ENODEV ; } } -return ata_pci_sff_init_one (dev, ppi, &pdc202xx_sht,NULL ); +return ata_pci_sff_init_one (dev, ppi, &pdc202xx_sht,NULL ,0 ); }static const struct pci_device_id pdc202xx[] = {
drivers/ata/pata_piccolo.c +1 -1
@@ -95,7 +95,7 @@ static int ata_tosh_init_one(struct pci_dev *dev, const struct pci_device_id *id };const struct ata_port_info *ppi[] = { &info, &ata_dummy_port_info };/* Just one port for the moment */ -return ata_pci_sff_init_one (dev, ppi, &tosh_sht,NULL ); +return ata_pci_sff_init_one (dev, ppi, &tosh_sht,NULL ,0 ); }static struct pci_device_id ata_tosh[] = {
drivers/ata/pata_radisys.c +1 -1
@@ -227,7 +227,7 @@ static int radisys_init_one (struct pci_dev *pdev, const struct pci_device_id *edev_printk (KERN_DEBUG , &pdev->dev,"version " DRV_VERSION "\n" ); -return ata_pci_sff_init_one (pdev, ppi, &radisys_sht,NULL ); +return ata_pci_sff_init_one (pdev, ppi, &radisys_sht,NULL ,0 ); }static const struct pci_device_id radisys_pci_tbl[] = {
drivers/ata/pata_rz1000.c +1 -1
@@ -95,7 +95,7 @@ static int rz1000_init_one (struct pci_dev *pdev, const struct pci_device_id *en printk_once(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");if (rz1000_fifo_disable (pdev) ==0 ) -return ata_pci_sff_init_one (pdev, ppi, &rz1000_sht,NULL ); +return ata_pci_sff_init_one (pdev, ppi, &rz1000_sht,NULL ,0 ); printk(KERN_ERR DRV_NAME ": failed to disable read-ahead on chipset..\n");/* Not safe to use so skip */
drivers/ata/pata_sc1200.c +1 -1
@@ -237,7 +237,7 @@ static int sc1200_init_one(struct pci_dev *dev, const struct pci_device_id *id) };const struct ata_port_info *ppi[] = { &info,NULL }; -return ata_pci_sff_init_one (dev, ppi, &sc1200_sht,NULL ); +return ata_pci_sff_init_one (dev, ppi, &sc1200_sht,NULL ,0 ); }static const struct pci_device_id sc1200[] = {
drivers/ata/pata_serverworks.c +4 -3
@@ -1,6 +1,7 @@/* * pata_serverworks.c - Serverworks PATA for new ATA layer * (C) 2005 Red Hat Inc +* (C) 2010 Bartlomiej Zolnierkiewicz * * based upon *
@@ -253,7 +254,7 @@ static void serverworks_set_piomode(struct ata_port *ap, struct ata_device *adevif (serverworks_is_csb (pdev)) {pci_read_config_word (pdev,0x4A , &csb5_pio); csb5_pio &= ~(0x0F << devbits); -pci_write_config_byte (pdev,0x4A , csb5_pio | (pio << devbits)); +pci_write_config_word (pdev,0x4A , csb5_pio | (pio << devbits)); } }
@@ -327,7 +328,7 @@ static int serverworks_fixup_osb4(struct pci_dev *pdev)pci_dev_put (isa_dev);return 0 ; } -printk (KERN_WARNING "ata_serverworks: Unable to find bridge.\n" ); + printk(KERN_WARNING DRV_NAME ": Unable to find bridge.\n");return -ENODEV ; }
@@ -459,7 +460,7 @@ static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_idif (pdev->device ==PCI_DEVICE_ID_SERVERWORKS_CSB5IDE )ata_pci_bmdma_clear_simplex (pdev); -return ata_pci_sff_init_one (pdev, ppi, &serverworks_sht,NULL ); +return ata_pci_sff_init_one (pdev, ppi, &serverworks_sht,NULL ,0 ); }#ifdef CONFIG_PM
drivers/ata/pata_sil680.c +1 -1
@@ -356,7 +356,7 @@ static int __devinit sil680_init_one(struct pci_dev *pdev, IRQF_SHARED, &sil680_sht); use_ioports: -return ata_pci_sff_init_one (pdev, ppi, &sil680_sht,NULL ); +return ata_pci_sff_init_one (pdev, ppi, &sil680_sht,NULL ,0 ); }#ifdef CONFIG_PM
drivers/ata/pata_sis.c +1 -1
@@ -826,7 +826,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)sis_fixup (pdev, chipset); -return ata_pci_sff_init_one (pdev, ppi, &sis_sht, chipset); +return ata_pci_sff_init_one (pdev, ppi, &sis_sht, chipset,0 ); }#ifdef CONFIG_PM
drivers/ata/pata_sl82c105.c +1 -1
@@ -316,7 +316,7 @@ static int sl82c105_init_one(struct pci_dev *dev, const struct pci_device_id *id val |=CTRL_P0EN |CTRL_P0F16 |CTRL_P1F16 ;pci_write_config_dword (dev,0x40 , val); -return ata_pci_sff_init_one (dev, ppi, &sl82c105_sht,NULL ); +return ata_pci_sff_init_one (dev, ppi, &sl82c105_sht,NULL ,0 ); }static const struct pci_device_id sl82c105[] = {
drivers/ata/pata_triflex.c +1 -1
@@ -201,7 +201,7 @@ static int triflex_init_one(struct pci_dev *dev, const struct pci_device_id *id)if (!printed_version++)dev_printk (KERN_DEBUG , &dev->dev,"version " DRV_VERSION "\n" ); -return ata_pci_sff_init_one (dev, ppi, &triflex_sht,NULL ); +return ata_pci_sff_init_one (dev, ppi, &triflex_sht,NULL ,0 ); }static const struct pci_device_id triflex[] = {
drivers/ata/pata_via.c +97 -113
305 lines not on this page · raw message
drivers/ata/sata_via.c +20 -3
@@ -40,11 +40,13 @@#include <linux/blkdev.h> #include <linux/delay.h> #include <linux/device.h> +#include <scsi/scsi.h> +#include <scsi/scsi_cmnd.h> #include <scsi/scsi_host.h> #include <linux/libata.h> #define DRV_NAME "sata_via" -#define DRV_VERSION "2.4" +#define DRV_VERSION "2.6"/* * vt8251 is different from other sata controllers of VIA. It has two
@@ -80,6 +82,7 @@ static int vt8251_scr_write(struct ata_link *link, unsigned int scr, u32 val);static void svia_tf_load (struct ata_port *ap,const struct ata_taskfile *tf);static void svia_noop_freeze (struct ata_port *ap);static int vt6420_prereset (struct ata_link *link,unsigned long deadline); +static void vt6420_bmdma_start (struct ata_queued_cmd *qc);static int vt6421_pata_cable_detect (struct ata_port *ap);static void vt6421_set_pio_mode (struct ata_port *ap,struct ata_device *adev);static void vt6421_set_dma_mode (struct ata_port *ap,struct ata_device *adev);
@@ -121,6 +124,7 @@ static struct ata_port_operations vt6420_sata_ops = { .inherits = &svia_base_ops, .freeze = svia_noop_freeze, .prereset = vt6420_prereset, + .bmdma_start = vt6420_bmdma_start, };static struct ata_port_operations vt6421_pata_ops = {
@@ -377,6 +381,17 @@ static int vt6420_prereset(struct ata_link *link, unsigned long deadline)return 0 ; } +static void vt6420_bmdma_start (struct ata_queued_cmd *qc) +{ +struct ata_port *ap = qc->ap; +if ((qc->tf.command ==ATA_CMD_PACKET ) && + (qc->scsicmd->sc_data_direction ==DMA_TO_DEVICE )) { +/* Prevents corruption on some ATAPI burners */ +ata_sff_pause (ap); + } +ata_bmdma_start (qc); +} +static int vt6421_pata_cable_detect (struct ata_port *ap) {struct pci_dev *pdev =to_pci_dev (ap->host->dev);
@@ -392,14 +407,16 @@ static void vt6421_set_pio_mode(struct ata_port *ap, struct ata_device *adev) {struct pci_dev *pdev =to_pci_dev (ap->host->dev);static const u8 pio_bits[] = {0xA8 ,0x65 ,0x65 ,0x31 ,0x20 }; -pci_write_config_byte (pdev,PATA_PIO_TIMING , pio_bits[adev->pio_mode -XFER_PIO_0 ]); +pci_write_config_byte (pdev,PATA_PIO_TIMING - adev->devno, + pio_bits[adev->pio_mode -XFER_PIO_0 ]); }static void vt6421_set_dma_mode (struct ata_port *ap,struct ata_device *adev) {struct pci_dev *pdev =to_pci_dev (ap->host->dev);static const u8 udma_bits[] = {0xEE ,0xE8 ,0xE6 ,0xE4 ,0xE2 ,0xE1 ,0xE0 ,0xE0 }; -pci_write_config_byte (pdev,PATA_UDMA_TIMING , udma_bits[adev->dma_mode -XFER_UDMA_0 ]); +pci_write_config_byte (pdev,PATA_UDMA_TIMING - adev->devno, + udma_bits[adev->dma_mode -XFER_UDMA_0 ]); }static const unsigned int svia_bar_sizes[] = {
drivers/staging/phison/phison.c +1 -1
@@ -62,7 +62,7 @@ static int phison_init_one(struct pci_dev *pdev, const struct pci_device_id *id) };const struct ata_port_info *ppi[] = { &info,NULL }; - ret =ata_pci_sff_init_one (pdev, ppi, &phison_sht,NULL ); + ret =ata_pci_sff_init_one (pdev, ppi, &phison_sht,NULL ,0 );dev_dbg (&pdev->dev,"phison_init_one(), ret = %x\n" , ret);
include/linux/ata.h +2 -1
@@ -841,7 +841,8 @@ static inline int ata_id_current_chs_valid(const u16 *id)static inline int ata_id_is_cfa (const u16 *id) { -if (id[ATA_ID_CONFIG ] ==0x848A )/* Traditional CF */ +if ((id[ATA_ID_CONFIG ] ==0x848A ) ||/* Traditional CF */ + (id[ATA_ID_CONFIG ] ==0x844A ))/* Delkin Devices CF */ return 1 ;/* * CF specs don't require specific value in the word 0 anymore and yet
include/linux/libata.h +3 -2
@@ -857,6 +857,7 @@ struct ata_port_operations {unsigned int (*sff_data_xfer)(struct ata_device *dev,unsigned char *buf,unsigned int buflen,int rw);u8 (*sff_irq_on)(struct ata_port *); +bool (*sff_irq_check)(struct ata_port *);void (*sff_irq_clear)(struct ata_port *);void (*bmdma_setup)(struct ata_queued_cmd *qc);
@@ -1642,8 +1643,8 @@ extern int ata_pci_sff_activate_host(struct ata_host *host,irq_handler_t irq_handler, struct scsi_host_template *sht);extern int ata_pci_sff_init_one (struct pci_dev *pdev, -const struct ata_port_info *const * ppi, -struct scsi_host_template *sht,void *host_priv); +const struct ata_port_info *const * ppi, +struct scsi_host_template *sht,void *host_priv,int hflags);#endif /* CONFIG_PCI */ /**
Quoted 1 line · Jeff Garzik
libata: Pass host flags into the pci helper
It introduces a subtle bug:
struct ata_host {
...
unsigned long flags;
include/linux/libata.h extern int ata_pci_sff_activate_host(struct ata_host *host, · line 1647
Quoted 8 lines
include/linux/libata.h +2
-2@@ -1642,8 +1643,8 @@ extern int ata_pci_sff_activate_host(struct ata_host *host,irq_handler_t irq_handler, struct scsi_host_template *sht);extern int ata_pci_sff_init_one (struct pci_dev *pdev, -const struct ata_port_info *const * ppi, -struct scsi_host_template *sht,void *host_priv); +const struct ata_port_info *const * ppi, +struct scsi_host_template *sht,void *host_priv,int hflags);
'int' type is not equal 'unsigned long' one on 64-bit architectures.
Besides doing it this way is clearly suboptimal as the same effect could have been achieved by doing:
extern int __ata_pci_sff_init_one(struct pci_dev *pdev,
const struct ata_port_info * const *ppi, struct scsi_host_template *sht, void *host_priv, int hflag);
static inline int ata_pci_sff_init_one(struct pci_dev *pdev,
const struct ata_port_info * const *ppi, struct scsi_host_template *sht, void *host_priv)
{
return __ata_pci_sff_init_one(pdev, ppi, sht, host_priv, 0);
}without the need to update all drivers and without breaking pending out-of-tree driver patches (yeah, it breaks my pata_ep93xx patches)..
--
Bartlomiej Zolnierkiewicz
Quoted 5 lines
Quoted 3 lines
(quoted diff) +2
-0+ const struct ata_port_info * const * ppi, + struct scsi_host_template *sht, void *host_priv,int hflags);
'int' type is not equal 'unsigned long' one on 64-bit architectures.
Agreed should indeed be a ulong.
Quoted 1 line
Besides doing it this way is clearly suboptimal
In your opinion - see previous discussion of this.
Quoted 10 lines · Bartlomiej Zolnierkiewicz
Quoted 1 line · Jeff Garzik
libata: Pass host flags into the pci helper
It introduces a subtle bug:
struct
ata_host{
...unsigned long flags;
Quoted 10 lines
include/linux/libata.h extern int ata_pci_sff_activate_host(struct ata_host *host, · line 1647
Quoted 8 lines
include/linux/libata.h +2
-2@@ -1642,8 +1643,8 @@ extern int ata_pci_sff_activate_host(struct ata_host *host,irq_handler_t irq_handler, struct scsi_host_template *sht);extern int ata_pci_sff_init_one (struct pci_dev *pdev, -const struct ata_port_info *const * ppi, -struct scsi_host_template *sht,void *host_priv); +const struct ata_port_info *const * ppi, +struct scsi_host_template *sht,void *host_priv,int hflags);'int' type is not equal 'unsigned long' one on 64-bit architectures.
True but largely irrelevant as we will never use more than 32 bits worth of host flags.
Quoted 10 lines
Besides doing it this way is clearly suboptimal as the same effect could have been achieved by doing:
extern int __ata_pci_sff_init_one(struct
pci_dev*pdev,
const structata_port_info* const *ppi, structscsi_host_template*sht, void*host_priv, int hflag);
static inline int ata_pci_sff_init_one(structpci_dev*pdev,
const structata_port_info* const *ppi, structscsi_host_template*sht, void*host_priv)
Quoted 3 lines
{
return __ata_pci_sff_init_one(pdev, ppi, sht, host_priv, 0);
}This is far uglier than simply changing the API.
Quoted 2 lines
without the need to update all drivers and without breaking pending out-of-tree driver patches (yeah, it breaks my
pata_ep93xxpatches)..
Every post you include a disclaimer about "my patches are not intended for upstream" yet you still complain?
Some people are never satisfied...
Jeff
Quoted 40 lines · Jeff Garzik
Quoted 10 lines · Bartlomiej Zolnierkiewicz
Quoted 1 line · Jeff Garzik
libata: Pass host flags into the pci helper
It introduces a subtle bug:
struct
ata_host{
...unsigned long flags;Quoted 10 lines
include/linux/libata.h extern int ata_pci_sff_activate_host(struct ata_host *host, · line 1647
Quoted 8 lines
include/linux/libata.h +2
-2@@ -1642,8 +1643,8 @@ extern int ata_pci_sff_activate_host(struct ata_host *host,irq_handler_t irq_handler, struct scsi_host_template *sht);extern int ata_pci_sff_init_one (struct pci_dev *pdev, -const struct ata_port_info *const * ppi, -struct scsi_host_template *sht,void *host_priv); +const struct ata_port_info *const * ppi, +struct scsi_host_template *sht,void *host_priv,int hflags);'int' type is not equal 'unsigned long' one on 64-bit architectures.
True but largely irrelevant as we will never use more than 32 bits worth of host flags.
Quoted 10 lines
Besides doing it this way is clearly suboptimal as the same effect could have been achieved by doing:
extern int __ata_pci_sff_init_one(struct
pci_dev*pdev,
const structata_port_info* const *ppi, structscsi_host_template*sht, void*host_priv, int hflag);
static inline int ata_pci_sff_init_one(structpci_dev*pdev,
const structata_port_info* const *ppi, structscsi_host_template*sht, void*host_priv)Quoted 3 lines
{ return __ata_pci_sff_init_one(pdev, ppi, sht, host_priv, 0); }
Quoted 7 lines
This is far uglier than simply changing the API.
Quoted 2 lines
without the need to update all drivers and without breaking pending out-of-tree driver patches (yeah, it breaks my
pata_ep93xxpatches)..Every post you include a disclaimer about "my patches are not intended for upstream" yet you still complain?
You've interpreted the disclaimer wrong -- "if you want my patches upstream do it yourself or pay for it cause I have neither time nor interest in an added bureaucracy and clean-yet-buggy mentality"..
Lets put things in the right perspective, look at your pull request:
48 files changed, 663 insertions(+), 417 deletions(-)
then at Dave's IDE pull request:
52 files changed, 617 insertions(+), 678 deletions(-)
and finally at my atang tree (I'm just testing 2.6.33 rebase):
328 files changed, 11528 insertions(+), 14491 deletions(-)
This is a whole different scale of changes and you shouldn't be surprised that it requires a bit different set of strategies to handle it effectively..
Quoted 1 line
Some people are never satisfied...
When did it become a bad thing? :)
--
Bartlomiej Zolnierkiewicz
Jeff,
this is a new machine, so I don't know when it started, but it was
running a couple of Fedora 2.6.31/32 kernels for a while with no trouble. So I _think_ it's recent.
I'd guess it's due to commit 27943620cb ("libata: implement spurious irq handling for SFF and apply it to piix"), in fact.
With current -git I got a 30 second pause, and it was accompanied with this kernel log:
Mar 9 12:51:05 i5 kernel: [ 7.040194] ata4: clearing spurious IRQ
Mar 9 12:51:05 i5 kernel: [ 37.978933] ata4: lost interrupt (Status 0x50)
Mar 9 12:51:05 i5 kernel: [ 37.978948] ata4.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0 frozen
Mar 9 12:51:05 i5 kernel: [ 37.978951] ata4.01: failed command: READ DMA
Mar 9 12:51:05 i5 kernel: [ 37.978954] ata4.01: cmd c8/00:08:ef:44:47/00:00:00:00:00/f0 tag 0 dma 4096 in
Mar 9 12:51:05 i5 kernel: [ 37.978955] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
Mar 9 12:51:05 i5 kernel: [ 37.978957] ata4.01: status: { DRDY }
Mar 9 12:51:05 i5 kernel: [ 37.978963] ata4.00: hard resetting link
Mar 9 12:51:05 i5 kernel: [ 38.306451] ata4.01: hard resetting link
Mar 9 12:51:05 i5 kernel: [ 38.785773] ata4.00: SATA link down (SStatus 0 SControl 300)
Mar 9 12:51:05 i5 kernel: [ 38.785787] ata4.01: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
Mar 9 12:51:05 i5 kernel: [ 38.809900] ata4.01: configured for UDMA/133
Mar 9 12:51:05 i5 kernel: [ 38.809903] ata4.01: device reported invalid CHS sector 0
Mar 9 12:51:05 i5 kernel: [ 38.809907] ata4: EH completeand notice how it first complains about a spurious interrupt, and then thirty seconds later the timeout for a _lost_ interrupt happens. Looks like a race condition in SATA irq handling.
This is a Core i5 with intel controller and intel SSD:
Mar 9 12:51:05 i5 kernel: [ 1.431579] ata_piix 0000:00:1f.2: PCI INT D -> GSI 21 (level, low) -> IRQ 21 Mar 9 12:51:05 i5 kernel: [ 1.431607] ata_piix 0000:00:1f.2: MAP [ P0 P2 P1 P3 ] Mar 9 12:51:05 i5 kernel: [ 1.431698] scsi3 : ata_piix Mar 9 12:51:05 i5 kernel: [ 1.431760] scsi4 : ata_piix Mar 9 12:51:05 i5 kernel: [ 1.432800] ata4: SATA max UDMA/133 cmd 0x9880 ctl 0x9800 bmdma 0x9080 irq 21 Mar 9 12:51:05 i5 kernel: [ 1.432829] ata5: SATA max UDMA/133 cmd 0x9480 ctl 0x9400 bmdma 0x9088 irq 21 ... Mar 9 12:51:05 i5 kernel: [ 2.236210] ata4.00: SATA link down (SStatus 0 SControl 300) Mar 9 12:51:05 i5 kernel: [ 2.237724] ata4.01: SATA link up 3.0 Gbps (SStatus 123 SControl 300) Mar 9 12:51:05 i5 kernel: [ 2.256250] ata4.01: ATA-7: INTEL SSDSA2M160G2GC, 2CV102HA, max UDMA/133 Mar 9 12:51:05 i5 kernel: [ 2.257747] ata4.01: 312581808 sectors, multi 16: LBA48 NCQ (depth 0/32) Mar 9 12:51:05 i5 kernel: [ 2.268256] ata4.01: configured for UDMA/133
yeah, yeah, I realize it's ata_piix, and I need to go into the BIOS and turn it into AHCI mode, but I thought I'd make a report about this before I do anything else.
The 30 second pause was annoying, but then half an hour later it just hung entirely, with the disk light blinking at 1Hz. Which I assume is related.
Oh, just happened again:
Mar 9 13:12:29 i5 kernel: [ 540.453163] ata4: clearing spurious IRQ
Mar 9 13:12:59 i5 kernel: [ 571.133725] ata4: lost interrupt (Status 0x50)
Mar 9 13:12:59 i5 kernel: [ 571.133749] ata4.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0 frozen
Mar 9 13:12:59 i5 kernel: [ 571.133755] ata4.01: failed command: READ DMA
Mar 9 13:12:59 i5 kernel: [ 571.133764] ata4.01: cmd c8/00:08:c7:9a:47/00:00:00:00:00/f5 tag 0 dma 4096 in
Mar 9 13:12:59 i5 kernel: [ 571.133766] res 40/00:00:00:4f:c2/00:00:00:00:00/10 Emask 0x4 (timeout)
Mar 9 13:12:59 i5 kernel: [ 571.133771] ata4.01: status: { DRDY }
Mar 9 13:12:59 i5 kernel: [ 571.133783] ata4.00: hard resetting link
Mar 9 13:13:00 i5 kernel: [ 571.453215] ata4.01: hard resetting link
Mar 9 13:13:00 i5 kernel: [ 571.928512] ata4.00: SATA link down (SStatus 0 SControl 300)
Mar 9 13:13:00 i5 kernel: [ 571.928526] ata4.01: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
Mar 9 13:13:00 i5 kernel: [ 571.952699] ata4.01: configured for UDMA/133
Mar 9 13:13:00 i5 kernel: [ 571.952707] ata4.01: device reported invalid CHS sector 0
Mar 9 13:13:00 i5 kernel: [ 571.952716] ata4: EH completeso I really think PIIX is screwed up in current -git. And it really must be fairly recent, since none of this happened with the Fedora kernels, and it's clearly not a one-time event.
In fact, grepping for this, it's happened at least four times since I upgraded the machine to 2.6.34-rc1-00005-g522dba7.
Linus
Quoted 12 lines · Linus Torvalds
Jeff,
this is a new machine, so I don't know when it started, but it was
running a couple of Fedora 2.6.31/32 kernels for a while with no trouble. So I _think_ it's recent.I'd guess it's due to commit
27943620cb("libata: implement spurious irq handling for SFF and apply it to piix"), in fact.With current -git I got a 30 second pause, and it was accompanied with this kernel log:
Quoted 14 lines
Mar 9 12:51:05 i5 kernel: [ 7.040194] ata4: clearing spurious IRQ
Mar 9 12:51:05 i5 kernel: [ 37.978933] ata4: lost interrupt (Status 0x50)
Mar 9 12:51:05 i5 kernel: [ 37.978948] ata4.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0 frozen
Mar 9 12:51:05 i5 kernel: [ 37.978951] ata4.01: failed command: READ DMA
Mar 9 12:51:05 i5 kernel: [ 37.978954] ata4.01: cmd c8/00:08:ef:44:47/00:00:00:00:00/f0 tag 0 dma 4096 in
Mar 9 12:51:05 i5 kernel: [ 37.978955] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
Mar 9 12:51:05 i5 kernel: [ 37.978957] ata4.01: status: { DRDY }
Mar 9 12:51:05 i5 kernel: [ 37.978963] ata4.00: hard resetting link
Mar 9 12:51:05 i5 kernel: [ 38.306451] ata4.01: hard resetting link
Mar 9 12:51:05 i5 kernel: [ 38.785773] ata4.00: SATA link down (SStatus 0 SControl 300)
Mar 9 12:51:05 i5 kernel: [ 38.785787] ata4.01: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
Mar 9 12:51:05 i5 kernel: [ 38.809900] ata4.01: configured for UDMA/133
Mar 9 12:51:05 i5 kernel: [ 38.809903] ata4.01: device reported invalid CHS sector 0
Mar 9 12:51:05 i5 kernel: [ 38.809907] ata4: EH completeCoincedentally, it looks like someone else just reported the same problem, with 2.6.34-rc1.
It definitely sounds like a race. READ DMA is a DMA command as the name implies, so that eliminates the possibility of polling-related paths in ata_sff_interrupt (libata-sff.c).
I'll flip some of my machines to the icky slow boring piix mode, rather than sexy AHCI mode :) to see if I can reproduce. I have had a feeling that we needed a more sophisticated IRQ handling setup, this may be what was needed. Lost interrupt recovery should occur faster than 30 seconds in any case, and should not require a hard reset if the hardware functions just fine outside of the lost-interrupt / race that just occurred.
If it helps, this wiki pages explains the error output a bit more: http://ata.wiki.kernel.org/index.php/Libata_error_messages
though in this case, it is clearly a timeout, so looking at the input and output taskfile register blocks will not be as informative as in other error situations.
Jeff
Hello, Linus, Jeff.
Quoted 7 lines · Jeff Garzik
Coincedentally, it looks like someone else just reported the same problem, with 2.6.34-rc1.
It definitely sounds like a race. READ DMA is a DMA command as the name implies, so that eliminates the possibility of polling-related paths in
ata_sff_interrupt(libata-sff.c).
Quoted 7 lines
I'll flip some of my machines to the icky slow boring piix mode, rather than sexy AHCI mode :) to see if I can reproduce. I have had a feeling that we needed a more sophisticated IRQ handling setup, this may be what was needed. Lost interrupt recovery should occur faster than 30 seconds in any case, and should not require a hard reset if the hardware functions just fine outside of the lost-interrupt / race that just occurred.
Yeap, there is a race condition with clearing which I don't think we can solve completely but with some modification I think we can at least cover known failure cases.
For longer term, I don't think we can solve this by diddling with the SFF registers. The interface is just way too ancient and horrid to build anything reliable on top of. I'm planning on implementing smarter IRQ storm handling and stepped timeouts for ATA commands.
Linus, can you please test whether the following patch resolves the problem?
Thanks.
drivers/ata/libata-sff.c +35 -8
@@ -1667,6 +1667,7 @@ unsigned int ata_sff_host_intr(struct ata_port *ap, {struct ata_eh_info *ehi = &ap->link.eh_info;u8 status, host_stat =0 ; +bool bmdma_stopped = false;VPRINTK ("ata%u: protocol %d task_state %d\n" , ap->print_id, qc->tf.protocol, ap->hsm_task_state);
@@ -1699,6 +1700,7 @@ unsigned int ata_sff_host_intr(struct ata_port *ap,/* before we do anything else, clear DMA-Start bit */ ap->ops->bmdma_stop (qc); + bmdma_stopped = true;if (unlikely (host_stat &ATA_DMA_ERR )) {/* error when transfering data to/from memory */
@@ -1716,8 +1718,14 @@ unsigned int ata_sff_host_intr(struct ata_port *ap,/* check main status, clearing INTRQ if needed */ status =ata_sff_irq_status (ap); -if (status &ATA_BUSY ) - goto idle_irq; +if (status &ATA_BUSY ) { +if (bmdma_stopped) { +/* BMDMA engine is already stopped, we're screwed */ + qc->err_mask |=AC_ERR_HSM ; + ap->hsm_task_state =HSM_ST_ERR ; + }else + goto idle_irq; + }/* ack bmdma irq events */ ap->ops->sff_irq_clear (ap);
@@ -1762,13 +1770,15 @@ EXPORT_SYMBOL_GPL(ata_sff_host_intr);irqreturn_t ata_sff_interrupt (int irq,void *dev_instance) {struct ata_host *host = dev_instance; +bool retried = false;unsigned int i; -unsigned int handled =0 , polling =0 ; +unsigned int handled, idle, polling;unsigned long flags;/* TODO: make _irqsave conditional on x86 PCI IDE legacy mode */ spin_lock_irqsave (&host->lock, flags); - +retry: + handled = idle = polling =0 ;for (i =0 ; i < host->n_ports; i++) {struct ata_port *ap = host->ports[i];struct ata_queued_cmd *qc;
@@ -1782,7 +1792,8 @@ irqreturn_t ata_sff_interrupt(int irq, void *dev_instance) handled |=ata_sff_host_intr (ap, qc); else polling |= 1 << i; - } + }else + idle |=1 << i; }/*
@@ -1790,7 +1801,9 @@ irqreturn_t ata_sff_interrupt(int irq, void *dev_instance)* asserting IRQ line, nobody cared will ensue. Check IRQ * pending status if available and clear spurious IRQ. */ -if (!handled) { +if (!handled && !retried) { +bool retry = false; +for (i =0 ; i < host->n_ports; i++) {struct ata_port *ap = host->ports[i];
@@ -1805,8 +1818,22 @@ irqreturn_t ata_sff_interrupt(int irq, void *dev_instance)ata_port_printk (ap,KERN_INFO ,"clearing spurious IRQ\n" ); - ap->ops->sff_check_status (ap); - ap->ops->sff_irq_clear (ap); +if (idle & (1 << i)) { + ap->ops->sff_check_status (ap); + ap->ops->sff_irq_clear (ap); + }else { +/* clear INTRQ and check if BUSY cleared */ +if (!(ap->ops->sff_check_status (ap) &ATA_BUSY )) + retry |= true; +/* +* With command in flight, we can't do +* sff_irq_clear() w/o racing with completion. +*/ + } + } +if (retry) { + retried = true; + goto retry; } }
Quoted 18 lines · Tejun Heo
Hello, Linus, Jeff.
Quoted 7 lines · Jeff Garzik
Coincedentally, it looks like someone else just reported the same problem, with 2.6.34-rc1.
It definitely sounds like a race. READ DMA is a DMA command as the name implies, so that eliminates the possibility of polling-related paths in
ata_sff_interrupt(libata-sff.c).Quoted 7 lines
I'll flip some of my machines to the icky slow boring piix mode, rather than sexy AHCI mode :) to see if I can reproduce. I have had a feeling that we needed a more sophisticated IRQ handling setup, this may be what was needed. Lost interrupt recovery should occur faster than 30 seconds in any case, and should not require a hard reset if the hardware functions just fine outside of the lost-interrupt / race that just occurred.
Quoted 8 lines
Yeap, there is a race condition with clearing which I don't think we can solve completely but with some modification I think we can at least cover known failure cases.
For longer term, I don't think we can solve this by diddling with the SFF registers. The interface is just way too ancient and horrid to build anything reliable on top of. I'm planning on implementing smarter IRQ storm handling and stepped timeouts for ATA commands.
Another ata_piix report on l-i & lkml indicates that 2.6.33 is fine and libata timeouts occur on 2.6.34-rc1.
I was able to reproduce once, during disk stress. I think I can do so again and hopefully verify a fix.
Jeff
Quoted 18 lines · Tejun Heo
Hello, Linus, Jeff.
Quoted 7 lines · Jeff Garzik
Coincedentally, it looks like someone else just reported the same problem, with 2.6.34-rc1.
It definitely sounds like a race. READ DMA is a DMA command as the name implies, so that eliminates the possibility of polling-related paths in
ata_sff_interrupt(libata-sff.c).Quoted 7 lines
I'll flip some of my machines to the icky slow boring piix mode, rather than sexy AHCI mode :) to see if I can reproduce. I have had a feeling that we needed a more sophisticated IRQ handling setup, this may be what was needed. Lost interrupt recovery should occur faster than 30 seconds in any case, and should not require a hard reset if the hardware functions just fine outside of the lost-interrupt / race that just occurred.
Quoted 8 lines
Yeap, there is a race condition with clearing which I don't think we can solve completely but with some modification I think we can at least cover known failure cases.
For longer term, I don't think we can solve this by diddling with the SFF registers. The interface is just way too ancient and horrid to build anything reliable on top of. I'm planning on implementing smarter IRQ storm handling and stepped timeouts for ATA commands.
A tester on this bug
http://bugzilla.kernel.org/show_bug.cgi?id=15537
seemed to find success with the patch.
Jeff
Quoted 25 lines · Jeff Garzik
Quoted 24 lines · Tejun Heo
Hello, Linus, Jeff.
Quoted 8 lines · Jeff Garzik
Coincedentally, it looks like someone else just reported the same problem, with 2.6.34-rc1.
It definitely sounds like a race. READ DMA is a DMA command as the name implies, so that eliminates the possibility of polling-related paths in
ata_sff_interrupt(libata-sff.c).Quoted 7 lines
I'll flip some of my machines to the icky slow boring piix mode, rather than sexy AHCI mode :) to see if I can reproduce. I have had a feeling that we needed a more sophisticated IRQ handling setup, this may be what was needed. Lost interrupt recovery should occur faster than 30 seconds in any case, and should not require a hard reset if the hardware functions just fine outside of the lost-interrupt / race that just occurred.
Yeap, there is a race condition with clearing which I don't think we can solve completely but with some modification I think we can at least cover known failure cases.
Quoted 8 lines
Quoted 4 lines
For longer term, I don't think we can solve this by diddling with the SFF registers. The interface is just way too ancient and horrid to build anything reliable on top of. I'm planning on implementing smarter IRQ storm handling and stepped timeouts for ATA commands.
A tester on this bug
http://bugzilla.kernel.org/show_bug.cgi?id=15537
seemed to find success with the patch.
Thanks for the Update!
I will wait some more and then test rc-2.
Best
Zeno
Quoted 31 lines · Zeno Davatz
Quoted 30 lines · Jeff Garzik
Quoted 28 lines · Tejun Heo
Hello, Linus, Jeff.
Quoted 8 lines · Jeff Garzik
Coincedentally, it looks like someone else just reported the same problem, with 2.6.34-rc1.
It definitely sounds like a race. READ DMA is a DMA command as the name implies, so that eliminates the possibility of polling-related paths in
ata_sff_interrupt(libata-sff.c).Quoted 7 lines
I'll flip some of my machines to the icky slow boring piix mode, rather than sexy AHCI mode :) to see if I can reproduce. I have had a feeling that we needed a more sophisticated IRQ handling setup, this may be what was needed. Lost interrupt recovery should occur faster than 30 seconds in any case, and should not require a hard reset if the hardware functions just fine outside of the lost-interrupt / race that just occurred.
Yeap, there is a race condition with clearing which I don't think we can solve completely but with some modification I think we can at least cover known failure cases.
For longer term, I don't think we can solve this by diddling with the SFF registers. The interface is just way too ancient and horrid to build anything reliable on top of. I'm planning on implementing smarter IRQ storm handling and stepped timeouts for ATA commands.
Quoted 7 lines
Quoted 3 lines
A tester on this bug
http://bugzilla.kernel.org/show_bug.cgi?id=15537seemed to find success with the patch.
Thanks for the Update!
I will wait some more and then test rc-2.
Can you test the patch, please?
Jeff
Quoted 41 lines · Jeff Garzik
Quoted 40 lines · Zeno Davatz
Quoted 37 lines · Jeff Garzik
Quoted 23 lines · Tejun Heo
Hello, Linus, Jeff.
Quoted 9 lines · Jeff Garzik
Coincedentally, it looks like someone else just reported the same problem, with 2.6.34-rc1.
It definitely sounds like a race. READ DMA is a DMA command as the name
implies, so that eliminates the possibility of polling-related paths inata_sff_interrupt(libata-sff.c).Quoted 9 lines
I'll flip some of my machines to the icky slow boring piix mode, rather than sexy AHCI mode :) to see if I can reproduce. I have had a feeling that we needed a more sophisticated IRQ handling setup, this may be what
was needed. Lost interrupt recovery should occur faster than 30 seconds
in any case, and should not require a hard reset if the hardware functions just fine outside of the lost-interrupt / race that just occurred.Quoted 8 lines
Yeap, there is a race condition with clearing which I don't think we can solve completely but with some modification I think we can at least cover known failure cases.
For longer term, I don't think we can solve this by diddling with the SFF registers. The interface is just way too ancient and horrid to build anything reliable on top of. I'm planning on implementing smarter IRQ storm handling and stepped timeouts for ATA commands.
A tester on this bug
http://bugzilla.kernel.org/show_bug.cgi?id=15537
seemed to find success with the patch.
Quoted 5 lines
Quoted 3 lines
Thanks for the Update!
I will wait some more and then test rc-2.
Can you test the patch, please?
Sure. I done:
/usr/src/linux> sudo patch -p1 < teo
patching file drivers/ata/libata-sff.c
Hunk #1 FAILED at 1667.
Hunk #2 FAILED at 1700.
Hunk #3 FAILED at 1718.
Hunk #4 FAILED at 1770.
Hunk #5 FAILED at 1792.
Hunk #6 FAILED at 1801.
Hunk #7 FAILED at 1818.
7 out of 7 hunks FAILED -- saving rejects to file drivers/ata/libata-sff.c.rej
Is that the expected outcome? Can I ignore the "failed" output?
Now I guess I still need to do "make", lilo and reboot.
Let me know.
Best
Zeno
Quoted 61 lines · Zeno Davatz
Quoted 41 lines · Jeff Garzik
Quoted 40 lines · Zeno Davatz
Quoted 37 lines · Jeff Garzik
Quoted 23 lines · Tejun Heo
Hello, Linus, Jeff.
Quoted 9 lines · Jeff Garzik
Coincedentally, it looks like someone else just reported the same problem, with 2.6.34-rc1.
It definitely sounds like a race. READ DMA is a DMA command as the name
implies, so that eliminates the possibility of polling-related paths inata_sff_interrupt(libata-sff.c).Quoted 9 lines
I'll flip some of my machines to the icky slow boring piix mode, rather than sexy AHCI mode :) to see if I can reproduce. I have had a feeling that we needed a more sophisticated IRQ handling setup, this may be what
was needed. Lost interrupt recovery should occur faster than 30 seconds
in any case, and should not require a hard reset if the hardware functions just fine outside of the lost-interrupt / race that just occurred.Quoted 8 lines
Yeap, there is a race condition with clearing which I don't think we can solve completely but with some modification I think we can at least cover known failure cases.
For longer term, I don't think we can solve this by diddling with the SFF registers. The interface is just way too ancient and horrid to build anything reliable on top of. I'm planning on implementing smarter IRQ storm handling and stepped timeouts for ATA commands.
A tester on this bug
http://bugzilla.kernel.org/show_bug.cgi?id=15537
seemed to find success with the patch.Quoted 5 lines
Quoted 3 lines
Thanks for the Update!
I will wait some more and then test rc-2.
Can you test the patch, please?
Sure. I done:
/usr/src/linux> sudo patch -p1 < teo
patching filedrivers/ata/libata-sff.c
Hunk #1 FAILED at 1667.
Hunk #2 FAILED at 1700.
Hunk #3 FAILED at 1718.
Hunk #4 FAILED at 1770.
Hunk #5 FAILED at 1792.
Hunk #6 FAILED at 1801.
Hunk #7 FAILED at 1818.
7 out of 7 hunks FAILED -- saving rejects to filedrivers/ata/libata-sff.c.rej
Quoted 3 lines
Is that the expected outcome? Can I ignore the "failed" output?
Now I guess I still need to do "make", lilo and reboot.
Done all of the above, no getting the following right after running dmesg after the reboot:
Mar 15 04:22:12 zenogentoo Probing IDE interface ide1... Mar 15 04:22:12 zenogentoo ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 Mar 15 04:22:12 zenogentoo ide1 at 0x170-0x177,0x376 on irq 15 Mar 15 04:22:12 zenogentoo ide_generic: please use "probe_mask=0x3f" module parameter for probing all legacy ISA IDE ports Mar 15 04:22:12 zenogentoo ide-gd driver 1.18 Mar 15 04:22:12 zenogentoo ide-cd driver 5.00 Mar 15 04:22:12 zenogentoo ide-cd: hda: ATAPI 48X DVD-ROM DVD-R CD-R/RW drive, 2048kB Cache Mar 15 04:22:12 zenogentoo Uniform CD-ROM driver Revision: 3.20 Mar 15 04:22:12 zenogentoo ata_piix 0000:00:1f.2: version 2.13 Mar 15 04:22:12 zenogentoo ata_piix 0000:00:1f.2: PCI INT B -> GSI 19 (level, low) -> IRQ 19 Mar 15 04:22:12 zenogentoo ata_piix 0000:00:1f.2: MAP [ P0 P2 P1 P3 ] Mar 15 04:22:12 zenogentoo ata_piix 0000:00:1f.2: setting latency timer to 64 Mar 15 04:22:12 zenogentoo scsi0 : ata_piix Mar 15 04:22:12 zenogentoo scsi1 : ata_piix Mar 15 04:22:12 zenogentoo ata1: SATA max UDMA/133 cmd 0xd080 ctl 0xd000 bmdma 0xc800 irq 19 Mar 15 04:22:12 zenogentoo ata2: SATA max UDMA/133 cmd 0xcc00 ctl 0xc880 bmdma 0xc808 irq 19 Mar 15 04:22:12 zenogentoo Intel(R) PRO/1000 Network Driver - version 7.3.21-k5-NAPI Mar 15 04:22:12 zenogentoo Copyright (c) 1999-2006 Intel Corporation. Mar 15 04:22:12 zenogentoo e1000 0000:02:06.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18 Mar 15 04:22:12 zenogentoo ata1.00: ATA-7: INTEL SSDSA2MH160G1GC, 045C8820, max UDMA/133 Mar 15 04:22:12 zenogentoo ata1.00: 312581808 sectors, multi 16: LBA48 NCQ (depth 0/31) Mar 15 04:22:12 zenogentoo ata1.00: configured for UDMA/133 Mar 15 04:22:12 zenogentoo scsi 0:0:0:0: Direct-Access ATA INTEL SSDSA2MH16 045C PQ: 0 ANSI: 5 Mar 15 04:22:12 zenogentoo sd 0:0:0:0: Attached scsi generic sg0 type 0 Mar 15 04:22:12 zenogentoo sd 0:0:0:0: [sda] 312581808 512-byte logical blocks: (160 GB/149 GiB) Mar 15 04:22:12 zenogentoo sd 0:0:0:0: [sda] Write Protect is off Mar 15 04:22:12 zenogentoo sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00 Mar 15 04:22:12 zenogentoo sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA Mar 15 04:22:12 zenogentoo e1000: 0000:02:06.0: e1000_probe: (PCI:33MHz:32-bit) 00:13:d3:b4:3c:6c Mar 15 04:22:12 zenogentoo sda: sda1 sda2 sda3 Mar 15 04:22:12 zenogentoo sd 0:0:0:0: [sda] Attached SCSI disk
Let me know if I can be of any further help.
Linux zenogentoo 2.6.34-rc1 #80 SMP Mon Mar 15 14:22:23 CET 2010 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz GenuineIntel GNU/Linux
If I get another hang I will let you know.
Best
Zeno
Quoted 61 lines · Zeno Davatz
Quoted 41 lines · Jeff Garzik
Quoted 40 lines · Zeno Davatz
Quoted 37 lines · Jeff Garzik
Quoted 23 lines · Tejun Heo
Hello, Linus, Jeff.
Quoted 9 lines · Jeff Garzik
Coincedentally, it looks like someone else just reported the same problem, with 2.6.34-rc1.
It definitely sounds like a race. READ DMA is a DMA command as the name
implies, so that eliminates the possibility of polling-related paths inata_sff_interrupt(libata-sff.c).Quoted 9 lines
I'll flip some of my machines to the icky slow boring piix mode, rather than sexy AHCI mode :) to see if I can reproduce. I have had a feeling that we needed a more sophisticated IRQ handling setup, this may be what
was needed. Lost interrupt recovery should occur faster than 30 seconds
in any case, and should not require a hard reset if the hardware functions just fine outside of the lost-interrupt / race that just occurred.Quoted 8 lines
Yeap, there is a race condition with clearing which I don't think we can solve completely but with some modification I think we can at least cover known failure cases.
For longer term, I don't think we can solve this by diddling with the SFF registers. The interface is just way too ancient and horrid to build anything reliable on top of. I'm planning on implementing smarter IRQ storm handling and stepped timeouts for ATA commands.
A tester on this bug
http://bugzilla.kernel.org/show_bug.cgi?id=15537seemed to find success with the patch.
Quoted 5 lines
Quoted 3 lines
Thanks for the Update!
I will wait some more and then test rc-2.
Can you test the patch, please?
Sure. I done:
/usr/src/linux> sudo patch -p1< teo
patching filedrivers/ata/libata-sff.c
Hunk #1 FAILED at 1667.
Hunk #2 FAILED at 1700.
Hunk #3 FAILED at 1718.
Hunk #4 FAILED at 1770.
Hunk #5 FAILED at 1792.
Hunk #6 FAILED at 1801.
Hunk #7 FAILED at 1818.
7 out of 7 hunks FAILED -- saving rejects to filedrivers/ata/libata-sff.c.rej
Quoted 1 line
Is that the expected outcome? Can I ignore the "failed" output?
With 7 out of 7 hunks failing, nothing got modified.
Is your source tree an unmodified, vanilla 2.6.34-rc1 tree?
Jeff
Quoted 68 lines · Jeff Garzik
Quoted 67 lines · Zeno Davatz
Quoted 45 lines · Jeff Garzik
Quoted 43 lines · Zeno Davatz
Quoted 40 lines · Jeff Garzik
Quoted 26 lines · Tejun Heo
Hello, Linus, Jeff.
Quoted 10 lines · Jeff Garzik
Coincedentally, it looks like someone else just reported the same problem, with 2.6.34-rc1.
It definitely sounds like a race. READ DMA is a DMA command as the name
implies, so that eliminates the possibility of polling-related paths inata_sff_interrupt(libata-sff.c).Quoted 11 lines
I'll flip some of my machines to the icky slow boring piix mode, rather
than sexy AHCI mode :) to see if I can reproduce. I have had a feeling
that we needed a more sophisticated IRQ handling setup, this may be what
was needed. Lost interrupt recovery should occur faster than 30 seconds
in any case, and should not require a hard reset if the hardware functions just fine outside of the lost-interrupt / race that just occurred.Quoted 8 lines
Yeap, there is a race condition with clearing which I don't think we can solve completely but with some modification I think we can at least cover known failure cases.
For longer term, I don't think we can solve this by diddling with the SFF registers. The interface is just way too ancient and horrid to build anything reliable on top of. I'm planning on implementing smarter IRQ storm handling and stepped timeouts for ATA commands.
A tester on this bug
http://bugzilla.kernel.org/show_bug.cgi?id=15537
seemed to find success with the patch.Quoted 5 lines
Quoted 3 lines
Thanks for the Update!
I will wait some more and then test rc-2.
Can you test the patch, please?
Sure. I done:
/usr/src/linux> sudo patch -p1< teo
patching filedrivers/ata/libata-sff.c
Hunk #1 FAILED at 1667.
Hunk #2 FAILED at 1700.
Hunk #3 FAILED at 1718.
Hunk #4 FAILED at 1770.
Hunk #5 FAILED at 1792.
Hunk #6 FAILED at 1801.
Hunk #7 FAILED at 1818.
7 out of 7 hunks FAILED -- saving rejects to filedrivers/ata/libata-sff.c.rej
Quoted 5 lines
Quoted 1 line
Is that the expected outcome? Can I ignore the "failed" output?
With 7 out of 7 hunks failing, nothing got modified.
Is your source tree an unmodified, vanilla 2.6.34-rc1 tree?
I normally only run "sudo git pull" on the git directory of Linus every time a new RC is out. Then I do a "make silentoldconfig" a "make", cp the bzImage, lilo -v and reboot.
I have not applied any patches on my kernel directory for ages.
Best
Zeno