From patchwork Wed Aug 23 04:56:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 9916555 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BBE5260327 for ; Wed, 23 Aug 2017 04:56:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACC0028864 for ; Wed, 23 Aug 2017 04:56:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A118028953; Wed, 23 Aug 2017 04:56:46 +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=-2.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2360928864 for ; Wed, 23 Aug 2017 04:56:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=KMfvYfO4d8zG9Ki/LgSd1zInDxDwyDBQic708JFIkN0=; b=mkVXsz2Dm5MzYrB3YdsTPUmUUt XR574ppq7jR7N+kKnheo+9nF7NkKSXoy1sagrkgkqLdhmRfjJRsxkBYFVHYG1TKBMgUGfDM+x8txP LJa9DqDeZqIWeXqBb+BKYk+zg/bHq4a+H97FHHme9reHmu/6LE2Qp6NckPS5N3tdChWMoEHR2rp9z B+k4eqODyvfUhvNXnIO87vrKNZ5MLU4cb6sCM+u60LnYGQXSkQJz7gVzD0lm5Q1N+v4Avn23LQBiH 52GPrxPsh4VYW8UHDDBIh47V2iJedYrQsfv61y+dLqRqNTU+b5209C7d/VcNruuY444WEI7BdC84S GCh9IUsw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dkNib-0002Xn-O6; Wed, 23 Aug 2017 04:56:41 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dkNiX-0002Gv-Ee for linux-arm-kernel@lists.infradead.org; Wed, 23 Aug 2017 04:56:39 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 049356070A; Wed, 23 Aug 2017 04:56:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1503464178; bh=UGcpZdiCLTj77CEsQm1wmDPDICpcRem5qLsETktpF6o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XZw2TNWTB809C4OMW1JDaBxox+lOK44UfdT/wUiDfHlTm7n2Ya5KiI3fsF0SHmV9C 5HMyA+hG9JvgwQIa5TkWcMrFsisKYU5k2oTbRpOsmwudNPDVSRK9cb7Vxl0QN0AQio gX4v55TfzF/JGPQ6Cnb5s1E10fxiBb+CP4UKu3vI= Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id BBD79606DB; Wed, 23 Aug 2017 04:56:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1503464177; bh=UGcpZdiCLTj77CEsQm1wmDPDICpcRem5qLsETktpF6o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V1Ski33YFc+DJ+trdxKtSVZ16VRWQ8rLmRfaKv/6xQrFbFsgE42gjG/JxxHi04+K3 rbyyj7PpI9AAmyXTjcoxcgdsBRyO8LYGYBNdsPbiHrDwjTHqZS/EJBqm2+86bL4oS5 gfMmXY23t+osixn0S+fMCLPJ7b/ms+ZLRhRq0jBY= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org BBD79606DB Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org From: Sinan Kaya To: linux-pci@vger.kernel.org, timur@codeaurora.org, alex.williamson@redhat.com Subject: [PATCH V12 2/5] PCI: add pci_bus_crs_visibility_pending() function to detect CRS response Date: Wed, 23 Aug 2017 00:56:08 -0400 Message-Id: <1503464171-6471-2-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1503464171-6471-1-git-send-email-okaya@codeaurora.org> References: <1503464171-6471-1-git-send-email-okaya@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170822_215637_655865_FBC6228E X-CRM114-Status: UNSURE ( 8.57 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sinan Kaya , linux-arm-msm@vger.kernel.org, Bjorn Helgaas , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP We need a wrapper function to determine when a particular device is returning Configuration Request Retry Status (CRS) response. This will only happen if the root port supports CRS visibility. Signed-off-by: Sinan Kaya --- drivers/pci/pci.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 22e0617..7fa583a 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -235,6 +235,10 @@ enum pci_bar_type { pci_bar_mem64, /* A 64-bit memory BAR */ }; +static inline bool pci_bus_crs_visibility_pending(u32 l) +{ + return (l & 0xffff) == 0x0001; +} bool pci_bus_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *pl, int crs_timeout); int pci_setup_device(struct pci_dev *dev);