From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751243AbdH2HkK (ORCPT ); Tue, 29 Aug 2017 03:40:10 -0400 Received: from mail-io0-f178.google.com ([209.85.223.178]:35296 "EHLO mail-io0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750815AbdH2HkI (ORCPT ); Tue, 29 Aug 2017 03:40:08 -0400 MIME-Version: 1.0 In-Reply-To: <37be90e4-c43b-26f8-7551-45ab107e2a4d@gmail.com> References: <1503954854-30963-1-git-send-email-mw@semihalf.com> <1503954854-30963-2-git-send-email-mw@semihalf.com> <37be90e4-c43b-26f8-7551-45ab107e2a4d@gmail.com> From: Marcin Wojtas Date: Tue, 29 Aug 2017 09:40:06 +0200 Message-ID: Subject: Re: [PATCH 1/2] mtd: spi-nor: add an option to force 3byte adressing mode To: Marek Vasut Cc: linux-kernel@vger.kernel.org, "linux-arm-kernel@lists.infradead.org" , MTD Maling List , linux-spi , Rob Herring , Mark Rutland , Will Deacon , Cyrille Pitchen , Mark Brown , Thomas Petazzoni , =?UTF-8?Q?Gregory_Cl=C3=A9ment?= , nadavh@marvell.com, Neta Zur Hershkovits , Omri Itach , Hanna Hawa , "jaz@semihalf.com" , Tomasz Nowicki Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marek, 2017-08-29 1:24 GMT+02:00 Marek Vasut : > On 08/28/2017 11:14 PM, Marcin Wojtas wrote: >> Hitherto code set 4B addressing mode for all SPI flashes whose >> size exceeds 16MB. However, changing the default 3B access >> in some cases may be harmful - it may happen that the Boot ROM >> is not capable of handling non-default state of the SPI NOR >> (e.g. after soft reset). > > No, this happens when your hardware is broken and does NOT reset the > flash while reseting the CPU as well. If the flash is in some funny > state (ie. middle of page program or erase cycle, which takes long OR > 4byte addressing mode) and the CPU resets , then if the SPI NOR is not > reset, your system will still get stuck . You need to fix your hardware > such that you use the reset output of your CPU to detect when the CPU > restarted and add logic to reset your storage as well. > > This stuff below is a poor workaround and has it's known problems which > can only be solved by fixing the hardware. This problem keeps coming up > repeatedly, just skim through the Linux MTD and U-Boot lists for other > victims of bad HW design. I don't think I want to see it in the kernel > as that would motivate people to use it rather than fixing their HW . > Understood. I just only got impression that attempts to overcome the HW design faults in terms of keeping SPI NOR default state during boot can be added - introducing SPI_NOR_4B_OPCODES seems to have no other reason, however it favors only a group of devices that support it. Best regards, Marcin