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: <50066b1c-6c4c-4aa7-c03d-1d2876afa2c2@microchip.com>
Date:   Mon, 5 Aug 2019 11:51:17 +0000
From:   <Tudor.Ambarus@...rochip.com>
To:     <vigneshr@...com>, <miquel.raynal@...tlin.com>, <richard@....at>
CC:     <marek.vasut@...il.com>, <linux-mtd@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>, <tmaimon77@...il.com>,
        <bbrezillon@...nel.org>
Subject: Re: [PATCH v4 2/3] mtd: spi-nor: Move m25p80 code in spi-nor.c



On 08/05/2019 02:10 PM, Vignesh Raghavendra wrote:
> External E-Mail
> 
> 
> 
> On 05/08/19 3:55 PM, Tudor.Ambarus@...rochip.com wrote:
>>
>>
>> On 08/01/2019 07:22 PM, Vignesh Raghavendra wrote:
>>
>>> diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
>>> index e02376e1127b..866962c715b4 100644
>>> --- a/drivers/mtd/spi-nor/spi-nor.c
>>> +++ b/drivers/mtd/spi-nor/spi-nor.c
>>> @@ -19,6 +19,7 @@
>>

>>>  
>>> @@ -688,6 +1003,16 @@ static int spi_nor_erase_sector(struct spi_nor *nor, u32 addr)
>>>  	if (nor->erase)
>>>  		return nor->erase(nor, addr);
>>>  
>>> +	if (nor->spimem) {
>>> +		struct spi_mem_op op =
>>> +			SPI_MEM_OP(SPI_MEM_OP_CMD(nor->erase_opcode, 1),
>>> +				   SPI_MEM_OP_ADDR(nor->addr_width, addr, 1),
>>> +				   SPI_MEM_OP_NO_DUMMY,
>>> +				   SPI_MEM_OP_NO_DATA);
>>> +
>>> +		return spi_mem_exec_op(nor->spimem, &op);
>>> +	}
>>> +
>>
>> this should be done below in the function, after masking the address.
> 
> Nope. It would have been true if addr been sent as part of op.data.buf.out. 
> But since addr is being send as part of op.addr.val, spi-mem.c takes care of this for spi_transfer(s)
> 

Is this valid also for the controllers that implement the ctlr->mem_ops?

>>
>> You add a double space after return in:
>>> +	return  nor->read_reg(nor, SPINOR_OP_RDSR2, sr2, 1);
>>
> 
> Ah, Will fix
> 
>> There are some checkpatch warnings that we can fix now.
>>
> 
> I did see warnings like:
>>
>> WARNING: line over 80 characters
>> #1023: FILE: drivers/mtd/spi-nor/spi-nor.c:2554:
>> +				   SPI_MEM_OP_DATA_IN(SPI_NOR_MAX_ID_LEN, id, 1));
> 
> I think its okay to overshoot 80 char limit for better readability. 

ok

> Let me know if you think otherwise> 
>> ERROR: space required after that ',' (ctx:VxV)
>> #1270: FILE: drivers/mtd/spi-nor/spi-nor.c:4846:
>> +	{"mx25l25635e"},{"mx66l51235l"},
>> 	               ^
> 
> This and similar warnings can be fixed, but will throw off alignment wrt previous lines.
> Therefore I let them be as is.

ok

Cheers,ta

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ