From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: * X-Spam-Status: No, score=1.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RDNS_NONE,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.0 Received: from lhrrgout.huawei.com ([185.176.76.210]:2550 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730192AbgCKQNB (ORCPT ); Wed, 11 Mar 2020 12:13:01 -0400 Subject: Re: About commit "io: change inX() to have their own IO barrier overrides" From: John Garry To: Arnd Bergmann CC: linux-arch , Catalin Marinas , Sinan Kaya , "linux-kernel@vger.kernel.org" , Jiaxun Yang , "xuwei (O)" , Bjorn Helgaas , Will Deacon , Linux ARM References: <2e80d7bc-32a0-cc40-00a9-8a383a1966c2@huawei.com> <8207cd51-5b94-2f15-de9f-d85c9c385bca@huawei.com> <6115fa56-a471-1e9f-edbb-e643fa4e7e11@kernel.org> <7c955142-1fcb-d99e-69e4-1e0d3d9eb8c3@huawei.com> <90af535f-00ef-c1e3-ec20-aae2bd2a0d88@kernel.org> <182a37c2-7437-b1bd-8b86-5c9ce2e29f00@huawei.com> <15e7158d-184d-9591-89a6-cd6b10ef054d@huawei.com> Message-ID: <96b407eb-f9cd-960c-02e5-5e2a4ece33d8@huawei.com> Date: Wed, 11 Mar 2020 16:12:58 +0000 MIME-Version: 1.0 In-Reply-To: <15e7158d-184d-9591-89a6-cd6b10ef054d@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: On 06/03/2020 16:43, John Garry wrote: > On 06/03/2020 16:29, Arnd Bergmann wrote: >>> The idea is good, but it would be nice if we just somehow use a common >>> asm-generic io.h definition directly in logic_pio.c, like: >>> >>> asm-generic io.h: >>> >>> #ifndef __raw_inw // name? >>> #define __raw_inw __raw_inw >>> static inline u16 __raw_inw(unsigned long addr) >>> { >>>          u16 val; >>> >>>          __io_pbr(); >>>          val = __le16_to_cpu(__raw_readw(addr)); >>>          __io_par(val); >>>          return val; >>> } >>> #endif >>> >>> #include >>> >>> #ifndef inw >>> #define inw __raw_inw >>> #endif >> Yes, makes sense. Maybe __arch_inw() then? Not great either, but I think >> that's better than __raw_inw() because __raw_* would sound like it >> mirrors __raw_readl() that lacks the barriers and byteswaps. > > Right, I had the same concern. And maybe the "arch" prefix is > misleading. Just __inw could be ok, and hopefully not conflict with the > arch/arm/mach-* definitions. > I think that it hasn't been mentioned already, but it looks like the outX methods also need the same treatment, from a7851aa54c. thanks, John