Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp547065pxj; Thu, 20 May 2021 15:55:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHAyMln7jl0jDALFA8ldogHxNcjsR79+Hf1biLS3b+BYEGCt9WqfF3DLNNR+0nD4Is0OxE X-Received: by 2002:aa7:d9d6:: with SMTP id v22mr7270755eds.16.1621551305953; Thu, 20 May 2021 15:55:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621551305; cv=none; d=google.com; s=arc-20160816; b=Yzy7c4YOjhuvu+XZAvKtL3Z3tKFG7DwV7IHtsyDGGp0TnrvgtjuEGT2h8nCoMvKBf5 V5vO+bR+MMiVYaVbmLRuRCqHGzv+WK89+XQesGodTelioxb//tzZN7o9wiadQdxVs8Yq W5doUP1mezN9lzHmq9JswtY0d0HdG80ZNrYekHdml4EgRPEb4ojxAQkcAtiLc5OPj+ap s7wpJkG40xpSHcKEgcCN0ipIBrnMlScRuTaHdeqw7JuFpeDY7xn3d5JoTLjHPfciT+Dh eBW51hz/08b4zzTHn0p+ab5BgeLTtmgPQCgc9XC8GkHnaxY3H2q1J2g7nUwGODKAvBxa zxrw== 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=lfc4ydLPkp8AlreOwqQSzqoBEGTfA5tt8FMfKE2IrZQ=; b=noc8Fith++RCWhFWobBgQmUYaXqqwWXEHC/36gaS3cmmM9vV+DQUdsHAcSpbQhyBTD CfJKBz/pqcdaylRfgl7R1XtwfHS0mcrTfg4mu1A5vEYmwncSVycAOimt8ybUe9oukmDG f855GOBHAmz5NyY70mQqUQ6G0YyyQA4xASram2gG9WsHSLVcJRf44r5+M6M+oa1At6IL AVfgPhG071/GX0bhlQBOwA3TNB3T/e+FVGVqrg9EAOha62zU7jt0LhelZ6IPcChSDA7q JWTW2zRvJ02bZ1uuNGLZYg3F1V1ErEgvE+MbQXnCKNKl11lzSZcN3/VlDObAZ5YVmK30 QX2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=s3LWDUwJ; 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 q19si1846242edv.397.2021.05.20.15.54.42; Thu, 20 May 2021 15:55:05 -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=s3LWDUwJ; 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 S240135AbhETLSi (ORCPT + 99 others); Thu, 20 May 2021 07:18:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:57202 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235969AbhETK6X (ORCPT ); Thu, 20 May 2021 06:58:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 558C961CFE; Thu, 20 May 2021 10:02:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504947; bh=ptNW44jHsjRZArmDd3G8VBS22Tjv0sPsPiBKScOyMBA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s3LWDUwJOmDPjVwXBjujVbXwpfYNEELywq7noFRGRFvCBvOJN0L8GuNNwXKSN0etH pZdEPQl63JpXnJEOeb+lzNlLW5MobH5lwcrUWKAQpoWHchMZSy/tvyDrArby7kbtTo qglwcuRQrDmUyVJ5Z1J09NN+L593amobQBokG8LQ= 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.9 154/240] MIPS: pci-legacy: stop using of_pci_range_to_resource Date: Thu, 20 May 2021 11:22:26 +0200 Message-Id: <20210520092113.816398528@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092108.587553970@linuxfoundation.org> References: <20210520092108.587553970@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 2d6886f09ba3..009b840ee5ef 100644 --- a/arch/mips/pci/pci-legacy.c +++ b/arch/mips/pci/pci-legacy.c @@ -158,8 +158,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