Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2742614ybz; Mon, 27 Apr 2020 03:46:14 -0700 (PDT) X-Google-Smtp-Source: APiQypLha468pV3bh2/nZcA6VmFCMbtToRiwH5oa2fk1sG9WKJtkNnmEvC6jQco4cWsgnb+RJNHh X-Received: by 2002:a17:906:cf8a:: with SMTP id um10mr18425909ejb.60.1587984374746; Mon, 27 Apr 2020 03:46:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587984374; cv=none; d=google.com; s=arc-20160816; b=S2dX/zdUAgSbVs7zx5T3SizZFQ33V/cbyfnH/glGjbuQkr8+4tGHBFZldbFolwjQKu y5BPpjBqa1AUWq8wQdl24ZnYZbkgMVou5k5/YeiO9aLIv9uxfV7dF1ZqJ9hXKFIkC0jc 9Vak31Wux4zp7Jp7xw4MpHXm9tckMTGwaTjfJlgK9ws0p7SEgHlWCXPm25x73+jo9XbJ rieTS6Fmz0pCaBXoEfPWDQiWPNpAm1qNVvMadXRHOjPq4PGq10mY/Gf0fh987Lu6HOea +GZOYK+CzNUHG2S0lia4qwSu3p1JWXZwAuwWihRdWCF91zzjG2q0sftcxAUpeo5UnLfM iZxA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=dtmaNptJor7REiv35K+U4AgcvkPWQAl2kQn2PuiZMLQ=; b=Ad9Hetu6VI4kBn2A95ZP5DNqir4lwQw5qRDUdGZLjXBmDE9NnePPHesUUqDE1C2wcX Preua9qp+SUv/U+fl9e7HEsSwan+dv/uASNhvYFfQTD7i1dVL/qIIjEqkKbhWdIvPtsh 5H4wvaoHomp7/aJ/cMIjtDCVfyap6EI0Gv+QfqV8uWLXt+ohpwwM9QtvZCdKLxvXkKYF qR5iFtRu2wiKkPkvcgN8SkqFqNsUhb5PWoG9vG/09f8cj3XTE83zugaA0OHlWUrrFp3B U4N4dReLn1tMTN9xqu0FQ76mpJdbnimlKrcGXvs0Gi938Xj494EAJ7KkKDbky9fQ4bSC fYyw== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p4si8488578edd.234.2020.04.27.03.45.51; Mon, 27 Apr 2020 03:46:14 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727072AbgD0Knw (ORCPT + 99 others); Mon, 27 Apr 2020 06:43:52 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:2111 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726537AbgD0Knv (ORCPT ); Mon, 27 Apr 2020 06:43:51 -0400 Received: from lhreml724-chm.china.huawei.com (unknown [172.18.7.107]) by Forcepoint Email with ESMTP id 1A5E68E417FCE3EC8A7D; Mon, 27 Apr 2020 11:43:50 +0100 (IST) Received: from [127.0.0.1] (10.210.170.137) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Mon, 27 Apr 2020 11:43:47 +0100 Subject: Re: [PATCH 3/4] lib: logic_pio: Introduce MMIO_LOWER_RESERVED To: Jiaxun Yang , 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 , , Arnd Bergmann , Linuxarm , Bjorn Helgaas , Rob Herring References: <20200426114806.1176629-1-jiaxun.yang@flygoat.com> <20200426114806.1176629-4-jiaxun.yang@flygoat.com> From: John Garry Message-ID: Date: Mon, 27 Apr 2020 11:43:09 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <20200426114806.1176629-4-jiaxun.yang@flygoat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.210.170.137] X-ClientProxiedBy: lhreml722-chm.china.huawei.com (10.201.108.73) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Hi, Is there some reason why the logic_pio code cannot be improved to handle these devices at these "fixed" addresses? Or do you have a plan to improve it? We already support fixed bus address devices in the INDIRECT IO region. Carving out a region of IO space is less than ideal. Thanks, John > > Signed-off-by: Jiaxun Yang > --- > lib/logic_pio.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/lib/logic_pio.c b/lib/logic_pio.c > index f511a99bb389..57fff1cb7063 100644 > --- a/lib/logic_pio.c > +++ b/lib/logic_pio.c > @@ -20,6 +20,10 @@ > static LIST_HEAD(io_range_list); > static DEFINE_MUTEX(io_range_mutex); > > +#ifndef MMIO_LOWER_RESERVED > +#define MMIO_LOWER_RESERVED 0 > +#endif > + > /* Consider a kernel general helper for this */ > #define in_range(b, first, len) ((b) >= (first) && (b) < (first) + (len)) > > @@ -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 = 0; > + resource_size_t mmio_end = MMIO_LOWER_RESERVED; > resource_size_t iio_sz = MMIO_UPPER_LIMIT; > int ret = 0; > >