public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] tegra: mmc: Set the bus width correctly
@ 2017-06-08  3:11 Simon Glass
  2017-06-08  4:03 ` Peter.Chubb at data61.csiro.au
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Glass @ 2017-06-08  3:11 UTC (permalink / raw)
  To: u-boot

The driver currently does not reset bit 5 of the hostctl register even if
the MMC stack requests it. Then means that once a bus width of 8 is
selected it is not possible to change it back to 1. This breaks
'mmc rescan' which needs to start off with a bus width of 1.

The problem was surfaced by enabling CONFIG_DM_MMC_OPS on tegra. Without
this option the MMC stack fully reinits the driver on a 'mmc rescan'.
But with this option driver model does not re-probe a driver once it has
been probed once.

Fix the driver to honour the request.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 drivers/mmc/tegra_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/tegra_mmc.c b/drivers/mmc/tegra_mmc.c
index 338e42b528..7d945a172e 100644
--- a/drivers/mmc/tegra_mmc.c
+++ b/drivers/mmc/tegra_mmc.c
@@ -438,7 +438,7 @@ static int tegra_mmc_set_ios(struct udevice *dev)
 	else if (mmc->bus_width == 4)
 		ctrl |= (1 << 1);
 	else
-		ctrl &= ~(1 << 1);
+		ctrl &= ~(1 << 1 | 1 << 5);
 
 	writeb(ctrl, &priv->reg->hostctl);
 	debug("mmc_set_ios: hostctl = %08X\n", ctrl);
-- 
2.13.0.506.g27d5fe0cd-goog

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

* [U-Boot] [PATCH] tegra: mmc: Set the bus width correctly
  2017-06-08  3:11 [U-Boot] [PATCH] tegra: mmc: Set the bus width correctly Simon Glass
@ 2017-06-08  4:03 ` Peter.Chubb at data61.csiro.au
  2017-06-14 11:32   ` Simon Glass
  0 siblings, 1 reply; 5+ messages in thread
From: Peter.Chubb at data61.csiro.au @ 2017-06-08  4:03 UTC (permalink / raw)
  To: u-boot

>>>>> "Simon" == Simon Glass <sjg@chromium.org> writes:

Simon> The driver currently does not reset bit 5 of the hostctl
Simon> register even if the MMC stack requests it. Then means that
Simon> once a bus width of 8 is selected it is not possible to change
Simon> it back to 1. This breaks 'mmc rescan' which needs to start off
Simon> with a bus width of 1.

Simon> The problem was surfaced by enabling CONFIG_DM_MMC_OPS on
Simon> tegra. Without this option the MMC stack fully reinits the
Simon> driver on a 'mmc rescan'.  But with this option driver model
Simon> does not re-probe a driver once it has been probed once.

Simon> Fix the driver to honour the request.

Simon> Signed-off-by: Simon Glass <sjg@chromium.org> ---

Tested-by: Peter Chubb <peter.chubb@data61.csiro.au>

Simon>  drivers/mmc/tegra_mmc.c | 2 +- 1 file changed, 1 insertion(+),
Simon> 1 deletion(-)

Simon> diff --git a/drivers/mmc/tegra_mmc.c b/drivers/mmc/tegra_mmc.c
Simon> index 338e42b528..7d945a172e 100644 ---
Simon> a/drivers/mmc/tegra_mmc.c +++ b/drivers/mmc/tegra_mmc.c @@
Simon> -438,7 +438,7 @@ static int tegra_mmc_set_ios(struct udevice
Simon> *dev) else if (mmc->bus_width == 4) ctrl |= (1 << 1); else -
Simon> ctrl &= ~(1 << 1); + ctrl &= ~(1 << 1 | 1 << 5);
 
Simon>  	writeb(ctrl, &priv->reg->hostctl); debug("mmc_set_ios:
Simon> hostctl = %08X\n", ctrl); -- 2.13.0.506.g27d5fe0cd-goog


Simon> --
Dr Peter Chubb         Tel: +61 2 9490 5852      http://ts.data61.csiro.au/
Trustworthy Systems Group                           Data61 (formerly NICTA)

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

* [U-Boot] [PATCH] tegra: mmc: Set the bus width correctly
  2017-06-08  4:03 ` Peter.Chubb at data61.csiro.au
@ 2017-06-14 11:32   ` Simon Glass
  2017-06-14 15:33     ` Tom Warren
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Glass @ 2017-06-14 11:32 UTC (permalink / raw)
  To: u-boot

Hi,

On 7 June 2017 at 22:03,  <Peter.Chubb@data61.csiro.au> wrote:
>>>>>> "Simon" == Simon Glass <sjg@chromium.org> writes:
>
> Simon> The driver currently does not reset bit 5 of the hostctl
> Simon> register even if the MMC stack requests it. Then means that
> Simon> once a bus width of 8 is selected it is not possible to change
> Simon> it back to 1. This breaks 'mmc rescan' which needs to start off
> Simon> with a bus width of 1.
>
> Simon> The problem was surfaced by enabling CONFIG_DM_MMC_OPS on
> Simon> tegra. Without this option the MMC stack fully reinits the
> Simon> driver on a 'mmc rescan'.  But with this option driver model
> Simon> does not re-probe a driver once it has been probed once.
>
> Simon> Fix the driver to honour the request.
>
> Simon> Signed-off-by: Simon Glass <sjg@chromium.org> ---
>
> Tested-by: Peter Chubb <peter.chubb@data61.csiro.au>
>
> Simon>  drivers/mmc/tegra_mmc.c | 2 +- 1 file changed, 1 insertion(+),
> Simon> 1 deletion(-)
>
> Simon> diff --git a/drivers/mmc/tegra_mmc.c b/drivers/mmc/tegra_mmc.c
> Simon> index 338e42b528..7d945a172e 100644 ---
> Simon> a/drivers/mmc/tegra_mmc.c +++ b/drivers/mmc/tegra_mmc.c @@
> Simon> -438,7 +438,7 @@ static int tegra_mmc_set_ios(struct udevice
> Simon> *dev) else if (mmc->bus_width == 4) ctrl |= (1 << 1); else -
> Simon> ctrl &= ~(1 << 1); + ctrl &= ~(1 << 1 | 1 << 5);
>
> Simon>          writeb(ctrl, &priv->reg->hostctl); debug("mmc_set_ios:
> Simon> hostctl = %08X\n", ctrl); -- 2.13.0.506.g27d5fe0cd-goog

Thanks for testing this.

Tom please note this is a bug fix.

- Simon

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

* [U-Boot] [PATCH] tegra: mmc: Set the bus width correctly
  2017-06-14 11:32   ` Simon Glass
@ 2017-06-14 15:33     ` Tom Warren
  2017-06-20 16:40       ` Thierry Reding
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Warren @ 2017-06-14 15:33 UTC (permalink / raw)
  To: u-boot

Thanks, Simon. I'll take it in to u-boot-tegra/master for the next PR.

> -----Original Message-----
> From: sjg at google.com [mailto:sjg at google.com] On Behalf Of Simon Glass
> Sent: Wednesday, June 14, 2017 4:32 AM
> To: Peter Chubb <Peter.Chubb@data61.csiro.au>
> Cc: U-Boot Mailing List <u-boot@lists.denx.de>; Tom Warren
> <TWarren@nvidia.com>; Stephen Warren <swarren@wwwdotorg.org>;
> Jaehoon Chung <jh80.chung@samsung.com>; Stephen Warren
> <swarren@nvidia.com>
> Subject: Re: [PATCH] tegra: mmc: Set the bus width correctly
> 
> Hi,
> 
> On 7 June 2017 at 22:03,  <Peter.Chubb@data61.csiro.au> wrote:
> >>>>>> "Simon" == Simon Glass <sjg@chromium.org> writes:
> >
> > Simon> The driver currently does not reset bit 5 of the hostctl
> > Simon> register even if the MMC stack requests it. Then means that
> > Simon> once a bus width of 8 is selected it is not possible to change
> > Simon> it back to 1. This breaks 'mmc rescan' which needs to start off
> > Simon> with a bus width of 1.
> >
> > Simon> The problem was surfaced by enabling CONFIG_DM_MMC_OPS on
> > Simon> tegra. Without this option the MMC stack fully reinits the
> > Simon> driver on a 'mmc rescan'.  But with this option driver model
> > Simon> does not re-probe a driver once it has been probed once.
> >
> > Simon> Fix the driver to honour the request.
> >
> > Simon> Signed-off-by: Simon Glass <sjg@chromium.org> ---
> >
> > Tested-by: Peter Chubb <peter.chubb@data61.csiro.au>
> >
> > Simon>  drivers/mmc/tegra_mmc.c | 2 +- 1 file changed, 1 insertion(+),
> > Simon> 1 deletion(-)
> >
> > Simon> diff --git a/drivers/mmc/tegra_mmc.c b/drivers/mmc/tegra_mmc.c
> > Simon> index 338e42b528..7d945a172e 100644 ---
> > Simon> a/drivers/mmc/tegra_mmc.c +++ b/drivers/mmc/tegra_mmc.c @@
> > Simon> -438,7 +438,7 @@ static int tegra_mmc_set_ios(struct udevice
> > Simon> *dev) else if (mmc->bus_width == 4) ctrl |= (1 << 1); else -
> > Simon> ctrl &= ~(1 << 1); + ctrl &= ~(1 << 1 | 1 << 5);
> >
> > Simon>          writeb(ctrl, &priv->reg->hostctl); debug("mmc_set_ios:
> > Simon> hostctl = %08X\n", ctrl); -- 2.13.0.506.g27d5fe0cd-goog
> 
> Thanks for testing this.
> 
> Tom please note this is a bug fix.
> 
> - Simon
--
nvpublic

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

* [U-Boot] [PATCH] tegra: mmc: Set the bus width correctly
  2017-06-14 15:33     ` Tom Warren
@ 2017-06-20 16:40       ` Thierry Reding
  0 siblings, 0 replies; 5+ messages in thread
From: Thierry Reding @ 2017-06-20 16:40 UTC (permalink / raw)
  To: u-boot

On Wed, Jun 14, 2017 at 03:33:18PM +0000, Tom Warren wrote:
> Thanks, Simon. I'll take it in to u-boot-tegra/master for the next PR.

I assume this means it'll make v2017.07? Currently v2017.07-rc2 is
broken, and this patch fixes the regression for me:

Tested-by: Thierry Reding <treding@nvidia.com>

> > -----Original Message-----
> > From: sjg at google.com [mailto:sjg at google.com] On Behalf Of Simon Glass
> > Sent: Wednesday, June 14, 2017 4:32 AM
> > To: Peter Chubb <Peter.Chubb@data61.csiro.au>
> > Cc: U-Boot Mailing List <u-boot@lists.denx.de>; Tom Warren
> > <TWarren@nvidia.com>; Stephen Warren <swarren@wwwdotorg.org>;
> > Jaehoon Chung <jh80.chung@samsung.com>; Stephen Warren
> > <swarren@nvidia.com>
> > Subject: Re: [PATCH] tegra: mmc: Set the bus width correctly
> > 
> > Hi,
> > 
> > On 7 June 2017 at 22:03,  <Peter.Chubb@data61.csiro.au> wrote:
> > >>>>>> "Simon" == Simon Glass <sjg@chromium.org> writes:
> > >
> > > Simon> The driver currently does not reset bit 5 of the hostctl
> > > Simon> register even if the MMC stack requests it. Then means that
> > > Simon> once a bus width of 8 is selected it is not possible to change
> > > Simon> it back to 1. This breaks 'mmc rescan' which needs to start off
> > > Simon> with a bus width of 1.
> > >
> > > Simon> The problem was surfaced by enabling CONFIG_DM_MMC_OPS on
> > > Simon> tegra. Without this option the MMC stack fully reinits the
> > > Simon> driver on a 'mmc rescan'.  But with this option driver model
> > > Simon> does not re-probe a driver once it has been probed once.
> > >
> > > Simon> Fix the driver to honour the request.
> > >
> > > Simon> Signed-off-by: Simon Glass <sjg@chromium.org> ---
> > >
> > > Tested-by: Peter Chubb <peter.chubb@data61.csiro.au>
> > >
> > > Simon>  drivers/mmc/tegra_mmc.c | 2 +- 1 file changed, 1 insertion(+),
> > > Simon> 1 deletion(-)
> > >
> > > Simon> diff --git a/drivers/mmc/tegra_mmc.c b/drivers/mmc/tegra_mmc.c
> > > Simon> index 338e42b528..7d945a172e 100644 ---
> > > Simon> a/drivers/mmc/tegra_mmc.c +++ b/drivers/mmc/tegra_mmc.c @@
> > > Simon> -438,7 +438,7 @@ static int tegra_mmc_set_ios(struct udevice
> > > Simon> *dev) else if (mmc->bus_width == 4) ctrl |= (1 << 1); else -
> > > Simon> ctrl &= ~(1 << 1); + ctrl &= ~(1 << 1 | 1 << 5);
> > >
> > > Simon>          writeb(ctrl, &priv->reg->hostctl); debug("mmc_set_ios:
> > > Simon> hostctl = %08X\n", ctrl); -- 2.13.0.506.g27d5fe0cd-goog
> > 
> > Thanks for testing this.
> > 
> > Tom please note this is a bug fix.
> > 
> > - Simon
> --
> nvpublic
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170620/26cd6472/attachment.sig>

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

end of thread, other threads:[~2017-06-20 16:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-08  3:11 [U-Boot] [PATCH] tegra: mmc: Set the bus width correctly Simon Glass
2017-06-08  4:03 ` Peter.Chubb at data61.csiro.au
2017-06-14 11:32   ` Simon Glass
2017-06-14 15:33     ` Tom Warren
2017-06-20 16:40       ` Thierry Reding

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