kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Best practice to lock a read/write to a HW register
@ 2013-11-14 10:32 Luca Ellero
  2013-11-14 11:20 ` Mandeep Sandhu
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Luca Ellero @ 2013-11-14 10:32 UTC (permalink / raw)
  To: kernelnewbies

Hi all,
can someone please show me which is the best practice to lock a
read/write to a hardware register.
In other words if, in a driver, I want to modify a bit in a HW register,
I have to read the register, set/reset the relevant bit and write back
the reg.
But what can I do to be sure that no other code modifies the register
between my read and write?
Is spin_lock() suitable for this purpose?
Thanks
Best regards
Luca

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

end of thread, other threads:[~2013-11-15  8:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-14 10:32 Best practice to lock a read/write to a HW register Luca Ellero
2013-11-14 11:20 ` Mandeep Sandhu
2013-11-14 11:51 ` binoy.jayan at wipro.com
2013-11-14 12:14 ` Bernd Petrovitsch
2013-11-15  1:30   ` manty kuma
2013-11-15  8:53     ` Luca Ellero

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).