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/ata_piix.c | 38 ++++++-------------------------------- drivers/ata/libata-core.c | 1 - drivers/ata/libata.h | 1 + drivers/ata/sata_sis.c | 21 ++++++++++----------- include/linux/libata.h | 1 - 5 files changed, 17 insertions(+), 45 deletions(-)
Jens Axboe:
Add 0x7110 piix to ata_piix.c
Tejun Heo:
sata_sis: fix flags handling for the secondary port
libata: unexport ata_dev_revalidate()
ata_piix: allow 01b MAP for both ICH6M and ICH7M
drivers/ata/ata_piix.c +6 -32
@@ -126,8 +126,7 @@ enum { ich6_sata =7 , ich6_sata_ahci =8 , ich6m_sata_ahci =9 , - ich7m_sata_ahci =10 , - ich8_sata_ahci =11 , + ich8_sata_ahci =10 ,/* constants for mapping table */ P0 = 0, /* port 0 */
@@ -169,6 +168,7 @@ static const struct pci_device_id piix_p #ifdef ATA_ENABLE_PATA /* Intel PIIX4 for the 430TX/440BX/MX chipset: UDMA 33 */ /* Also PIIX4E (fn3 rev 2) and PIIX4M (fn3 rev 3) */ + { 0x8086, 0x7110, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_33 }, { 0x8086, 0x7111, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_33 }, { 0x8086, 0x24db, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 }, { 0x8086, 0x25a2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 },
@@ -227,7 +227,7 @@ #endif/* 82801GB/GR/GH (ICH7, identical to ICH6) */ { 0x8086, 0x27c0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci },/* 2801GBM/GHM (ICH7M, identical to ICH6M) */ - { 0x8086, 0x27c4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich7m_sata_ahci }, + { 0x8086, 0x27c4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6m_sata_ahci },/* Enterprise Southbridge 2 (where's the datasheet?) */ { 0x8086, 0x2680, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci }, /* SATA Controller 1 IDE (ICH8, no datasheet yet) */
@@ -399,23 +399,10 @@ static const struct piix_map_db ich6m_ma .mask = 0x3, .port_enable = 0x5, .present_shift = 4, - .map = { - /* PM PS SM SS MAP */ - { P0, P2, RV, RV }, /* 00b */ - { RV, RV, RV, RV }, - { P0, P2, IDE, IDE }, /* 10b */ - { RV, RV, RV, RV }, - }, -}; - -static const struct piix_map_db ich7m_map_db = { - .mask = 0x3, - .port_enable = 0x5, - .present_shift = 4, /* Map 01b isn't specified in the doc but some notebooks use - * it anyway. ATM, the only case spotted carries subsystem ID - * 1025:0107. This is the only difference from ich6m. + * it anyway. MAP 01b have been spotted on both ICH6M and + * ICH7M. */ .map = {/* PM PS SM SS MAP */
@@ -445,7 +432,6 @@ static const struct piix_map_db *piix_ma [ich6_sata] = &ich6_map_db, [ich6_sata_ahci] = &ich6_map_db, [ich6m_sata_ahci] = &ich6m_map_db, - [ich7m_sata_ahci] = &ich7m_map_db, [ich8_sata_ahci] = &ich8_map_db, };
@@ -556,19 +542,7 @@ static struct ata_port_info piix_port_in .port_ops = &piix_sata_ops, }, -/* ich7m_sata_ahci: 10 */ - { - .sht = &piix_sht, - .flags = ATA_FLAG_SATA | - PIIX_FLAG_CHECKINTR | PIIX_FLAG_SCR | - PIIX_FLAG_AHCI, - .pio_mask = 0x1f, /* pio0-4 */ - .mwdma_mask = 0x07, /* mwdma0-2 */ - .udma_mask = 0x7f, /* udma0-6 */ - .port_ops = &piix_sata_ops, - }, - -/* ich8_sata_ahci: 11 */ +/* ich8_sata_ahci: 10 */ { .sht = &piix_sht, .flags = ATA_FLAG_SATA |
drivers/ata/libata-core.c +0 -1
@@ -6122,7 +6122,6 @@ EXPORT_SYMBOL_GPL(ata_std_prereset);EXPORT_SYMBOL_GPL (ata_std_softreset);EXPORT_SYMBOL_GPL (sata_std_hardreset);EXPORT_SYMBOL_GPL (ata_std_postreset); -EXPORT_SYMBOL_GPL (ata_dev_revalidate);EXPORT_SYMBOL_GPL (ata_dev_classify);EXPORT_SYMBOL_GPL (ata_dev_pair);EXPORT_SYMBOL_GPL (ata_port_disable);
drivers/ata/libata.h +1 -0
@@ -53,6 +53,7 @@ extern unsigned ata_exec_internal(structextern unsigned int ata_do_simple_cmd (struct ata_device *dev,u8 cmd);extern int ata_dev_read_id (struct ata_device *dev,unsigned int *p_class,int post_reset,u16 *id); +extern int ata_dev_revalidate (struct ata_device *dev,int post_reset);extern int ata_dev_configure (struct ata_device *dev,int print_info);extern int sata_down_spd_limit (struct ata_port *ap);extern int sata_set_spd_needed (struct ata_port *ap);
drivers/ata/sata_sis.c +10 -11
@@ -240,7 +240,7 @@ static int sis_init_one (struct pci_devstruct ata_probe_ent *probe_ent =NULL ;int rc;u32 genctl; -struct ata_port_info *ppi[2 ]; +struct ata_port_info pi = sis_port_info, *ppi[2 ] = { &pi, &pi };int pci_dev_busy =0 ;u8 pmr;u8 port2_start;
@@ -265,27 +265,20 @@ static int sis_init_one (struct pci_devif (rc) goto err_out_regions; - ppi[0 ] = ppi[1 ] = &sis_port_info; - probe_ent =ata_pci_init_native_mode (pdev, ppi,ATA_PORT_PRIMARY |ATA_PORT_SECONDARY ); -if (!probe_ent) { - rc = -ENOMEM ; - goto err_out_regions; - } -/* check and see if the SCRs are in IO space or PCI cfg space */ pci_read_config_dword (pdev,SIS_GENCTL , &genctl);if ((genctl &GENCTL_IOMAPPED_SCR ) ==0 ) - probe_ent->port_flags |=SIS_FLAG_CFGSCR ; + pi.flags |=SIS_FLAG_CFGSCR ;/* if hardware thinks SCRs are in IO space, but there are * no IO resources assigned, change to PCI cfg space. */ -if ((!(probe_ent->port_flags &SIS_FLAG_CFGSCR )) && +if ((!(pi.flags &SIS_FLAG_CFGSCR )) && ((pci_resource_start (pdev,SIS_SCR_PCI_BAR ) ==0 ) || (pci_resource_len (pdev,SIS_SCR_PCI_BAR ) <128 ))) { genctl &= ~GENCTL_IOMAPPED_SCR ;pci_write_config_dword (pdev,SIS_GENCTL , genctl); - probe_ent->port_flags |=SIS_FLAG_CFGSCR ; + pi.flags |=SIS_FLAG_CFGSCR ; }pci_read_config_byte (pdev,SIS_PMR , &pmr);
@@ -306,6 +299,12 @@ static int sis_init_one (struct pci_dev port2_start =0x20 ; } + probe_ent =ata_pci_init_native_mode (pdev, ppi,ATA_PORT_PRIMARY |ATA_PORT_SECONDARY ); +if (!probe_ent) { + rc = -ENOMEM ; + goto err_out_regions; + } +if (!(probe_ent->port_flags &SIS_FLAG_CFGSCR )) { probe_ent->port[0 ].scr_addr =pci_resource_start (pdev,SIS_SCR_PCI_BAR );
include/linux/libata.h +0 -1
@@ -702,7 +702,6 @@ extern int ata_std_prereset(struct ata_pextern int ata_std_softreset (struct ata_port *ap,unsigned int *classes);extern int sata_std_hardreset (struct ata_port *ap,unsigned int *class);extern void ata_std_postreset (struct ata_port *ap,unsigned int *classes); -extern int ata_dev_revalidate (struct ata_device *dev,int post_reset);extern void ata_port_disable (struct ata_port *);extern void ata_std_ports (struct ata_ioports *ioaddr);#ifdef CONFIG_PCI
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Jeff" == Jeff Garzik <[email protected]> writes:
Jeff> diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c Jeff> index 5250187..8385387 100644
Jeff> --- a/drivers/ata/ata_piix.c
Jeff> +++ b/drivers/ata/ata_piix.c
Jeff> @@ -126,8 +126,7 @@ enum {
Jeff> ich6_sata = 7, Jeff> ich6_sata_ahci = 8, Jeff> ich6m_sata_ahci = 9,
Jeff> - ich7m_sata_ahci = 10,
Jeff> - ich8_sata_ahci = 11,
Jeff> + ich8_sata_ahci = 10,
Jeff> /* constants for mapping table */
Jeff> P0 = 0, /* port 0 */
Jeff> @@ -169,6 +168,7 @@ static const struct pci_device_id piix_p
Jeff> #ifdef ATA_ENABLE_PATA Jeff> /* Intel PIIX4 for the 430TX/440BX/MX chipset: UDMA 33 */ Jeff> /* Also PIIX4E (fn3 rev 2) and PIIX4M (fn3 rev 3) */
Jeff> + { 0x8086, 0x7110, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_33 },
Jeff> { 0x8086, 0x7111, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_33 },
Umm, according to lspci -nn on my 440GX box, isn't the 0x8086/0x7110 an ISA bridge, not a PIIX? controller?
00:00.0 Host bridge [0600]: Intel Corporation 440GX - 82443GX Host bridge [8086:71a0] 00:01.0 PCI bridge [0604]: Intel Corporation 440GX - 82443GX AGP bridge [8086:71a1] 00:07.0 ISA bridge [0601]: Intel Corporation 82371AB/EB/MB PIIX4 ISA [8086:7110] (rev 02) 00:07.1 IDE interface [0101]: Intel Corporation 82371AB/EB/MB PIIX4 IDE [8086:7111] (rev 01) 00:07.2 USB Controller [0c03]: Intel Corporation 82371AB/EB/MB PIIX4 USB [8086:7112] (rev 01) 00:07.3 Bridge [0680]: Intel Corporation 82371AB/EB/MB PIIX4 ACPI [8086:7113] (rev 02)
John
Ar Mer, 2006-11-01 am 09:06 -0500, ysgrifennodd John Stoffel:
Quoted 5 lines
Jeff> + {
0x8086,0x7110,PCI_ANY_ID,PCI_ANY_ID, 0, 0,piix_pata_33},
Jeff> {0x8086,0x7111,PCI_ANY_ID,PCI_ANY_ID, 0, 0,piix_pata_33},Umm, according to lspci -nn on my 440GX box, isn't the 0x8086/0x7110 an ISA bridge, not a PIIX? controller?
Correct - the 7110 doesn't belong on that list.
Quoted 8 lines · On Wed, 01 Nov 2006 14:30:35 +0000 Alan Cox <[email protected]> wrote:
Ar Mer, 2006-11-01 am 09:06 -0500, ysgrifennodd John Stoffel:
Quoted 5 lines
Jeff> + {
0x8086,0x7110,PCI_ANY_ID,PCI_ANY_ID, 0, 0,piix_pata_33},
Jeff> {0x8086,0x7111,PCI_ANY_ID,PCI_ANY_ID, 0, 0,piix_pata_33},Umm, according to lspci -nn on my 440GX box, isn't the 0x8086/0x7110 an ISA bridge, not a PIIX? controller?
Correct - the 7110 doesn't belong on that list.
So should it be moved elsewhere, or simply removed?
Quoted 4 lines · Andrew Morton
Quoted 1 line · On Wed, 01 Nov 2006 14:30:35 +0000 Alan Cox <[email protected]> wrote:
Ar Mer, 2006-11-01 am 09:06 -0500, ysgrifennodd John Stoffel:
Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Jeff> + {
0x8086,0x7110,PCI_ANY_ID,PCI_ANY_ID, 0, 0,piix_pata_33},
Jeff> {0x8086,0x7111,PCI_ANY_ID,PCI_ANY_ID, 0, 0,piix_pata_33},Umm, according to lspci -nn on my 440GX box, isn't the 0x8086/0x7110 an ISA bridge, not a PIIX? controller?
Correct - the 7110 doesn't belong on that list.
So should it be moved elsewhere, or simply removed?
Well, according to Jens' own comment message, the PCI ID he needed was already in the driver (my eyes didn't catch this).
It looks like it should be reverted, based on this thread and also the patch's commit message itself.
Jeff
Quoted 14 lines · Jeff Garzik
Quoted 13 lines · Andrew Morton
Quoted 9 lines · On Wed, 01 Nov 2006 14:30:35 +0000 Alan Cox <[email protected]> wrote:
Ar Mer, 2006-11-01 am 09:06 -0500, ysgrifennodd John Stoffel:
Quoted 7 lines
Jeff> + {
0x8086,0x7110,PCI_ANY_ID,PCI_ANY_ID, 0, 0,piix_pata_33
},
Jeff> {0x8086,0x7111,PCI_ANY_ID,PCI_ANY_ID, 0, 0,piix_pata_33
},Umm, according to lspci -nn on my 440GX box, isn't the 0x8086/0x7110 an ISA bridge, not a PIIX? controller?
Correct - the 7110 doesn't belong on that list.
Quoted 7 lines
Quoted 1 line
So should it be moved elsewhere, or simply removed?
Well, according to Jens' own comment message, the PCI ID he needed was already in the driver (my eyes didn't catch this).
It looks like it should be reverted, based on this thread and also the patch's commit message itself.
I think so, I must have botched the lspci -> lspci -n read. I'll retest and see what went wrong on this notebook, but I can definitely ack that 0x7110 is an isa bridge here as well.
Signature · 1 line
Jens Axboe