* Re: [PATCH v4 1/5] io: define several IO & PIO barrier types for the asm-generic version
[not found] ` <20180406101949.jpPqfc1-inpGNHf8IPHNGATyIN-QZTUErOrIo2CssXU@z>
@ 2018-04-06 10:19 ` Arnd Bergmann
[not found] ` <20180406125050.kYsrAyZdONpXIaAMDCP9y5qJepzq4clyoAwF4bJYcwg@z>
0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2018-04-06 10:19 UTC (permalink / raw)
To: Sinan Kaya
Cc: Timur Tabi, sulrich, linux-arm-msm, Linux ARM, linux-arch,
Linux Kernel Mailing List, linux-s390, Martin Schwidefsky,
Heiko Carstens, Ley Foon Tan, moderated list:NIOS2 ARCHITECTURE
On Thu, Apr 5, 2018 at 3:09 PM, Sinan Kaya <okaya@codeaurora.org> wrote:
> Getting ready to harden readX()/writeX() and inX()/outX() semantics for the
> generic implementation.
>
> Defining two set of macros as __io_br() and __io_ar() to indicate actions
> to be taken before and after MMIO read.
>
> Defining two set of macros as __io_bw() and __io_aw() to indicate actions
> to be taken before and after MMIO write.
>
> Defining two set of macros as __io_pbw() and __io_paw() to indicate actions
> to be taken before and after Port IO write.
>
> Defining two set of macros as __io_pbr() and __io_par() to indicate actions
> to be taken before and after Port IO read.
>
> If rmb() is available for the architecture, prefer rmb() as the default
> implementation of __io_ar()/__io_par().
>
> If wmb() is available for the architecture, prefer wmb() as the default
> implementation of __io_bw()/__io_pbw().
>
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
I've applied the series to my asm-generic tree now, I will give it a few days
in linux-next to see if any obvious regressions happen, and then send
a pull request.
Checking the list of architectures that are affected by this, I see
h8300, microblaze, nios2, openrisc, s390, sparc, um, unicore32,
and xtensa, all of which use asm-generic/io.h without overriding
the default readl/writel.
I would guess that at least s390 doesn't need the barriers
(maintainers on Cc now), but there may be others that want to
override the new barriers with weaker ones where an MMIO
access is guaranteed to serialize against DMA, or where
a specialized barrier for this case exists.
Looking over the asm-generic implementation once more now,
I wonder if we should change the relaxed accessors to not have
any barriers (back to the version before your series) rather than
defaulting them to having the same barriers as the regular
readl/writel.
Arnd
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v4 1/5] io: define several IO & PIO barrier types for the asm-generic version
[not found] ` <20180406125050.kYsrAyZdONpXIaAMDCP9y5qJepzq4clyoAwF4bJYcwg@z>
@ 2018-04-06 12:50 ` okaya
2018-04-06 13:20 ` Arnd Bergmann
0 siblings, 1 reply; 3+ messages in thread
From: okaya @ 2018-04-06 12:50 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Timur Tabi, sulrich, linux-arm-msm, Linux ARM, linux-arch,
Linux Kernel Mailing List, linux-s390, Martin Schwidefsky,
Heiko Carstens, Ley Foon Tan, moderated list:NIOS2 ARCHITECTURE,
arndbergmann
On 2018-04-06 06:19, Arnd Bergmann wrote:
> On Thu, Apr 5, 2018 at 3:09 PM, Sinan Kaya <okaya@codeaurora.org>
> wrote:
>> Getting ready to harden readX()/writeX() and inX()/outX() semantics
>> for the
>> generic implementation.
>>
>> Defining two set of macros as __io_br() and __io_ar() to indicate
>> actions
>> to be taken before and after MMIO read.
>>
>> Defining two set of macros as __io_bw() and __io_aw() to indicate
>> actions
>> to be taken before and after MMIO write.
>>
>> Defining two set of macros as __io_pbw() and __io_paw() to indicate
>> actions
>> to be taken before and after Port IO write.
>>
>> Defining two set of macros as __io_pbr() and __io_par() to indicate
>> actions
>> to be taken before and after Port IO read.
>>
>> If rmb() is available for the architecture, prefer rmb() as the
>> default
>> implementation of __io_ar()/__io_par().
>>
>> If wmb() is available for the architecture, prefer wmb() as the
>> default
>> implementation of __io_bw()/__io_pbw().
>>
>> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
>
> I've applied the series to my asm-generic tree now, I will give it a
> few days
> in linux-next to see if any obvious regressions happen, and then send
> a pull request.
>
> Checking the list of architectures that are affected by this, I see
> h8300, microblaze, nios2, openrisc, s390, sparc, um, unicore32,
> and xtensa, all of which use asm-generic/io.h without overriding
> the default readl/writel.
>
> I would guess that at least s390 doesn't need the barriers
> (maintainers on Cc now), but there may be others that want to
> override the new barriers with weaker ones where an MMIO
> access is guaranteed to serialize against DMA, or where
> a specialized barrier for this case exists.
>
> Looking over the asm-generic implementation once more now,
> I wonder if we should change the relaxed accessors to not have
> any barriers (back to the version before your series) rather than
> defaulting them to having the same barriers as the regular
> readl/writel.
I can do a follow up patch. You want to map them to raw api without any
barriers as before. Right?
>
> Arnd
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v4 1/5] io: define several IO & PIO barrier types for the asm-generic version
2018-04-06 12:50 ` okaya
@ 2018-04-06 13:20 ` Arnd Bergmann
0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2018-04-06 13:20 UTC (permalink / raw)
To: Sinan Kaya
Cc: Timur Tabi, sulrich, linux-arm-msm, Linux ARM, linux-arch,
Linux Kernel Mailing List, linux-s390, Martin Schwidefsky,
Heiko Carstens, Ley Foon Tan, moderated list:NIOS2 ARCHITECTURE
On Fri, Apr 6, 2018 at 2:50 PM, <okaya@codeaurora.org> wrote:
> On 2018-04-06 06:19, Arnd Bergmann wrote:
>>
>> On Thu, Apr 5, 2018 at 3:09 PM, Sinan Kaya <okaya@codeaurora.org> wrote:
>>>
>>
>> I would guess that at least s390 doesn't need the barriers
>> (maintainers on Cc now), but there may be others that want to
>> override the new barriers with weaker ones where an MMIO
>> access is guaranteed to serialize against DMA, or where
>> a specialized barrier for this case exists.
>>
>> Looking over the asm-generic implementation once more now,
>> I wonder if we should change the relaxed accessors to not have
>> any barriers (back to the version before your series) rather than
>> defaulting them to having the same barriers as the regular
>> readl/writel.
>
>
> I can do a follow up patch. You want to map them to raw api without any
> barriers as before. Right?
Right, but of course with the byteswap.
Arnd
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-04-06 13:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1522933753-19589-1-git-send-email-okaya@codeaurora.org>
[not found] ` <20180406101949.jpPqfc1-inpGNHf8IPHNGATyIN-QZTUErOrIo2CssXU@z>
2018-04-06 10:19 ` [PATCH v4 1/5] io: define several IO & PIO barrier types for the asm-generic version Arnd Bergmann
[not found] ` <20180406125050.kYsrAyZdONpXIaAMDCP9y5qJepzq4clyoAwF4bJYcwg@z>
2018-04-06 12:50 ` okaya
2018-04-06 13:20 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox