All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcin Wojtas <mw@semihalf.com>
To: Marek Vasut <marek.vasut@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"MTD Maling List" <linux-mtd@lists.infradead.org>,
	linux-spi <linux-spi@vger.kernel.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Will Deacon" <will.deacon@arm.com>,
	"Cyrille Pitchen" <cyrille.pitchen@wedev4u.fr>,
	"Mark Brown" <broonie@kernel.org>,
	"Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>,
	"Gregory Clément" <gregory.clement@free-electrons.com>,
	nadavh@marvell.com, "Neta Zur Hershkovits" <neta@marvell.com>,
	"Omri Itach" <omrii@marvell.com>,
	"Hanna Hawa" <hannah@marvell.com>,
	"jaz@semihalf.com" <jaz@semihalf.com>,
	"Tomasz Nowicki" <tn@semihalf.com>
Subject: Re: [PATCH 1/2] mtd: spi-nor: add an option to force 3byte adressing mode
Date: Tue, 29 Aug 2017 09:40:06 +0200	[thread overview]
Message-ID: <CAPv3WKcL4wNseCrG5=2q51=6Xs1jERoB=50ar6T58nDK8aM9vw@mail.gmail.com> (raw)
In-Reply-To: <37be90e4-c43b-26f8-7551-45ab107e2a4d@gmail.com>

Hi Marek,

2017-08-29 1:24 GMT+02:00 Marek Vasut <marek.vasut@gmail.com>:
> 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

WARNING: multiple messages have this Message-ID (diff)
From: mw@semihalf.com (Marcin Wojtas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] mtd: spi-nor: add an option to force 3byte adressing mode
Date: Tue, 29 Aug 2017 09:40:06 +0200	[thread overview]
Message-ID: <CAPv3WKcL4wNseCrG5=2q51=6Xs1jERoB=50ar6T58nDK8aM9vw@mail.gmail.com> (raw)
In-Reply-To: <37be90e4-c43b-26f8-7551-45ab107e2a4d@gmail.com>

Hi Marek,

2017-08-29 1:24 GMT+02:00 Marek Vasut <marek.vasut@gmail.com>:
> 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

  reply	other threads:[~2017-08-29  7:40 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-28 21:14 [PATCH 0/2] SPI NOR - force 3byte addressing mode Marcin Wojtas
2017-08-28 21:14 ` Marcin Wojtas
2017-08-28 21:14 ` Marcin Wojtas
2017-08-28 21:14 ` [PATCH 1/2] mtd: spi-nor: add an option to force 3byte adressing mode Marcin Wojtas
2017-08-28 21:14   ` Marcin Wojtas
2017-08-28 21:18   ` Geert Uytterhoeven
2017-08-28 21:18     ` Geert Uytterhoeven
2017-08-28 21:18     ` Geert Uytterhoeven
2017-08-28 21:54     ` Marcin Wojtas
2017-08-28 21:54       ` Marcin Wojtas
2017-08-28 21:54       ` Marcin Wojtas
2017-08-28 21:54       ` Marcin Wojtas
2017-08-28 23:24   ` Marek Vasut
2017-08-28 23:24     ` Marek Vasut
2017-08-29  7:40     ` Marcin Wojtas [this message]
2017-08-29  7:40       ` Marcin Wojtas
2017-09-04 16:26   ` Pavel Machek
2017-09-04 16:26     ` Pavel Machek
2017-08-28 21:14 ` [PATCH 2/2] arm64: dts: marvell: Force 3byte addressing mode for SPI on A7040 DB Marcin Wojtas
2017-08-28 21:14   ` Marcin Wojtas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPv3WKcL4wNseCrG5=2q51=6Xs1jERoB=50ar6T58nDK8aM9vw@mail.gmail.com' \
    --to=mw@semihalf.com \
    --cc=broonie@kernel.org \
    --cc=cyrille.pitchen@wedev4u.fr \
    --cc=gregory.clement@free-electrons.com \
    --cc=hannah@marvell.com \
    --cc=jaz@semihalf.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=marek.vasut@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=nadavh@marvell.com \
    --cc=neta@marvell.com \
    --cc=omrii@marvell.com \
    --cc=robh+dt@kernel.org \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=tn@semihalf.com \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.