[PATCH] irq: bcm2835: Re-implement the hardware IRQ handler.
Craig McGeachie
slapdau at yahoo.com.au
Wed Oct 2 03:35:38 EDT 2013
On 10/02/2013 03:12 PM, Stephen Warren wrote:
> On 09/26/2013 02:19 AM, Craig McGeachie wrote:
>> I don't understand the concern with re-reading two volatile registers
>> between each dispatch. Given the amount of processing that occurs
>> between the call to handle_IRQ and the calls to the possibly multiple
>> registered interrupt handlers, plus the processing that the handlers
>> perform (even if they are implemented as top/bottom halves), I think the
>> performance overhead of the two extra reads is vanishingly small. In
>> fact, I think that focusing on eliminating them is premature
>> optimisation. Developers are notoriously bad at identifying performance
>> hotspots through visual inspection.
>>
>> The point about the registers being volatile is important. It's a C
>> keyword for a very good reason.
>
> Volatile as a keyword isn't especially useful for registers though,
> since register IO tends to need various barriers as well, but anyway...
I agree. I hadn't really meant that the volatile would make register
reading correct. I really only meant it as a concept of values that
might be changed by something else unknown.
I'm still a little uncertain about the correct reading of registers,
especially here. I tried to get a good understanding of readl versus
readl_relaxed and what ordering guarantees were, or were not given.
About the only thing I am sure of is the requirements for wmb() and
rmb() given by section 1.3 of BCM2835_ARM_Peripherals.pdf. And I don't
know whether or not it should be applied to interrupt registers, or
whether the two different readl functions remove the need for explicit
barriers.
I do know that the barriers are required when you switch which
peripheral IO memory you are reading/writing, and I think the interrupt
controller counts as different to the various devices that the handlers
will be interacting with.
Cheers,
Craig.
More information about the linux-arm-kernel
mailing list