All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] fsl_esdhc.c bug
@ 2011-12-16 13:48 Jim Lentz
  2011-12-16 14:17 ` Graeme Russ
  2011-12-16 14:51 ` Fabio Estevam
  0 siblings, 2 replies; 5+ messages in thread
From: Jim Lentz @ 2011-12-16 13:48 UTC (permalink / raw)
  To: u-boot

All,

There is a bug rendering SDCard support useless on Freescale esdhc 
controller.

File drivers/mmc/fsl_esdhc.c, function esdhc_pio_read_write

*change: *

struct fsl_esdhc *regs = mmc->priv;

*to:*

struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
volatile struct fsl_esdhc *regs = (struct fsl_esdhc *)cfg->esdhc_base;

How do I/we get this into the mainstream?

I cloned the repository, and have it fixed. First time using git, and 
trying to contribute to OpenSource too.

Regards,

Jim

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

* [U-Boot] fsl_esdhc.c bug
  2011-12-16 13:48 [U-Boot] fsl_esdhc.c bug Jim Lentz
@ 2011-12-16 14:17 ` Graeme Russ
  2011-12-16 14:51 ` Fabio Estevam
  1 sibling, 0 replies; 5+ messages in thread
From: Graeme Russ @ 2011-12-16 14:17 UTC (permalink / raw)
  To: u-boot

Hi Jim

On Dec 17, 2011 1:11 AM, "Jim Lentz" <JLentz@zhone.com> wrote:
>
> All,
>
> There is a bug rendering SDCard support useless on Freescale esdhc
controller.
>
> File drivers/mmc/fsl_esdhc.c, function esdhc_pio_read_write
>
> *change: *
>
> struct fsl_esdhc *regs = mmc->priv;
>
> *to:*
>
> struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
> volatile struct fsl_esdhc *regs = (struct fsl_esdhc *)cfg->esdhc_base;

use of volatile is highly likely to be wrong

>
> How do I/we get this into the mainstream?

First read:

http://www.denx.de/wiki/U-Boot/CodingStyle

And:

http://www.denx.de/wiki/U-Boot/Patches

>
> I cloned the repository, and have it fixed. First time using git, and
trying to contribute to OpenSource too.

git format-patch and git send-email

Regards,

Graeme

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

* [U-Boot] fsl_esdhc.c bug
  2011-12-16 13:48 [U-Boot] fsl_esdhc.c bug Jim Lentz
  2011-12-16 14:17 ` Graeme Russ
@ 2011-12-16 14:51 ` Fabio Estevam
  2011-12-16 14:53   ` Jim Lentz
  1 sibling, 1 reply; 5+ messages in thread
From: Fabio Estevam @ 2011-12-16 14:51 UTC (permalink / raw)
  To: u-boot

Hi Jim,

On Fri, Dec 16, 2011 at 11:48 AM, Jim Lentz <JLentz@zhone.com> wrote:
> All,
>
> There is a bug rendering SDCard support useless on Freescale esdhc
> controller.

Which Freescale processor do you use?

Please describe in details the problem you see, how to reproduce it,
the U-boot version
that you use, etc.

Regards,

Fabio Estevam

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

* [U-Boot] fsl_esdhc.c bug
  2011-12-16 14:51 ` Fabio Estevam
@ 2011-12-16 14:53   ` Jim Lentz
  2011-12-16 18:06     ` Ira W. Snyder
  0 siblings, 1 reply; 5+ messages in thread
From: Jim Lentz @ 2011-12-16 14:53 UTC (permalink / raw)
  To: u-boot

On 12/16/2011 09:51 AM, Fabio Estevam wrote:
> Hi Jim,
>
> On Fri, Dec 16, 2011 at 11:48 AM, Jim Lentz<JLentz@zhone.com>  wrote:
>> All,
>>
>> There is a bug rendering SDCard support useless on Freescale esdhc
>> controller.
> Which Freescale processor do you use?
>
> Please describe in details the problem you see, how to reproduce it,
> the U-boot version
> that you use, etc.
>
> Regards,
>
> Fabio Estevam
Freescale P2020. Latest U-boot version.

Easiest way to see it is typing mmcinfo at the U-boot cli. It will hang.

By default, PIO mode is selected when CONFIG_P2020 is defined. Legacy 
P2020 silicon revisions require PIO mode.

The esdhc_pio_read_write function has a bad reg pointer.

Jim

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

* [U-Boot] fsl_esdhc.c bug
  2011-12-16 14:53   ` Jim Lentz
@ 2011-12-16 18:06     ` Ira W. Snyder
  0 siblings, 0 replies; 5+ messages in thread
From: Ira W. Snyder @ 2011-12-16 18:06 UTC (permalink / raw)
  To: u-boot

On Fri, Dec 16, 2011 at 09:53:20AM -0500, Jim Lentz wrote:
> On 12/16/2011 09:51 AM, Fabio Estevam wrote:
> > Hi Jim,
> >
> > On Fri, Dec 16, 2011 at 11:48 AM, Jim Lentz<JLentz@zhone.com>  wrote:
> >> All,
> >>
> >> There is a bug rendering SDCard support useless on Freescale esdhc
> >> controller.
> > Which Freescale processor do you use?
> >
> > Please describe in details the problem you see, how to reproduce it,
> > the U-boot version
> > that you use, etc.
> >
> > Regards,
> >
> > Fabio Estevam
> Freescale P2020. Latest U-boot version.
> 
> Easiest way to see it is typing mmcinfo at the U-boot cli. It will hang.
> 
> By default, PIO mode is selected when CONFIG_P2020 is defined. Legacy 
> P2020 silicon revisions require PIO mode.
> 
> The esdhc_pio_read_write function has a bad reg pointer.
> 

Hi Jim,

I tested this on my P2020, and PIO mode fails as you describe. Your fix
works. I've attached a patch which is suitable for inclusion into
U-Boot. Feel free to submit your own patch to supercede this one. It is
a bug you found, you should get credit for it! :)

It looks like the patch which introduced this code (77c1458d1 "ppc/85xx:
PIO Support for FSL eSDHC Controller Driver") was carried out of tree
for a while. While it was out of tree, another commit happened
(c67bee146 "fsl_esdhc: add support for mx51 processor") which changed
how the mmc->priv variable is used.

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

end of thread, other threads:[~2011-12-16 18:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-16 13:48 [U-Boot] fsl_esdhc.c bug Jim Lentz
2011-12-16 14:17 ` Graeme Russ
2011-12-16 14:51 ` Fabio Estevam
2011-12-16 14:53   ` Jim Lentz
2011-12-16 18:06     ` Ira W. Snyder

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.