[PATCH v3 2/2] PCI/MSI: Implement irq_mask_noflush() for MSI-X

Thomas Gleixner tglx at kernel.org
Sat Nov 7 13:53:47 PST 2026


On Sat, Nov 07 2026 at 13:00, Keith Busch wrote:
> On Fri, Nov 06, 2026 at 09:53:06PM +0100, Thomas Gleixner wrote:
>> On Fri, Nov 06 2026 at 09:34, Keith Busch wrote:
>> > -static inline void pci_msix_mask(struct msi_desc *desc)
>> > +/* Posted write only: the device may still send an interrupt after return */
>> > +static inline void pci_msix_mask_noflush(struct msi_desc *desc)
>> >  {
>> >  	desc->pci.msix_ctrl |= PCI_MSIX_ENTRY_CTRL_MASKBIT;
>> > +	pci_msix_write_vector_ctrl(desc, desc->pci.msix_ctrl);
>> > +}
>> > +
>> > +static inline void pci_msix_mask(struct msi_desc *desc)
>> > +{
>> > +	pci_msix_mask_noflush(desc);
>> 
>> That's before the offline check now, which looks more than wrong.
>
> This is done on purpose: pci_msix_write_vector_ctrl() already has the
> same offline check, so nothing actually gets written, same as before.
>
> And regardless of whether it's offline or not, we have to set the
> PCI_MSIX_ENTRY_CTRL_MASKBIT in the cached msxi_ctrl. That's common to
> both paths, so it lives in the noflush helper to avoid duplicating it.

Indeed, but that's an unreadable mess TBH.

Can we please change that to have two functions here?

    pci_msix_write_vector_ctrl()
plus    
    pci_msix_write_vector_ctrl_and_flush()

and fixup the related call sites?

Thanks,

        tglx



More information about the Linux-nvme mailing list