Port-i386 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 Sat, Nov 30, 2019 at 09:11:20AM -0800, Jason Thorpe wrote:
> 
> > On Aug 26, 2019, at 8:46 AM, Manuel Bouyer <bouyer%antioche.eu.org@localhost> wrote:
> > 
> > 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.
> 
> Ok, I'm timing out on this... I'm going to commit what I have to -current today ... I've been running these changes on systems for a while now, and need to clean out the local changes in my tree.  (I have a ton of i2c cleanup I want to check in, and they depend on this.)
> 
> The XEN stuff can be fixed up later.

Actually I did look at it, but it's much more complicated than I
rememberd. We can have several interrupt sources mapped to the same
event channel, and this extra level of indirection requires some
design and code rewrite.

Just please make sure that the i2c code (espeically hid over i2c) can
still run without the mask/unmask MD parts (this will probably require some
#ifdef unfortunably).

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index