Linux PCI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Alex Elder" <elder@riscstar.com>
Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v3 2/3] misc: tc9564: introduce base PCI driver
Date: Tue, 15 Sep 2026 18:22:27 +0000	[thread overview]
Message-ID: <20260915182227.A53281F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260915181003.1633543-3-elder@riscstar.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] tc9564: missing Kconfig dependencies on OF and PCI_DYNAMIC_OF_NODES
--

commit e821d4f3b3a6f26cf2df684fa3788ceb3794a058
Author: Alex Elder <elder@riscstar.com>
Subject: misc: tc9564: introduce base PCI driver

This commit introduces a base PCI driver for the Toshiba TC9564 SoC. It binds
with embedded PCIe endpoint functions within the chip to perform basic PCI
initialization. The driver then uses Open Firmware APIs to populate and probe
endpoint bus children.

> diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
> --- a/drivers/misc/Kconfig
> +++ b/drivers/misc/Kconfig
> @@ -568,6 +568,15 @@ config MCHP_LAN966X_PCI
>  	    - lan966x-miim (MDIO_MSCC_MIIM)
>  	    - lan966x-switch (LAN966X_SWITCH)
>  
> +config TC9564_PCI
> +	tristate "Toshiba TC9564 PCI function support"
> +	depends on PCI

[Severity: Medium]
Should this configuration also depend on OF and PCI_DYNAMIC_OF_NODES?

Because the driver relies entirely on Open Firmware to function, compiling
it without CONFIG_OF or CONFIG_PCI_DYNAMIC_OF_NODES will result in a
successful build but an unconditional runtime probe failure.

[ ... ]

> diff --git a/drivers/misc/tc9564-pci.c b/drivers/misc/tc9564-pci.c
> --- /dev/null
> +++ b/drivers/misc/tc9564-pci.c
> @@ -0,0 +1,84 @@
[ ... ]
> +static int
> +tc9564_function_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> +{
> +	struct device *dev = &pdev->dev;
> +	struct device_node *np;
> +	int ret;
> +
> +	/* Despite being a PCI device, we require devicetree */
> +	np = dev_of_node(dev);
> +	if (!np)
> +		return dev_err_probe(dev, -EINVAL, "no devicetree node\n");

[Severity: Medium]
Will this probe fail unconditionally if the required dependencies are missing?

If CONFIG_OF is disabled, dev_of_node() will always return NULL, causing
dev_err_probe() to trigger here.

Similarly, this commit relies on of_pci_make_dev_node() via a PCI quirk to
dynamically create the devicetree node for the PCIe function. If
CONFIG_PCI_DYNAMIC_OF_NODES is disabled, of_pci_make_dev_node() compiles
to an empty stub, meaning the node is never created.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260915181003.1633543-1-elder@riscstar.com?part=2

  reply	other threads:[~2026-09-15 18:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15 18:09 [PATCH v3 0/3] PCI: introduce TC9564 misc driver Alex Elder
2026-09-15 18:10 ` [PATCH v3 1/3] dt-bindings: misc: introduce pci1179,0220.yaml Alex Elder
2026-09-15 18:16   ` sashiko-bot
2026-09-15 18:10 ` [PATCH v3 2/3] misc: tc9564: introduce base PCI driver Alex Elder
2026-09-15 18:22   ` sashiko-bot [this message]
2026-09-15 18:42     ` Alex Elder
2026-09-15 18:10 ` [PATCH v3 3/3] arm64: dts: qcom: qcs6490-rb3gen2: add endpoint buses Alex Elder
2026-09-15 18:25   ` sashiko-bot
2026-09-15 18:42     ` Alex Elder

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=20260915182227.A53281F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=elder@riscstar.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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