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: <50b7293c-8c4d-0162-2810-a74d59e7d03e@linux.alibaba.com>
Date:   Tue, 12 Sep 2023 16:28:35 +0800
From:   Baolin Wang <baolin.wang@...ux.alibaba.com>
To:     Linhua Xu <Linhua.xu@...soc.com>,
        Linus Walleij <linus.walleij@...aro.org>
Cc:     Orson Zhai <orsonzhai@...il.com>,
        Chunyan Zhang <zhang.lyra@...il.com>,
        linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        lh xu <xulh0829@...il.com>,
        Zhirong Qiu <zhirong.qiu@...soc.com>,
        Xiongpeng Wu <xiongpeng.wu@...soc.com>
Subject: Re: [PATCH V2 2/6] pinctrl: sprd: Fix the incorrect mask and shift
 definition



On 9/8/2023 1:51 PM, Linhua Xu wrote:
> From: Linhua Xu <Linhua.Xu@...soc.com>
> 
> Pull-up and pull-down are mutually exclusive. When setting one of them,
> the bit of the other needs to be clear. Now, there are cases where pull-up
> and pull-down are set at the same time in the code, thus fix them.
> 
> Signed-off-by: Linhua Xu <Linhua.Xu@...soc.com>
> ---
>   drivers/pinctrl/sprd/pinctrl-sprd.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/pinctrl/sprd/pinctrl-sprd.c b/drivers/pinctrl/sprd/pinctrl-sprd.c
> index 25fb9ce9ad78..5b9126b2cde2 100644
> --- a/drivers/pinctrl/sprd/pinctrl-sprd.c
> +++ b/drivers/pinctrl/sprd/pinctrl-sprd.c
> @@ -58,21 +58,21 @@
>   #define DRIVE_STRENGTH_SHIFT		19
>   
>   #define SLEEP_PULL_DOWN			BIT(2)
> -#define SLEEP_PULL_DOWN_MASK		0x1
> +#define SLEEP_PULL_DOWN_MASK		GENMASK(1, 0)
>   #define SLEEP_PULL_DOWN_SHIFT		2
>   
>   #define PULL_DOWN			BIT(6)
> -#define PULL_DOWN_MASK			0x1
> +#define PULL_DOWN_MASK			(GENMASK(1, 0) | BIT(6))
>   #define PULL_DOWN_SHIFT			6
>   
>   #define SLEEP_PULL_UP			BIT(3)
> -#define SLEEP_PULL_UP_MASK		0x1
> -#define SLEEP_PULL_UP_SHIFT		3
> +#define SLEEP_PULL_UP_MASK		GENMASK(1, 0)
> +#define SLEEP_PULL_UP_SHIFT		2
>   
>   #define PULL_UP_4_7K			(BIT(12) | BIT(7))
>   #define PULL_UP_20K			BIT(7)
> -#define PULL_UP_MASK			0x21
> -#define PULL_UP_SHIFT			7
> +#define PULL_UP_MASK			(GENMASK(1, 0) | BIT(6))
> +#define PULL_UP_SHIFT			6

This change looks weird, BIT(6) is for PULL_DOWN. So I am curious these 
changes are backward compatibility?

Now I can not access the SPRD Spec, Chunyan, can you help to confirm 
these changes? Thanks.

>   
>   #define INPUT_SCHMITT			BIT(11)
>   #define INPUT_SCHMITT_MASK		0x1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ