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: 1130835 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amazon.com header.i=@amazon.com header.b="T7etnh+e"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 45kzdb539wz9s4Y for ; Fri, 12 Jul 2019 00:56:03 +1000 (AEST) 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 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