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:   Tue, 25 Oct 2016 00:15:02 +0200
From:   Marek Vasut <marex@...x.de>
To:     Cyrille Pitchen <cyrille.pitchen@...el.com>,
        computersforpeace@...il.com, linux-mtd@...ts.infradead.org
Cc:     nicolas.ferre@...el.com, boris.brezillon@...e-electrons.com,
        richard@....at, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 5/9] mtd: m25p80: add support of dual and quad spi
 protocols to all commands

On 10/24/2016 06:34 PM, Cyrille Pitchen wrote:
> Before this patch, m25p80_read() supported few SPI protocols:
> - regular SPI 1-1-1
> - SPI Dual Output 1-1-2
> - SPI Quad Output 1-1-4
> On the other hand, all other m25p80_*() hooks only supported SPI 1-1-1.
> 
> This patch adds support to all currently existing SPI protocols to
> cover as many protocols as possible.
> 
> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@...el.com>
> ---
>  drivers/mtd/devices/m25p80.c | 193 +++++++++++++++++++++++++++++++++----------
>  1 file changed, 149 insertions(+), 44 deletions(-)
> 
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index f0a55c01406b..38778eac6c21 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -27,22 +27,64 @@
>  #include <linux/spi/flash.h>
>  #include <linux/mtd/spi-nor.h>
>  
> -#define	MAX_CMD_SIZE		6
> +#define	MAX_CMD_SIZE		16
>  struct m25p {
>  	struct spi_device	*spi;
>  	struct spi_nor		spi_nor;
>  	u8			command[MAX_CMD_SIZE];
>  };
>  
> +static inline int m25p80_proto2nbits(enum spi_nor_protocol proto,

This can be void , since it's always returning zero.

> +				     unsigned *code_nbits,
> +				     unsigned *addr_nbits,
> +				     unsigned *data_nbits)
> +{
> +	if (code_nbits)
> +		*code_nbits = SNOR_PROTO_CODE_FROM_PROTO(proto);
> +	if (addr_nbits)
> +		*addr_nbits = SNOR_PROTO_ADDR_FROM_PROTO(proto);
> +	if (data_nbits)
> +		*data_nbits = SNOR_PROTO_DATA_FROM_PROTO(proto);
> +
> +	return 0;
> +}
> +
[...]


-- 
Best regards,
Marek Vasut

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ