Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2975507pxf; Sun, 28 Mar 2021 07:43:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdGNqiE4JpsTj3nHMAjKox+zmJSo5otRrfWA1cOmZgyx1VhAQGYv/ZNewVAh2xuve5lkHz X-Received: by 2002:aa7:cd6a:: with SMTP id ca10mr24681375edb.7.1616942619671; Sun, 28 Mar 2021 07:43:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616942619; cv=none; d=google.com; s=arc-20160816; b=a7rSQUxfCdtA+xih3cnlSaQNZ6ZygyWBErnI+5GxKTtmMxzjMPZlSYTaS5YouRDduK UKjd20HvX7UgejpxfCRo4Qbp0csLH14Gg9gkDxS9Eep0oZqsjyKaxHJFdPCfATO6gItn KvVDO0IdYYwchPPdiuJVdTnL36WtX/nmwZJTkOVNPhh/rshNf7CSHgq9dJDzbpkue8/t Ykm1n3VzdaWzOcHg35FJoM8ltb2NsInYQcoLTwtiZ5JBGMuR4gFF9OTutHZmiupgq1vS UaVY7qpXy5lqI87dC6RVgyV3zILhpWZX0cnMrE7vJg0SZWc07F5HSFFM1SaJn0C6ZKxR q6Iw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Yc6QjgSudbKWQkdConiaKqiDBMnbnOx4Gm3AgRAanEM=; b=T0bIHlKbTY1d70nTGZGc/aioxZg+nx08FxQJv5JpzK0vy4TNPURlqKJS3hfvQpPNDU qx7KH9bOo3gIbhAuL4WHcXLZiKFHIL6S398iiQlH2wmtgPFCGTKXgUqGr4pu8GGo5L7y pvng8x88OOPmYgv1fF0UOznUn66IUwGUkC3Z0vIMQU8PJVZNAdH2PwfXT4OPrHB9dDHv ptmf01PXVkiU1VUkJGM1fX4wzqOgA0gijMD9xKnaIfWGKk9uc2z/53jHi895Ftq1QXyJ 4yhz9VSbaFpzZZusT1dAW5ugbR82CBF8ym/X2dr5SNoKn75FHfnyZ+57APPiYHPVLbxo hV7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aLCQk5kL; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 24si12000323edv.533.2021.03.28.07.43.13; Sun, 28 Mar 2021 07:43:39 -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=@gmail.com header.s=20161025 header.b=aLCQk5kL; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230525AbhC1Olk (ORCPT + 99 others); Sun, 28 Mar 2021 10:41:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229762AbhC1Ol0 (ORCPT ); Sun, 28 Mar 2021 10:41:26 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2270C061756; Sun, 28 Mar 2021 07:41:25 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id m7so7773163pgj.8; Sun, 28 Mar 2021 07:41:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Yc6QjgSudbKWQkdConiaKqiDBMnbnOx4Gm3AgRAanEM=; b=aLCQk5kLbjZyZx0gEfGu6LdSgR2yv5X1RaQVw9hbl6DwAsEsFg7zpq3i13Tm1Mpucr nwCQk1Hk7xUeynIHTybcXyS6P1LBpIn6+teRJhLTDE2nGPncn2d1RtbPYArVjJK1x9wH 2QsSTSs5fMrfyRNdizLqjiPy2t6mOJI84qvtFcXfRDRVG3uFYgsMJIO7qsXqmkxfHVAh XcgNYLuH+YzeS8R6V+E/ukHJIjpBRs+XW7/ztUOSlWOFi/ukSOvzgp3YzRQkCyNE0HGp qrUdmf5pNVs98x/ciIKsgnGU+wKPnRI+6eBFIjT2JswuoAAuIek6GfDjAYM5lLkGeIAr Utdg== 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:mime-version :content-transfer-encoding; bh=Yc6QjgSudbKWQkdConiaKqiDBMnbnOx4Gm3AgRAanEM=; b=DJrPpa20M7yy5Kl2swXKQzATEj7Be1PWcVgRzogD/G4LtOPrZAkXHkavlu0LXHB16E TcyVXafAHs7cZYwww0veAS7q/1CnuRVHBrtIf9DJ0MS1OyP7yWeeg14NA36WVcg/ZFqS FqC0N6R1WovykYPS9J83VX62th6IZjFCu3jdATY2WGOH7cCJc3icWFpP8v2AdYlkU+3X Wrf7URFIp7GYsgi/EOj8VChgzevBW/Rdv5D7RRmvzetU3H1xqkqBD5U6EXWs0W41OEfg gejT8Zi/2D3+5x6wTK5C1FE5H4k4oMkiJ7KgWmqnOWwECFmR3QScTCkg7I2vUIZ6pCSq OPLQ== X-Gm-Message-State: AOAM532eAeC/IjGStkS7dHg8rYoD2bLn6tiv67ZFcWKaJ+k5BPuyOoQk +1AM0QQvewhXgayByuUzOyE= X-Received: by 2002:a62:5c5:0:b029:217:7019:d9e8 with SMTP id 188-20020a6205c50000b02902177019d9e8mr22158225pff.10.1616942485326; Sun, 28 Mar 2021 07:41:25 -0700 (PDT) Received: from localhost (185.212.56.149.16clouds.com. [185.212.56.149]) by smtp.gmail.com with ESMTPSA id s12sm13923980pgj.70.2021.03.28.07.41.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Mar 2021 07:41:25 -0700 (PDT) From: Dejin Zheng To: toan@os.amperecomputing.com, lorenzo.pieralisi@arm.com, robh@kernel.org, bhelgaas@google.com, gustavo.pimentel@synopsys.com, linux-pci@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Dejin Zheng , dann.frazier@canonical.com Subject: [PATCH] PCI: xgene: fix a mistake about cfg address Date: Sun, 28 Mar 2021 22:41:18 +0800 Message-Id: <20210328144118.305074-1-zhengdejin5@gmail.com> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It has a wrong modification to the xgene driver by the commit e2dcd20b1645a. it use devm_platform_ioremap_resource_byname() to simplify codes and remove the res variable, But the following code needs to use this res variable, So after this commit, the port->cfg_addr will get a wrong address. Now, revert it. Fixes: e2dcd20b1645a ("PCI: controller: Convert to devm_platform_ioremap_resource_byname()") Reported-by: dann.frazier@canonical.com Signed-off-by: Dejin Zheng --- drivers/pci/controller/pci-xgene.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/pci-xgene.c b/drivers/pci/controller/pci-xgene.c index 2afdc865253e..7f503dd4ff81 100644 --- a/drivers/pci/controller/pci-xgene.c +++ b/drivers/pci/controller/pci-xgene.c @@ -354,7 +354,8 @@ static int xgene_pcie_map_reg(struct xgene_pcie_port *port, 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; -- 2.30.1