Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4627517pxj; Wed, 12 May 2021 09:32:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyO/j1Eczbb2UzRhhvIQTV0gxRQmPEOKTiq6cNMg9Sj0SE+xP7SaBsRj2/Z4ZD5itWaaK4u X-Received: by 2002:a05:6512:b98:: with SMTP id b24mr24697853lfv.216.1620837170828; Wed, 12 May 2021 09:32:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620837170; cv=none; d=google.com; s=arc-20160816; b=l73ZET9oqnBmD/NKwvBkdHsxYrDf7n/Io7Cbvgc/cApfIkEUZdk4haXvoM74RBbH9E haObyncX7hRlTA/4dGrETDKRf2iE+8ePFNFojhCEOnIWX+gtJeOonyN8UWpnITvFMcTo oM6xPY0NMYnFF6kCH7PEQr5auaYZjXUXj6u845wrvG7E1KXxRnt+6vjqV00t5OOsDs3D MzBaVX2A/LP6wg34FzuZ60iRLW3AFXOOI7wwJiZX9/nwhCSfCN7wsKkbtRwyNiX0vUUF FcMlfXj+bCMDpfocLEnXQwDhoFUDCM5E7lKur4916yk1cwIum8ivcxR0Q8xsxSQ85EPu c0qw== 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=WDi4hfbYasvkV2yGs2xxMCdYivG23SeA3JS3VSKHCYc=; b=IDc6qKNtobAJeuCOELGbwhIUfWVjsyGgeu3ZtL7efBIKxhnt44y1pfOdDK1AlleEkQ RDOynWRlHIAwqDB7BSCHEKblemm02slnpB8XSrruv/VBcHiLrMUPCgHMJzB777RVWKuz Z2RLs+J22JwemgNWc8AASX8dr2gz/4nqVymEskz+9NZfHb9rPISvDwusubKedgfNmfjz 0Cx71bK75HIEbiToh2DM9i5eEk39kimm91Z4acpQxcuI2+hAojjFehCA1sHwOLo2/08j OnyILWwGvUqFKQjh6LRX2wq+ByFZjjtHygne2iZ1cvyU8CRMYDaluN0QF/XvPH3BEib2 jP0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=v9gkMutk; 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 i23si273665ljj.294.2021.05.12.09.32.21; Wed, 12 May 2021 09:32:50 -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=v9gkMutk; 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 S241893AbhELQbD (ORCPT + 99 others); Wed, 12 May 2021 12:31:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:56820 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235946AbhELPkV (ORCPT ); Wed, 12 May 2021 11:40:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0CA3D619A3; Wed, 12 May 2021 15:21:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832861; bh=PbfKYe+osiPgdsnQSlzfrRC76DNdtXx/z2RiJMzamGA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v9gkMutkcefbaKXU254arQjYnWkonsQBU2ulAnmL1zaXzuGaGfmmj2llsCHo3iSqS 9kv5puZWT6dor41WP/A4NisbCyAR0gVtWeSDAjiZQ15TrNJM2lf3TY+6YgyE4TFKc+ K0RkwYBZURrsYPCa6FhddA+dLkPlIYW4aZ4E/Fo0= 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 5.10 454/530] MIPS: pci-legacy: stop using of_pci_range_to_resource Date: Wed, 12 May 2021 16:49:24 +0200 Message-Id: <20210512144834.688581887@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@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 39052de915f3..3a909194284a 100644 --- a/arch/mips/pci/pci-legacy.c +++ b/arch/mips/pci/pci-legacy.c @@ -166,8 +166,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