lkml.org 
[lkml]   [2012]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 1/2] mfd: Add anatop mfd driver
On Thu, Mar 01, 2012 at 05:10:51PM +0800, Ying-Chun Liu (PaulLiu) wrote:

> + spin_lock(&adata->reglock);
> + val = readl(adata->ioreg + addr);
> + spin_unlock(&adata->reglock);

Do you really need to take a lock for a single read operation from a
memory mapped register? I'd expect this to be atomic in itself. You
need to lock on read/modify/write cycles to make sure that you don't get
a read/read/modify/modify/write/write and misplace one of the modifies
but that's not an issue for an isolated read.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2012-03-01 12:33    [W:0.127 / U:3.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site