linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>,
	Rich Felker <dalias@libc.org>,
	Magnus Damm <magnus.damm@gmail.com>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Phil Edworthy <phil.edworthy@renesas.com>,
	linux-sh@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-gpio@vger.kernel.org
Subject: Re: [PATCH/RFC 0/4] sh: sh7722/sh7757i/sh7264/sh7269: Fix pinctrl registration
Date: Tue, 09 May 2017 18:44:09 +0300	[thread overview]
Message-ID: <2601530.Ncn6bLinC5@avalon> (raw)
In-Reply-To: <1494339117-31221-1-git-send-email-geert+renesas@glider.be>

Hi Geert,

Thank you for the patches.

On Tuesday 09 May 2017 16:11:53 Geert Uytterhoeven wrote:
> 	Hi all,
> 
> Magnus reported that on sh7722/Migo-R, pinctrl registration fails with:
> 
>     sh-pfc pfc-sh7722: pin 0 already registered
>     sh-pfc pfc-sh7722: error during pin registration
>     sh-pfc pfc-sh7722: could not register: -22
>     sh-pfc: probe of pfc-sh7722 failed with error -22
> 
> pinmux_pins[] is initialized through PINMUX_GPIO(), using designated
> array initializers, where the GPIO_* enums serve as indices.
> Apparently GPIO_PTQ7 was defined in the enum, but never used.
> If enum values are defined, but never used, pinmux_pins[] contains
> (zero-filled) holes.  Hence such entries are treated as pin zero, which
> was registered before, and initialization fails.
> 
> I can't see how this ever worked, as at the time of commit f5e25ae52feff2dc
> ("sh-pfc: Add sh7722 pinmux support"), pinmux_gpios[] in
> drivers/pinctrl/sh-pfc/pfc-sh7722.c already had the hole, and
> drivers/pinctrl/core.c already had the check.
> 
> Some scripting revealed a few more broken drivers:
>   - sh7757 has four holes, due to nonexistent GPIO_PT[JLNQ]7_RESV.
>   - sh7264 and sh7269 define GPIO_PH[0-7], but don't use it with
>     PINMUX_GPIO().
> 
> Patch 1 fixes the issue on sh7722, and was tested.
> Patches 3-4 should fix the issue on the other 3 SoCs, but was untested due
> to lack of hardware.

This all looks good to me, even if I can't test or verify patches 2/4 to 4/4 
as I don't have access to the hardware or datasheet either. Given that they're 
untested I wouldn't fake the error message in the commit log though, but just 
refer to the problem noticed on sh7722.

Apart from that, for the whole series,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> Thanks for your comments!
> 
> Geert Uytterhoeven (4):
>   sh: sh7722: Remove nonexistent GPIO_PTQ7 to fix pinctrl registration
>   [RFC] sh: sh7757: Remove nonexistent GPIO_PT[JLNQ]7_RESV to fix
>     pinctrl registration
>   sh: sh7264: Remove nonexistent GPIO_PH[0-7] to fix pinctrl
>     registration
>   [RFC] sh: sh7269: Remove nonexistent GPIO_PH[0-7] to fix pinctrl
>     registration
> 
>  arch/sh/include/cpu-sh2a/cpu/sh7264.h | 4 +---
>  arch/sh/include/cpu-sh2a/cpu/sh7269.h | 4 +---
>  arch/sh/include/cpu-sh4/cpu/sh7722.h  | 2 +-
>  arch/sh/include/cpu-sh4/cpu/sh7757.h  | 8 ++++----
>  4 files changed, 7 insertions(+), 11 deletions(-)

-- 
Regards,

Laurent Pinchart

  parent reply	other threads:[~2017-05-09 15:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-09 14:11 [PATCH/RFC 0/4] sh: sh7722/sh7757i/sh7264/sh7269: Fix pinctrl registration Geert Uytterhoeven
2017-05-09 14:11 ` [PATCH 1/4] sh: sh7722: Remove nonexistent GPIO_PTQ7 to fix " Geert Uytterhoeven
2017-05-10  7:31   ` jmondi
2017-05-09 14:11 ` [PATCH 2/4] [RFC] sh: sh7757: Remove nonexistent GPIO_PT[JLNQ]7_RESV " Geert Uytterhoeven
2017-05-09 14:11 ` [PATCH 3/4] sh: sh7264: Remove nonexistent GPIO_PH[0-7] " Geert Uytterhoeven
2017-05-09 14:11 ` [PATCH 4/4] [RFC] sh: sh7269: " Geert Uytterhoeven
2017-05-09 15:44 ` Laurent Pinchart [this message]
2017-05-09 15:53   ` [PATCH/RFC 0/4] sh: sh7722/sh7757i/sh7264/sh7269: Fix " Phil Edworthy

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=2601530.Ncn6bLinC5@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=dalias@libc.org \
    --cc=geert+renesas@glider.be \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=phil.edworthy@renesas.com \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    --cc=ysato@users.sourceforge.jp \
    /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).