Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1172966ybl; Wed, 21 Aug 2019 11:11:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVzkxos2jULNEsGHkhU6LTTPwAfQ7GK/Ck6f2UnQUaJI4jW10HrdncplS359LXjndaXRnD X-Received: by 2002:a17:902:a50a:: with SMTP id s10mr24014304plq.108.1566411109467; Wed, 21 Aug 2019 11:11:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566411109; cv=none; d=google.com; s=arc-20160816; b=iuyXUPetWzWcxRqQg2DApvHkXcYufUVGSAGr0LWJRVJdcn1yd0oJKIjTKvAIUsY+pE pzvRPe16CDc0s8Z+7b6OpeSajjGWRk5Eb85ec8q6Vu17Q1jInwrZLaw3x9o49BVxIM1P VnJMtoQPRNjALqDziVw5hGZU8m9maKunzUjk/EFuhXvqVJ2YPpRWQQeiZOsoTp35Mi9G RD2oFGwPx9UuwcaUpVtizUaK+XnVHrF1oGXJDDhGKzHlLAhC0J3VtNV+betwuIFWzskI ChSmp/TGRjmaf+QNR6PulU3m2OGLgp1qy+X+lsbb6YLApLJ4GrFDG2X4zUUXWBqFqypN DLzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=yPw/cZErk19SmOK/njpJRQGVQoT+U5XdF/Qgj3DD9Ng=; b=Cmp1SDR1JNMiMmICH7OekZLj4hc19lLcMBMZtrv6fDayaVyU+bnRhkNfcrCTuahZmM c1p3jQ9P41NnsMry2XDrRYnbwu36T+H8de+ErcmMEiQoP4xX1uGNZKB+OIcnzMhrkr0Y jaYWWTIXe+lZbePJqztqr3TjCTZhxwJcdfnBsHhlcogeu+4IJHSLfBrhwS00a3lGdABu A0hLOHAv+IDx/IS/GMuH49NggLepCKIDU3TSQ46VWKGJJAOYmgyguLWnFgpaToatfCwU +My47Rpja2g6RpIuICknrgYJc/r/wIOHv91ENHATuR3qm/Su08M3+CxsSuMxeAH5l/Uw XO/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=T8VaTM7E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l67si10053326plb.336.2019.08.21.11.11.33; Wed, 21 Aug 2019 11:11:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=T8VaTM7E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730017AbfHUPg3 (ORCPT + 99 others); Wed, 21 Aug 2019 11:36:29 -0400 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]:6724 "EHLO smtp-fw-33001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730002AbfHUPg1 (ORCPT ); Wed, 21 Aug 2019 11:36:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1566401787; x=1597937787; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=yPw/cZErk19SmOK/njpJRQGVQoT+U5XdF/Qgj3DD9Ng=; b=T8VaTM7ECgAGDj6A8BiqPsq7XG22eBpKOsoPZmNpM/10+tQLj+bqR5MR VFj53SFMzLcBypd3VDife5DnSIYVJXae6Wr5KziqWoiSLby9MaFHLZ9mt zYZVS4HrEm9PcZk5xAiA5umWJ4MgHqymTEA2E09Mnqlb/tbE0HAZUufHo 8=; X-IronPort-AV: E=Sophos;i="5.64,412,1559520000"; d="scan'208";a="822276236" Received: from sea3-co-svc-lb6-vlan2.sea.amazon.com (HELO email-inbound-relay-2a-d0be17ee.us-west-2.amazon.com) ([10.47.22.34]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP; 21 Aug 2019 15:36:26 +0000 Received: from EX13MTAUWA001.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan3.pdx.amazon.com [10.170.41.166]) by email-inbound-relay-2a-d0be17ee.us-west-2.amazon.com (Postfix) with ESMTPS id DCF84A28F4; Wed, 21 Aug 2019 15:36:25 +0000 (UTC) Received: from EX13D13UWA001.ant.amazon.com (10.43.160.136) by EX13MTAUWA001.ant.amazon.com (10.43.160.118) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 21 Aug 2019 15:36:25 +0000 Received: from u9ff250417f405e.ant.amazon.com (10.43.160.100) by EX13D13UWA001.ant.amazon.com (10.43.160.136) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 21 Aug 2019 15:36:19 +0000 From: Jonathan Chocron To: , , , , , CC: , , , , , , , , , , , , Subject: [PATCH v4 3/7] PCI/VPD: Add VPD release quirk for Amazon's Annapurna Labs Root Port Date: Wed, 21 Aug 2019 18:35:43 +0300 Message-ID: <20190821153545.17635-4-jonnyc@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190821153545.17635-1-jonnyc@amazon.com> References: <20190821153545.17635-1-jonnyc@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.160.100] X-ClientProxiedBy: EX13D18UWC004.ant.amazon.com (10.43.162.77) To EX13D13UWA001.ant.amazon.com (10.43.160.136) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Amazon Annapurna Labs PCIe Root Port 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 Reviewed-by: Gustavo Pimentel --- drivers/pci/vpd.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/pci/vpd.c b/drivers/pci/vpd.c index 4963c2e2bd4c..c23a8ec08db9 100644 --- a/drivers/pci/vpd.c +++ b/drivers/pci/vpd.c @@ -644,4 +644,20 @@ 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 "Releasing VPD capability (No support for VPD read/write transactions)\n"); + } +} + +/* + * The 0031 device id is reused for other non Root Port device types, + * therefore the quirk is registered for the PCI_CLASS_BRIDGE_PCI class. + */ +DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_AMAZON_ANNAPURNA_LABS, 0x0031, + PCI_CLASS_BRIDGE_PCI, 8, quirk_al_vpd_release); + #endif -- 2.17.1