|
From: dave p. <dpe...@gm...> - 2026-06-04 21:41:49
|
On Thu, 4 Jun 2026 at 22:09, David Gravereaux <dav...@po...> wrote:
> ...
Regarding
> /usr/src/linux-gpib-4.3.7/drivers/gpib/tnt4882/tnt4882_gpib.c:63 for
> tnt_paged_readb(), would this be more correct or am I just thinking this
> all wrong?
>
> static inline unsigned int tnt_paged_readb(struct tnt4882_priv *priv,
> unsigned long offset) {
> unsigned int val;
>
> // 1. Write the page-in command
> iowrite8(AUX_PAGEIN, priv->nec7210_priv.mmiobase + AUXMR *
> priv->nec7210_priv.offset);
>
> // 2. Force full synchronization: Write MUST complete before Read
> starts
> mb();
>
> // 3. Read the data from the newly established page
> val = ioread8(priv->nec7210_priv.mmiobase + offset);
>
> // 4. Force Read completion before the function returns or next
> instructions run
> rmb();
>
> return val;
> }
>
> iowrite8 calls writeb
<https://elixir.bootlin.com/linux/v7.0.10/source/include/asm-generic/io.h#L260>
which
has a barrier before the __raw_writeb same for ioread8
This driver has been working fine without the mb()'s
|