Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1355285 > unrolled thread

Re: [PATCH v10 06/59] PCI: Kill wrong quirk about M7101

Started byBjorn Helgaas <helgaas@kernel.org>
First post2016-03-10 18:50 +0100
Last post2016-03-12 09:40 +0100
Articles 6 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v10 06/59] PCI: Kill wrong quirk about M7101 Bjorn Helgaas <helgaas@kernel.org> - 2016-03-10 18:50 +0100
    Re: [PATCH v10 06/59] PCI: Kill wrong quirk about M7101 Yinghai Lu <yinghai@kernel.org> - 2016-03-11 23:10 +0100
      Re: [PATCH v10 06/59] PCI: Kill wrong quirk about M7101 Linus Torvalds <torvalds@linux-foundation.org> - 2016-03-12 02:10 +0100
      Re: [PATCH v10 06/59] PCI: Kill wrong quirk about M7101 Meelis Roos <mroos@linux.ee> - 2016-03-12 08:50 +0100
        Re: [PATCH v10 06/59] PCI: Kill wrong quirk about M7101 Yinghai Lu <yinghai@kernel.org> - 2016-03-12 09:30 +0100
          Re: [PATCH v10 06/59] PCI: Kill wrong quirk about M7101 Meelis Roos <mroos@linux.ee> - 2016-03-12 09:40 +0100

#1355285 — Re: [PATCH v10 06/59] PCI: Kill wrong quirk about M7101

FromBjorn Helgaas <helgaas@kernel.org>
Date2016-03-10 18:50 +0100
SubjectRe: [PATCH v10 06/59] PCI: Kill wrong quirk about M7101
Message-ID<rbcSJ-1Wa-5@gated-at.bofh.it>
On Wed, Feb 24, 2016 at 06:11:57PM -0800, Yinghai Lu wrote:
> Meelis reported that qla2000 driver does not get loaded on one sparc system.
> 
> schizo f00732d0: PCI host bridge to bus 0001:00
> pci_bus 0001:00: root bus resource [io  0x7fe01000000-0x7fe01ffffff] (bus address [0x0000-0xffffff])
> pci 0001:00:06.0: quirk: [io  0x7fe01000800-0x7fe0100083f] claimed by ali7101 ACPI
> pci 0001:00:06.0: quirk: [io  0x7fe01000600-0x7fe0100061f] claimed by ali7101 SMB
> pci 0001:00:07.0: can't claim BAR 0 [io  0x7fe01000000-0x7fe0100ffff]: address conflict with 0001:00:06.0 [io  0x7fe01000600-0x7fe0100061f]
> 
> So the quirk for M7101 claim the io range early.
> 
> According to spec with M7101 in M1543 page 103/104,
> 	http://www.versalogic.com/Support/Downloads/pdf/ali1543.pdf
> 0xe0, and 0xe2 do not include address info for acpi/smb.
> 
> Kill wrong quirk about them.

This needs an explanation for why the quirk was added in the first
place, and why it is now safe to remove it.

> Link: http://kodu.ut.ee/~mroos/dm/dm.v240
> Link: http://kodu.ut.ee/~mroos/dm/dm.sb100
> Reported-by: Meelis Roos <mroos@linux.ee>
> Cc: Meelis Roos <mroos@linux.ee>
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> Tested-by: Khalid Aziz <khalid.aziz@oracle.com>
> ---
>  drivers/pci/quirks.c | 18 ------------------
>  1 file changed, 18 deletions(-)
> 
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 0575a1e..051999e 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -445,24 +445,6 @@ static void quirk_amd_nl_class(struct pci_dev *pdev)
>  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB,
>  		quirk_amd_nl_class);
>  
> -/*
> - * Let's make the southbridge information explicit instead
> - * of having to worry about people probing the ACPI areas,
> - * for example.. (Yes, it happens, and if you read the wrong
> - * ACPI register it will put the machine to sleep with no
> - * way of waking it up again. Bummer).
> - *
> - * ALI M7101: Two IO regions pointed to by words at
> - *	0xE0 (64 bytes of ACPI registers)
> - *	0xE2 (32 bytes of SMB registers)
> - */
> -static void quirk_ali7101_acpi(struct pci_dev *dev)
> -{
> -	quirk_io_region(dev, 0xE0, 64, PCI_BRIDGE_RESOURCES, "ali7101 ACPI");
> -	quirk_io_region(dev, 0xE2, 32, PCI_BRIDGE_RESOURCES+1, "ali7101 SMB");
> -}
> -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL,	PCI_DEVICE_ID_AL_M7101,		quirk_ali7101_acpi);
> -
>  static void piix4_io_quirk(struct pci_dev *dev, const char *name, unsigned int port, unsigned int enable)
>  {
>  	u32 devres;
> -- 
> 1.8.4.5
> 

[toc] | [next] | [standalone]


#1356223

FromYinghai Lu <yinghai@kernel.org>
Date2016-03-11 23:10 +0100
Message-ID<rbDpT-4rR-17@gated-at.bofh.it>
In reply to#1355285
On Thu, Mar 10, 2016 at 9:40 AM, Bjorn Helgaas <helgaas@kernel.org> wrote:
> On Wed, Feb 24, 2016 at 06:11:57PM -0800, Yinghai Lu wrote:
>> Meelis reported that qla2000 driver does not get loaded on one sparc system.
>>
>> schizo f00732d0: PCI host bridge to bus 0001:00
>> pci_bus 0001:00: root bus resource [io  0x7fe01000000-0x7fe01ffffff] (bus address [0x0000-0xffffff])
>> pci 0001:00:06.0: quirk: [io  0x7fe01000800-0x7fe0100083f] claimed by ali7101 ACPI
>> pci 0001:00:06.0: quirk: [io  0x7fe01000600-0x7fe0100061f] claimed by ali7101 SMB
>> pci 0001:00:07.0: can't claim BAR 0 [io  0x7fe01000000-0x7fe0100ffff]: address conflict with 0001:00:06.0 [io  0x7fe01000600-0x7fe0100061f]
>>
>> So the quirk for M7101 claim the io range early.
>>
>> According to spec with M7101 in M1543 page 103/104,
>>       http://www.versalogic.com/Support/Downloads/pdf/ali1543.pdf
>> 0xe0, and 0xe2 do not include address info for acpi/smb.
>>
>> Kill wrong quirk about them.
>
> This needs an explanation for why the quirk was added in the first
> place, and why it is now safe to remove it.

The related commit does not tell much about why it is there exactly.
But it is added the same time with intel piix4.

Maybe Linus could have some hint about that quirk?

commit 34f550135e349102bd065488eabbbb217ab27f0d
Author: Linus Torvalds <torvalds@linuxfoundation.org>
Date:   Fri Nov 23 15:32:20 2007 -0500

    Import 2.3.49pre2

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index cda39a5..8029b19 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -113,6 +113,55 @@ static void __init quirk_s3_64M(struct pci_dev *dev)
        }
 }

+static void __init quirk_io_region(struct pci_dev *dev, unsigned region, unsign
ed size, int nr)
+{
+       region &= ~(size-1);
+       if (region) {
+               struct resource *res = dev->resource + nr;
+
+               res->name = dev->name;
+               res->start = region;
+               res->end = region + size - 1;
+               res->flags = IORESOURCE_IO;
+               pci_claim_resource(dev, nr);
+       }
+}
+
+/*
+ * Let's make the southbridge information explicit instead
+ * of having to worry about people probing the ACPI areas,
+ * for example.. (Yes, it happens, and if you read the wrong
+ * ACPI register it will put the machine to sleep with no
+ * way of waking it up again. Bummer).
+ *
+ * ALI M7101: Two IO regions pointed to by words at
+ *     0xE0 (64 bytes of ACPI registers)
+ *     0xE2 (32 bytes of SMB registers)
+ */
+static void __init quirk_ali7101(struct pci_dev *dev)
+{
+       u16 region;
+
+       pci_read_config_word(dev, 0xE0, &region);
+       quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES);
+       pci_read_config_word(dev, 0xE2, &region);
+       quirk_io_region(dev, region, 32, PCI_BRIDGE_RESOURCES+1);
+}
+
+/*
+ * PIIX4 ACPI: Two IO regions pointed to by longwords at
+ *     0x40 (64 bytes of ACPI registers)
+ *     0x90 (32 bytes of SMB registers)
+ */
+static void __init quirk_piix4acpi(struct pci_dev *dev)
+{
+       u32 region;
+
+       pci_read_config_dword(dev, 0x40, &region);
+       quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES);
+       pci_read_config_dword(dev, 0x90, &region);
+       quirk_io_region(dev, region, 32, PCI_BRIDGE_RESOURCES+1);
+}

 /*
  *  The main table of quirks.
@@ -143,6 +192,8 @@ static struct pci_fixup pci_fixups[] __initdata = {
        { PCI_FIXUP_FINAL,      PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_82443BX_2,  quirk_natoma },
        { PCI_FIXUP_FINAL,      PCI_VENDOR_ID_SI,
PCI_DEVICE_ID_SI_5597,          quirk_nopcipci },
        { PCI_FIXUP_FINAL,      PCI_VENDOR_ID_SI,
PCI_DEVICE_ID_SI_496,           quirk_nopcipci },
+       { PCI_FIXUP_FINAL,      PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_82371AB_3,  quirk_piix4acpi },
+       { PCI_FIXUP_FINAL,      PCI_VENDOR_ID_AL,
PCI_DEVICE_ID_AL_M7101,         quirk_ali7101 },
        { 0 }
 };

[toc] | [prev] | [next] | [standalone]


#1356305

FromLinus Torvalds <torvalds@linux-foundation.org>
Date2016-03-12 02:10 +0100
Message-ID<rbGe5-6xR-1@gated-at.bofh.it>
In reply to#1356223
On Fri, Mar 11, 2016 at 2:08 PM, Yinghai Lu <yinghai@kernel.org> wrote:
>
> Maybe Linus could have some hint about that quirk?
>
> commit 34f550135e349102bd065488eabbbb217ab27f0d
> Author: Linus Torvalds <torvalds@linuxfoundation.org>
> Date:   Fri Nov 23 15:32:20 2007 -0500
>
>     Import 2.3.49pre2

Gah. That's marked as 2007, but that's an import of a much older
change, and 2.3.49 is way back in the last century.

But I looked at the datasheet for the M1543 PMU, and can confirm that
there's nothing at e0/e2 according to that datasheet. The PMU IO bases
show up at 0x10, and the SMB IO base at 0x14 in that doc..

Those kinds of things sometimes change between revisions, and it's
possible that there were versions that had them at that e0/e2 area,
and it got moved to the standard PCI BAR locations later.

I was definitely involved in these things, but my memory just doesn't
go back far enough to haev a clue what is going on. The only one I
remember working on myself was the PIIX4 one.

Removing it based on current datasheets and a failure of a known sparc
setup sounds reasonable.

                Linus

[toc] | [prev] | [next] | [standalone]


#1356363

FromMeelis Roos <mroos@linux.ee>
Date2016-03-12 08:50 +0100
Message-ID<rbMtb-2Fi-3@gated-at.bofh.it>
In reply to#1356223
> On Thu, Mar 10, 2016 at 9:40 AM, Bjorn Helgaas <helgaas@kernel.org> wrote:
> > On Wed, Feb 24, 2016 at 06:11:57PM -0800, Yinghai Lu wrote:
> >> Meelis reported that qla2000 driver does not get loaded on one sparc system.
> >>
> >> schizo f00732d0: PCI host bridge to bus 0001:00
> >> pci_bus 0001:00: root bus resource [io  0x7fe01000000-0x7fe01ffffff] (bus address [0x0000-0xffffff])
> >> pci 0001:00:06.0: quirk: [io  0x7fe01000800-0x7fe0100083f] claimed by ali7101 ACPI
> >> pci 0001:00:06.0: quirk: [io  0x7fe01000600-0x7fe0100061f] claimed by ali7101 SMB
> >> pci 0001:00:07.0: can't claim BAR 0 [io  0x7fe01000000-0x7fe0100ffff]: address conflict with 0001:00:06.0 [io  0x7fe01000600-0x7fe0100061f]
> >>
> >> So the quirk for M7101 claim the io range early.

But why did it work until 4.2 and only with 4.3 the allocations broke?


> >>
> >> According to spec with M7101 in M1543 page 103/104,
> >>       http://www.versalogic.com/Support/Downloads/pdf/ali1543.pdf
> >> 0xe0, and 0xe2 do not include address info for acpi/smb.
> >>
> >> Kill wrong quirk about them.
> >
> > This needs an explanation for why the quirk was added in the first
> > place, and why it is now safe to remove it.
> 
> The related commit does not tell much about why it is there exactly.
> But it is added the same time with intel piix4.
> 
> Maybe Linus could have some hint about that quirk?
> 
> commit 34f550135e349102bd065488eabbbb217ab27f0d
> Author: Linus Torvalds <torvalds@linuxfoundation.org>
> Date:   Fri Nov 23 15:32:20 2007 -0500
> 
>     Import 2.3.49pre2
> 
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index cda39a5..8029b19 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -113,6 +113,55 @@ static void __init quirk_s3_64M(struct pci_dev *dev)
>         }
>  }
> 
> +static void __init quirk_io_region(struct pci_dev *dev, unsigned region, unsign
> ed size, int nr)
> +{
> +       region &= ~(size-1);
> +       if (region) {
> +               struct resource *res = dev->resource + nr;
> +
> +               res->name = dev->name;
> +               res->start = region;
> +               res->end = region + size - 1;
> +               res->flags = IORESOURCE_IO;
> +               pci_claim_resource(dev, nr);
> +       }
> +}
> +
> +/*
> + * Let's make the southbridge information explicit instead
> + * of having to worry about people probing the ACPI areas,
> + * for example.. (Yes, it happens, and if you read the wrong
> + * ACPI register it will put the machine to sleep with no
> + * way of waking it up again. Bummer).
> + *
> + * ALI M7101: Two IO regions pointed to by words at
> + *     0xE0 (64 bytes of ACPI registers)
> + *     0xE2 (32 bytes of SMB registers)
> + */
> +static void __init quirk_ali7101(struct pci_dev *dev)
> +{
> +       u16 region;
> +
> +       pci_read_config_word(dev, 0xE0, &region);
> +       quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES);
> +       pci_read_config_word(dev, 0xE2, &region);
> +       quirk_io_region(dev, region, 32, PCI_BRIDGE_RESOURCES+1);
> +}
> +
> +/*
> + * PIIX4 ACPI: Two IO regions pointed to by longwords at
> + *     0x40 (64 bytes of ACPI registers)
> + *     0x90 (32 bytes of SMB registers)
> + */
> +static void __init quirk_piix4acpi(struct pci_dev *dev)
> +{
> +       u32 region;
> +
> +       pci_read_config_dword(dev, 0x40, &region);
> +       quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES);
> +       pci_read_config_dword(dev, 0x90, &region);
> +       quirk_io_region(dev, region, 32, PCI_BRIDGE_RESOURCES+1);
> +}
> 
>  /*
>   *  The main table of quirks.
> @@ -143,6 +192,8 @@ static struct pci_fixup pci_fixups[] __initdata = {
>         { PCI_FIXUP_FINAL,      PCI_VENDOR_ID_INTEL,
> PCI_DEVICE_ID_INTEL_82443BX_2,  quirk_natoma },
>         { PCI_FIXUP_FINAL,      PCI_VENDOR_ID_SI,
> PCI_DEVICE_ID_SI_5597,          quirk_nopcipci },
>         { PCI_FIXUP_FINAL,      PCI_VENDOR_ID_SI,
> PCI_DEVICE_ID_SI_496,           quirk_nopcipci },
> +       { PCI_FIXUP_FINAL,      PCI_VENDOR_ID_INTEL,
> PCI_DEVICE_ID_INTEL_82371AB_3,  quirk_piix4acpi },
> +       { PCI_FIXUP_FINAL,      PCI_VENDOR_ID_AL,
> PCI_DEVICE_ID_AL_M7101,         quirk_ali7101 },
>         { 0 }
>  };
> 

-- 
Meelis Roos (mroos@linux.ee)

[toc] | [prev] | [next] | [standalone]


#1356373

FromYinghai Lu <yinghai@kernel.org>
Date2016-03-12 09:30 +0100
Message-ID<rbN5T-39u-1@gated-at.bofh.it>
In reply to#1356363
On Fri, Mar 11, 2016 at 11:52 PM, Meelis Roos <mroos@linux.ee> wrote:
>> On Thu, Mar 10, 2016 at 9:40 AM, Bjorn Helgaas <helgaas@kernel.org> wrote:
>> > On Wed, Feb 24, 2016 at 06:11:57PM -0800, Yinghai Lu wrote:
>> >> Meelis reported that qla2000 driver does not get loaded on one sparc system.
>> >>
>> >> schizo f00732d0: PCI host bridge to bus 0001:00
>> >> pci_bus 0001:00: root bus resource [io  0x7fe01000000-0x7fe01ffffff] (bus address [0x0000-0xffffff])
>> >> pci 0001:00:06.0: quirk: [io  0x7fe01000800-0x7fe0100083f] claimed by ali7101 ACPI
>> >> pci 0001:00:06.0: quirk: [io  0x7fe01000600-0x7fe0100061f] claimed by ali7101 SMB
>> >> pci 0001:00:07.0: can't claim BAR 0 [io  0x7fe01000000-0x7fe0100ffff]: address conflict with 0001:00:06.0 [io  0x7fe01000600-0x7fe0100061f]
>> >>
>> >> So the quirk for M7101 claim the io range early.
>
> But why did it work until 4.2 and only with 4.3 the allocations broke?
>

My understanding is we really install the root bus resource and try to
do the sanitary checking
for device resource.

Or did you find exact commit between 4.2 and 4.3 cause the problem ?

Thanks

Yinghai

[toc] | [prev] | [next] | [standalone]


#1356376

FromMeelis Roos <mroos@linux.ee>
Date2016-03-12 09:40 +0100
Message-ID<rbNfz-3dT-1@gated-at.bofh.it>
In reply to#1356373
> On Fri, Mar 11, 2016 at 11:52 PM, Meelis Roos <mroos@linux.ee> wrote:
> >> On Thu, Mar 10, 2016 at 9:40 AM, Bjorn Helgaas <helgaas@kernel.org> wrote:
> >> > On Wed, Feb 24, 2016 at 06:11:57PM -0800, Yinghai Lu wrote:
> >> >> Meelis reported that qla2000 driver does not get loaded on one sparc system.
> >> >>
> >> >> schizo f00732d0: PCI host bridge to bus 0001:00
> >> >> pci_bus 0001:00: root bus resource [io  0x7fe01000000-0x7fe01ffffff] (bus address [0x0000-0xffffff])
> >> >> pci 0001:00:06.0: quirk: [io  0x7fe01000800-0x7fe0100083f] claimed by ali7101 ACPI
> >> >> pci 0001:00:06.0: quirk: [io  0x7fe01000600-0x7fe0100061f] claimed by ali7101 SMB
> >> >> pci 0001:00:07.0: can't claim BAR 0 [io  0x7fe01000000-0x7fe0100ffff]: address conflict with 0001:00:06.0 [io  0x7fe01000600-0x7fe0100061f]
> >> >>
> >> >> So the quirk for M7101 claim the io range early.
> >
> > But why did it work until 4.2 and only with 4.3 the allocations broke?
> >
> 
> My understanding is we really install the root bus resource and try to
> do the sanitary checking
> for device resource.
> 
> Or did you find exact commit between 4.2 and 4.3 cause the problem ?

No, I have not bisected that.

-- 
Meelis Roos (mroos@linux.ee)

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web