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]
Date:   Fri, 11 Nov 2016 17:47:24 +0530
From:   Laxman Dewangan <ldewangan@...dia.com>
To:     Linus Walleij <linus.walleij@...aro.org>
CC:     Alexandre Courbot <gnurou@...il.com>,
        Arnd Bergmann <arnd@...db.de>,
        "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>
Subject: Re: [PATCH 1/1] gpio: lib: Add gpio_is_enabled() to get pin mode


On Saturday 05 November 2016 03:50 AM, Linus Walleij wrote:
> On Wed, Nov 2, 2016 at 1:17 PM, Laxman Dewangan <ldewangan@...dia.com> wrote:
>
>> Many of devices/SoCs supports the GPIO and special IO function
>> from their pins. On such cases, there is always configuration
>> bits to select the mode of pin as GPIO or as the special IO mode.
>> The functional modes are selected by pinmux option.
>>
>> When device booted and reach to kernel, it is not possible to get
>> the current configuration of pin whether it is in GPIO mode or
>> in special IO mode without configurations.
>>
>> Add APIs to return the current mode of pins without requesting it
>> as GPIO to find out the current mode.
>> This helps on dumping the pin configuration from debug/test utility
>> to get the current mode GPIO or functional mode.
>>
>> The typical utility looks as:
>> pin_dump(pin)
>> {
>>          if(gpio_is_enabled(pin)) {
>>                  dump direction using get_direction()
>>          } else {
>>                  dump pinmux option and its configurations.
>>          }
>> }
> Yeah but since pinctrl and pinmux has its own debugfs files why is this
> necessary? I understand it is convenient but only for debugging
> right? They the inconvenience of using pinctrls debugfs files should
> be bearable.

Yes, it is debugging and capturing all the info at single place. 
Currently, gpio debugFs shows the gpio related stuff and the pinctrl on 
pinconfig but there is not any dump which shows the complete pin mapping.
The effort is to compile all the data in single place with proper 
message to avoid any manual work for decoding multiple outputs.


>
> Also it is possible for any GPIO chip to implement its own
> debug print if they like, check what we do in
> ->dbg_show in drivers/pinctrl/nomadik/pinctrl-nomadik.c
> for example.
>
> If the use is for debug prints, keep it driver-local.
>
> (...)

This callback can print the stuff for GPIO related stuff as there is not 
much info about the pinmux related configuration to gpio driver. For 
GPIO or functional mode, it can only display gpio or functional mode.

Is there something we can link from gpio driver to pinctrl driver like 
pinctrl_debug_show()?
Like in gpio_request(), we say that pinctrl_request(), similary on the 
GPIO dbg_show(), we can say pinctrl_dbg_show() and get all the info for 
prints.
This will also serve the purpose.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ