Re: [PATCH] Add intr_mask() / intr_unmask() interface to mask / unmask individual interrupt sources

Jason Thorpe <[email protected]>
Newsgroups gmane.os.netbsd.ports.i386,gmane.os.netbsd.ports.x86-64
Message-ID <[email protected]>

> On Nov 30, 2019, at 3:17 PM, Jason Thorpe <[email protected]> wrote:
> 
> Yah, on second thought, I don't think I will add that additional code... as far as I can tell, it's completely unnecessary (because it's all already serialized with cpu_lock) and would only add confusion.  I will add a comment about the mask count being protected with cpu_lock, however.

Ok, so I thought about this some more, and there is a problem there, but not the one you mentioned.

intr_mask() is intended to be callable from an interrupt handler, but you can't take the cpu_lock in that case, because that's a MUTEX_DEFAULT mutex.  The code can be tweaked to address this issue, but yes, places where the mask count is checked do need to be protected in a block that disables interrupts.

I'll post a follow-up patch shortly.

-- thorpej
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.