linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Cc: "linux-renesas-soc@vger.kernel.org"
	<linux-renesas-soc@vger.kernel.org>,
	"Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
	"Marek Vasut" <marek.vasut@gmail.com>,
	"Phong Hoang" <phong.hoang.wz@renesas.com>
Subject: RE: [PATCH RFT] mmc: renesas_sdhi: limit block count to 16 bit for old revisions
Date: Wed, 20 Mar 2019 08:01:19 +0000	[thread overview]
Message-ID: <TY2PR01MB4812EEF87FA3133EE9C6738ED8410@TY2PR01MB4812.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <20190319101259.20078-1-wsa+renesas@sang-engineering.com>

Hi Wolfram-san,

> From: Wolfram Sang, Sent: Tuesday, March 19, 2019 7:13 PM
> 
> R-Car Gen2 has two different SDHI incarnations in the same chip. The
> older one does not support the recently introduced 32 bit register
> access to the block count register. Make sure we use this feature only
> after the first known version.
> 
> Thanks to the Renesas Testing team for this bug report!
> 
> Fixes:5603731a15ef ("mmc: tmio: fix access width of Block Count Register")
> Reported-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---

Thank you for the patch.
Since our test team tested this patch on R-Car H2 / Lager board and the issue disappeared.
So,

Tested-by: Phong Hoang <phong.hoang.wz@renesas.com>

Best regards,
Yoshihiro Shimoda

> I could reproduce the issue on my Renesas Lager board (R-Car H2) and this patch
> fixes the issue for me. Still, if we could confirmation from the testing team,
> this would be awesome to have before applying, I think.
> 
>  drivers/mmc/host/renesas_sdhi_core.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
> index 71e13844df6c..8742e27e4e8b 100644
> --- a/drivers/mmc/host/renesas_sdhi_core.c
> +++ b/drivers/mmc/host/renesas_sdhi_core.c
> @@ -641,6 +641,7 @@ int renesas_sdhi_probe(struct platform_device *pdev,
>  	struct renesas_sdhi *priv;
>  	struct resource *res;
>  	int irq, ret, i;
> +	u16 ver;
> 
>  	of_data = of_device_get_match_data(&pdev->dev);
> 
> @@ -773,12 +774,17 @@ int renesas_sdhi_probe(struct platform_device *pdev,
>  	if (ret)
>  		goto efree;
> 
> +	ver = sd_ctrl_read16(host, CTL_VERSION);
> +	/* GEN2_SDR104 is first known SDHI to use 32bit block count */
> +	if (ver < SDHI_VER_GEN2_SDR104 && mmc_data->max_blk_count > U16_MAX)
> +		mmc_data->max_blk_count = U16_MAX;
> +
>  	ret = tmio_mmc_host_probe(host);
>  	if (ret < 0)
>  		goto edisclk;
> 
>  	/* One Gen2 SDHI incarnation does NOT have a CBSY bit */
> -	if (sd_ctrl_read16(host, CTL_VERSION) == SDHI_VER_GEN2_SDR50)
> +	if (ver == SDHI_VER_GEN2_SDR50)
>  		mmc_data->flags &= ~TMIO_MMC_HAVE_CBSY;
> 
>  	/* Enable tuning iff we have an SCC and a supported mode */
> --
> 2.11.0


  parent reply	other threads:[~2019-03-20  8:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19 10:12 [PATCH RFT] mmc: renesas_sdhi: limit block count to 16 bit for old revisions Wolfram Sang
2019-03-19 12:02 ` Simon Horman
2019-03-20  8:01 ` Yoshihiro Shimoda [this message]
2019-03-21 10:46 ` Ulf Hansson

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=TY2PR01MB4812EEF87FA3133EE9C6738ED8410@TY2PR01MB4812.jpnprd01.prod.outlook.com \
    --to=yoshihiro.shimoda.uh@renesas.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=marek.vasut@gmail.com \
    --cc=niklas.soderlund@ragnatech.se \
    --cc=phong.hoang.wz@renesas.com \
    --cc=wsa+renesas@sang-engineering.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;
as well as URLs for NNTP newsgroup(s).