Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3724497pxb; Mon, 24 Jan 2022 16:23:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwohjxkEokyR4lmsy/KtUWxYVTwequ0Udiec0nX4xZLkZ3Zc4YtJlobtRMCMd1Jh2BMvnuT X-Received: by 2002:a62:cd4b:0:b0:4c7:f198:6eb1 with SMTP id o72-20020a62cd4b000000b004c7f1986eb1mr11177015pfg.1.1643070210446; Mon, 24 Jan 2022 16:23:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643070210; cv=none; d=google.com; s=arc-20160816; b=U4Edm98En7TXfNCKQLqpplx2m0QxZ94OEbvOJ0/lQch2Zytp95lT2U8dKi3PJ4NaNB FZI/fy+WYRX6BzN4sXntJX10xQfXuQva7XyQV1nJVa8ldECU+wQjM/f5Y5b9M3ngOvSI b0uZbWiUnmd8YLbQkhsSWYUQlihZCeR5JMwLH/6DvxzgJCVMLu1ciqeWTH9NRfJIgrMm Ler1EUD32Q8Xklw0NAmQQdeMLSnvedkj5jpIIRrhG9dO35CYCuMs7SP/wetVNcZpFxwx hpUb4rIDKsredu31kz1ULpJEEKE60xor49iiZSJdcBzePs/Jxuzdbx++NRm9t4YIlN15 rrvQ== 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=jREcCCKDEmNgaEHl1PjzAMpsmAoPMyiSOrpyqO5qEXY=; b=qju0CabdSyNru8OHTd0tMTQZSuZOTl7I/xDLPs9OE2SgEwQ9OkwsuNh7AG6JVN13Cw XnteweEXRM6TKbTWZAZsquHsNeKuaywVrzS9M9tAIksGFYAWozvl6u7R0ON0eMUYk2Pf w2X2bijoaTUKzGJO4cn1WyLsnUhoYmXZNMDirV8M7RQxvmWIk+Tp1nZIUjqGCXUQuWtK o5qexXcmMY/CQIh75Az8A6TRoRYL16eEVs0dXoateCKKClDcyZEyB+/F7T9rUZXulDO4 D2tFAj76QGec2gqPbQQqIIDCy0nblafs9pxcl4fgIHGOD+fQpYQFXf3XhqDzRl8Yl051 9ufQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pqFGKyYR; 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 p1si4686201pfo.187.2022.01.24.16.23.18; Mon, 24 Jan 2022 16:23:30 -0800 (PST) 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=pqFGKyYR; 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 S2374575AbiAYAR1 (ORCPT + 99 others); Mon, 24 Jan 2022 19:17:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1458085AbiAXX2P (ORCPT ); Mon, 24 Jan 2022 18:28:15 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE344C01D7FC; Mon, 24 Jan 2022 13:32:19 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 934D2B8105C; Mon, 24 Jan 2022 21:32:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0C85C340E4; Mon, 24 Jan 2022 21:32:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059938; bh=EA7dMKNdQg24nhqA/oLL+3Ocd+cZ/ldxMW1D3CxdYDs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pqFGKyYR7JYddE/dLIoxcTABiKng5hTcmFmNrIxhq3u706tAqsme+ybkJSXLIhaS4 +7ffZPwdHPUEwNZlYQHPYMcIn2XQ9wXALgsQJE8WVAsdCjqunf4kQwuMhOa8crUOJu 5Vik0YAwXhsBb2mwJo5qFILq4UFClwN2+YkE8qsc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tim Harvey , Lorenzo Pieralisi , Rob Herring , Richard Zhu , Sasha Levin Subject: [PATCH 5.16 0785/1039] PCI: dwc: Do not remap invalid res Date: Mon, 24 Jan 2022 19:42:54 +0100 Message-Id: <20220124184151.676819654@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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: Tim Harvey [ Upstream commit 6e5ebc96ec651b67131f816d7e3bf286c635e749 ] 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. Link: https://lore.kernel.org/r/20211101180243.23761-1-tharvey@gateworks.com Fixes: 281f1f99cf3a ("PCI: dwc: Detect number of iATU windows") Signed-off-by: Tim Harvey Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring Acked-by: Richard Zhu Cc: Richard Zhu Signed-off-by: Sasha Levin --- 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 850b4533f4ef5..d92c8a25094fa 100644 --- a/drivers/pci/controller/dwc/pcie-designware.c +++ b/drivers/pci/controller/dwc/pcie-designware.c @@ -672,10 +672,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.34.1