linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Should we use "dsb" or "dmb" between write to buffer and write to register
@ 2022-08-22  7:53 Mark Zhang
  2022-09-07 17:53 ` Catalin Marinas
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Zhang @ 2022-08-22  7:53 UTC (permalink / raw)
  To: catalin.marinas, will, linux-arm-kernel
  Cc: Yishai Hadas, Jason Gunthorpe, Maor Gottlieb, Leon Romanovsky,
	Michael Guralnik, Michael Berezin, yong.xu, Eran Ben Elisha

Hi ARM experts,

May I consult when to use dsb or dmb in our device driver, thanks:

For example when send a command a FW/HW, usually we do it with 3 steps:
   1. memcpy(buff, src, size);
   2. wmb();
   3. write64(ctrl, reg_addr);

IIUC in kernel wmb() is implemented with "dsb st". When we change this 
to "dmb st" then we get better performance, but we are not sure if it's 
safe. I have read Will's post[1] but still not sure.

So our questions are:
1. can we use "dmb" here?
2. If we can then should we use "dmb st", or "dmb oshst"?

Thank you very much.

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/commit/?id=22ec71615d824f4f11d38d0e55a88d8956b7e45f

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-09-14 17:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-22  7:53 Should we use "dsb" or "dmb" between write to buffer and write to register Mark Zhang
2022-09-07 17:53 ` Catalin Marinas
2022-09-08 13:50   ` Will Deacon
2022-09-12  8:43     ` Mark Zhang
2022-09-13 11:11       ` Will Deacon
2022-09-12 18:16     ` Catalin Marinas
2022-09-13 11:06       ` Will Deacon
2022-09-14 17:29         ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).