public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* BUG in nand_base.c
@ 2004-10-06  3:47 Brad Beveridge
  2004-10-06  8:28 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Brad Beveridge @ 2004-10-06  3:47 UTC (permalink / raw)
  To: MTD mailing list

Hi all, I have been playing with large size nand devices & have found 
what I think is a bug in nand_base.c::nand_command.  I have the latest 
daily snapshot.
Starting at line 546, there is the following code
                        /* One more address cycle for higher density 
devices */
                        if (this->chipsize & 0x0c000000)
                                this->write_byte(mtd, (unsigned char) 
((page_addr >> 16) & 0x0f));
Which will correctly trap the 4th write cycle for 64 & 128MiB parts, but 
not for larger sizes of 256 & 512 MiB.
In my code I have changed the line to read
                        if (this->chipsize & 0xfc000000)

Also, I noticed that for the large page devices (nand_command_lp) a 
proper compare (>) is used instead of a mask - should one of these be 
changed to make both functions consistant?

Cheers
Brad

-- 
Bluewater Systems Ltd - ARM Technology Solution Centre

       Brad Beveridge                           Bluewater Systems Ltd
Phone: +64 3 3779127 (Aus +1 800 148 751)       Level 17, 119 Armagh St
Fax:   +64 3 3779135                            PO Box 13889
Email: bbeveridge@bluewatersys.com              Christchurch
Web:   http://www.bluewatersys.com              New Zealand 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: BUG in nand_base.c
  2004-10-06  3:47 BUG in nand_base.c Brad Beveridge
@ 2004-10-06  8:28 ` Thomas Gleixner
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2004-10-06  8:28 UTC (permalink / raw)
  To: Brad Beveridge; +Cc: MTD mailing list

On Wed, 2004-10-06 at 05:47, Brad Beveridge wrote:
> Hi all, I have been playing with large size nand devices & have found 
> what I think is a bug in nand_base.c::nand_command.  I have the latest 
> daily snapshot.
> Starting at line 546, there is the following code
>                         /* One more address cycle for higher density 
> devices */
>                         if (this->chipsize & 0x0c000000)
>                                 this->write_byte(mtd, (unsigned char) 
> ((page_addr >> 16) & 0x0f));
> Which will correctly trap the 4th write cycle for 64 & 128MiB parts, but 
> not for larger sizes of 256 & 512 MiB.
> In my code I have changed the line to read
>                         if (this->chipsize & 0xfc000000)
> 
> Also, I noticed that for the large page devices (nand_command_lp) a 
> proper compare (>) is used instead of a mask - should one of these be 
> changed to make both functions consistant?

You're right. I will fix this later when I have CVS access again.

Thanks
tglx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-10-06  8:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-06  3:47 BUG in nand_base.c Brad Beveridge
2004-10-06  8:28 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox