From patchwork Tue Jan 5 09:42:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 11998481 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.2 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,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 BFA5FC433E6 for ; Tue, 5 Jan 2021 09:45:41 +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 65856229C7 for ; Tue, 5 Jan 2021 09:45:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 65856229C7 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:References: To:From:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=eJNkgAiUCjhzrcZDFxYLr8BVuF4vt9eEzNtoYOhEhtY=; b=cWaQg/W6WxhhT8Xs8sL3fzQwl ngc5JnY9k/cgI6GnlufQFBuVRya50v3zGOmYfytfRic3lSq9ooap7aU6VyUY9StjDDryGomTRdRCR JM5goEPi7IAqRfxWcaJEjTc7rUo2MBjo8GlZhcSTII8BXybFQzp82k1Vrma9PUovglEYZYIxNImt5 PbMPWhn+uSB/rzzwSF77bp5G/nBzu0NM08uS5wF+eFGuf/xjQhEZaBDcfJapQc48nFnLZqV4AXtAi 0bl1y/O5bk5WIFwvs41LmS1kB8UPn2xiQswdlTxBi9MK8vpBRZNDiEsoB7kczM5wjQxyHADv+WViG fFl1Kc2ew==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwisu-000277-Go; Tue, 05 Jan 2021 09:44:12 +0000 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwisr-00025r-1j for linux-arm-kernel@lists.infradead.org; Tue, 05 Jan 2021 09:44:09 +0000 Received: by mail-ed1-x52a.google.com with SMTP id j16so30385377edr.0 for ; Tue, 05 Jan 2021 01:44:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=XmXaHO6XtlhHHB5hr+caHztCDCfS/3Yl6IO2xbPe16k=; b=gfbZAVluaUqAozdn9jK6zB3yBcuBHNf9CLjz8QKiIYMnz8pEGY+0EylU2s12/mZULU ZAcU1oz+XARDrvcRCl0amZP+GPZV2buPTWzMrgUu3UsrDtwCL3ACyGLKdu3Gz1ByvcA3 nc6E7IQhwmkGPNEK5OiTnOzMXiXj1N4IyMlorzj1X2kg7vG0anr+eCrRVxX5ZxYIPdiV HjQUYDT3RyNMZm/gtcy8XkWe69eZQ++EI7o/g9RIKaidM2OJ4JoZizJIZWrvd1zdBCYe n4Br++yELMy6Mq6TrDWLOoNQsOLh/3VYOh49CrYf64KQa/F3DC//s27wqCsqbtu9ryne mu8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=XmXaHO6XtlhHHB5hr+caHztCDCfS/3Yl6IO2xbPe16k=; b=VcIqeNzk0j//XlHH3wXb0aL/AI4PswiXQiDdIKbVmG8skDH8pgdTR3KImUdadxAIRu MGnpGnx77ZAOsdDh92qndlv01Uy/pXokkdFSfZ0yP4+lbbiAImBsCoeQAD0YVXRR0akT bkNgi7D+H2WYFbdpWsMXtgi3ZDMbW0Uz3giLXTTOvkt0z2M2rNZgLQMIiE/Yx11/RP9l fnG3kTlNWuH2h+uhwQqUzVO19DxlkAPcX7ZiW040gFfq5V/90+YNyLLpjPZklfOWNsQu d3ZHbUrroPncIKE62KiVDNIMVlm9kdpMiBsfC27/GJEF01azMM9WH31LCV9o0I42DiW8 Q1jA== X-Gm-Message-State: AOAM5337KCZEfzHWBAwdWxNJFRS+X9Ueo8FUanynD9KTj10ZvZ3pGq3S 1wQOWLU3KSpGiIIVq61Bak0= X-Google-Smtp-Source: ABdhPJwRYM03xT7yONzoDkBZsabwRjqq8Mork0bii5H2CPRKf8zDK8nIEhGoIt4NVJNNRwLlIt0DwA== X-Received: by 2002:aa7:c444:: with SMTP id n4mr73120970edr.226.1609839847685; Tue, 05 Jan 2021 01:44:07 -0800 (PST) Received: from ?IPv6:2003:ea:8f06:5500:5ee:6bfd:b6c9:8fa1? (p200300ea8f06550005ee6bfdb6c98fa1.dip0.t-ipconnect.de. [2003:ea:8f06:5500:5ee:6bfd:b6c9:8fa1]) by smtp.googlemail.com with ESMTPSA id e25sm22382832edq.24.2021.01.05.01.44.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Jan 2021 01:44:07 -0800 (PST) Subject: [PATCH 2/3] ARM: iop32x: improve N2100 PCI broken parity quirk From: Heiner Kallweit To: Bjorn Helgaas , Russell King - ARM Linux , Realtek linux nic maintainers , David Miller , Jakub Kicinski References: Message-ID: Date: Tue, 5 Jan 2021 10:42:31 +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: Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210105_044409_111156_156F2ED7 X-CRM114-Status: GOOD ( 15.92 ) 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: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "netdev@vger.kernel.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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); } -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) {