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: <2ba27f8a-6d10-3a7a-45b2-dbe503c79d47@linaro.org>
Date:   Fri, 19 Nov 2021 17:18:19 +0000
From:   Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To:     Chunfeng Yun <chunfeng.yun@...iatek.com>,
        Rob Herring <robh+dt@...nel.org>, Vinod Koul <vkoul@...nel.org>
Cc:     Matthias Brugger <matthias.bgg@...il.com>,
        Kishon Vijay Abraham I <kishon@...com>,
        devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-phy@...ts.infradead.org,
        Eddie Hung <eddie.hung@...iatek.com>,
        Andrew-CT Chen <andrew-ct.chen@...iatek.com>,
        Yz Wu <yz.wu@...iatek.com>
Subject: Re: [PATCH 3/6] nvmem: mtk-efuse: support minimum one byte access
 stride and granularity



On 07/11/2021 07:56, Chunfeng Yun wrote:
> In order to support nvmem bits property, should support minimum 1 byte
> read stride and minimum 1 byte read granularity at the same time.
> 
> Signed-off-by: Chunfeng Yun <chunfeng.yun@...iatek.com>
Applied thanks,

--srini

> ---
>   drivers/nvmem/mtk-efuse.c | 13 +++++++------
>   1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/nvmem/mtk-efuse.c b/drivers/nvmem/mtk-efuse.c
> index 6a537d959f14..e9a375dd84af 100644
> --- a/drivers/nvmem/mtk-efuse.c
> +++ b/drivers/nvmem/mtk-efuse.c
> @@ -19,11 +19,12 @@ static int mtk_reg_read(void *context,
>   			unsigned int reg, void *_val, size_t bytes)
>   {
>   	struct mtk_efuse_priv *priv = context;
> -	u32 *val = _val;
> -	int i = 0, words = bytes / 4;
> +	void __iomem *addr = priv->base + reg;
> +	u8 *val = _val;
> +	int i;
>   
> -	while (words--)
> -		*val++ = readl(priv->base + reg + (i++ * 4));
> +	for (i = 0; i < bytes; i++, val++)
> +		*val = readb(addr + i);
>   
>   	return 0;
>   }
> @@ -45,8 +46,8 @@ static int mtk_efuse_probe(struct platform_device *pdev)
>   	if (IS_ERR(priv->base))
>   		return PTR_ERR(priv->base);
>   
> -	econfig.stride = 4;
> -	econfig.word_size = 4;
> +	econfig.stride = 1;
> +	econfig.word_size = 1;
>   	econfig.reg_read = mtk_reg_read;
>   	econfig.size = resource_size(res);
>   	econfig.priv = priv;
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ