Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2760553ybz; Mon, 27 Apr 2020 04:07:43 -0700 (PDT) X-Google-Smtp-Source: APiQypLkTG+SE9LGoC/B0bdBPQqlCKOcTPGYC8Qex6jiunkaMZll/XrUosUBTgd2pweFB5MlNVfy X-Received: by 2002:aa7:c643:: with SMTP id z3mr11066136edr.154.1587985663602; Mon, 27 Apr 2020 04:07:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1587985663; cv=pass; d=google.com; s=arc-20160816; b=Uuf1Z5h1D/phzDKr9VC4ISK7vhYQ8Z3Klt7bXIIQN2/xOmw7z8I8rDHfzWrRUFuVt8 ZcI9KokWFadj5gGA1gNOdsCa09Pek33NGfc7bih20BDewUHUAF1Ik50tnfKowg2iwDkM DEpCr6fPKw2l/kSDJ5YkzxkxJT6+IXTtj3wR88f/tscNjNjNBJE7ZFO2GS7jq5YzcVQc kNng5Yqox1+t7wIhjrjKLJrA/u6anuuPIoDmNvms8IfqpRaPaPt1z1mFcTfinsO87eYV o1O/6UQhH98iEaLZ9xX9or+OYBxL+1omEYHKN6cbsOxTc6JtL6IUJn+0CCBUYJy/5LRp jpdQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:references:in-reply-to:reply-to:user-agent:subject:cc:to :from:date:dkim-signature; bh=uqWai94iDA2ATC9yAqYojNIDFCeGKFzxWGb1697+ko0=; b=v7ha0K1AWYnkh1B++pYd8VwiC/maFtopSZNHmZW5LwhC7hAVrEYkYDTNY9hn7GXe99 q947+pkZeUUGJ+WcG60p5h21lvaEx3wWJCVD0jBXinyRYBetz9Y+TYCOmfFKo0lvqEJY OJUoZF77JrQuC2WjZmVgZ2EZjEnyAc+BLqlHegj9EcvHqk6ptcPBPbyFnRA5LpuJlNlj 3xbO8gECgTYRO9cvgOz+bFeNlazomPrEqDWkG9Yx0SgCTslkc0141lHHsCORLUiWJdjY DaGa0klU8mQelhtQL7ZBmjHdEraxiHpfsYlK25F237SGhfkYIB4cSlRAdiS1ArImHTZv gUaA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@flygoat.com header.s=mail header.b=Xq0NFfpd; arc=pass (i=1 spf=pass spfdomain=flygoat.com dkim=pass dkdomain=flygoat.com dmarc=pass fromdomain=flygoat.com>); 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=flygoat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p21si7523715eja.160.2020.04.27.04.07.19; Mon, 27 Apr 2020 04:07:43 -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=@flygoat.com header.s=mail header.b=Xq0NFfpd; arc=pass (i=1 spf=pass spfdomain=flygoat.com dkim=pass dkdomain=flygoat.com dmarc=pass fromdomain=flygoat.com>); 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=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726879AbgD0LFy (ORCPT + 99 others); Mon, 27 Apr 2020 07:05:54 -0400 Received: from sender3-op-o12.zoho.com.cn ([124.251.121.243]:17794 "EHLO sender3-op-o12.zoho.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726485AbgD0LFy (ORCPT ); Mon, 27 Apr 2020 07:05:54 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1587985428; cv=none; d=zoho.com.cn; s=zohoarc; b=jvlgkNg+Hi5GA+aRS4w7bcwPWkHxzoXapKmBTQ30pDBzxrqVMbLRYk+/CVOBIxk46FFalYiAmfPPmMiN+2aFhViqf5RdeXYRRUHPSTbzUPs+wskvo0VjC+p/PbjPsE2IUI8ZorZsxfvAUDRLKCOOwJ6AGU2KaqNpD4izKIAp67s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1587985428; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:Reply-To:References:Subject:To; bh=uqWai94iDA2ATC9yAqYojNIDFCeGKFzxWGb1697+ko0=; b=C8qiQVvWRHk9DUk9Gqj0aITm5xLGjlxyaDvqgu5QpuHEtvWYohCVRhZ2xHBXFChl3KfnqrqdZBoUO9whx6ZoqsHgYp5iXd+DPROKIGijfTB6IF7HzbqR2x4uvuiUInF8G9B7qdBME45vGtWbhH85AkqwK/PZ3nxJlMwPXQz+m6A= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=flygoat.com; spf=pass smtp.mailfrom=jiaxun.yang@flygoat.com; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1587985428; s=mail; d=flygoat.com; i=jiaxun.yang@flygoat.com; h=Date:From:To:CC:Subject:Reply-to:In-Reply-To:References:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=uqWai94iDA2ATC9yAqYojNIDFCeGKFzxWGb1697+ko0=; b=Xq0NFfpdw0D67d5vPqunFsxKR9cSbo4YdwaCDNPitmWnM5j4mN27sarKA6eTUTqL acUB+CWwjXMB1hJof/q3/r/4gdHIy+3CX274/obsSk6PAvXwydMZYs1RtQesGy/tOcG MfvxOYqh6ZS3EJ5gMk5njZhkbD77OB8jpmCrfVtU= Received: from [127.0.0.1] (122.235.213.3 [122.235.213.3]) by mx.zoho.com.cn with SMTPS id 158798542576895.68244044207586; Mon, 27 Apr 2020 19:03:45 +0800 (CST) Date: Mon, 27 Apr 2020 19:03:40 +0800 From: Jiaxun Yang To: John Garry , linux-mips@vger.kernel.org CC: Thomas Bogendoerfer , Huacai Chen , Paul Burton , Thomas Gleixner , Stephen Kitt , Nick Desaulniers , Serge Semin , Anshuman Khandual , Geert Uytterhoeven , Andrew Morton , Daniel Silsby , Mike Rapoport , Paul Cercueil , Mark Tomlinson , Greg Kroah-Hartman , Allison Randal , Tiezhu Yang , Wei Xu , linux-kernel@vger.kernel.org, Arnd Bergmann , Linuxarm , Bjorn Helgaas , Rob Herring Subject: Re: [PATCH 3/4] lib: logic_pio: Introduce MMIO_LOWER_RESERVED User-Agent: K-9 Mail for Android Reply-to: jiaxun.yang@flygoat.com In-Reply-To: References: <20200426114806.1176629-1-jiaxun.yang@flygoat.com> <20200426114806.1176629-4-jiaxun.yang@flygoat.com> Message-ID: <42432F7C-D859-48B4-9547-A61BD22EFEEF@flygoat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ZohoCNMailClient: External Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org =E4=BA=8E 2020=E5=B9=B44=E6=9C=8827=E6=97=A5 GMT+08:00 =E4=B8=8B=E5=8D=886= :43:09, John Garry =E5=86=99=E5=88=B0: >On 26/04/2020 12:47, Jiaxun Yang wrote: >> That would allow platforms reserve some lower address in PIO MMIO range >> to deal with legacy drivers with hardcoded I/O ports that can't be >> managed by logic_pio=2E > >Hi, > >Is there some reason why the logic_pio code cannot be improved to handle= =20 >these devices at these "fixed" addresses? Or do you have a plan to=20 >improve it? We already support fixed bus address devices in the INDIRECT= =20 >IO region=2E Hi, The issue about "Fixed Address" is we can't control the ioport That driver used to operate devices=2E So any attempt to resolve it in logic_pio seems impossible=2E Currently we have i8259, i8042, piix4_smbus, mc146818 rely on this assumpt= ion=2E My plan is after getting this part merged, I'm going to work on a ISA Host= bridge driver, then convert device drivers into logic_pio and Devicetree based driver ste= p by step=2E Finally when we nologner have any legacy driver, we can safely remove this= reserved range=2E Thanks=2E > >Carving out a region of IO space is less than ideal=2E > >Thanks, >John > >>=20 >> Signed-off-by: Jiaxun Yang >> --- >> lib/logic_pio=2Ec | 6 +++++- >> 1 file changed, 5 insertions(+), 1 deletion(-) >>=20 >> diff --git a/lib/logic_pio=2Ec b/lib/logic_pio=2Ec >> index f511a99bb389=2E=2E57fff1cb7063 100644 >> --- a/lib/logic_pio=2Ec >> +++ b/lib/logic_pio=2Ec >> @@ -20,6 +20,10 @@ >> static LIST_HEAD(io_range_list); >> static DEFINE_MUTEX(io_range_mutex); >> =20 >> +#ifndef MMIO_LOWER_RESERVED >> +#define MMIO_LOWER_RESERVED 0 >> +#endif >> + >> /* Consider a kernel general helper for this */ >> #define in_range(b, first, len) ((b) >=3D (first) && (b) < (fi= rst) + (len)) >> =20 >> @@ -36,7 +40,7 @@ int logic_pio_register_range(struct logic_pio_hwaddr = *new_range) >> struct logic_pio_hwaddr *range; >> resource_size_t start; >> resource_size_t end; >> - resource_size_t mmio_end =3D 0; >> + resource_size_t mmio_end =3D MMIO_LOWER_RESERVED; >> resource_size_t iio_sz =3D MMIO_UPPER_LIMIT; >> int ret =3D 0; >> =20 >>=20 > --=20 Jiaxun Yang