Re: [PATCH 3/5] qlge: bugfix: Fix shadow register endian issue.
From: David Miller <davem@davemloft.net>
Date: 2009-01-05 01:09:34
From: David Miller <davem@davemloft.net>
Date: 2009-01-05 01:09:34
From: Ron Mercer <redacted> Date: Tue, 30 Dec 2008 13:12:23 -0800
Shadow registers are consistent memory locations to which the chip
echos ring indexes in little endian format. These values need to
be endian swapped before referencing.
Note:
The register pointer declaration uses the volatile modifier which
causes warnings in checkpatch.
Per Documentation/volatile-considered-harmful.txt:
- Pointers to data structures in coherent memory which might be modified
by I/O devices can, sometimes, legitimately be volatile. A ring buffer
used by a network adapter, where that adapter changes pointers to
indicate which descriptors have been processed, is an example of this
type of situation.
Signed-off-by: Ron Mercer <redacted>Applied, but still kill the volatile and use proper memory barriers around accesses to this value instead. Many other drivers handle exactly this situation without having to resort to volatile.