On 15.12.2018 19:35, David Miller wrote:
> From: Heiner Kallweit <hkallwe...@gmail.com>
> Date: Sat, 15 Dec 2018 16:24:02 +0100
>
>> @@ -6405,8 +6405,9 @@ static irqreturn_t rtl8169_interrupt(int irq, void
>> *dev_instance)
>> {
>> struct rtl8169_private *tp = dev_instance;
>> u16 status = rtl_get_events(tp);
>> + u16 irq_mask = RTL_R16(tp, IntrMask);
>>
>> - if (status == 0xffff || !(status & tp->irq_mask))
>> + if (status == 0xffff || !(status & irq_mask))
>> return IRQ_NONE;
>
> Heiner, this is really expensive. Why is the tp->irq_mask value out of
> sync with the value programmed into IntrMask? Is there some way we can
> fix that instead?
>
tp->irq_mask holds the chip-specific interrupt mask. It doesn't say
whether interrupts are enabled or not. rtl_get_events() reads via
PCI(e) anyway, so I was under the impression that one more PCI(e) read
doesn't really matter.
We could introduce a flag shadowing the "interrupts are enabled" state
and use it here. But I'm not sure whether it's worth it.
Alternatively we could also go with the readw_relaxed() version to
get the values, this would eliminate the memory barrier at least.