Received: by 2002:a05:6520:4211:b029:f4:110d:56bc with SMTP id o17csp2118670lkv; Thu, 20 May 2021 03:51:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5pyrkEYfz5Ke4XdiCgE7AZekXKZwQAdtD7Z3AZ8jsBougv/vObL8WakmKEhorNadWfwDa X-Received: by 2002:a17:906:3949:: with SMTP id g9mr4106002eje.7.1621507882766; Thu, 20 May 2021 03:51:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621507882; cv=none; d=google.com; s=arc-20160816; b=X+0Z2YaOidXB3kjEFnEIUJG/ygGktj8Pydz9hNzPJ8aezU2I1gbWvUzyKG0W5S/dgs OP9i8G7eDjC03zP5kYkQJHjuPmRMXrtUBfPH2SMaxUasCtasN0nvLphhAzcSQUXAF+mN xqsPZdijhGeKyvvHogy45po82OEoR5cdG2Pr7/ZIL5BEEPqDgj+5hdibHyhODHzg+U92 qXrnH2i0A/gPTL1+hr5qYLUaOjZ3ZK62KDNNmH/gfWLrDlcgZ+FKa/aJuSIkbiBVGxtB COKIJZxNyF/+4y7mIdC8UtkzUWhHOrBxZKmBs30BQh3v5ypDrXnsXRvD1I6FE+uNw2FQ 9QEA== 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=cFnWADZx2bRTpqn2RFRgiVoQEFDbHCoTJlzMasNNwFA=; b=cm6eSZERxs030MG2KpiS2iouhxEuW4/XrHO1IiE2On5k95vfQCyxCUiR7aSylrTwpc r6SMUp0WzJjtcE68l/Mpu8/I+bkKFAXXRTolmSmM4vF9zA3vme0c0mC1MWCJcFjkbNJd GRXI99PkIJLF/cSqPwLgUmXRXcW/ek3Y57sFg9iXGvhGcZ2sJauCY8lcEkQAHQ8rGn7V Re0w7T6Q9pDMmBgq4nUqCAFzgmdr001KAey/mNEF42N4hDmiBGdQsZ+WGA2eHlxdIaXX h/qXUVCTkdL2sWrTRjfb0NN7Mo00M7h9KL8GCWeSU43Ag9PRi/j6ju9P9j+crkn7I1Qy sAPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="CzIC/CH7"; 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 o17si2038589eju.179.2021.05.20.03.50.55; Thu, 20 May 2021 03:51:22 -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="CzIC/CH7"; 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 S238905AbhETKua (ORCPT + 99 others); Thu, 20 May 2021 06:50:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:60386 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236493AbhETKd3 (ORCPT ); Thu, 20 May 2021 06:33:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F39346161C; Thu, 20 May 2021 09:52:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504369; bh=kbph+OCMGvkpl0PwQ4sZMAjVv0+sOnl0W0xrNpNcW+o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CzIC/CH7Wli5dLJIqWtv+tlh1dIoSO5s8g99YJl0Y9A7THpOzPz50AYhRFIvZuuKR R1kW+tFrk3kgx6oAGeAEV+NqapRHP5ZF3t/lZKonRusuUcbZGVKpz721VK/cNiCGni hrCTTEPkLCSrTtz2MP126D90fNseR7ch364KzhTY= 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.14 215/323] MIPS: pci-legacy: stop using of_pci_range_to_resource Date: Thu, 20 May 2021 11:21:47 +0200 Message-Id: <20210520092127.498539638@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@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 1ae6bc414e2b..c932ffa6e1d3 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