From: Bjorn Helgaas <helgaas@kernel.org>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
Russell King - ARM Linux <linux@armlinux.org.uk>,
Realtek linux nic maintainers <nic_swsd@realtek.com>,
David Miller <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH 2/3] ARM: iop32x: improve N2100 PCI broken parity quirk
Date: Tue, 5 Jan 2021 18:28:33 -0600 [thread overview]
Message-ID: <20210106002833.GA1286114@bjorn-Precision-5520> (raw)
In-Reply-To: <d53b6377-ff2a-3bba-612f-d052ffa81d09@gmail.com>
On Tue, Jan 05, 2021 at 10:42:31AM +0100, Heiner Kallweit wrote:
> Simplify the quirk by using new PCI core function
> pci_quirk_broken_parity(). In addition make the quirk
> more specific, use device id 0x8169 instead of PCI_ANY_ID.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
> arch/arm/mach-iop32x/n2100.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/arch/arm/mach-iop32x/n2100.c b/arch/arm/mach-iop32x/n2100.c
> index 78b9a5ee4..24c3eec46 100644
> --- a/arch/arm/mach-iop32x/n2100.c
> +++ b/arch/arm/mach-iop32x/n2100.c
> @@ -122,12 +122,10 @@ static struct hw_pci n2100_pci __initdata = {
> */
> static void n2100_fixup_r8169(struct pci_dev *dev)
> {
> - if (dev->bus->number == 0 &&
> - (dev->devfn == PCI_DEVFN(1, 0) ||
> - dev->devfn == PCI_DEVFN(2, 0)))
> - dev->broken_parity_status = 1;
> + if (machine_is_n2100())
> + pci_quirk_broken_parity(dev);
Whatever "machine_is_n2100()" is (I can't find the definition), it is
surely not equivalent to "00:01.0 || 00:02.0". That change probably
should be a separate patch with some explanation.
If this makes the quirk safe to use in a generic kernel, that sounds
like a good thing.
I guess a parity problem could be the result of a defect in either the
device (e.g., 0x8169), which would be an issue in *all* platforms, or
a platform-specific issue in the way it's wired up. I assume it's the
latter because the quirk is not in drivers/pci/quirks.c.
Why is it safe to restrict this to device ID 0x8169? If this is
platform issue, it might affect any device in the slot.
> }
> -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_REALTEK, PCI_ANY_ID, n2100_fixup_r8169);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_REALTEK, 0x8169, n2100_fixup_r8169);
>
> static int __init n2100_pci_init(void)
> {
> --
> 2.30.0
>
>
next prev parent reply other threads:[~2021-01-06 0:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-05 9:40 [PATCH 0/3] PCI: Disable parity checking if broken_parity is set Heiner Kallweit
2021-01-05 9:41 ` [PATCH 1/3] PCI: Disable parity checking if broken_parity_status " Heiner Kallweit
2021-01-05 10:00 ` Leon Romanovsky
2021-01-05 9:42 ` [PATCH 2/3] ARM: iop32x: improve N2100 PCI broken parity quirk Heiner Kallweit
2021-01-06 0:28 ` Bjorn Helgaas [this message]
2021-01-06 0:44 ` Heiner Kallweit
2021-01-06 0:52 ` Russell King - ARM Linux admin
2021-01-06 0:57 ` Heiner Kallweit
2021-01-06 0:50 ` Russell King - ARM Linux admin
2021-01-05 9:44 ` [PATCH 3/3] r8169: simplify broken parity handling now that PCI core takes care Heiner Kallweit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210106002833.GA1286114@bjorn-Precision-5520 \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=nic_swsd@realtek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox