lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdXNz8ZbFXRgYCGuAd1+Cz8xTvMc-rkwXXiE-E-Fb5XXNA@mail.gmail.com>
Date:   Fri, 19 Feb 2021 10:06:51 +0100
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Drew Fustini <drew@...gleboard.org>
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Tony Lindgren <tony@...mide.com>,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Pantelis Antoniou <pantelis.antoniou@...sulko.com>,
        Jason Kridner <jkridner@...gleboard.org>,
        Robert Nelson <robertcnelson@...gleboard.org>,
        Joe Perches <joe@...ches.com>,
        Dan Carpenter <dan.carpenter@...cle.com>,
        Jonathan Corbet <corbet@....net>,
        "open list:DOCUMENTATION" <linux-doc@...r.kernel.org>
Subject: Re: [PATCH v7 2/3] pinctrl: pinmux: Add pinmux-select debugfs file

Hi Drew,

On Wed, Feb 17, 2021 at 11:15 PM Drew Fustini <drew@...gleboard.org> wrote:
> Add "pinmux-select" to debugfs which will activate a function and group:
>
>   echo "<function-name group-name>" > pinmux-select
>
> The write operation pinmux_select() handles this by checking that the
> names map to valid selectors and then calling ops->set_mux().
>
> The existing "pinmux-functions" debugfs file lists the pin functions
> registered for the pin controller. For example:
>
>   function: pinmux-uart0, groups = [ pinmux-uart0-pins ]
>   function: pinmux-mmc0, groups = [ pinmux-mmc0-pins ]
>   function: pinmux-mmc1, groups = [ pinmux-mmc1-pins ]
>   function: pinmux-i2c0, groups = [ pinmux-i2c0-pins ]
>   function: pinmux-i2c1, groups = [ pinmux-i2c1-pins ]
>   function: pinmux-spi1, groups = [ pinmux-spi1-pins ]
>
> To activate function pinmux-i2c1 and group pinmux-i2c1-pins:
>
>   echo "pinmux-i2c1 pinmux-i2c1-pins" > pinmux-select
>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@...il.com>
> Reviewed-by: Tony Lindgren <tony@...mide.com>
> Signed-off-by: Drew Fustini <drew@...gleboard.org>

Thanks for your patch!

On R-Car M2-W, which does not use pinctrl-single, I have:

    # cat pinmux-functions
    ...
    function 14: i2c2, groups = [ i2c2 i2c2_b i2c2_c i2c2_d ]
    ...
    function 51: ssi, groups = [ ssi0_data ssi0_data_b ssi0129_ctrl
ssi0129_ctrl_b ssi1_data ssi1_data_b ssi1_ctrl ssi1_ctrl_b ssi2_data
ssi2_ctrl ssi3_data ssi34_ctrl ssi4_data ssi4_ctrl ssi5_data ssi5_ctrl
ssi6_data ssi6_ctrl ssi7_data ssi7_data_b ssi78_ctrl ssi78_ctrl_b
ssi8_data ssi8_data_b ssi9_data ssi9_data_b ssi9_ctrl ssi9_ctrl_b ]
    ...

On the Koelsch board:

    # cd /sys/kernel/debug/pinctrl/e6060000.pinctrl-sh-pfc/
    # echo ssi ssi2_ctrl > pinmux-select # Configure i2c2 pins for ssi
    # i2cdetect -y -a 2                  # Fails
    # echo i2c2 i2c2 > pinmux-select     # Restore i2c2
    # i2cdetect -y -a 2                  # Works again

The order of the 2 parameters looks a bit odd to me, as the operation
configures the pins from "group" to be used for "function".
See also arch/arm/boot/dts/r8a7791-koelsch.dts
For the i2c2 example it's not that obvious, but for ssi it is.
Might feel different for pinctrl-single, and perhaps I just need to get
used to it ;-)

Anyway:
Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
Tested-by: Geert Uytterhoeven <geert+renesas@...der.be>

Gr{oetje,eeting}s,

                        Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ