From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F063C433E0 for ; Wed, 6 Jan 2021 00:47:22 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C082222DD3 for ; Wed, 6 Jan 2021 00:47:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C082222DD3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:Subject: From:References:To:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UIvKEwFZDRKAu2Zstj1z4aCEVr1auvLts8hQawPL4ug=; b=le3cSXbvMWeWZwMDiwr8yvZ3I TM+ubz5flxMFAAJ1MXE1DYLlwSMqkG9ak+jPpc1bTQDtgueYx7OoIoQ7cIISYnYzhulRkMHQde76S h4WOEPSDxI1zHyB6mEQJf2Rn2Xst9RFqlQcJgE05NqaCbH0fFrMEhAaEmhxYwgWXa67xqblYwobrX RuOezXpagZ+1N16bnkuQoBAgM3g2Ln3ciZp9x8FJ+r/fksmL8he4Qm/sIHC+aU5WyCFzpFU9fxXV6 64I/MussvewAbiwyrwBrLP2Ww0GgbXNGtSnTZKbaxjaAFVvvjsAv0SGDG85JXPPXx7pwxqjwKjpI0 nvbqyOebg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwwvv-0005vk-TI; Wed, 06 Jan 2021 00:44:15 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwwvs-0005v2-Vi for linux-arm-kernel@lists.infradead.org; Wed, 06 Jan 2021 00:44:14 +0000 Received: by mail-wm1-x334.google.com with SMTP id g185so1193536wmf.3 for ; Tue, 05 Jan 2021 16:44:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:references:from:subject:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=+aMW43IZhOweNyfQdq3RrsIez7U9DouYQFivMqkSnzQ=; b=AvDD6nNiGb11qb5480K59zSzTDIzPKhKEpnXc9KQu2TzJzl2ELZGRPNHJYmcetbDOi 4pa9VHigYBATlxcYL+m+DE1mAJStRz5oOLTuQIn13SfFRILuIvR2jOjQc87iQV+f3GKe 2ij1LIH8RNuoMC7Ng9xvnmK3F1DvdGPSfQfBrOfSPb2SCvVNwhZbocLHUkAJkNTNwmbu Gclpk+COgBQ60goJbw6DtC4BR5NpympUofbXEAHtC2PhsLnrTc0kUnEQMsL6tMpgrVHy suRXx92QUaRR3fhq856bUKw84KhG29yej5nHbrgit5dqzgVB0gw957ac07F+ZDKlIXH9 bddw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=+aMW43IZhOweNyfQdq3RrsIez7U9DouYQFivMqkSnzQ=; b=GpkJx5f8cT4jcV3M3R7+HfX7z4XSHCzCXGzdExFFadhXgjLk9KQjf+sc93CcOCcOSU ZrhfsTR0Ya6J57aRquoTJEh8QlqEOartQSacJf0NHFXRa8zuRkrRwUqhECSKEDgyuKbf W+oYCojABr1VlIHrrCp/3YVW6kpwH+vBGrIJ30qwjsv6j0LVGvaW+wmfqEY5RwR0Jybr aCU9uUe+sbGb2Pl+x9Wpv/qXE7p6eF2Eqql+ydnLOwvtCydtP3GJv3KhNwn8HZc1EfCC OgTb/7TQR8o1p7jOcLDsaBKaCd8O5j3jCZ+5wFB2BT1HRHRvWCGwHw9FYUuxSqBNbMdo d3zA== X-Gm-Message-State: AOAM532cLOVdZ/uK4oI/kgtNsrF4k3f/uQHP/LElsua6bg4QE4MTOnSl qVa3jXR0vqHdpe+cooxNYcU= X-Google-Smtp-Source: ABdhPJxFXf+WJ0i6zhYIOFZK5nMMsxVY6A7dj9zpWGlfcf6AuyDvqJIyaqZ1YzGXrNKHWzsYbgBPtg== X-Received: by 2002:a7b:c8c5:: with SMTP id f5mr1384772wml.106.1609893851768; Tue, 05 Jan 2021 16:44:11 -0800 (PST) Received: from ?IPv6:2003:ea:8f06:5500:303d:91bf:ac5c:51a1? (p200300ea8f065500303d91bfac5c51a1.dip0.t-ipconnect.de. [2003:ea:8f06:5500:303d:91bf:ac5c:51a1]) by smtp.googlemail.com with ESMTPSA id b7sm884725wrv.47.2021.01.05.16.44.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Jan 2021 16:44:10 -0800 (PST) To: Bjorn Helgaas References: <20210106002833.GA1286114@bjorn-Precision-5520> From: Heiner Kallweit Subject: Re: [PATCH 2/3] ARM: iop32x: improve N2100 PCI broken parity quirk Message-ID: <9d2d3d61-8866-f7d3-09e9-a43b05128689@gmail.com> Date: Wed, 6 Jan 2021 01:44:03 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210106002833.GA1286114@bjorn-Precision-5520> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210105_194413_077616_3C259E44 X-CRM114-Status: GOOD ( 33.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Realtek linux nic maintainers , "linux-pci@vger.kernel.org" , Russell King - ARM Linux , "netdev@vger.kernel.org" , Bjorn Helgaas , Jakub Kicinski , David Miller , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 06.01.2021 01:28, Bjorn Helgaas wrote: > 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 >> --- >> 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. > The machine_is_xxx() checks are dynamically created, see arch/arm/tools/gen-mach-types. Slots 1 and 2 are the two network cards, both are Realtek RTL8169. The quirk (after this patch) applies for Realtek RTL8169 devices only, therefore we don't need the slot checks any longer. Actually the slot checks haven't been needed even before, because only in slots 1 and 2 are Realtek devices. The machine type check is there to protect from (theoretical) cases where the n2100 code (incl. the RTL8169 quirk) may be compiled in, but the kernel is used on another machine. > 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. > I haven't seen any other report about RTL8169 parity problems. Therefore I also think it's platform-specific. > Why is it safe to restrict this to device ID 0x8169? If this is > platform issue, it might affect any device in the slot. > So far the quirk was applied for all Realtek devices. The parity problem is limited to the two RTL8169 network cards, and there are no other Realtek PCI devices in the system. Supposedly PCI_ANY_ID was just used because it was less work than looking for the device id. Functionally it's the same on this system. >> } >> -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 >> >> _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel