Linux PCI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ian Rogers" <irogers@google.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH 1/2] PCI: cadence: Set .owner = THIS_MODULE in cdns_pcie_epc_ops
Date: Thu, 03 Dec 2026 18:33:12 +0000	[thread overview]
Message-ID: <sashiko-outbox-248400@kernel.org> (raw)
In-Reply-To: <20261203171642.440891-2-irogers@google.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] PCI: cadence: Fixes tag cites 37dddf14f1ae instead of
  f876904e4436
--

commit 7d16f45d8dc004d424a29a6333f5e5299a95a021
Author: Ian Rogers <irogers@google.com>

> PCI: cadence: Set .owner = THIS_MODULE in cdns_pcie_epc_ops
>
> pci_epc_get() calls try_module_get(epc->ops->owner) and pci_epc_put()
> calls module_put(epc->ops->owner), while __pci_epc_create() ignores its
> owner parameter because epc->ops is const struct pci_epc_ops *. Because
> pcie-cadence-ep can be built as a module (CONFIG_PCIE_CADENCE_EP),
> omitting .owner leaves the module unpinned while an endpoint controller
> reference is held.
>
> Set .owner = THIS_MODULE in cdns_pcie_epc_ops, found with Clang's
> require_explicit_initialization attribute.
>
> Fixes: 37dddf14f1ae ("PCI: cadence: Add EndPoint Controller driver for Cadence PCIe controller")
> Signed-off-by: Ian Rogers <irogers@google.com>

[Severity: Low]
Should the Fixes tag point to f876904e4436 ("PCI: cadence: Add support to
build pcie-cadence library as a kernel module") instead?

In the cited commit, CONFIG_PCIE_CADENCE_EP was bool and built-in only, so
THIS_MODULE expanded to NULL.  The unpinned-module bug began when the driver
was converted to tristate, and citing the older commit can trigger unnecessary
backports to stable trees where it cannot be built as a module.

  Fixes: f876904e4436 ("PCI: cadence: Add support to build pcie-cadence library as a kernel module")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203171642.440891-1-irogers@google.com?part=1

  reply	other threads:[~2026-12-03 18:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 17:16 [PATCH 0/2] PCI: endpoint: Set .owner = THIS_MODULE in struct pci_epc_ops Ian Rogers
2026-12-03 17:16 ` [PATCH 1/2] PCI: cadence: Set .owner = THIS_MODULE in cdns_pcie_epc_ops Ian Rogers
2026-12-03 18:33   ` sashiko-bot [this message]
2026-12-03 17:16 ` [PATCH 2/2] PCI: endpoint: Set .owner = THIS_MODULE in remaining pci_epc_ops Ian Rogers
2026-12-03 18:47 ` [PATCH 0/2] PCI: endpoint: Set .owner = THIS_MODULE in struct pci_epc_ops sashiko-bot

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=sashiko-outbox-248400@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=irogers@google.com \
    --cc=linux-pci@vger.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