mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@kernel.org>
To: Keith Busch <kbusch@kernel.org>
Cc: Keith Busch <kbusch@meta.com>,
	bhelgaas@google.com, maz@kernel.org, lrizzo@google.com,
	hch@lst.de, changfengnan@bytedance.com,
	namjain@linux.microsoft.com, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org, linux-nvme@lists.infradead.org
Subject: Re: [PATCH v3 2/2] PCI/MSI: Implement irq_mask_noflush() for MSI-X
Date: Sat, 07 Nov 2026 22:53:47 +0100	[thread overview]
Message-ID: <87o6c0wbo4.ffs@fw13> (raw)
In-Reply-To: <au-DcqwAz2wmmOne@kbusch-mbp>

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

      reply	other threads:[~2026-11-07 21:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 17:34 [PATCH v3 0/2] genirq, PCI/MSI: mask without flushing Keith Busch
2026-11-06 17:34 ` [PATCH v3 1/2] genirq: Add disable_irq_noflush() Keith Busch
2026-11-06 17:34 ` [PATCH v3 2/2] PCI/MSI: Implement irq_mask_noflush() for MSI-X Keith Busch
2026-11-06 20:53   ` Thomas Gleixner
2026-11-07 20:00     ` Keith Busch
2026-11-07 21:53       ` Thomas Gleixner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o6c0wbo4.ffs@fw13 \
    --to=tglx@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=changfengnan@bytedance.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=kbusch@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lrizzo@google.com \
    --cc=maz@kernel.org \
    --cc=namjain@linux.microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®