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-next>] [day] [month] [year] [list]
Message-ID: <20190321135642.GK3622@lahna.fi.intel.com>
Date:   Thu, 21 Mar 2019 15:56:42 +0200
From:   Mika Westerberg <mika.westerberg@...ux.intel.com>
To:     "zhuchangchun@...e.com" <zhuchangchun@...e.com>
Cc:     "andriy.shevchenko" <andriy.shevchenko@...ux.intel.com>,
        "linus.walleij" <linus.walleij@...aro.org>,
        linux-gpio <linux-gpio@...r.kernel.org>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        hendychu <hendychu@...yun.com>
Subject: Re: Re: [PATCH] pinctrl: intel: Implements gpio free function

On Thu, Mar 21, 2019 at 09:35:26PM +0800, zhuchangchun@...e.com wrote:
>    --> I know your meaning, even though I've did following actions
>    instead of unexport,
> 
>    # echo 0 > /sys/class/gpio/gpioXX/value
>      # echo in > /sys/class/gpio/gpioXX/direction
> 
>    the padcfg0 value still can not roll back,because after export the
>    gpio,the following
> 
>    action as padcfg0 settings was done.
> 
>    Exactly  TX and RX register have been set as below in GPIO request:
> 
>    /* Disable TX buffer and enable RX (this will be input) */
> 
>    value &= ~PADCFG0_GPIORXDIS;
> 
>    value |= PADCFG0_GPIOTXDIS;
> 
>    this will infruence next reboot gpio signal.
> 
>    And could you pls see my ->free function implementation?

I checked it and you do this:

+       value |= PADCFG0_GPIORXDIS;
+       value &= ~PADCFG0_GPIOTXDIS;

which pretty much turns the pin GPIO output unconditionally. I don't
really think it is good idea. May work in your case but may cause
problems with others.

If you want to keep it as output and leave the value 1 (high) before you
issue reboot, I don't think you need to do anything via sysfs (as the
pin is already in that state and issuing reboot command should not
change anything because the driver does not have ->shutdown callback.

In other words, your peripheral expects reset GPIO to be asserted (high)
during reboot so unless the boot firmware resets the pin I don't see why
leaving it as is does not work for you.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ