Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp323895pxj; Thu, 20 May 2021 10:08:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzALaS3m4tXYA4D7WJCVrqyGHesPGmVSf5MhNZPzSQTBMukUtb7Y7C194Om26LPn5BEI4KF X-Received: by 2002:a02:294e:: with SMTP id p75mr7362606jap.34.1621530505938; Thu, 20 May 2021 10:08:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621530505; cv=none; d=google.com; s=arc-20160816; b=x6yRsYN03ziiQhCIZbLo6Un6WKHxBBQ9Ysoen7Dax2O5ZJibDNuFHXhm3YGgGbQD++ HPK3+LRwW9jSoQer0qorOMZDmuqbEhkShTX/FzZkMpTrDzbduNIcCfCmNE/X25xJzukg G0yKakURJblQGwm0y4WS4aH8BeE5Xb6y0Xf4QpbecDCvjyiKtOTVYd0jpgG3WFzOpPIY +g+nlGnklNJVJdSOj53Zte3OObmNAXLWa//Tje4Nz9uua40tKHxubx+7Syi5JGuFpDd+ t7ocESrgTv9q5MSiweLy5abSSEexrdimvaJ5wPu/U0BhBOwFJ+1Wxl9FVSprbR/hFnRO c4sw== 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=O8X4sVj7fk3yljj7oyzplbVDB7P15BVJNJTsCBbXX/0=; b=haVekgfz+X/nWlpeaJ/JX7ew0xJiXO5h3Y3fn5wkCL9jQt7uJJGmjG41gZe1QbdukN jN8GyxqBqWPFqgLwhkyoVpwQyie+BS9yC+LZHmSkKL1gmKjqZ7hOeCQtxrfdbuMpNk/o gY990LeI4f/uhK75hHvRD7JTdr1aiu29OgMK3uuqb3Sztce39wb2fP86oL4UvpFYEIAF kuhqSYPV1JelH5+kfaxe5UnxqvJ7+aatOO7Qu+qfi3a1lUAkXUMM7dXaEDuB0JUuH9X8 YZ2TlFUPwOL1xKfsYf1ongHFnFUoGvZv61+xa2now7UfreIPH4VviHuG0FJ4M8e5YoZT fheA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fltOhMMN; 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 a23si2695432jap.18.2021.05.20.10.08.11; Thu, 20 May 2021 10:08:25 -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=fltOhMMN; 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 S234295AbhETKLk (ORCPT + 99 others); Thu, 20 May 2021 06:11:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:60418 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234061AbhETKA0 (ORCPT ); Thu, 20 May 2021 06:00:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9A22E6186A; Thu, 20 May 2021 09:39:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503553; bh=VLrBjtSWclsCYcwSRoPvp4+8CLXfigEKiXL1HhuDylY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fltOhMMN4708ETbo2x24FL0MV+vJ6isBzZCucQxGHuq7ycQH2zNXFRGPmgABkASBu KcONG9o0LhB51eKeG3mPwydxmSAti4NXRQJRnBUAiCBgECIvYsFttqPASDA25J8LnK /LDxxC+xT1TxvgPCllw2yj9KKMhixDWLir0P8iZA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ilya Lipnitskiy , Liviu Dudau , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 4.19 273/425] MIPS: pci-legacy: stop using of_pci_range_to_resource Date: Thu, 20 May 2021 11:20:42 +0200 Message-Id: <20210520092140.413247436@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@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: Ilya Lipnitskiy [ Upstream commit 3ecb9dc1581eebecaee56decac70e35365260866 ] Mirror commit aeba3731b150 ("powerpc/pci: Fix IO space breakage after of_pci_range_to_resource() change"). Most MIPS platforms do not define PCI_IOBASE, nor implement pci_address_to_pio(). Moreover, IO_SPACE_LIMIT is 0xffff for most MIPS platforms. of_pci_range_to_resource passes the _start address_ of the IO range into pci_address_to_pio, which then checks it against IO_SPACE_LIMIT and fails, because for MIPS platforms that use pci-legacy (pci-lantiq, pci-rt3883, pci-mt7620), IO ranges start much higher than 0xffff. In fact, pci-mt7621 in staging already works around this problem, see commit 09dd629eeabb ("staging: mt7621-pci: fix io space and properly set resource limits") So just stop using of_pci_range_to_resource, which does not work for MIPS. Fixes PCI errors like: pci_bus 0000:00: root bus resource [io 0xffffffff] Fixes: 0b0b0893d49b ("of/pci: Fix the conversion of IO ranges into IO resources") Signed-off-by: Ilya Lipnitskiy Cc: Liviu Dudau Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/pci/pci-legacy.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/mips/pci/pci-legacy.c b/arch/mips/pci/pci-legacy.c index 3c3b1e6abb53..e8b0751d5b76 100644 --- a/arch/mips/pci/pci-legacy.c +++ b/arch/mips/pci/pci-legacy.c @@ -169,8 +169,13 @@ void pci_load_of_ranges(struct pci_controller *hose, struct device_node *node) res = hose->mem_resource; break; } - if (res != NULL) - of_pci_range_to_resource(&range, node, res); + if (res != NULL) { + res->name = node->full_name; + res->flags = range.flags; + res->start = range.cpu_addr; + res->end = range.cpu_addr + range.size - 1; + res->parent = res->child = res->sibling = NULL; + } } } -- 2.30.2