public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Jurgen <jurgen.parmentier@telenet.be>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mtd@lists.infradead.org,
	"Vladimir A. Barinov" <vbarinov@ru.mvista.com>,
	Todd Poynor <tpoynor@mvista.com>,
	linux-mips@linux-mips.org
Subject: Re: [PATCH] PNX8550 NAND flash driver
Date: Tue, 25 Jul 2006 20:34:31 +0200	[thread overview]
Message-ID: <44C66437.9030402@telenet.be> (raw)
In-Reply-To: <1152525196.30929.11.camel@localhost>

Thomas Gleixner schreef:
> On Tue, 2006-02-14 at 15:59 +0300, Vladimir A. Barinov wrote:
>   
>>>> +    }
>>>> +
>>>> +    if (((bytes & 3) || (bytes < 16)) || ((u32) to & 3) || ((u32) 
>>>> from & 3)) {
>>>> +        if (((bytes & 1) == 0) &&
>>>> +            (((u32) to & 1) == 0) && (((u32) from & 1) == 0)) {
>>>> +            int words = bytes / 2;
>>>> +
>>>> +            local_irq_disable();
>>>> +            for (i = 0; i < words; i++) {
>>>> +                to16[i] = from16[i];
>>>> +            }
>>>> +            local_irq_enable();
>>>>         
>>> Really necessary to disable all irqs around this transfer?  How long 
>>> can interrupts be off during that time?
>>>       
>> That is needed since the NAND device is binded to the external XIO bus 
>> that could be used by another devices.
>>     
>
> Err, you have to protect the whole access sequence then. What protects
> the chip against access between the command write and data read ?
>
> If this really is a bus conflict problem, then you need some more
> protection than this.
>
> Can you please describe in detail why you think this is necessary. 
>
> 	tglx
>
>
>
>
>
>
>
>   
Root cause of the problem lies within the early implementation of the 
low-level NAND commands. There was a severe risk that the PCI accesses 
were stalled because of a Read Status command for the NAND Flash. This 
Read Status was launched immediately after program/erase command. The 
hardware itself will wait for the Ready/Busy to be high and only then 
launch the Read Status command. This behavior caused timeout on the 
internal bus because PCI was unable to use the pins during this wait.

If this problem was coinciding with an ISR that tried to perform a PCI 
status register, then this PCI access could possibly timeout (because 
the PCI pins were already claimed for the XIO access that is depending 
on the RBY signal).

Since the problem only showed during the PCI device ISR, the 
quick'n'dirty hack was to disable interrupts during XIO accesses.

A better fix that should be available somewhere, is to improve the 
low-level NAND driver that will first check the status of the Ready/Busy 
line and only THEN launch the Read NAND Status command...

Jurgen

  reply	other threads:[~2006-07-25 18:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-16 17:23 [PATCH] PNX8550 NAND flash driver Vladimir A. Barinov
2005-12-20 14:28 ` Vladimir A. Barinov
2006-01-12 18:24 ` Todd Poynor
2006-02-14 13:00   ` Vladimir A. Barinov
2006-02-22  0:57     ` Todd Poynor
2006-07-10  9:53     ` Thomas Gleixner
2006-07-25 18:34       ` Jurgen [this message]
2006-07-26  7:02         ` Thomas Gleixner

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=44C66437.9030402@telenet.be \
    --to=jurgen.parmentier@telenet.be \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tpoynor@mvista.com \
    --cc=vbarinov@ru.mvista.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox