From patchwork Wed Aug 28 19:27:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 2850952 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 089A39F485 for ; Wed, 28 Aug 2013 19:27:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1D32B2044A for ; Wed, 28 Aug 2013 19:27:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2AA73203FD for ; Wed, 28 Aug 2013 19:27:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754122Ab3H1T1M (ORCPT ); Wed, 28 Aug 2013 15:27:12 -0400 Received: from mail-yh0-f54.google.com ([209.85.213.54]:51323 "EHLO mail-yh0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753092Ab3H1T1M (ORCPT ); Wed, 28 Aug 2013 15:27:12 -0400 Received: by mail-yh0-f54.google.com with SMTP id b20so801701yha.27 for ; Wed, 28 Aug 2013 12:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=zOOWs08aA3BSrzPMOT76cffcI3n36+rPHpVtqzJduqc=; b=QzfyF3oqzaDIlT2JZ8iHNEzGFfvy8PJ0ZU2D7rUmp8YpLn0zPbzdHIPEN8vObljRLz gOkTEO8zWmIdrRjra6zBorQMeK0Kzi0yM7uxIuMwcC+cZqdcoVt4x/Ua8Y3my1PT/5rY RHV4ruOihNDtfH/rIcqzV1rSF5UUvZ/umalpdzswnVJ0z4BljcSjrYg8C+6Db0gWfeDt buyjFrGwq5x9Pjfrw/SamEldjl86W8FcaMYHSwD5wh0upvuFxWxsznWxNNTh/keCP+4z inZ/N2S9Du8eTZPplBnIIrEIWFo5ak1g9OIHBVpNOgBYwke4qa2QZw8xlzgZu08GVyL4 JXQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=zOOWs08aA3BSrzPMOT76cffcI3n36+rPHpVtqzJduqc=; b=K1WULbN+dGAniU72uLLUdD7tca7svDxQ+SAxOL+rcWCsMDreCVEOTcooq3hGotD+mQ lnigyy3egb/TOl9joIgGIilIVU3A96bSU9gACRNfwMM5TcoAgXA5JZ9jIksBmUeFwZTi u1jN8WolBsCY9Qqp0nezOU2GdN1HT7Jn3FVYjDPgo+3EGVUdU4o+fwRtJFFeqtgjVudO Vm+G++ZZw0EBF0ST0oVBM/rqzp0gjuaHfWaXIpqLwkbLETjBmcF2dQcecQsHw5DWAssl 9mBUYADa1EkyfesMi+mu1cnEzNCku0ny82Xf53KcsAzq5hISsp77XweeSBkkiqVJ4M1I bOPA== X-Gm-Message-State: ALoCoQk6mgWTvAadyzxZHOsGhglkIBwQhWky+wcIR3I1RENgfmCqtM4vLAVbk3MXWT02esT7BUH+yEQQkg2yPY8L0Tla7IdDsZ4FVWAzgEmWH4ZMm8ldEb+1jmUMbRoK+AVfCYUQVnhbD6xuqdK/JQM3K6I3ZYf6KmZV0FOn94X+feT/X5T5RP9UPTvjpbJ7mG9P16LGx1RX57dkGaR8PjJaEqwLQYP1xsxwRkZN3S78uLWb/E+QgLQ= X-Received: by 10.236.163.228 with SMTP id a64mr26543223yhl.35.1377718030824; Wed, 28 Aug 2013 12:27:10 -0700 (PDT) Received: from localhost ([172.16.52.7]) by mx.google.com with ESMTPSA id v22sm33516378yhn.12.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 28 Aug 2013 12:27:10 -0700 (PDT) Subject: [PATCH 2/4] PCI: Remove PCIe Capability version checks To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: Yuval Mintz , Jacob Keller , Jiang Liu , Jiang Liu Date: Wed, 28 Aug 2013 13:27:08 -0600 Message-ID: <20130828192708.5895.51049.stgit@bhelgaas-glaptop> In-Reply-To: <20130828192627.5895.26558.stgit@bhelgaas-glaptop> References: <20130828192627.5895.26558.stgit@bhelgaas-glaptop> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Previously we relied on the PCIe r3.0, sec 7.8, spec language that says "For Functions that do not implement the [Link, Slot, Root] registers, these spaces must be hardwired to 0b," which means that for v2 PCIe capabilities, we don't need to check the device type at all. But it's simpler if we don't need to check the capability version at all, and I think the spec is explicit enough about which registers are required for which types that we can remove the version checks. Signed-off-by: Bjorn Helgaas --- drivers/pci/access.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/access.c b/drivers/pci/access.c index e26c3bd..9a46fa9 100644 --- a/drivers/pci/access.c +++ b/drivers/pci/access.c @@ -484,8 +484,7 @@ static inline bool pcie_cap_has_lnkctl(const struct pci_dev *dev) { int type = pci_pcie_type(dev); - return pcie_cap_version(dev) > 1 || - type == PCI_EXP_TYPE_ENDPOINT || + return type == PCI_EXP_TYPE_ENDPOINT || type == PCI_EXP_TYPE_LEG_END || type == PCI_EXP_TYPE_ROOT_PORT || type == PCI_EXP_TYPE_UPSTREAM || @@ -498,8 +497,7 @@ static inline bool pcie_cap_has_sltctl(const struct pci_dev *dev) { int type = pci_pcie_type(dev); - return pcie_cap_version(dev) > 1 || - type == PCI_EXP_TYPE_ROOT_PORT || + return type == PCI_EXP_TYPE_ROOT_PORT || (type == PCI_EXP_TYPE_DOWNSTREAM && pcie_caps_reg(dev) & PCI_EXP_FLAGS_SLOT); } @@ -508,8 +506,7 @@ static inline bool pcie_cap_has_rtctl(const struct pci_dev *dev) { int type = pci_pcie_type(dev); - return pcie_cap_version(dev) > 1 || - type == PCI_EXP_TYPE_ROOT_PORT || + return type == PCI_EXP_TYPE_ROOT_PORT || type == PCI_EXP_TYPE_RC_EC; }