Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3321001pxb; Mon, 1 Nov 2021 11:42:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoj1Ah84h8cgHOQTvEweyf/HijlVJJl7gJ9OwnsqwON5m/OEct8vbbrbr3bZxE2SisXA5b X-Received: by 2002:a17:906:368e:: with SMTP id a14mr37273044ejc.60.1635792134651; Mon, 01 Nov 2021 11:42:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635792134; cv=none; d=google.com; s=arc-20160816; b=zvmL0OP0nR+ptXY/5/ngyZONYebIH/wE8FzhKFcquoxekeLv141hYsui2G8Yw08FR7 ocHx34PjeJHiHYzZJqaogKY8JaJ3ax4C8P7HwSW2b04+lF64WyItFDiOZ4g1sCye3CHh iafnxzowXpKdWZWav/OyIxh089dryc2qcGVY4ByChHJ4zV86UX3Gzs+OQG1OaP7ZMbfk SKWS4iDkQl7OZJqkCsSy2KwzW0lukEtMj5m5UOTR9Y49BBy/aWtuwoI8H0PBxcUF6Aqw OwRy5BWgERFyGE860AiVgyFWL+bI05/wD5ipRK1kUpVZVYk5ppW9gOM35DrGSoygRyKg I1fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=qbuLap34FUrO0S65XBhagq+2XWIuqtcFyL+T9Fv2nOo=; b=aFzJvX/0qpXb1wqV2bG4LT44anCRVHiCx7AsGzDG4+bbLm3XqZU1qC5K16f2fpeo8E SIdTvEskBHTdyOWDM0DlXXYZWNfiS4yVcfCtjzyyxK/HYAtm6MdaOsNGsaqT210r1Rou rH9U9Nq0KAg+XLLSCGqO3+2iyLmNy1ZH84P7xjPyUVxY3gIhw+R3bUAG1OUkMe47qOWb UCfAfI3ieESRFK8quZ0E7skW8+ipuQL2fsWknCK6D6uADN9MPCDO8D+ALfR6r4EJzW4c v7v1ik0HoR1voNey/38pA+sfjlt2IqDnl03eSI6NWz9cy1PJg3PrU3q2wEBN502TvSwf 7Qtg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn8si4117421ejc.146.2021.11.01.11.41.50; Mon, 01 Nov 2021 11:42:14 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232147AbhKASjz (ORCPT + 99 others); Mon, 1 Nov 2021 14:39:55 -0400 Received: from finn.gateworks.com ([108.161.129.64]:59064 "EHLO finn.localdomain" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232191AbhKASjs (ORCPT ); Mon, 1 Nov 2021 14:39:48 -0400 X-Greylist: delayed 1791 seconds by postgrey-1.27 at vger.kernel.org; Mon, 01 Nov 2021 14:39:48 EDT Received: from 068-189-091-139.biz.spectrum.com ([68.189.91.139] helo=tharvey.pdc.gateworks.com) by finn.localdomain with esmtp (Exim 4.93) (envelope-from ) id 1mhbdt-007rRg-E2; Mon, 01 Nov 2021 18:02:45 +0000 From: Tim Harvey To: Jingoo Han , Gustavo Pimentel , Rob Herring , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Bjorn Helgaas , linux-pci@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Tim Harvey , Richard Zhu Subject: [PATCH] PCI: imx: do not remap invalid res Date: Mon, 1 Nov 2021 11:02:43 -0700 Message-Id: <20211101180243.23761-1-tharvey@gateworks.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On imx6 and perhaps others when pcie probes you get a: imx6q-pcie 33800000.pcie: invalid resource This occurs because the atu is not specified in the DT and as such it should not be remapped. Cc: Richard Zhu Signed-off-by: Tim Harvey --- drivers/pci/controller/dwc/pcie-designware.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c index a945f0c0e73d..3254f60d1713 100644 --- a/drivers/pci/controller/dwc/pcie-designware.c +++ b/drivers/pci/controller/dwc/pcie-designware.c @@ -671,10 +671,11 @@ void dw_pcie_iatu_detect(struct dw_pcie *pci) if (!pci->atu_base) { struct resource *res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "atu"); - if (res) + if (res) { pci->atu_size = resource_size(res); - pci->atu_base = devm_ioremap_resource(dev, res); - if (IS_ERR(pci->atu_base)) + pci->atu_base = devm_ioremap_resource(dev, res); + } + if (!pci->atu_base || IS_ERR(pci->atu_base)) pci->atu_base = pci->dbi_base + DEFAULT_DBI_ATU_OFFSET; } -- 2.17.1