From: Stephan Gerhold <stephan.gerhold@linaro.org>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Johan Hovold <johan@kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>, Kalle Valo <kvalo@kernel.org>,
linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
Steev Klimaszewski <steev@kali.org>
Subject: Re: [PATCH v4 3/3] arm64: dts: qcom: sc8280xp-x13s: model the PMU of the on-board wcn6855
Date: Fri, 4 Oct 2024 13:04:02 +0200 [thread overview]
Message-ID: <Zv_Lok1BT1Hg13dC@linaro.org> (raw)
In-Reply-To: <CAMRc=Mde8rGT+81ViTX0Qj2sDrD59dkLHeUZd1xkWO_H=QvC0Q@mail.gmail.com>
On Thu, Oct 03, 2024 at 05:16:59AM -0700, Bartosz Golaszewski wrote:
> On Thu, 3 Oct 2024 13:38:35 +0200, Bartosz Golaszewski <brgl@bgdev.pl> said:
> > On Thu, Oct 3, 2024 at 1:07 PM Johan Hovold <johan@kernel.org> wrote:
> >>
> >> Without this patch I'm seeing an indefinite probe deferral with
> >> 6.12-rc1:
> >>
> >> platform 1c00000.pcie:pcie@0:wifi@0: deferred probe pending: pci-pwrctl-pwrseq: Failed to get the power sequencer
> >>
> >> Can you please look into that and make sure that the existing DT
> >> continues to work without such warnings.
> >>
> >
> > Ah, dammit, I missed the fact that X13s already has this node defined
> > so PCI pwrctl will consume it and try to get the power sequencer
> > handle. I'm wondering how to tackle it though... It will most likely
> > require some kind of a driver quirk where we check if we have the PMU
> > node and if not, then don't try to set up power sequencing. Any other
> > ideas?
> >
>
> This is untested but would it make sense?
>
> diff --git a/drivers/pci/pwrctl/pci-pwrctl-pwrseq.c
> b/drivers/pci/pwrctl/pci-pwrctl-pwrseq.c
> index a23a4312574b..071ee77c763d 100644
> --- a/drivers/pci/pwrctl/pci-pwrctl-pwrseq.c
> +++ b/drivers/pci/pwrctl/pci-pwrctl-pwrseq.c
> @@ -3,6 +3,7 @@
> * Copyright (C) 2024 Linaro Ltd.
> */
>
> +#include <linux/cleanup.h>
> #include <linux/device.h>
> #include <linux/mod_devicetable.h>
> #include <linux/module.h>
> @@ -87,7 +88,31 @@ static struct platform_driver pci_pwrctl_pwrseq_driver = {
> },
> .probe = pci_pwrctl_pwrseq_probe,
> };
> -module_platform_driver(pci_pwrctl_pwrseq_driver);
> +
> +static int __init pci_pwrctl_pwrseq_init(void)
> +{
> + /*
> + * Old device trees for the Lenovo X13s have the "pci17cb,1103" node
> + * defined but don't use power sequencing yet. If we register this
> + * driver, it will match against this node and lead to emitting of
> + * a warning in the kernel log when we cannot get the power sequencing
> + * handle. Let's skip registering the platform driver if we're on X13s
> + * but don't have the PMU node.
> + */
> + if (of_machine_is_compatible("lenovo,thinkpad-x13s")) {
> + struct device_node *dn __free(device_node) =
> + of_find_compatible_node(NULL, NULL, "qcom,wcn6855-pmu");
> + if (!dn)
> + return 0;
> + }
> +
> + return platform_driver_register(&pci_pwrctl_pwrseq_driver);
> +}
> +
> +static void __exit pci_pwrctl_pwrseq_exit(void)
> +{
> + platform_driver_unregister(&pci_pwrctl_pwrseq_driver);
> +}
>
> MODULE_AUTHOR("Bartosz Golaszewski <bartosz.golaszewski@linaro.org>");
> MODULE_DESCRIPTION("Generic PCI Power Control module for power
> sequenced devices");
>
> X13s is the only platform that would use one of the compatibles supported by
> this driver before power sequencing so it should be a one-off quirk.
>
I'm guessing the pci17cb,1107 node in x1e80100-lenovo-yoga-slim7x is
also affected?
Maybe you can check if the node has one of the -supply properties and
return -ENODEV from pci_pwrctl_pwrseq_probe() otherwise?
Thanks,
Stephan
next prev parent reply other threads:[~2024-10-04 11:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-30 10:30 [PATCH v4 0/3] arm64: dts: qcom: sc8280xp: enable WLAN and Bluetooth Bartosz Golaszewski
2024-09-30 10:30 ` [PATCH v4 1/3] arm64: dts: qcom: sc8280xp-crd: model the PMU of the on-board wcn6855 Bartosz Golaszewski
2024-10-03 10:40 ` Johan Hovold
2024-10-03 11:26 ` Bartosz Golaszewski
2024-09-30 10:30 ` [PATCH v4 2/3] arm64: dts: qcom: sc8280xp-crd: enable bluetooth Bartosz Golaszewski
2024-10-03 10:59 ` Johan Hovold
2024-09-30 10:30 ` [PATCH v4 3/3] arm64: dts: qcom: sc8280xp-x13s: model the PMU of the on-board wcn6855 Bartosz Golaszewski
2024-10-03 11:07 ` Johan Hovold
2024-10-03 11:38 ` Bartosz Golaszewski
2024-10-03 12:16 ` Bartosz Golaszewski
2024-10-04 11:04 ` Stephan Gerhold [this message]
2024-10-04 11:08 ` Bartosz Golaszewski
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=Zv_Lok1BT1Hg13dC@linaro.org \
--to=stephan.gerhold@linaro.org \
--cc=andersson@kernel.org \
--cc=bartosz.golaszewski@linaro.org \
--cc=bhelgaas@google.com \
--cc=brgl@bgdev.pl \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=johan@kernel.org \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kvalo@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=steev@kali.org \
/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).