Port-amd64 archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: [PATCH] Add intr_mask() / intr_unmask() interface to mask / unmask individual interrupt sources
On Wed, Aug 07, 2019 at 10:41:30PM -0700, Jason Thorpe wrote:
> Folks --
>
> A patch I need reviewed by x86 interrupt handling experts. It adds two new routines:
>
> void intr_mask(void *ih);
> void intr_unmask(void *ih);
>
> That mask and unmask, respectively, individual interrupt sources. The "ih" argument is the interrupt cookie that's returned by intr_establish().
>
> There are some corresponding changes to the ACPI interrupt functions that I haven't included here, but suffice to say they're basic wrappers.
>
> These changes are needed in order to be able to defer processing of a hard interrupt to a softint in some circumstances, specifically in cases where it's not actually safe to access the interrupting device's registers while in interrupt context. Real world example: ihidev (hid-over-i2c driver). That driver currently does i2c access from the hardware interrupt, but it plays some unsavory tricks in order to do so, and it can't work in all cases as-written. Unfortunately, the hid-over-i2c spec specifies a level-triggered interrupt, hence the need to be able to mask it off after scheduling a softint. The interrupt can then be unmasked after processing all outstanding data from the input device.
Thanks for looking at this. I'll review the Xen parts in more details later
this week.
Note that this will probably have to be implemented for other ports in
the near future. There are lots of I2C devices in the ARM world :)
The API looks MI enough.
--
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
NetBSD: 26 ans d'experience feront toujours la difference
--
Home |
Main Index |
Thread Index |
Old Index