[PATCH v1 03/10] ufs: host: mediatek: Add memory barrier for ref-clk control
Peter Wang (王信友)
peter.wang at mediatek.com
Wed Jul 16 23:52:52 PDT 2025
On Wed, 2025-07-16 at 08:26 -0700, Bart Van Assche wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>
>
> On 7/15/25 11:25 PM, peter.wang at mediatek.com wrote:
> > + /*
> > + * Make sure that ref-clk on/off control register
> > + * is writed done before read it.
> > + */
> > + mb();
>
> A memory barrier doesn't guarantee that an MMIO write has been
> completed. A memory barrier enforces ordering of MMIO writes but does
> not guarantee completion of MMIO writes. What you need is an MMIO
> read.
> See e.g. commit 4bf3855497b6 ("scsi: ufs: core: Perform read back
> after
> disabling UIC_COMMAND_COMPL").
>
> Bart.
Hi Bart,
Understood, this seems to be unnecessary code and will be removed
in the next version.
Thanks.
Peter
More information about the Linux-mediatek
mailing list