linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Brian Masney <bmasney@redhat.com>,
	linus.walleij@linaro.org, brgl@bgdev.pl
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, psodagud@quicinc.com,
	quic_shazhuss@quicinc.com, quic_ppareek@quicinc.com,
	ahalaney@redhat.com, echanude@redhat.com,
	nicolas.dechesne@linaro.org
Subject: Re: [PATCH RFC] gpiolib: ensure that fwnode is properly set
Date: Tue, 15 Nov 2022 12:53:52 +0100	[thread overview]
Message-ID: <f51cfe4d-9cb9-e680-8e27-e6ba457a97d0@linaro.org> (raw)
In-Reply-To: <20221114202943.2389489-1-bmasney@redhat.com>


On 14/11/2022 21:29, Brian Masney wrote:
> Note that this is a RFC patch and not meant to be merged. I looked into
> a problem with linux-next-20221110 on the Qualcomm SA8540P automotive
> board (sc8280xp) where the UFS host controller would fail to probe due
> to repeated probe deferrals when trying to get reset-gpios via
> devm_gpiod_get_optional().
>
> of_get_named_gpiod_flags() returns -EPROBE_DEFER, which is caused by
> of_gpiochip_match_node_and_xlate() returning 0 since the of_xlate function
> pointer is not set for the qcom,sc8280xp-tlmm pinctrl driver. The
> pinctrl driver doesn't define one, so of_gpiochip_add() should
> automatically setup of_gpio_simple_xlate() on it's behalf. This doesn't
> happen since the fwnode member on the struct gpiochip is set to null
> when of_gpiochip_add() is called. Let's work around this by ensuring
> that it's set if available.
>
> Note that this broke sometime within the last few weeks within
> linux-next and I haven't bisected this. I'm posting this in the hopes
> that someone may know offhand which patch(es) may have broken this.
>
> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---

Fixes boot on 8450 on next-20221115


Tested-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad

>   drivers/gpio/gpiolib.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index 11fb7ec883e9..8bec66008869 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -678,7 +678,7 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,
>   	 * Assign fwnode depending on the result of the previous calls,
>   	 * if none of them succeed, assign it to the parent's one.
>   	 */
> -	gdev->dev.fwnode = dev_fwnode(&gdev->dev) ?: fwnode;
> +	gc->fwnode = gdev->dev.fwnode = dev_fwnode(&gdev->dev) ?: fwnode;
>   
>   	gdev->id = ida_alloc(&gpio_ida, GFP_KERNEL);
>   	if (gdev->id < 0) {

  parent reply	other threads:[~2022-11-15 11:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-14 20:29 [PATCH RFC] gpiolib: ensure that fwnode is properly set Brian Masney
2022-11-14 21:02 ` Robert Marko
2022-11-14 21:16   ` Brian Masney
2022-11-15  8:18   ` Shazad Hussain
2022-11-15 11:08 ` Marijn Suijten
2022-11-15 11:53 ` Konrad Dybcio [this message]
2022-11-15 17:07 ` Bryan O'Donoghue
2022-11-15 22:02   ` Steev Klimaszewski
2022-11-16  9:19     ` Bartosz Golaszewski
2022-11-16 10:23     ` Thierry Reding
2022-11-16  9:09 ` Neil Armstrong
2022-11-16 10:21 ` Thierry Reding
2022-11-16 10:35   ` Thierry Reding
2022-11-16 11:14   ` Brian Masney

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=f51cfe4d-9cb9-e680-8e27-e6ba457a97d0@linaro.org \
    --to=konrad.dybcio@linaro.org \
    --cc=ahalaney@redhat.com \
    --cc=bmasney@redhat.com \
    --cc=brgl@bgdev.pl \
    --cc=echanude@redhat.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.dechesne@linaro.org \
    --cc=psodagud@quicinc.com \
    --cc=quic_ppareek@quicinc.com \
    --cc=quic_shazhuss@quicinc.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).