From: Will Deacon <will@kernel.org>
To: Ilkka Koskinen <ilkka@os.amperecomputing.com>
Cc: Shuai Xue <xueshuai@linux.alibaba.com>,
Jing Zhang <renyu.zj@linux.alibaba.com>,
Mark Rutland <mark.rutland@arm.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] perf/dwc_pcie: Load DesignWare PCIe PMU driver automatically on Ampere SoCs
Date: Mon, 28 Oct 2024 17:31:34 +0000 [thread overview]
Message-ID: <20241028173132.GC2871@willie-the-truck> (raw)
In-Reply-To: <617bffb7-9dee-6139-53d5-524ba03197f6@os.amperecomputing.com>
On Thu, Oct 24, 2024 at 03:19:17PM -0700, Ilkka Koskinen wrote:
>
> Hi Will,
>
> On Thu, 24 Oct 2024, Will Deacon wrote:
> > On Tue, Oct 08, 2024 at 11:18:23PM +0000, Ilkka Koskinen wrote:
> > > Load DesignWare PCIe PMU driver automatically if the system has a PCI
> > > bridge by Ampere.
> > >
> > > Signed-off-by: Ilkka Koskinen <ilkka@os.amperecomputing.com>
> > > ---
> > > drivers/perf/dwc_pcie_pmu.c | 10 ++++++++++
> > > 1 file changed, 10 insertions(+)
> > >
> > > diff --git a/drivers/perf/dwc_pcie_pmu.c b/drivers/perf/dwc_pcie_pmu.c
> > > index 3581d916d851..d752168733cf 100644
> > > --- a/drivers/perf/dwc_pcie_pmu.c
> > > +++ b/drivers/perf/dwc_pcie_pmu.c
> > > @@ -782,6 +782,16 @@ static void __exit dwc_pcie_pmu_exit(void)
> > > module_init(dwc_pcie_pmu_init);
> > > module_exit(dwc_pcie_pmu_exit);
> > >
> > > +static const struct pci_device_id dwc_pcie_pmu_table[] = {
> > > + {
> > > + PCI_DEVICE(PCI_VENDOR_ID_AMPERE, PCI_ANY_ID),
> > > + .class = PCI_CLASS_BRIDGE_PCI_NORMAL,
> > > + .class_mask = ~0,
> > > + },
> > > + { }
> > > +};
> > > +MODULE_DEVICE_TABLE(pci, dwc_pcie_pmu_table);
> >
> > Hmm, won't this only work if the driver is modular? Should we be calling
> > pci_register_driver() for the builtin case?
>
> That would be the normal case indeed. However, this driver is quite
> different: dwc_pcie_pmu_init() goes through all the pci devices looking for
> root ports with the pmu capabilities. Moreover, the probe function isn't
> bound to any specific vendor/class/device IDs. This patch simply makes sure
> the driver is loaded and the init function gets called, if the driver was
> built as module and ran on Ampere system.
Ok, but that seems like the wrong approach, no? We end up with a weird
list of vendors who want the thing to probe on their SoCs and, by
omission, everybody not on the list doesn't want that behaviour.
Will
next prev parent reply other threads:[~2024-10-28 17:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20241008231824.5102-1-ilkka@os.amperecomputing.com>
[not found] ` <20241008231824.5102-3-ilkka@os.amperecomputing.com>
2024-10-24 11:32 ` [PATCH 2/3] perf/dwc_pcie: Load DesignWare PCIe PMU driver automatically on Ampere SoCs Will Deacon
2024-10-24 22:19 ` Ilkka Koskinen
2024-10-28 17:31 ` Will Deacon [this message]
2024-10-29 3:27 ` Ilkka Koskinen
2024-10-29 13:00 ` Will Deacon
2024-10-29 15:39 ` Jonathan Cameron
2024-10-29 16:15 ` [PATCH 0/3] perf/dwc_pcie: Enable DesignWare PCIe PMU " Will Deacon
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=20241028173132.GC2871@willie-the-truck \
--to=will@kernel.org \
--cc=ilkka@os.amperecomputing.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=renyu.zj@linux.alibaba.com \
--cc=xueshuai@linux.alibaba.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