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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Fri, 22 Mar 2019 12:42: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 Fri, Mar 22, 2019 at 11:14:14AM +0800, zhuchangchun@...e.com wrote:
>    static int intel_gpio_set_direction(struct pinctrl_dev *pctldev,
>       struct pinctrl_gpio_range *range,
>       unsigned pin, bool input)
>    {
>    struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
>    void __iomem *padcfg0;
>    unsigned long flags;
>    u32 value;
>    spin_lock_irqsave(&pctrl->lock, flags);
>    padcfg0 = intel_get_padcfg(pctrl, pin, PADCFG0);
>    value = readl(padcfg0);
>    if (input)
>    value |= PADCFG0_GPIOTXDIS;
>    else
>    value &= ~PADCFG0_GPIOTXDIS;
>    writel(value, padcfg0);
>    spin_unlock_irqrestore(&pctrl->lock, flags);
>    return 0;
>    }
> 
>    From above,you can kown when you export a GPIO ,it will do request,
> 
>    and there will set TX and RX register at the time same time.
> 
>    when you try to set direction in and set value, TX register value can
>    roll back
> 
>    the value,but RX register was not set, so who will set RX value back??

I think you are looking at some older code. There is now function
__intel_gpio_set_direction() that is supposed to set both buffers
depending on the direction. It was introduced with commit 17fab473693e
("pinctrl: intel: Set pin direction properly").

Powered by blists - more mailing lists