mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@nxp.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Kishon Vijay Abraham I" <kishon@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"Anup Patel" <apatel@ventanamicro.com>,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	imx@lists.linux.dev, "Niklas Cassel" <cassel@kernel.org>,
	dlemoal@kernel.org, maz@kernel.org, jdmason@kudzu.us,
	stable@kernel.org
Subject: Re: [PATCH v9 1/6] platform-msi: Add msi_remove_device_irq_domain() in platform_device_msi_free_irqs_all()
Date: Tue, 3 Dec 2024 16:40:16 -0500	[thread overview]
Message-ID: <Z096wCMFmR7AyfWn@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <87y10wsc6z.ffs@tglx>

On Tue, Dec 03, 2024 at 10:12:36PM +0100, Thomas Gleixner wrote:
> On Tue, Dec 03 2024 at 15:36, Frank Li wrote:
> > The follow steps trigger kernel dump warning and
> > platform_device_msi_init_and_alloc_irqs() return false.
> >
> > 1: platform_device_msi_init_and_alloc_irqs();
> > 2: platform_device_msi_free_irqs_all();
> > 3: platform_device_msi_init_and_alloc_irqs();
> >
> > Do below two things in platform_device_msi_init_and_alloc_irqs().
> > - msi_create_device_irq_domain()
> > - msi_domain_alloc_irqs_range()
> >
> > But only call msi_domain_free_irqs_all() in
> > platform_device_msi_free_irqs_all(), which missed call
> > msi_remove_device_irq_domain().
>
> It's not a missed call. It's intentional as all existing users remove
> the device afterwards.
>
> > This cause above kernel dump when call
> > platform_device_msi_init_and_alloc_irqs() again.
>
> Sure, but that's not a fix and not required for stable because no
> existing driver is affected by this unless I'm missing something.
>
> What's the actual use case for this? You describe in great length what
> fails, which is nice, but I'm missing the larger picture here.

PCI host send a door bell to PCI endpoint, which use platform msi to
trigger a IRQ.

PCI Host side				PCI endpoint side

Send "enable"  command      ->         call platform_device_msi_init_and_alloc_irqs()
Get doorbell address        <-         send back MSI address by shared memory
Write data to doorbell      -> 	       MSI irq handler triggered.
Send "Disable"  command     ->	       call platform_device_msi_free_irqs_all()


At endpoint side, need dymatic response "enable/disable" commands. Of
course, I can call msi_remove_device_irq_domain() in my disable function.
But I think it should be symetic in alloc/free pair functions.

Previous version, alloc/free in bind/unbind function. I missed to do
unbind/bind test. the principle should be the same.

Frank

>
> Thanks,
>
>         tglx

  reply	other threads:[~2024-12-03 21:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-03 20:36 [PATCH v9 0/6] PCI: EP: Add RC-to-EP doorbell with platform MSI controller Frank Li
2024-12-03 20:36 ` [PATCH v9 1/6] platform-msi: Add msi_remove_device_irq_domain() in platform_device_msi_free_irqs_all() Frank Li
2024-12-03 21:12   ` Thomas Gleixner
2024-12-03 21:40     ` Frank Li [this message]
2024-12-03 23:14       ` Thomas Gleixner
2024-12-04 16:10         ` Frank Li
2024-12-03 20:36 ` [PATCH v9 2/6] PCI: endpoint: Add RC-to-EP doorbell support using platform MSI controller Frank Li
2024-12-03 22:15   ` Thomas Gleixner
2024-12-03 23:24     ` Frank Li
2024-12-04 13:08       ` Thomas Gleixner
2024-12-03 20:36 ` [PATCH v9 3/6] PCI: endpoint: Add pci_epf_align_inbound_addr() helper for address alignment Frank Li
2024-12-03 20:36 ` [PATCH v9 4/6] PCI: endpoint: pci-epf-test: Add doorbell test support Frank Li
2024-12-03 20:36 ` [PATCH v9 5/6] misc: pci_endpoint_test: Add doorbell test case Frank Li
2024-12-03 20:36 ` [PATCH v9 6/6] tools: PCI: Add 'B' option for test doorbell Frank Li

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=Z096wCMFmR7AyfWn@lizhi-Precision-Tower-5810 \
    --to=frank.li@nxp.com \
    --cc=apatel@ventanamicro.com \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=cassel@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=imx@lists.linux.dev \
    --cc=jdmason@kudzu.us \
    --cc=kishon@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=maz@kernel.org \
    --cc=rafael@kernel.org \
    --cc=stable@kernel.org \
    --cc=tglx@linutronix.de \
    /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®