Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2225670ybf; Mon, 2 Mar 2020 04:36:23 -0800 (PST) X-Google-Smtp-Source: ADFU+vuxOknSlgfTNerbK8gKaSqIisQpIt1zh+7wzt30pKkJrjv282yE4uqx9wGJzW4Fqr5v0FQ5 X-Received: by 2002:aca:d509:: with SMTP id m9mr79012oig.136.1583152583179; Mon, 02 Mar 2020 04:36:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583152583; cv=none; d=google.com; s=arc-20160816; b=X+10tnK4MFKYDS9s8dREIWc8TYebtNEDPyFW7WlzyBtZ4TTfbfTsiKMDEoH+JFF8IS KXiiJd/UOYsYaxmXcLAWoo7OwDHMDC98c/oOBOTqqQXuEF5O8M+XkChu4WkExy8OZl9L tsC/aJLdQbw5cpn0pDtZKHgxQqvAtSmUE/6hzRwgG311oGc9F52Ti4SU2Nckou4JiyD9 RMXpjpxjKMuOaGPfRI0oenWWE8Gqu6q+F8gSoTaQcddDD5TH1pcr2c6ykt6AShAMsLGe 68bfjPC9g9YiYGlS7lEpcyvLl82KMsvk98w6wQfdfAnch0QzhsEQZsCEMvkU2kGH75/K /3lw== 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=1NuXblUNnnMD6yrhM4IwiGEpuFq/YONs9SEcALwEWdc=; b=eWBdGqHy8Iq/iUCmwgCD0d3oYyeg4X1uTdwu9pfHQK6r1y8gAc9eFGqZLxSTA55qLv tBbsJt50/oyNk93A89bm8BHoawnu3cOP1Nku49rnbfJRnkE6ZTvriKIpmvYWOjCM8SUV x0MMMPQXO1TOZRNxsKwdZbiy10JURE1qJ9Lb4tbCSJVEIOnDV2nkm4bdEFswL/EsZOoq A0qTgGdcfmZ51lpd1Ti+MtZo8mJw+ssABA9kDz99Bez3pS2CS7G3GeUUn6U/2Ozt2P5Q kj/VsYQKEBm7rJaRlyXCSvnVJmnJKcF6tTLtIOxultiuUPs+RlKwKj9bp3nJbeKJanDw CfjQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j2si6106606otr.255.2020.03.02.04.36.11; Mon, 02 Mar 2020 04:36:23 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727941AbgCBMfU (ORCPT + 99 others); Mon, 2 Mar 2020 07:35:20 -0500 Received: from lhrrgout.huawei.com ([185.176.76.210]:2493 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727519AbgCBMfT (ORCPT ); Mon, 2 Mar 2020 07:35:19 -0500 Received: from lhreml703-cah.china.huawei.com (unknown [172.18.7.108]) by Forcepoint Email with ESMTP id 5CB611CD9B5172B7698A; Mon, 2 Mar 2020 12:35:18 +0000 (GMT) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by lhreml703-cah.china.huawei.com (10.201.108.44) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 2 Mar 2020 12:35:18 +0000 Received: from [127.0.0.1] (10.202.226.45) 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.1713.5; Mon, 2 Mar 2020 12:35:17 +0000 Subject: Re: About commit "io: change inX() to have their own IO barrier overrides" To: Sinan Kaya , Arnd Bergmann CC: "xuwei (O)" , Bjorn Helgaas , "linux-kernel@vger.kernel.org" , Jiaxun Yang References: <2e80d7bc-32a0-cc40-00a9-8a383a1966c2@huawei.com> From: John Garry Message-ID: <8207cd51-5b94-2f15-de9f-d85c9c385bca@huawei.com> Date: Mon, 2 Mar 2020 12:35:17 +0000 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: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.226.45] X-ClientProxiedBy: lhreml725-chm.china.huawei.com (10.201.108.76) 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 Hi Sinan, Thanks for getting back to me. > On 2/28/2020 4:52 AM, John Garry wrote: >> About the commit in the $subject 87fe2d543f81, would there be any >> specific reason why the logic pio versions of these functions did not >> get the same treatment In fact, your changes and the logic PIO changes went in at the same time. or should not? I'm talking about lib/logic_pio.c >> here - commit 031e3601869c ("lib: Add generic PIO mapping method") >> introduced this. >> >> In fact, logic pio will override these for arm64 with the vanilla >> defconfig these days. > > We only looked at inX()/inY() and readX()/writeX() API because the > semantics of these API are defined in the kernel documentation. Could we consider adding __io_pbr() et al to the kernel Documentation? I couldn't find them and I had to rely on checking 64e2c67738 ("io: define several IO & PIO barrier types for the asm-generic version") commit message to find the definition. > We looked at how to generalize this so that there is a uniform > behavior across different architectures. > > Is logic PIO subject to ordering issues? Well the point is that we're still concerned here with using readX/writeX for MMIO-based IO port accesses, see *** from logic_pio.c: #define BUILD_LOGIC_IO(bw, type) type logic_in##bw(unsigned long addr) { type ret = (type)~0; if (addr < MMIO_UPPER_LIMIT) { ret = read##bw(PCI_IOBASE + addr); *** } else if (addr >= MMIO_UPPER_LIMIT && addr < IO_SPACE_LIMIT) { struct logic_pio_hwaddr *entry = find_io_range(addr); if (entry) ret = entry->ops->in(entry->hostdata, addr, sizeof(type)); else WARN_ON_ONCE(1); } return ret; } > How is the behavior on different architectures? So today only ARM64 uses it for this relevant code, above. But maybe others in future will want to use it - any arch without native IO port access is a candidate. > > As long as the expectations are set, I see no reason why it shouldn't > but, I'll let Arnd comment on it too. ok, so it looks reasonable consider replicating your change for ***, above. Thanks, John