From patchwork Tue Feb 2 20:35:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 375859 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=-14.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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=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 06657C433DB for ; Tue, 2 Feb 2021 20:41:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CB70264F61 for ; Tue, 2 Feb 2021 20:41:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232853AbhBBUky (ORCPT ); Tue, 2 Feb 2021 15:40:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232563AbhBBUks (ORCPT ); Tue, 2 Feb 2021 15:40:48 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6B74C061573; Tue, 2 Feb 2021 12:40:06 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id j11so2832921wmi.3; Tue, 02 Feb 2021 12:40:06 -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=VRNaTwygjoG94Shw3fbvKOdrUfqMLPpUXM7Pp/gF9pI=; b=bjjo4p+lNXiQo6YU2auC75u72ORxvMqw5aYLhzxWUTwIOHC9cE0qy+luqjkqQi0K73 L2mxbmU96c7SHhHv4YRbgHLb5bgHT98yXgUGQl3GILOaU9kcm3iRL1wj5ReK2L5IWHvm MT6Zjc+cyXhZcslOP6eQMur+VmCngF2Ui3HhA2aUBd5qkqU7FNMXfmXAnG8JlFI2Mrb/ tp+1fx4mng5CqtTRDVWMNy/nvUMl1XBFJwEILZ8xIGpgOmgRJAyvFf+P+Xos8o4X3M51 jSHm0hY1AQ73tBdib7XzDybpmYXJVjyHkzE6bYfaDkiTB4q+1tgtSxbV6owtu/itrt7z 5U5g== 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=VRNaTwygjoG94Shw3fbvKOdrUfqMLPpUXM7Pp/gF9pI=; b=RmhLGyFG8EPhtqgvp1m4B/S0AZlzk/xnFyB1ZT+0D1qF3LZTVmTMmWsiHpwbCFdNKS Fd0ry8SFT2+Uji/VXjAd7tqOhjOqbz8pZBi8X9gXOFEVzkJHZ1s629oNpQcx79Gy4gZc H/+O6WRweubxtjJeJ0mR6SuhAtv3w5vrNvUSJl9VuM15lwJ9KLRcxcI/zeD31kBbY6zS Wx8k8i2sk0H8d9BXtpP3jXdUB9sOKRO7j5GV1jth90SSQ5rWZtRMKQ9Mfi8gRLc0dNdO ZgJm/2BPnYTjRXxo8ttnzeMH8NBaUt+BMEzFMg4fWiYj89jZ1wynXhPur4nDa+gCIwGJ 8Y3A== X-Gm-Message-State: AOAM533muKILmg/ZEn+uQrVaBajGehvqJq7R0sBmkZXO6ud3QTYqFsX7 6QN9pv7/uBFIELyPQFvp8lR2IIRVCY4= X-Google-Smtp-Source: ABdhPJxR5dT7yR9//xUi7XSoyjsW7rOCWKDZWKA4CByoFhGH+36Z84GlniRFPaeAf56r5T/C2RUN5Q== X-Received: by 2002:a1c:f417:: with SMTP id z23mr5255054wma.29.1612298405165; Tue, 02 Feb 2021 12:40:05 -0800 (PST) Received: from ?IPv6:2003:ea:8f1f:ad00:e887:ce1a:5d1d:a96e? (p200300ea8f1fad00e887ce1a5d1da96e.dip0.t-ipconnect.de. [2003:ea:8f1f:ad00:e887:ce1a:5d1d:a96e]) by smtp.googlemail.com with ESMTPSA id e11sm34110798wrt.35.2021.02.02.12.40.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Feb 2021 12:40:04 -0800 (PST) Subject: [PATCH net-next 1/4] PCI/VPD: Remove Chelsio T3 quirk From: Heiner Kallweit To: Raju Rangoju , Jakub Kicinski , David Miller , Bjorn Helgaas Cc: "linux-pci@vger.kernel.org" , "netdev@vger.kernel.org" References: Message-ID: Date: Tue, 2 Feb 2021 21:35:55 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org cxgb3 driver doesn't use the PCI core code for VPD access, it has its own implementation. Therefore we don't need a quirk for it in the core code. Signed-off-by: Heiner Kallweit --- drivers/pci/vpd.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/pci/vpd.c b/drivers/pci/vpd.c index 7915d10f9..db86fe226 100644 --- a/drivers/pci/vpd.c +++ b/drivers/pci/vpd.c @@ -628,22 +628,17 @@ static void quirk_chelsio_extend_vpd(struct pci_dev *dev) { int chip = (dev->device & 0xf000) >> 12; int func = (dev->device & 0x0f00) >> 8; - int prod = (dev->device & 0x00ff) >> 0; /* - * If this is a T3-based adapter, there's a 1KB VPD area at offset - * 0xc00 which contains the preferred VPD values. If this is a T4 or - * later based adapter, the special VPD is at offset 0x400 for the - * Physical Functions (the SR-IOV Virtual Functions have no VPD - * Capabilities). The PCI VPD Access core routines will normally + * If this is a T4 or later based adapter, the special VPD is at offset + * 0x400 for the Physical Functions (the SR-IOV Virtual Functions have + * no VPD Capabilities). The PCI VPD Access core routines will normally * compute the size of the VPD by parsing the VPD Data Structure at * offset 0x000. This will result in silent failures when attempting * to accesses these other VPD areas which are beyond those computed * limits. */ - if (chip == 0x0 && prod >= 0x20) - pci_set_vpd_size(dev, 8192); - else if (chip >= 0x4 && func < 0x8) + if (chip >= 0x4 && func < 0x8) pci_set_vpd_size(dev, 2048); } From patchwork Tue Feb 2 20:37:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 375858 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=-14.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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=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 A8693C433E6 for ; Tue, 2 Feb 2021 20:41:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 77C6964E46 for ; Tue, 2 Feb 2021 20:41:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233023AbhBBUk6 (ORCPT ); Tue, 2 Feb 2021 15:40:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232223AbhBBUku (ORCPT ); Tue, 2 Feb 2021 15:40:50 -0500 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5642BC06174A; Tue, 2 Feb 2021 12:40:10 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id f16so3639407wmq.5; Tue, 02 Feb 2021 12:40:10 -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=qbvG1/4AK/H5qBhZoBN+xgCAiYBIeTeEr9eZF1c6zWg=; b=YV/cKDH4aEhl1g3iXkwK5cZuBr+bQ5s+IWFv6/g0n9+E5/28BimmXFisB4ooh4wzN2 Ae5eFqhgX9NO8vZDv4x5Vf/xn5GhtwteCbG9yWrWfgQ8HWUtrfxXQVpzhKqkSPOtyU7n Tg60WjY239bNTjcrhuWBFglphDKJAHGWbhw/tdH6ZZadCj2wNEvsNWIGmesX85Nt2U8Z SPvkoYFbD+e1/r90qvm7HT14jRWmxjmry1sHwhn8KjwMlxAg3uHHwLZps8XS72KnJknP NKoUfyLg9+hNnxfRBUn9PXENn8G/q5dOxWpbwM3cnbgWLx8klAW3KYIIVGd7q1TFTWak hIYQ== 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=qbvG1/4AK/H5qBhZoBN+xgCAiYBIeTeEr9eZF1c6zWg=; b=bgXcaAVwRQ2IkooK+/auX+AeW8E1zDFpmjP4/018OdAOHr4KWqP/Jb3gxDYoZwUBKt g0RjnyGvT7Zt9p8yOG/Jn3FYCBJGubSsnNFIf5Ii8ofCw6ioI3a6dIT9jXXYhAmT56FL hdkE+eqZlfrwnJAvAah796r5UUtXmSkdgWVwSOqM8jr849UlDw95vod6sdwOpgNwkO4I OvoBXsPvSoyQ6hLIgBij+vUZpOAw6dQkiFBTzpzL6ddUqKBt8O5DEr3SjuBRZEY4MT8A Ns/0gHOc+G8t9Ex244D0rx4hXxHIEeEQ0ovKD60OIjDPnJJ26WtuTginY9RiVcd7gFg2 hjXA== X-Gm-Message-State: AOAM530jvx9BE1/tFwhpjFC1haPaFrkW7zqNCI+8A5evoM7ipEloTxMn RR/UwEjPFntUcztrGAx4WDG2/6LWfWg= X-Google-Smtp-Source: ABdhPJyvWJYIp3jVW12fLvgFwZ7xaSWFVX3MmrIK4+jPc2QmMabau6IvZCs3aPi0b2iWQgV+gd2YKg== X-Received: by 2002:a1c:40d4:: with SMTP id n203mr5188782wma.46.1612298408872; Tue, 02 Feb 2021 12:40:08 -0800 (PST) Received: from ?IPv6:2003:ea:8f1f:ad00:e887:ce1a:5d1d:a96e? (p200300ea8f1fad00e887ce1a5d1da96e.dip0.t-ipconnect.de. [2003:ea:8f1f:ad00:e887:ce1a:5d1d:a96e]) by smtp.googlemail.com with ESMTPSA id m24sm3809900wmi.24.2021.02.02.12.40.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Feb 2021 12:40:08 -0800 (PST) Subject: [PATCH net-next 2/4] cxgb4: remove unused vpd_cap_addr From: Heiner Kallweit To: Raju Rangoju , Jakub Kicinski , David Miller , Bjorn Helgaas Cc: "linux-pci@vger.kernel.org" , "netdev@vger.kernel.org" References: Message-ID: <19159db1-abe9-d265-c4f7-7e8db75ee5e5@gmail.com> Date: Tue, 2 Feb 2021 21:37:35 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Presumably this is a leftover from T3 driver heritage. cxgb4 uses the PCI core VPD access code that handles detection of VPD capabilities. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 1 - drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h index 8e681ce72..314f8d806 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h @@ -414,7 +414,6 @@ struct pf_resources { }; struct pci_params { - unsigned int vpd_cap_addr; unsigned char speed; unsigned char width; }; diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index 9f1965c80..6264bc66a 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c @@ -3201,8 +3201,6 @@ static void cxgb4_mgmt_fill_vf_station_mac_addr(struct adapter *adap) int err; u8 *na; - adap->params.pci.vpd_cap_addr = pci_find_capability(adap->pdev, - PCI_CAP_ID_VPD); err = t4_get_raw_vpd_params(adap, &adap->params.vpd); if (err) return; From patchwork Tue Feb 2 20:38:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 374988 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=-14.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 D6CBFC4332B for ; Tue, 2 Feb 2021 20:41:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AE99064E46 for ; Tue, 2 Feb 2021 20:41:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233436AbhBBUlK (ORCPT ); Tue, 2 Feb 2021 15:41:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232860AbhBBUky (ORCPT ); Tue, 2 Feb 2021 15:40:54 -0500 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF08FC0613D6; Tue, 2 Feb 2021 12:40:13 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id l12so21881744wry.2; Tue, 02 Feb 2021 12:40:13 -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=ORPezsdgKuM/UizLE6LMgwfCKfuf7GSRSsDWm72yA2k=; b=XXjimafFVrRwYXC3f4KzfMEMIgZK+AgRXNUhzTmlFs/9Rwf9hMktTDmyx0Of3R4Rhw B0fsFZqZ13gFc+umECAm4WtaLkFZRg3IvzbGq075P3wuaCAE5/8XWs1orrkBI8+WPNBN BvWTv4s6Cwf+l72RlHC74vy2ghmgijRPRpueDn3JVELfUyw74kn0HDXl9icacL1OUSfA JtV59ph8bxnzX0Ipf7X4tT8BnyqrjefbupLw0RCMbCwISJCs4V7QDR9FW5XYnQ44p5/E lh/NkNdP7zKuSEeP32Q/t+H0cZy5ZQnzOdH66oy98JSiQhkwmEJj71KDoHFab+Tjf8XY 4tNA== 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=ORPezsdgKuM/UizLE6LMgwfCKfuf7GSRSsDWm72yA2k=; b=jocRlfnGqPFhHT8YAtd00bY1cJ1HRsxAiP1DhJauBlr4H/Wc7MelDv4W2qThdPJYjH 6zsj42pd/738LfOQyOVQvrMhFLEnKhgJWEj6coubIC69qobyFDfD0GgvKxzMM1BVb2Bi FHCjqzADYS6QNcvAowjRgY/n2PoAkQfX3l2xgv0nw4Rr5EUrxWjZKVJDfPJYkgaZjbYj 6pdd/bcE7MGE5ee5dQ4wpLnFd5VNgN1ON0lYKgXGqhtToyB9FKgs0uf8RbnFvziq5adP 9SqBvYPSOI13DM5ZePY0mMEV+MAmz0vDKvDJbY3e1Zo45zUx7EZAyrxZH5n6u4O+JZj9 cGSA== X-Gm-Message-State: AOAM532cbMiVfL2UoEcOIo2anp3hcvrk+lHgzssTrjkZZfSOY5y9L4sY ahmHPaMITlgHPY3K6qaKQh3ETuduEso= X-Google-Smtp-Source: ABdhPJxp9DC7uhjPrkUTMD6bKCFlKP7wDtWxA5rjqx4JSXwKU54DXdkpkMG7K/iedVAxe4/B/ZDDuw== X-Received: by 2002:a5d:6912:: with SMTP id t18mr25891517wru.268.1612298412322; Tue, 02 Feb 2021 12:40:12 -0800 (PST) Received: from ?IPv6:2003:ea:8f1f:ad00:e887:ce1a:5d1d:a96e? (p200300ea8f1fad00e887ce1a5d1da96e.dip0.t-ipconnect.de. [2003:ea:8f1f:ad00:e887:ce1a:5d1d:a96e]) by smtp.googlemail.com with ESMTPSA id i59sm36440916wri.3.2021.02.02.12.40.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Feb 2021 12:40:11 -0800 (PST) Subject: [PATCH net-next 3/4] PCI/VPD: Change Chelsio T4 quirk to provide access to full virtual EEPROM address space From: Heiner Kallweit To: Raju Rangoju , Jakub Kicinski , David Miller , Bjorn Helgaas Cc: "linux-pci@vger.kernel.org" , "netdev@vger.kernel.org" References: Message-ID: <3db0112d-8767-fd9a-4e65-ad97a284a866@gmail.com> Date: Tue, 2 Feb 2021 21:38:41 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org cxgb4 uses the full VPD address space for accessing its EEPROM (with some mapping, see t4_eeprom_ptov()). In cudbg_collect_vpd_data() it sets the VPD len to 32K (PCI_VPD_MAX_SIZE), and then back to 2K (CUDBG_VPD_PF_SIZE). Having official (structured) and unofficial (unstructured) VPD data violates the PCI spec, let's set VPD len according to all data that can be accessed via PCI VPD access, no matter of its structure. Signed-off-by: Heiner Kallweit --- drivers/pci/vpd.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/pci/vpd.c b/drivers/pci/vpd.c index db86fe226..90f17f3b7 100644 --- a/drivers/pci/vpd.c +++ b/drivers/pci/vpd.c @@ -630,16 +630,11 @@ static void quirk_chelsio_extend_vpd(struct pci_dev *dev) int func = (dev->device & 0x0f00) >> 8; /* - * If this is a T4 or later based adapter, the special VPD is at offset - * 0x400 for the Physical Functions (the SR-IOV Virtual Functions have - * no VPD Capabilities). The PCI VPD Access core routines will normally - * compute the size of the VPD by parsing the VPD Data Structure at - * offset 0x000. This will result in silent failures when attempting - * to accesses these other VPD areas which are beyond those computed - * limits. + * If this is a T4 or later based adapter, provide access to the full + * virtual EEPROM address space. */ if (chip >= 0x4 && func < 0x8) - pci_set_vpd_size(dev, 2048); + pci_set_vpd_size(dev, PCI_VPD_MAX_SIZE); } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, PCI_ANY_ID, From patchwork Tue Feb 2 20:39:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 374987 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=-14.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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=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 C29A1C433E0 for ; Tue, 2 Feb 2021 20:41:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 94DDB64E46 for ; Tue, 2 Feb 2021 20:41:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233545AbhBBUlN (ORCPT ); Tue, 2 Feb 2021 15:41:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229870AbhBBUk5 (ORCPT ); Tue, 2 Feb 2021 15:40:57 -0500 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C5E2C0613ED; Tue, 2 Feb 2021 12:40:17 -0800 (PST) Received: by mail-wr1-x434.google.com with SMTP id a1so21883273wrq.6; Tue, 02 Feb 2021 12:40:17 -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=8aD1EJG8L7ZfKvZv8OiIzpjC2zKu/VqFxWL5/5e+V9I=; b=bxgbywt2px9FMutCT/DXUGOHsLcZXBC6lt0jqfjA+B913sjTfaubJKA3G8R6f+hxRB XtK8Bj94n1G/o6MBSIWy2KZLPZlzx0lIl8FqSVe5Pw6uPbFeu7js0G9oEzn8tUJQQ7Mf t+AhftgDo2d9dxdizZI3KnP+n+v2o0F0UoAFkRzcM8Ir315X28upx3qwXlCja8oCL52J ocfDk8dtYPiQCyPf7/eQVPuH03nSJ/oJjpHJaUtJeGXVhfsEzU5goRIjeM0kcN0aTajS PM9GuLL5eJ9MZm+8rmytH4tJQSDpDp7WFWElpLcs7nFOqaTY2QTS1Q1rwUFIXbODZZtb x6yw== 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=8aD1EJG8L7ZfKvZv8OiIzpjC2zKu/VqFxWL5/5e+V9I=; b=fKvVKWYnRx1tFbrfXiksNl3tja8CxmIuU1kPoJbV5shwCwPZY3SSpiXROatA1DQ+M1 km97+mUjSx8JCXlr7zRn15NPgcnJBlMnsogJSj6+aBt4ro0ZoSHF9JNM178xYNaFYkoo LwS95KIpHuaA5SurGoXzW7pPjKPeCQnd7kL26KaCCnJMmVjcTSvjHVFNoNLVb1RydYpM 9nqWagUAzJ2TQ114Bt9C6U8eajC+00+7qt3CGF9KGi4MLnhwAXRwKP58OCeuRhKuKlj9 fWBwXwutg2/fs99NKxgIdDG7q6MD+uq+9BDxKhanLWNw59fnjBBwiG+S2CxdL+P/O+jn Khsg== X-Gm-Message-State: AOAM532YW1XlEdBMNnP28pO2oLmllEK6KjCMzgBKXTOoj6ht4nZw6fXB ErwXFkXE+2eogcfbnIHCZDR8dIRo6x0= X-Google-Smtp-Source: ABdhPJzXtHa597iQ6dnvhfTsRevLvGslOeT8z+bak4GYZifWLH4IGEhMwCyG2b3tHGxMxTaVgaiM/A== X-Received: by 2002:a5d:6a85:: with SMTP id s5mr24599752wru.283.1612298415734; Tue, 02 Feb 2021 12:40:15 -0800 (PST) Received: from ?IPv6:2003:ea:8f1f:ad00:e887:ce1a:5d1d:a96e? (p200300ea8f1fad00e887ce1a5d1da96e.dip0.t-ipconnect.de. [2003:ea:8f1f:ad00:e887:ce1a:5d1d:a96e]) by smtp.googlemail.com with ESMTPSA id r15sm33885094wrj.61.2021.02.02.12.40.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Feb 2021 12:40:15 -0800 (PST) Subject: [PATCH net-next 4/4] cxgb4: remove changing VPD len From: Heiner Kallweit To: Raju Rangoju , Jakub Kicinski , David Miller , Bjorn Helgaas Cc: "linux-pci@vger.kernel.org" , "netdev@vger.kernel.org" References: Message-ID: <0a7ac2c0-8a63-f31c-9fbd-381a8fc59d18@gmail.com> Date: Tue, 2 Feb 2021 21:39:58 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Now that the PCI VPD for Chelsio devices from T4 on has been changed and VPD len is set to PCI_VPD_MAX_SIZE (32K), we don't have to change the VPD len any longer. Signed-off-by: Heiner Kallweit --- .../net/ethernet/chelsio/cxgb4/cudbg_entity.h | 1 - .../net/ethernet/chelsio/cxgb4/cudbg_lib.c | 21 ++++--------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h b/drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h index 876f90e57..02ccb610a 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h +++ b/drivers/net/ethernet/chelsio/cxgb4/cudbg_entity.h @@ -220,7 +220,6 @@ struct cudbg_mps_tcam { u8 reserved[2]; }; -#define CUDBG_VPD_PF_SIZE 0x800 #define CUDBG_SCFG_VER_ADDR 0x06 #define CUDBG_SCFG_VER_LEN 4 #define CUDBG_VPD_VER_ADDR 0x18c7 diff --git a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c index 75474f810..addac5518 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c @@ -2689,7 +2689,7 @@ int cudbg_collect_vpd_data(struct cudbg_init *pdbg_init, u32 scfg_vers, vpd_vers, fw_vers; struct cudbg_vpd_data *vpd_data; struct vpd_params vpd = { 0 }; - int rc, ret; + int rc; rc = t4_get_raw_vpd_params(padap, &vpd); if (rc) @@ -2699,24 +2699,11 @@ int cudbg_collect_vpd_data(struct cudbg_init *pdbg_init, if (rc) return rc; - /* Serial Configuration Version is located beyond the PF's vpd size. - * Temporarily give access to entire EEPROM to get it. - */ - rc = pci_set_vpd_size(padap->pdev, EEPROMVSIZE); - if (rc < 0) - return rc; - - ret = cudbg_read_vpd_reg(padap, CUDBG_SCFG_VER_ADDR, CUDBG_SCFG_VER_LEN, - &scfg_vers); - - /* Restore back to original PF's vpd size */ - rc = pci_set_vpd_size(padap->pdev, CUDBG_VPD_PF_SIZE); - if (rc < 0) + rc = cudbg_read_vpd_reg(padap, CUDBG_SCFG_VER_ADDR, CUDBG_SCFG_VER_LEN, + &scfg_vers); + if (rc) return rc; - if (ret) - return ret; - rc = cudbg_read_vpd_reg(padap, CUDBG_VPD_VER_ADDR, CUDBG_VPD_VER_LEN, vpd_str); if (rc)