Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2354887ybb; Mon, 30 Mar 2020 04:44:54 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvsWB7qKNZ6fJSyRwGy+xRKucAR/u92svAPCJFEddlwPApVJB79c+CXtwnbQ6xgILLj8LAF X-Received: by 2002:aca:c415:: with SMTP id u21mr6960126oif.102.1585568694164; Mon, 30 Mar 2020 04:44:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585568694; cv=none; d=google.com; s=arc-20160816; b=taYAT89WSEkDINwjeJV1vlg4Wn8RZLhY+Q+uPSL8Aj7JJ0kQjEkkZJMMLxRyGdUkaR 5jkEA1f8BLx2hhNdrlgDxYp0lLsd8rIv/xTjqE4J/Fhun3yUnG8OPGEHhzxn0smoK1tb lKl9RVb5dee6TmGR56AhlK2+KH16n/X4HuY6xrGjUT0i59Vs7f2DyEibBRjLALpGck8E xEdUaCNQP8UshP4d/y3QmbZJk77w/M23Rkdt+fJJh4ebyV3IZL4ORMEQKtzdPYDxbsnr XssAbpCPSpMx0pXFE0fLgfNhmexklueZMSJeIOsgP5OJULSN+1dZ0/KnrqehbacR1vZd B9+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:subject:message-id:cc:to:from :dkim-signature; bh=M9AG6YJZ1M+WKraGHw9VnEsvm+cbbYRG2eJ2kWp3UGU=; b=MQAYIIi7KCyvwd2cun/Vpk9vCaCQXW1irqM+m+T1pDxmFRjhKIn2tUrh7G/40xruHd UdjFOAxUOWu5psb61CSBx5+EjlnFrhmMr5UfsOAPfHSUILZq6JPqjyytgqB2J7teBvI4 b7DydVIv0gvtuefgGlrPEiX7m9bmOffJG1nH/vgfoxyqL9WqtU22WUAkcDm3vYtOpgzQ Br2+h1gb+DWQrGmEV+ODzCpQcwOZhX/6KJ/+h0+7BhtUSPRfbAiw6V6ExwuMXLOfTAhT 5mzPUeOnGLOirYDOg6zRJHySK8uYYM5M7qJo7Yb2EBSjx4zHxHqKqVUju1MHfEYFxzdd BJ1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=mail header.b=b93sDSdp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v2si6394487oov.20.2020.03.30.04.44.41; Mon, 30 Mar 2020 04:44:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=mail header.b=b93sDSdp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729896AbgC3LoS (ORCPT + 99 others); Mon, 30 Mar 2020 07:44:18 -0400 Received: from sender3-op-o12.zoho.com.cn ([124.251.121.243]:17811 "EHLO sender3-op-o12.zoho.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729669AbgC3LoQ (ORCPT ); Mon, 30 Mar 2020 07:44:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1585568623; s=mail; d=flygoat.com; i=jiaxun.yang@flygoat.com; h=From:To:Cc:Message-ID:Subject:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type; bh=M9AG6YJZ1M+WKraGHw9VnEsvm+cbbYRG2eJ2kWp3UGU=; b=b93sDSdpfFSbNQ/TbkXeVy1VSlXaaspflYWqSmMY/Ea/n4FkrmHsGf5RG4jEGq9W vm1oF0KY/lxXz7lHHAu75DyWncICAHgm4ElrBlFv5/mUY5sXMJtPy5ZjxPMCRojbKar L6NcwDNZbl0CqUtV265O7bXKxnztsiG4QaDru6cU= Received: from localhost.localdomain (39.155.141.144 [39.155.141.144]) by mx.zoho.com.cn with SMTPS id 1585568620346276.9023750732374; Mon, 30 Mar 2020 19:43:40 +0800 (CST) From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: Jiaxun Yang , Bjorn Helgaas , Rob Herring , Thomas Bogendoerfer , Huacai Chen , Lorenzo Pieralisi , Andrew Murray , Paul Burton , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <20200330114239.1112759-2-jiaxun.yang@flygoat.com> Subject: [PATCH 1/5] PCI: OF: Don't remap iospace on unsupported platform Date: Mon, 30 Mar 2020 19:42:26 +0800 X-Mailer: git-send-email 2.26.0.rc2 In-Reply-To: <20200330114239.1112759-1-jiaxun.yang@flygoat.com> References: <20200330114239.1112759-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoCNMailClient: External Content-Type: text/plain; charset=utf8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are some platforms doesn't support iospace remapping like MIPS. However, our PCI code will try to remap iospace unconditionally and reject io resources on these platforms. So we should remove iospace remapping check and use a range check instead on these platforms. Signed-off-by: Jiaxun Yang --- drivers/pci/of.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/pci/of.c b/drivers/pci/of.c index 81ceeaa6f1d5..36e8761b66c6 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -547,12 +547,21 @@ int pci_parse_request_of_pci_ranges(struct device *de= v, =20 =09=09switch (resource_type(res)) { =09=09case IORESOURCE_IO: +#if defined(PCI_IOBASE) && defined(CONFIG_MMU) =09=09=09err =3D devm_pci_remap_iospace(dev, res, iobase); =09=09=09if (err) { =09=09=09=09dev_warn(dev, "error %d: failed to map resource %pR\n", =09=09=09=09=09 err, res); =09=09=09=09resource_list_destroy_entry(win); =09=09=09} +#else +=09=09=09/* Simply check if IO is inside the range */ +=09=09=09if (res->end > IO_SPACE_LIMIT) { +=09=09=09=09dev_warn(dev, "resource %pR out of the IO range\n", +=09=09=09=09=09res); +=09=09=09=09resource_list_destroy_entry(win); +=09=09=09} +#endif =09=09=09break; =09=09case IORESOURCE_MEM: =09=09=09res_valid |=3D !(res->flags & IORESOURCE_PREFETCH); --=20 2.26.0.rc2