From patchwork Thu Jul 11 14:55:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chocron, Jonathan" X-Patchwork-Id: 11040197 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D8D6213A4 for ; Thu, 11 Jul 2019 14:56:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C87D528B15 for ; Thu, 11 Jul 2019 14:56:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BCE1228B18; Thu, 11 Jul 2019 14:56:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58E8928B17 for ; Thu, 11 Jul 2019 14:56:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728836AbfGKO4C (ORCPT ); Thu, 11 Jul 2019 10:56:02 -0400 Received: from smtp-fw-2101.amazon.com ([72.21.196.25]:2466 "EHLO smtp-fw-2101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727612AbfGKO4C (ORCPT ); Thu, 11 Jul 2019 10:56:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1562856961; x=1594392961; h=from:to:cc:message-id:in-reply-to:references: mime-version:subject:resent-from:resent-cc:date: content-transfer-encoding; bh=iXLRftEBw/Jkp/LrWyaQjuv1hqsFph3pECp1WiqwQto=; b=T7etnh+eJh+iNIfYva0qRpMuGbU0x3zx6tJ5RnJN3GR62NElKfAwS1M+ JcpjpqITdnd3m3B6kqVNQR5i9e+1xe9/+DoFb/xWX+YZZ0bGtH6j2skAN juIKsBU0kW5G9nodeeAIibBPXkIhaOYMq95sBaYoK1lul5PZ6QIdPzYuP I=; X-IronPort-AV: E=Sophos;i="5.62,478,1554768000"; d="scan'208";a="741352873" Received: from iad6-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-1d-98acfc19.us-east-1.amazon.com) ([10.124.125.2]) by smtp-border-fw-out-2101.iad2.amazon.com with ESMTP; 11 Jul 2019 14:56:00 +0000 Received: from EX13MTAUWC001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1d-98acfc19.us-east-1.amazon.com (Postfix) with ESMTPS id CDEA1A2170; Thu, 11 Jul 2019 14:55:59 +0000 (UTC) Received: from EX13D20UWC003.ant.amazon.com (10.43.162.18) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 11 Jul 2019 14:55:58 +0000 Received: from EX13MTAUWC001.ant.amazon.com (10.43.162.135) by EX13D20UWC003.ant.amazon.com (10.43.162.18) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 11 Jul 2019 14:55:58 +0000 Received: from u9ff250417f405e.ant.amazon.com (10.107.0.52) by mail-relay.amazon.com (10.43.162.232) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 11 Jul 2019 14:55:57 +0000 Received: from EX13D13UWB004.ant.amazon.com (10.43.161.218) by EX13D13UWA001.ant.amazon.com (10.43.160.136) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Mailbox Transport; Wed, 10 Jul 2019 16:45:38 +0000 Received: from EX13MTAUWB001.ant.amazon.com (10.43.161.207) by EX13D13UWB004.ant.amazon.com (10.43.161.218) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 10 Jul 2019 16:45:38 +0000 Received: from email-inbound-relay-1a-16acd5e0.us-east-1.amazon.com (10.25.10.214) by mail-relay.amazon.com (10.43.161.249) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 10 Jul 2019 16:45:38 +0000 Received: by email-inbound-relay-1a-16acd5e0.us-east-1.amazon.com (Postfix) id B16DFA25D4; Wed, 10 Jul 2019 16:45:37 +0000 (UTC) Received: from u9ff250417f405e.ant.amazon.com (iad7-ws-svc-lb50-vlan2.amazon.com [10.0.93.210]) by email-inbound-relay-1a-16acd5e0.us-east-1.amazon.com (Postfix) with ESMTPS id 0DF16A258C; Wed, 10 Jul 2019 16:45:36 +0000 (UTC) Received: from u9ff250417f405e.ant.amazon.com (localhost [127.0.0.1]) by u9ff250417f405e.ant.amazon.com (8.15.2/8.15.2/Debian-10) with ESMTP id x6AGjWOF021588; Wed, 10 Jul 2019 19:45:32 +0300 Received: (from jonnyc@localhost) by u9ff250417f405e.ant.amazon.com (8.15.2/8.15.2/Submit) id x6AGjVA8021533; Wed, 10 Jul 2019 19:45:31 +0300 From: Jonathan Chocron To: , , , , , CC: , , , , , , , , , , , Message-ID: <20190710164519.17883-4-jonnyc@amazon.com> In-Reply-To: <20190710164519.17883-1-jonnyc@amazon.com> References: <20190710164519.17883-1-jonnyc@amazon.com> MIME-Version: 1.0 Subject: [PATCH 3/8] PCI/VPD: Add VPD release quirk for Amazon Annapurna Labs host bridge Date: Thu, 11 Jul 2019 17:55:56 +0300 X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The Amazon Annapurna Labs pcie host bridge exposes the VPD capability, but there is no actual support for it. The reason for not using the already existing quirk_blacklist_vpd() is that, although this fails pci_vpd_read/write, the 'vpd' sysfs entry still exists. When running lspci -vv, for example, this results in the following error: pcilib: sysfs_read_vpd: read failed: Input/output error This quirk removes the sysfs entry, which avoids the error print. Signed-off-by: Jonathan Chocron --- drivers/pci/vpd.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/pci/vpd.c b/drivers/pci/vpd.c index 4963c2e2bd4c..b594b2895ffe 100644 --- a/drivers/pci/vpd.c +++ b/drivers/pci/vpd.c @@ -644,4 +644,16 @@ static void quirk_chelsio_extend_vpd(struct pci_dev *dev) DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, PCI_ANY_ID, quirk_chelsio_extend_vpd); +static void quirk_al_vpd_release(struct pci_dev *dev) +{ + if (dev->vpd) { + pci_vpd_release(dev); + dev->vpd = NULL; + pci_warn(dev, FW_BUG "Annapurna Labs pcie quirk - Releasing VPD capability (No support for VPD read/write transactions)\n"); + } +} + +DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_AMAZON_ANNAPURNA_LABS, 0x0031, + PCI_CLASS_BRIDGE_PCI, 8, quirk_al_vpd_release); + #endif