- Certain pic_assign_cpu, e.g. msi_assign_cpu can have quite a long call chain. For msi_assign_cpu, mutex makes complex PCI bridge drivers more tricky, e.g. sleep can not be used, etc; it will be too tricky for upcoming Hyper-V PCI bridge driver for PCI pass-through.
- It is not used on any hot code path nor non-sleepable context, so sx should have the same effect as mutex.
Details
Tested-by: Dexuan Cui <decui microsoft com> w/ WIP PCI bridge driver for Hyper-V PCI pass-through.
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
My worry is that this has a negative impact on suspend/resume. (In general suspend/resume can't sleep).) One option perhaps would be to split the lock into a mutex protecting list of PICs (that is what suspend/resume needs) and the intr_table_lock would only protect interrupt_sources[].
Split intr_table_lock into two. One for intr sources, which is now sx. One for PIC, which stays mutex. Suggested-by: jhb
Any specific reason to write the or statement as two separate if clauses?
I believe in other parts we do it ((true & x & y & z) | (false & a & b &c )) - as multiline checks;
I don't like them both get executed "always", so at the very least, an "else" just before the 2nd if would be good.
The logic looks ok to me.