mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Michael Ellerman" <mpe@ellerman.id.au>, linuxppc-dev@lists.ozlabs.org
Cc: linux-kernel@vger.kernel.org, "Jeremy Kerr" <jk@ozlabs.org>,
	"Geoff Levand" <geoff@infradead.org>
Subject: Re: [RFC PATCH 13/20] powerpc/io: Remove unnecessary indirection
Date: Thu, 14 Nov 2024 16:24:16 +0100	[thread overview]
Message-ID: <e34e2353-5818-408f-ab04-ce289bf418af@app.fastmail.com> (raw)
In-Reply-To: <20241114125111.599093-13-mpe@ellerman.id.au>

On Thu, Nov 14, 2024, at 13:51, Michael Ellerman wrote:
> Some of the __do_xxx() defines do nothing useful, they just existed to
> make the previous hooking macros work. So remove them.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

> @@ -607,27 +600,27 @@ static inline u32 readl_be(const PCI_IO_ADDR addr)
> 
>  static inline void writeb(u8 val, PCI_IO_ADDR addr)
>  {
> -	__do_writeb(val, addr);
> +	out_8(addr, val);
>  }

I would open-code PCI_IO_ADDR here.

Also, at this point the writeb() etc functions are close enough
to the asm-generic/io.h version that we could try to go the next
few steps. One problem doing this is the definition of the
*_relaxed() accessors. Ideally the inline asm would go
into the __raw_*() helpers, with the "sync" and "twi;isync"
going into __io_br(), __io_bw() and __io_aw(), at which point
these can all use the generic versions, and out_*/in_*() can
be defined on top of those.

What I'm not sure about here is the __io_br() (sync before
readl()), since most other architectures don't do this.
Any idea why powerpc does it, and if the relaxed() version
needs it as well? Is this for spinlocks serialization?

I think the sync before write and twi;isync after read() is
needed mainly for synchronizing against concurrent DMA, so
it should be fine to leave those out of the relaxed
versions, but it's possible that there is something
more going on than I remember.

      Arnd

  reply	other threads:[~2024-11-14 15:24 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-14 12:50 [RFC PATCH 01/20] powerpc/cell: Remove support for IBM Cell Blades Michael Ellerman
2024-11-14 12:50 ` [RFC PATCH 02/20] powerpc: Remove some Cell leftovers Michael Ellerman
2024-11-14 12:50 ` [RFC PATCH 03/20] powerpc: Remove PPC_PMI and driver Michael Ellerman
2024-11-14 12:50 ` [RFC PATCH 04/20] powerpc: Remove IBM_CELL_BLADE & SPIDER_NET references Michael Ellerman
2024-11-14 12:50 ` [RFC PATCH 05/20] powerpc/cell: Remove CBE_CPUFREQ_SPU_GOVERNOR Michael Ellerman
2024-11-14 12:50 ` [RFC PATCH 06/20] powerpc/xmon: Remove SPU debug and disassembly Michael Ellerman
2024-11-14 12:50 ` [RFC PATCH 07/20] powerpc: Remove DCR_MMIO and the DCR generic layer Michael Ellerman
2024-11-14 12:50 ` [RFC PATCH 08/20] powerpc: Remove PPC_OF_PLATFORM_PCI Michael Ellerman
2024-11-14 12:50 ` [RFC PATCH 09/20] powerpc/io: Remove PPC_IO_WORKAROUNDS Michael Ellerman
2024-11-14 12:50 ` [RFC PATCH 10/20] powerpc/io: Remove PPC_INDIRECT_MMIO Michael Ellerman
2024-11-14 14:41   ` Arnd Bergmann
2024-11-14 12:51 ` [RFC PATCH 11/20] powerpc/io: Remove PCI_FIX_ADDR Michael Ellerman
2024-11-14 14:50   ` Arnd Bergmann
2024-11-14 12:51 ` [RFC PATCH 12/20] powerpc/io: Unhook MMIO accessors Michael Ellerman
2024-11-14 12:51 ` [RFC PATCH 13/20] powerpc/io: Remove unnecessary indirection Michael Ellerman
2024-11-14 15:24   ` Arnd Bergmann [this message]
2024-11-14 12:51 ` [RFC PATCH 14/20] powerpc: Remove UDBG_RTAS_CONSOLE Michael Ellerman
2024-11-14 12:51 ` [RFC PATCH 15/20] cpufreq: ppc_cbe: Remove powerpc Cell driver Michael Ellerman
2024-11-14 12:51 ` [RFC PATCH 16/20] EDAC/cell: " Michael Ellerman
2024-11-14 12:51 ` [RFC PATCH 17/20] net: spider_net: " Michael Ellerman
2024-11-14 14:55   ` Arnd Bergmann
2024-11-14 12:51 ` [RFC PATCH 18/20] net: toshiba: Remove reference to PPC_IBM_CELL_BLADE Michael Ellerman
2024-11-14 12:51 ` [RFC PATCH 19/20] docs: Remove reference to removed CBE_CPUFREQ_SPU_GOVERNOR Michael Ellerman
2024-11-14 12:51 ` [RFC PATCH 20/20] genirq: Remove IRQ_EDGE_EOI_HANDLER Michael Ellerman
2024-11-26 17:41   ` Thomas Gleixner
2024-11-14 15:28 ` [RFC PATCH 01/20] powerpc/cell: Remove support for IBM Cell Blades Arnd Bergmann
2024-11-15  0:30 ` Jeremy Kerr
2024-11-27 21:27 ` Segher Boessenkool

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e34e2353-5818-408f-ab04-ce289bf418af@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=geoff@infradead.org \
    --cc=jk@ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®