All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Brian Norris <briannorris@chromium.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	Manivannan Sadhasivam <mani@kernel.org>,
	linux-pci@vger.kernel.org, David Matlack <dmatlack@google.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] PCI/portdrv: Allow probing even without child services
Date: Thu, 23 Jul 2026 08:27:41 +0200	[thread overview]
Message-ID: <amG0XebAYI-4eDIN@wunner.de> (raw)
In-Reply-To: <20260722160942.v4.1.I5fd5d83f518681b3949d8ab2f16ba8244fd3e774@changeid>

On Wed, Jul 22, 2026 at 04:09:42PM -0700, Brian Norris wrote:
> +++ b/drivers/pci/pcie/portdrv.c
> @@ -330,7 +330,7 @@ static int pcie_device_init(struct pci_dev *pdev, int service, int irq)
>   */
>  static int pcie_port_device_register(struct pci_dev *dev)
>  {
> -	int status, capabilities, i, nr_service;
> +	int status, capabilities, i;
>  	int irqs[PCIE_PORT_DEVICE_MAXSERVICES];

Nit:  Move the amended line below the irqs[] declaration to sustain
inverse Christmas tree ordering.

Otherwise this is
Reviewed-by: Lukas Wunner <lukas@wunner.de>

One caveat, I note there is a pre-existing issue on Loongson LS7A,
which (according to 62b6dee1b44a) suffers from a defect wherein
disabling bus mastering prevents forwarding of MMIO requests downstream.
This happens right now (and continues to happen after the present patch)
if the error path in pcie_port_device_register() is taken.

I also note that pci_enable_device() is only called because per
1ce5e83063bf, it was necessary in 2009 for legacy interrupt initialization
"on some architectures", which sounds fairly vague to me.  In any case,
it seems to suggest that pci_disable_device() should be called if
pcie_init_service_irqs() fails.  Right now that is done, after the patch
it isn't.  I guess portdrv would have to remember on probe whether
pci_enable_device() was called and only then call pci_disable_device()
on remove.  I guess it would be possible to abuse dev_set_drvdata()
to store this status bit (as a fake pointer).  Then again, I'm not
sure pci_enable_device() is still necessary for legacy interrupt
initalization today.  I guess "legacy interrupt" refers to INTx.
A lot has changed in generic and PCI irq code since 2009.
I assume we otherwise don't have a need to access BARs on PCIe ports
currently, but perhaps new port services may come along which do?

Thanks,

Lukas

      parent reply	other threads:[~2026-07-23  6:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22 23:09 [PATCH v4] PCI/portdrv: Allow probing even without child services Brian Norris
2026-07-22 23:20 ` sashiko-bot
2026-07-23  6:27 ` Lukas Wunner [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=amG0XebAYI-4eDIN@wunner.de \
    --to=lukas@wunner.de \
    --cc=bhelgaas@google.com \
    --cc=briannorris@chromium.org \
    --cc=dmatlack@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mani@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.