From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Marek Vasut <marek.vasut+renesas@mailbox.org>
Cc: linux-arm-kernel@lists.infradead.org,
Anand Moon <linux.amoon@gmail.com>,
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Bjorn Helgaas <bhelgaas@google.com>,
Conor Dooley <conor+dt@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Magnus Damm <magnus.damm@gmail.com>,
Rob Herring <robh@kernel.org>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v2 1/3] PCI/pwrctrl: Add optional slot clock to pwrctrl driver for PCI slots
Date: Wed, 4 Jun 2025 10:40:25 +0200 [thread overview]
Message-ID: <CAMuHMdUFHKHKfymqa6jwfNnxZTAuH3kbj5WL+-zN=TR6XGd0eA@mail.gmail.com> (raw)
In-Reply-To: <20250530225504.55042-1-marek.vasut+renesas@mailbox.org>
Hi Marek,
Thanks for your patch!
On Sat, 31 May 2025 at 00:55, Marek Vasut
<marek.vasut+renesas@mailbox.org> wrote:
> Add the ability to enable optional slot clock into the pwrctrl driver.
> This is used to enable slot clock in split-clock topologies, where the
> PCIe host/controller supply and PCIe slot supply are not provided by
> the same clock. The PCIe host/controller clock should be described in
> the controller node as the controller clock, while the slot clock should
> be described in controller bridge/slot subnode.
>
> Example DT snippet:
> &pcicontroller {
> clocks = <&clk_dif 0>; /* PCIe controller clock */
>
> pci@0,0 {
> #address-cells = <3>;
> #size-cells = <2>;
> reg = <0x0 0x0 0x0 0x0 0x0>;
> compatible = "pciclass,0604";
> device_type = "pci";
> clocks = <&clk_dif 1>; /* PCIe slot clock */
I assume this should be documented in
dtschema/schemas/pci/pci-bus-common.yaml, too?
> vpcie3v3-supply = <®_3p3v>;
> ranges;
> };
> };
>
> Example clock topology:
> ____________ ____________
> | PCIe host | | PCIe slot |
> | | | |
> | PCIe RX<|==================|>PCIe TX |
> | PCIe TX<|==================|>PCIe RX |
> | | | |
> | PCIe CLK<|======.. ..======|>PCIe CLK |
> '------------' || || '------------'
> || ||
> ____________ || ||
> | 9FGV0441 | || ||
> | | || ||
> | CLK DIF0<|======'' ||
> | CLK DIF1<|==========''
> | CLK DIF2<|
> | CLK DIF3<|
> '------------'
>
> Reviewed-by: Anand Moon <linux.amoon@gmail.com>
> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
> --- a/drivers/pci/pwrctrl/slot.c
> +++ b/drivers/pci/pwrctrl/slot.c
> @@ -30,6 +31,7 @@ static int pci_pwrctrl_slot_probe(struct platform_device *pdev)
> {
> struct pci_pwrctrl_slot_data *slot;
> struct device *dev = &pdev->dev;
> + struct clk *clk;
> int ret;
>
> slot = devm_kzalloc(dev, sizeof(*slot), GFP_KERNEL);
> @@ -50,6 +52,13 @@ static int pci_pwrctrl_slot_probe(struct platform_device *pdev)
> goto err_regulator_free;
> }
>
> + clk = devm_clk_get_optional_enabled(dev, NULL);
> + if (IS_ERR(clk)) {
> + ret = dev_err_probe(dev, PTR_ERR(clk),
> + "Failed to enable slot clock\n");
> + goto err_regulator_disable;
> + }
You are adding this block in the middle of the regulator handling.
Please move it below, under the devm_add_action_or_reset() call
(which is handled wrong, I have sent a patch[1]).
> +
> ret = devm_add_action_or_reset(dev, devm_pci_pwrctrl_slot_power_off,
> slot);
> if (ret)
[1] https://lore.kernel.org/f60c445e965ba309f08c33de78bd62f358e68cd0.1749025687.git.geert+renesas@glider.be
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next prev parent reply other threads:[~2025-06-04 8:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-30 22:53 [PATCH v2 1/3] PCI/pwrctrl: Add optional slot clock to pwrctrl driver for PCI slots Marek Vasut
2025-05-30 22:53 ` [PATCH v2 2/3] arm64: dts: renesas: r8a779g0: Describe root port on R-Car V4H Marek Vasut
2025-06-04 9:13 ` Geert Uytterhoeven
2025-06-04 17:26 ` Manivannan Sadhasivam
2025-05-30 22:53 ` [PATCH v2 3/3] arm64: dts: renesas: r8a779g3: Describe split PCIe clock on V4H Sparrow Hawk Marek Vasut
2025-06-04 9:24 ` Geert Uytterhoeven
2025-06-04 17:31 ` Manivannan Sadhasivam
2025-06-05 7:33 ` Geert Uytterhoeven
2025-06-04 17:27 ` Manivannan Sadhasivam
2025-06-02 10:17 ` [PATCH v2 1/3] PCI/pwrctrl: Add optional slot clock to pwrctrl driver for PCI slots Bartosz Golaszewski
2025-06-04 8:40 ` Geert Uytterhoeven [this message]
2025-06-04 17:22 ` Manivannan Sadhasivam
2025-06-07 19:48 ` Marek Vasut
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='CAMuHMdUFHKHKfymqa6jwfNnxZTAuH3kbj5WL+-zN=TR6XGd0eA@mail.gmail.com' \
--to=geert@linux-m68k.org \
--cc=bhelgaas@google.com \
--cc=brgl@bgdev.pl \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux.amoon@gmail.com \
--cc=magnus.damm@gmail.com \
--cc=manivannan.sadhasivam@linaro.org \
--cc=marek.vasut+renesas@mailbox.org \
--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;
as well as URLs for NNTP newsgroup(s).