Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4585224pxj; Wed, 12 May 2021 08:42:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpOpNPw4PVoRUoBSW7b6XGWi45OQaFZWHSBNjt82EwiIpJPGMR/p3zQn+R6+ZWO1KFjko6 X-Received: by 2002:aa7:cf06:: with SMTP id a6mr43973581edy.340.1620834143002; Wed, 12 May 2021 08:42:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620834142; cv=none; d=google.com; s=arc-20160816; b=SKoRO8TNX6GepM9TGnAqya1oF3sX6MXXzpdprh7Cfwg81rn/qJ4uE/ou4GH6gaYNOV qmP9W8c6l46llwnl1T6wVLND0uxWZ/cAQnMcYpARUNBuKhePvulMFqmkeod2zV0iGWsT 5yA0z0mpLbDX1CO/TghCREMYghKxXJK6CVCyncd674jEHngNjExYRBzDFGMtEcrx7Ld6 5Ux22hJ2h6j3qmvi945ufqjBHWFc1poFHixQsHpK4wyeGA3ehneyVdtCIyr/ntp9dM3z //QXa+VSkCfz0O2rXdC+3bf6y8oH4IakKYSG20mMrCSP9GPgQ9sLr/bdN9kkQaUuxBnT A9nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VrjETWW0omXwj4cqc0peW3O04tYsZ9TAJMR+f8U++fo=; b=E4UOtTJtdS7vuwrgELCC0UpR8d03J2fm6imlKzlWFV8O52ewfdq7A0JxsrVOwAWO+p W072e7p+gAJ2GRfr6eVr11AW5xz72pJYXsELVHiOSmllmpioKU/ceIMvY8X+SmJv1mW9 TB+aLh44s7tTFuYKhbAuyCSXktqbGiS7ZDtLdkldgkXnHJAJRVvrLlk1mdaIeRcURAkm 2PxyN4IFdzqm6vum+9wPkg6KNgSRIbds7BTyxj2HEJIFKPWV6sWYxrSbB1HSgK+ETdyO j9sINvswE7hXZH3Y2EQUgjb/zXBjx0lA8aVsh6pWve2jWAElXdL1egz9PxxxeaTnKvM5 PtCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nXI0SoNu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t26si250868eju.184.2021.05.12.08.41.58; Wed, 12 May 2021 08:42:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nXI0SoNu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235084AbhELPfR (ORCPT + 99 others); Wed, 12 May 2021 11:35:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:49670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234169AbhELPQL (ORCPT ); Wed, 12 May 2021 11:16:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A3A7D6194D; Wed, 12 May 2021 15:05:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620831935; bh=RECN36ShKBagzxEbRoQl0Lum/THzHpmshgFw7da/V3E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nXI0SoNuSqDXE5XBaiLSrTW6+v5yuvU98e+3s5qI/1Gn6EoqewQkgtrYAoltiIcP1 lB8/u9n+wmbDlE4uA+Qlwtdh6Ocm0WNN69IkbaSNGmzcrYd6qoHkMA7uH6tcFnLyPP aepR1liQedCThteNI10aZrUbK35ZJ3/q5CBOk3pY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, dann.frazier@canonical.com, Dejin Zheng , Lorenzo Pieralisi Subject: [PATCH 5.10 030/530] PCI: xgene: Fix cfg resource mapping Date: Wed, 12 May 2021 16:42:20 +0200 Message-Id: <20210512144820.718490956@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dejin Zheng commit d4707d79fae08c8996a1ba45965a491045a22dda upstream. In commit e2dcd20b1645 a change was made to use devm_platform_ioremap_resource_byname() to simplify code and remove the res variable; this was wrong since the res variable is still needed and as an outcome the port->cfg_addr gets an erroneous address. Revert the change going back to original behaviour. Link: https://lore.kernel.org/r/20210328144118.305074-1-zhengdejin5@gmail.com Fixes: e2dcd20b1645a ("PCI: controller: Convert to devm_platform_ioremap_resource_byname()") Reported-by: dann.frazier@canonical.com Tested-by: dann frazier Signed-off-by: Dejin Zheng Signed-off-by: Lorenzo Pieralisi Cc: stable@vger.kernel.org # v5.9+ Signed-off-by: Greg Kroah-Hartman --- drivers/pci/controller/pci-xgene.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/pci/controller/pci-xgene.c +++ b/drivers/pci/controller/pci-xgene.c @@ -355,7 +355,8 @@ static int xgene_pcie_map_reg(struct xge if (IS_ERR(port->csr_base)) return PTR_ERR(port->csr_base); - port->cfg_base = devm_platform_ioremap_resource_byname(pdev, "cfg"); + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg"); + port->cfg_base = devm_ioremap_resource(dev, res); if (IS_ERR(port->cfg_base)) return PTR_ERR(port->cfg_base); port->cfg_addr = res->start;