From: Niklas Cassel <cassel@kernel.org>
To: Manivannan Sadhasivam <mani@kernel.org>
Cc: Koichiro Den <den@valinux.co.jp>,
Bjorn Helgaas <helgaas@kernel.org>,
marek.vasut+renesas@gmail.com, yoshihiro.shimoda.uh@renesas.com,
lpieralisi@kernel.org, kwilczynski@kernel.org, robh@kernel.org,
bhelgaas@google.com, geert+renesas@glider.be,
magnus.damm@gmail.com, linux-pci@vger.kernel.org,
linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] PCI: dwc: rcar-gen4-ep: Mark BAR0 and BAR2 as Resizable BARs
Date: Wed, 4 Mar 2026 18:34:09 +0100 [thread overview]
Message-ID: <aahtEe3Klcg4QDyJ@ryzen> (raw)
In-Reply-To: <sreho2ezzdlndgzazx5alj3cx2snli4yemtrhiamjmr2v3myj5@yudnnbek4wbq>
On Wed, Mar 04, 2026 at 08:04:52PM +0530, Manivannan Sadhasivam wrote:
> >
> > So this is not something unique to BAR type/sizing scheme, the same arguments,
> > for/against, also applies for msi_capable/msix_capable.
> >
> > Manivannan, would it be possible to automatically initialize msi/msix_capable
> > on Qcom once a reference is provided, or would this be too late?
> >
>
> Yes, with a valid reference clock, it should be possible to read the
> capabilities and detect these. But there is no way we can make sure that the
> reference clock is always be present. Maybe we can do it using a devicetree
> property that you tried upstreaming some time before:
> https://lore.kernel.org/linux-pci/20250425092012.95418-2-cassel@kernel.org
I was thinking something more like, e.g. dw_pcie_ep_init_registers() calling:
1) A function that hides broken features.
2) A function that allocates and initializes features in epc_features.
E.g. msi_capable = true, msix_capable = true, barX = resizable,
based on the information it can parse from the capabilities list.
The allocation done in 2) could be dynamically allocated memory, so the
information could be kept even if the reference clock is lost at a later
time.
At least during dw_pcie_ep_init_registers(), I would assume that there is
a reference clock, even when using Common Clock, e.g. as default on Qcom.
Anyway, while I kind of like this idea, it would be a significant change
from the current design.
E.g. pci-epf-test makes use of epc_features already in .bind().
I don't know exactly how e.g. Qcom works, do we know that we will have
a reference clock in .bind() ? If I remember correctly, we only know that
we have a reference clock in .epc_init(). So this change would also need
to modify all existing EPF drivers to not make use of epc_features in
.bind(), and only make use of epc_features first after .epc_init().
So it sounds like quite a big change. Probably a design we would want if
we designed the PCI endpoint framework today, but doubt it will happen now.
Kind regards,
Niklas
prev parent reply other threads:[~2026-03-04 17:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-10 16:03 [PATCH v2] PCI: dwc: rcar-gen4-ep: Mark BAR0 and BAR2 as Resizable BARs Koichiro Den
2026-02-26 7:22 ` Manivannan Sadhasivam
2026-03-02 22:31 ` Bjorn Helgaas
2026-03-03 5:12 ` Koichiro Den
2026-03-04 13:32 ` Niklas Cassel
2026-03-04 14:34 ` Manivannan Sadhasivam
2026-03-04 17:34 ` Niklas Cassel [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=aahtEe3Klcg4QDyJ@ryzen \
--to=cassel@kernel.org \
--cc=bhelgaas@google.com \
--cc=den@valinux.co.jp \
--cc=geert+renesas@glider.be \
--cc=helgaas@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=magnus.damm@gmail.com \
--cc=mani@kernel.org \
--cc=marek.vasut+renesas@gmail.com \
--cc=robh@kernel.org \
--cc=yoshihiro.shimoda.uh@renesas.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