All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dario Binacchi <dariobin@libero.it>
To: u-boot@lists.denx.de
Subject: [PATCH] pinctrl: single: Fix probe failure getting register area size
Date: Tue, 18 May 2021 18:16:41 +0200 (CEST)	[thread overview]
Message-ID: <815715173.177842.1621354601558@mail1.libero.it> (raw)
In-Reply-To: <20210517201517.GH17669@bill-the-cat>

Hi,

> Il 17/05/2021 22:15 Tom Rini <trini@konsulko.com> ha scritto:
> 
>  
> On Fri, May 07, 2021 at 02:40:34PM +0530, Vignesh Raghavendra wrote:
> 
> > If reg property of pinctrl-single node requires address translation then
> > probe fails with following message:
> > 
> > single-pinctrl pinctrl at 4301c000: failed to get base register size
> > 
> > This is because driver uses dev_read_addr_size() to get size which also
> > tries to fetch untranslated addr and fails.
> > Fix this by using dev_read_addr_size_index() which takes care of address
> > translation and also makes following dev_read_addr() call redundant.
> > 
> > This fixes Ethernet failures on TI's AM654 based EVMs due to lack of
> > pinmux configuration.
> > 
> > Fixes: 9fd8a430f3 ("pinctrl: single: get register area size by device API")
> > Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
> > ---
> >  drivers/pinctrl/pinctrl-single.c | 10 ++--------
> >  1 file changed, 2 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
> > index ebb7602dde..7af6c5f0b0 100644
> > --- a/drivers/pinctrl/pinctrl-single.c
> > +++ b/drivers/pinctrl/pinctrl-single.c
> > @@ -509,19 +509,13 @@ static int single_of_to_plat(struct udevice *dev)
> >  		return -EINVAL;
> >  	}
> >  
> > -	addr = dev_read_addr_size(dev, "reg", &size);
> > +	addr = dev_read_addr_size_index(dev, 0, &size);
> >  	if (addr == FDT_ADDR_T_NONE) {
> > -		dev_err(dev, "failed to get base register size\n");
> > +		dev_err(dev, "failed to get base register address\n");
> >  		return -EINVAL;
> >  	}
> >  
> >  	pdata->offset = size - pdata->width / BITS_PER_BYTE;
> > -
> > -	addr = dev_read_addr(dev);
> > -	if (addr == FDT_ADDR_T_NONE) {
> > -		dev_dbg(dev, "no valid base register address\n");
> > -		return -EINVAL;
> > -	}
> >  	pdata->base = addr;
> >  
> >  	ret = dev_read_u32(dev, "pinctrl-single,function-mask", &pdata->mask);
> 
> Dario, since this has a fixes tag for a commit of yours, comments?
> Thanks!
> 

I applied the patch and tested it on my beaglebone black. 
It is OK. As well the tests I had developed in the sandbox configuration for pinmux passed.

Thanks and regards,
Dario

> -- 
> Tom

  reply	other threads:[~2021-05-18 16:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-07  9:10 [PATCH] pinctrl: single: Fix probe failure getting register area size Vignesh Raghavendra
2021-05-17 20:15 ` Tom Rini
2021-05-18 16:16   ` Dario Binacchi [this message]
2021-05-27 11:41 ` Tom Rini

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=815715173.177842.1621354601558@mail1.libero.it \
    --to=dariobin@libero.it \
    --cc=u-boot@lists.denx.de \
    /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 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.