[<prev] [next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.0703141557210.7723-100000@iolanthe.rowland.org>
Date: Wed, 14 Mar 2007 16:06:28 -0400 (EDT)
From: Alan Stern <stern@...land.harvard.edu>
To: Oliver Neukum <oliver@...kum.org>
cc: David Howells <dhowells@...hat.com>,
USB development list <linux-usb-devel@...ts.sourceforge.net>,
Kernel development list <linux-kernel@...r.kernel.org>
Subject: Re: [linux-usb-devel] question on irqs and memory ordering
On Wed, 14 Mar 2007, Oliver Neukum wrote:
> Hi,
>
> I am looking at this code:
>
> if (new_msr &
> (MOS_MSR_DELTA_CTS | MOS_MSR_DELTA_DSR | MOS_MSR_DELTA_RI |
> MOS_MSR_DELTA_CD)) {
> icount = &mos7840_port->icount;
>
> /* update input line counters */
> if (new_msr & MOS_MSR_DELTA_CTS) {
> icount->cts++;
> }
> if (new_msr & MOS_MSR_DELTA_DSR) {
> icount->dsr++;
> }
> if (new_msr & MOS_MSR_DELTA_CD) {
> icount->dcd++;
> }
> if (new_msr & MOS_MSR_DELTA_RI) {
> icount->rng++;
> }
> }
>
> It is called in interrupt and uses no locking. What happens if the next
> irq is processed on another cpu? Is that cpu guaranteed to see the updates
> to the incremented variables?
I _think_ it's okay. Taking an interrupt and returning from an interrupt
ought to have explicit or implicit memory barriers.
It wouldn't hurt to ask someone else. David Howells wrote
Documentation/memory-barriers.txt so maybe he knows. (The document itself
doesn't say one way or the other.)
Alan Stern
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists