From patchwork Fri Mar 31 15:06:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 9656573 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 BAE0360349 for ; Fri, 31 Mar 2017 15:07:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD39A286B5 for ; Fri, 31 Mar 2017 15:07:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1D22286CA; Fri, 31 Mar 2017 15:07:34 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable 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 3E19C286B5 for ; Fri, 31 Mar 2017 15:07:34 +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: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:In-Reply-To: References:List-Owner; bh=Or28PXcXvC43kyhnh3KMUUIRD9ljiCfT3iWB+QDP54I=; b=oYw vBZDLi0gN7K8NbwePS+OEKqxq1B0lklreRd1ARrUQ3AQyMm3WqmIUJyzKhlDhXRhH1sjbx1ef0FNI Gg2mSevzQTvv/SEyCNnbyY+Zn2T+02lXxlukr9VLt++o5WUUpXT3ezxDAy4f8QpCmwrBUzWjx5++0 FgMcWnEOuYeP35EyEIXtaB7gcIew/s8rDcFoM4QeXiBYnHdTLlXR0Ky8sgYAIJWa09mUoh6iGsU2R CvoQPYNYLnj54YH8jtUaZN6/T9H3Friwfnkh+IdoO07079Nsq5jgyAOEJeg/VbsFsGaPvcYuY8KJ9 14mY/CILDzfzv5yYaTKO/0aCaFM81EA==; 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 1cty9G-0003tV-04; Fri, 31 Mar 2017 15:07:34 +0000 Received: from mail-lf0-x22a.google.com ([2a00:1450:4010:c07::22a]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cty9C-0003re-Al for linux-arm-kernel@lists.infradead.org; Fri, 31 Mar 2017 15:07:32 +0000 Received: by mail-lf0-x22a.google.com with SMTP id x137so45912001lff.3 for ; Fri, 31 Mar 2017 08:07:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=WCDee2ojDE0s3faDNzSvI+yTfiWTj0FB9WOQx0NbLHc=; b=NGwY1SJIw072Gg+abjEJ+prUNswNUR5Qi75RyX25wOezTn2CXyPVSj/bDWn1+oPhB1 C9YrorMjrnC89eaUQRaLf5zdHDF4ff4V8XUFxnNQv9rh9iAsibkWRz8KNK06QiU6ete9 6hkJnMDHOEKTvj39kef0EJ3nAQSVjJlVQ5RLHuqU18lI0qj6FiIn6lUG0uHf/kO/WIF8 OsH679+4wHiu1482CS+nVNn5/yF+/e82ad8EYYRk9lBe/PxdQpt7A0UTaqPZTL6Y0Pgn cf4/zjAc2FRBpgETZzZBP9Hdv2l11sztF6REhqRyT+aBnJtIQNsw6NLi2SbbMa99l0L1 gCCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=WCDee2ojDE0s3faDNzSvI+yTfiWTj0FB9WOQx0NbLHc=; b=awFwLA9rvh3GIZg3qtEMep22CIQAVGAdIbgAu6zJ79MjOHPeFndfPuo+xyhmPBymkh pKTZxmxIw5XKQ7swia7el1AyUTMbukUbCdNRmT4KjdsfqgRWZXx004VqWReioPJS4BYk yRymtzD5EoEFiZG8Yn6YsGwU1Z6YQANqRy4kV0wtE+R36yrEc0rdVHyoFVATka9f3e88 q3UZQlXFE1nfmgi6+SmR3tNjs3+Nxsmo4TNe3Z8OWnuctKDjD5jgLUOrCw0V0FxPKTVH 9X+swxq/aUtD0u0Iu2f5Rs0q30Ne1GcqFR4to9QtZ7YY8VkiYwYFxkFsfjgNBrxI8izk RQ1A== X-Gm-Message-State: AFeK/H2gFG2SqZzJnYa1HvVA2S6Bkn81T7nJs5WmONizU4pdlLHMJEvFuUQhRovZXY93tw== X-Received: by 10.46.84.76 with SMTP id y12mr1200056ljd.126.1490972827947; Fri, 31 Mar 2017 08:07:07 -0700 (PDT) Received: from tn-desktop.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id e13sm976522lfb.14.2017.03.31.08.07.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 31 Mar 2017 08:07:07 -0700 (PDT) From: Tomasz Nowicki To: helgaas@kernel.org, Lorenzo.Pieralisi@arm.com, robert.richter@caviumnetworks.com, ddaney@caviumnetworks.com, Vadim.Lomovtsev@caviumnetworks.com, rafael@kernel.org Subject: [PATCH 1/1] PCI: Fix for PEM-specific resource reservation for legacy firmware case Date: Fri, 31 Mar 2017 17:06:44 +0200 Message-Id: <1490972804-25830-1-git-send-email-tn@semihalf.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170331_080730_623567_9D426E06 X-CRM114-Status: GOOD ( 11.29 ) 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: Sunil.Goutham@cavium.com, linux-pci@vger.kernel.org, geethasowjanya.akula@gmail.com, linux-acpi@vger.kernel.org, linu.cherian@cavium.com, Tomasz Nowicki , 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 SZ_16M PEM resource size includes PEM-specific register and its children resources. Reservation of the whole SZ_16M range leads to child device driver failure when pcieport driver is requesting resources: pcieport 0004:1f:00.0: can't enable device: BAR 0 [mem 0x87e0c0f00000-0x87e0c0ffffff 64bit] not claimed So we cannot reserve full 16M here and instead we want to reserve PEM-specific register only which is SZ_64K. At the end increase PEM resource to SZ_16M since this is what thunder_pem_init() call expects for proper initialization. Fixes: 9abb27c7594a ("PCI: thunder-pem: Add legacy firmware support for Cavium ThunderX host controller") Signed-off-by: Tomasz Nowicki CC: stable@vger.kernel.org # v4.10+ --- drivers/pci/host/pci-thunder-pem.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/pci/host/pci-thunder-pem.c b/drivers/pci/host/pci-thunder-pem.c index b89c373..6e031b5 100644 --- a/drivers/pci/host/pci-thunder-pem.c +++ b/drivers/pci/host/pci-thunder-pem.c @@ -375,7 +375,6 @@ static void thunder_pem_legacy_fw(struct acpi_pci_root *root, index -= node * PEM_MAX_DOM_IN_NODE; res_pem->start = PEM_RES_BASE | FIELD_PREP(PEM_NODE_MASK, node) | FIELD_PREP(PEM_INDX_MASK, index); - res_pem->end = res_pem->start + SZ_16M - 1; res_pem->flags = IORESOURCE_MEM; } @@ -399,8 +398,15 @@ static int thunder_pem_acpi_init(struct pci_config_window *cfg) */ if (ret) { thunder_pem_legacy_fw(root, res_pem); - /* Reserve PEM-specific resources and PCI configuration space */ + /* + * Reserve 64K size PEM specific resources. The full 16M range + * size is required for thunder_pem_init() call. + */ + res_pem->end = res_pem->start + SZ_64K - 1; thunder_pem_reserve_range(dev, root->segment, res_pem); + res_pem->end = res_pem->start + SZ_16M - 1; + + /* Reserve PCI configuration space as well. */ thunder_pem_reserve_range(dev, root->segment, &cfg->res); }