[lkml]   [2004]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: 2.6.6-mm5
Andrew Morton <> writes:

> add-i386-readq.patch
> add i386 readq()/writeq()

> static inline u64 readq(void *addr)
> {
> return readl(addr) | (((u64)readl(addr + 4)) << 32);
> }
> static inline void writeq(u64 v, void *addr)
> {
> u32 v32;
> v32 = v;
> writel(v32, addr);
> v32 = v >> 32;
> writel(v32, addr + 4);
> }
> #endif

The implementation is broken and it will break drivers that actually
expect writeq and readq to be 64bit reads and writes.

In particular an interrupt can come in during the middle of a read
or a write and widely separate the two different halves.

Unless the driver has a lock protecting access to the card already
this race could be nasty and quite difficult to debug. And I have
looked and we do have some cases in the kernel that do not have
a lock protecting them.

I attempted to suggest some alternative implementations earlier
in the original thread that brought this up but it looks like
you missed that.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:03    [W:0.132 / U:2.788 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site