All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pinctrl: qcom-pmic-gpio: silence -EPROBE_DEFER message on probe
@ 2023-08-17 14:59 Brian Masney
  2023-08-17 15:01 ` Konrad Dybcio
  0 siblings, 1 reply; 6+ messages in thread
From: Brian Masney @ 2023-08-17 14:59 UTC (permalink / raw)
  To: andersson, linus.walleij
  Cc: agross, konrad.dybcio, linux-arm-msm, linux-gpio, linux-kernel

The following message shows up one or more times when booting a Qualcomm
SA8775 Development board:

    qcom-spmi-gpio c440000.spmi:pmic@2:gpio@8800: can't add gpio chip

Convert this over to use dev_err_probe() to silence this message.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
index deded9c6fd7d..d7576fa14935 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
@@ -1154,10 +1154,8 @@ static int pmic_gpio_probe(struct platform_device *pdev)
 	girq->child_irq_domain_ops.translate = pmic_gpio_domain_translate;
 
 	ret = gpiochip_add_data(&state->chip, state);
-	if (ret) {
-		dev_err(state->dev, "can't add gpio chip\n");
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(state->dev, ret, "can't add gpio chip\n");
 
 	/*
 	 * For DeviceTree-supported systems, the gpio core checks the
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] pinctrl: qcom-pmic-gpio: silence -EPROBE_DEFER message on probe
  2023-08-17 14:59 [PATCH] pinctrl: qcom-pmic-gpio: silence -EPROBE_DEFER message on probe Brian Masney
@ 2023-08-17 15:01 ` Konrad Dybcio
  2023-08-17 16:26   ` Brian Masney
  0 siblings, 1 reply; 6+ messages in thread
From: Konrad Dybcio @ 2023-08-17 15:01 UTC (permalink / raw)
  To: Brian Masney, andersson, linus.walleij
  Cc: agross, linux-arm-msm, linux-gpio, linux-kernel

On 17.08.2023 16:59, Brian Masney wrote:
> The following message shows up one or more times when booting a Qualcomm
> SA8775 Development board:
> 
>     qcom-spmi-gpio c440000.spmi:pmic@2:gpio@8800: can't add gpio chip
> 
> Convert this over to use dev_err_probe() to silence this message.
> 
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---
That looks odd, why would it ever defer?

SPMI should be up by the time it gets a chance to probe.

Konrad

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] pinctrl: qcom-pmic-gpio: silence -EPROBE_DEFER message on probe
  2023-08-17 15:01 ` Konrad Dybcio
@ 2023-08-17 16:26   ` Brian Masney
  2023-08-18 13:51     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 6+ messages in thread
From: Brian Masney @ 2023-08-17 16:26 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: andersson, linus.walleij, agross, linux-arm-msm, linux-gpio,
	linux-kernel

On Thu, Aug 17, 2023 at 05:01:19PM +0200, Konrad Dybcio wrote:
> On 17.08.2023 16:59, Brian Masney wrote:
> > The following message shows up one or more times when booting a Qualcomm
> > SA8775 Development board:
> > 
> >     qcom-spmi-gpio c440000.spmi:pmic@2:gpio@8800: can't add gpio chip
> > 
> > Convert this over to use dev_err_probe() to silence this message.
> > 
> > Signed-off-by: Brian Masney <bmasney@redhat.com>
> > ---
> That looks odd, why would it ever defer?
> 
> SPMI should be up by the time it gets a chance to probe.

You replied within the same minute of me posting that patch, which is
the fastest review I've had to date on an upstream kernel list. Before
we continue, please verify:

              [ ] I am not a robot

:)

So SPMI is up and probes normally the first time, and is up by time this
driver probes. I think the probe deferral is happening somewhere in
pinctrl, however I am not sure exactly where. I added some tracers to
the kernel command line and here's some relevant log messages:

    device: 'c440000.spmi:pmic@2:gpio@8800': device_add
    bus: 'platform': add device c440000.spmi:pmic@2:gpio@8800
    PM: Adding info for platform:c440000.spmi:pmic@2:gpio@8800
    bus: 'platform': __driver_probe_device: matched device c440000.spmi:pmic@2:gpio@8800 with driver qcom-spmi-gpio
    bus: 'platform': really_probe: probing driver qcom-spmi-gpio with device c440000.spmi:pmic@2:gpio@8800
    qcom-spmi-gpio c440000.spmi:pmic@2:gpio@8800: no pinctrl handle
    qcom-spmi-gpio c440000.spmi:pmic@2:gpio@8800: try to register 12 pins ...
    pinctrl core: registered pin 0 (gpio1) on c440000.spmi:pmic@2:gpio@8800
    pinctrl core: registered pin 1 (gpio2) on c440000.spmi:pmic@2:gpio@8800
    pinctrl core: registered pin 2 (gpio3) on c440000.spmi:pmic@2:gpio@8800
    pinctrl core: registered pin 3 (gpio4) on c440000.spmi:pmic@2:gpio@8800
    pinctrl core: registered pin 4 (gpio5) on c440000.spmi:pmic@2:gpio@8800
    pinctrl core: registered pin 5 (gpio6) on c440000.spmi:pmic@2:gpio@8800
    pinctrl core: registered pin 6 (gpio7) on c440000.spmi:pmic@2:gpio@8800
    pinctrl core: registered pin 7 (gpio8) on c440000.spmi:pmic@2:gpio@8800
    pinctrl core: registered pin 8 (gpio9) on c440000.spmi:pmic@2:gpio@8800
    pinctrl core: registered pin 9 (gpio10) on c440000.spmi:pmic@2:gpio@8800
    pinctrl core: registered pin 10 (gpio11) on c440000.spmi:pmic@2:gpio@8800
    pinctrl core: registered pin 11 (gpio12) on c440000.spmi:pmic@2:gpio@8800
    qcom-spmi-gpio c440000.spmi:pmic@2:gpio@8800: no hogs found
    qcom-spmi-gpio c440000.spmi:pmic@2:gpio@8800: error -EPROBE_DEFER: can't add gpio chip
    qcom-spmi-gpio c440000.spmi:pmic@2:gpio@8800: Driver qcom-spmi-gpio requests probe deferral
    platform c440000.spmi:pmic@2:gpio@8800: Added to deferred list

The second time it probes the device is successfully added.

Brian


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] pinctrl: qcom-pmic-gpio: silence -EPROBE_DEFER message on probe
  2023-08-17 16:26   ` Brian Masney
@ 2023-08-18 13:51     ` Krzysztof Kozlowski
  2023-08-18 13:59       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-18 13:51 UTC (permalink / raw)
  To: Brian Masney, Konrad Dybcio
  Cc: andersson, linus.walleij, agross, linux-arm-msm, linux-gpio,
	linux-kernel

On 17/08/2023 18:26, Brian Masney wrote:
> On Thu, Aug 17, 2023 at 05:01:19PM +0200, Konrad Dybcio wrote:
>> On 17.08.2023 16:59, Brian Masney wrote:
>>> The following message shows up one or more times when booting a Qualcomm
>>> SA8775 Development board:
>>>
>>>     qcom-spmi-gpio c440000.spmi:pmic@2:gpio@8800: can't add gpio chip
>>>
>>> Convert this over to use dev_err_probe() to silence this message.
>>>
>>> Signed-off-by: Brian Masney <bmasney@redhat.com>
>>> ---
>> That looks odd, why would it ever defer?
>>
>> SPMI should be up by the time it gets a chance to probe.
> 
> You replied within the same minute of me posting that patch, which is
> the fastest review I've had to date on an upstream kernel list. Before
> we continue, please verify:
> 
>               [ ] I am not a robot
> 
> :)
> 
> So SPMI is up and probes normally the first time, and is up by time this
> driver probes. I think the probe deferral is happening somewhere in
> pinctrl, however I am not sure exactly where. I added some tracers to
> the kernel command line and here's some relevant log messages:
> 
>     device: 'c440000.spmi:pmic@2:gpio@8800': device_add
>     bus: 'platform': add device c440000.spmi:pmic@2:gpio@8800
>     PM: Adding info for platform:c440000.spmi:pmic@2:gpio@8800
>     bus: 'platform': __driver_probe_device: matched device c440000.spmi:pmic@2:gpio@8800 with driver qcom-spmi-gpio
>     bus: 'platform': really_probe: probing driver qcom-spmi-gpio with device c440000.spmi:pmic@2:gpio@8800
>     qcom-spmi-gpio c440000.spmi:pmic@2:gpio@8800: no pinctrl handle
>     qcom-spmi-gpio c440000.spmi:pmic@2:gpio@8800: try to register 12 pins ...
>     pinctrl core: registered pin 0 (gpio1) on c440000.spmi:pmic@2:gpio@8800
>     pinctrl core: registered pin 1 (gpio2) on c440000.spmi:pmic@2:gpio@8800
>     pinctrl core: registered pin 2 (gpio3) on c440000.spmi:pmic@2:gpio@8800
>     pinctrl core: registered pin 3 (gpio4) on c440000.spmi:pmic@2:gpio@8800
>     pinctrl core: registered pin 4 (gpio5) on c440000.spmi:pmic@2:gpio@8800
>     pinctrl core: registered pin 5 (gpio6) on c440000.spmi:pmic@2:gpio@8800
>     pinctrl core: registered pin 6 (gpio7) on c440000.spmi:pmic@2:gpio@8800
>     pinctrl core: registered pin 7 (gpio8) on c440000.spmi:pmic@2:gpio@8800
>     pinctrl core: registered pin 8 (gpio9) on c440000.spmi:pmic@2:gpio@8800
>     pinctrl core: registered pin 9 (gpio10) on c440000.spmi:pmic@2:gpio@8800
>     pinctrl core: registered pin 10 (gpio11) on c440000.spmi:pmic@2:gpio@8800
>     pinctrl core: registered pin 11 (gpio12) on c440000.spmi:pmic@2:gpio@8800
>     qcom-spmi-gpio c440000.spmi:pmic@2:gpio@8800: no hogs found
>     qcom-spmi-gpio c440000.spmi:pmic@2:gpio@8800: error -EPROBE_DEFER: can't add gpio chip
>     qcom-spmi-gpio c440000.spmi:pmic@2:gpio@8800: Driver qcom-spmi-gpio requests probe deferral
>     platform c440000.spmi:pmic@2:gpio@8800: Added to deferred list
> 
> The second time it probes the device is successfully added.

There is a bug in DTS. I'll send a patch.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] pinctrl: qcom-pmic-gpio: silence -EPROBE_DEFER message on probe
  2023-08-18 13:51     ` Krzysztof Kozlowski
@ 2023-08-18 13:59       ` Krzysztof Kozlowski
  2023-08-21 13:11         ` Brian Masney
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-18 13:59 UTC (permalink / raw)
  To: Brian Masney, Konrad Dybcio
  Cc: andersson, linus.walleij, agross, linux-arm-msm, linux-gpio,
	linux-kernel

On 18/08/2023 15:51, Krzysztof Kozlowski wrote:
>>     qcom-spmi-gpio c440000.spmi:pmic@2:gpio@8800: no hogs found
>>     qcom-spmi-gpio c440000.spmi:pmic@2:gpio@8800: error -EPROBE_DEFER: can't add gpio chip
>>     qcom-spmi-gpio c440000.spmi:pmic@2:gpio@8800: Driver qcom-spmi-gpio requests probe deferral
>>     platform c440000.spmi:pmic@2:gpio@8800: Added to deferred list
>>
>> The second time it probes the device is successfully added.
> 
> There is a bug in DTS. I'll send a patch.

https://lore.kernel.org/linux-arm-msm/20230818135538.47481-1-krzysztof.kozlowski@linaro.org/T/#u

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] pinctrl: qcom-pmic-gpio: silence -EPROBE_DEFER message on probe
  2023-08-18 13:59       ` Krzysztof Kozlowski
@ 2023-08-21 13:11         ` Brian Masney
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Masney @ 2023-08-21 13:11 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Konrad Dybcio, andersson, linus.walleij, agross, linux-arm-msm,
	linux-gpio, linux-kernel

On Fri, Aug 18, 2023 at 03:59:18PM +0200, Krzysztof Kozlowski wrote:
> On 18/08/2023 15:51, Krzysztof Kozlowski wrote:
> >>     qcom-spmi-gpio c440000.spmi:pmic@2:gpio@8800: no hogs found
> >>     qcom-spmi-gpio c440000.spmi:pmic@2:gpio@8800: error -EPROBE_DEFER: can't add gpio chip
> >>     qcom-spmi-gpio c440000.spmi:pmic@2:gpio@8800: Driver qcom-spmi-gpio requests probe deferral
> >>     platform c440000.spmi:pmic@2:gpio@8800: Added to deferred list
> >>
> >> The second time it probes the device is successfully added.
> > 
> > There is a bug in DTS. I'll send a patch.
> 
> https://lore.kernel.org/linux-arm-msm/20230818135538.47481-1-krzysztof.kozlowski@linaro.org/T/#u

Thanks for sending that. I didn't look at the DTS. Let's just drop the
patch that I posted here since that message may help someone in the
future identify this same type of issue for another platform.

Brian


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-08-21 13:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-17 14:59 [PATCH] pinctrl: qcom-pmic-gpio: silence -EPROBE_DEFER message on probe Brian Masney
2023-08-17 15:01 ` Konrad Dybcio
2023-08-17 16:26   ` Brian Masney
2023-08-18 13:51     ` Krzysztof Kozlowski
2023-08-18 13:59       ` Krzysztof Kozlowski
2023-08-21 13:11         ` Brian Masney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.