The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
	linux-mmc@vger.kernel.org, Ulf Hansson <ulf.hansson@linaro.org>,
	linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] mmc: tmio: move MFD variant reset to a platform hook
Date: Wed, 3 Oct 2018 01:01:15 +0200	[thread overview]
Message-ID: <20181002230115.GB812@kunai> (raw)
In-Reply-To: <1538397062-19162-2-git-send-email-yamada.masahiro@socionext.com>

[-- Attachment #1: Type: text/plain, Size: 1602 bytes --]

Hi Yamada-san,

On Mon, Oct 01, 2018 at 09:31:01PM +0900, Masahiro Yamada wrote:
> CTL_RESET_SDIO register is specific to the TMIO MFD (tmio_mmc.c).
> 
> Add a new hook host->reset for performing a platform-specific reset
> sequence, and move CTL_RESET_SDIO over there.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

I like it in general.

> +static void tmio_mmc_reset(struct tmio_mmc_host *host)
> +{
> +	sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0000);
> +	usleep_range(10000, 11000);
> +	sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0001);
> +	usleep_range(10000, 11000);
> +}
> +

Are you sure resetting SDIO works independently of resetting SD? Maybe
we should add resetting SD here, too, to keep the pattern...

> --- a/drivers/mmc/host/tmio_mmc_core.c
> +++ b/drivers/mmc/host/tmio_mmc_core.c
> @@ -164,14 +164,13 @@ static void tmio_mmc_reset(struct tmio_mmc_host *host)
>  {
>  	/* FIXME - should we set stop clock reg here */
>  	sd_ctrl_write16(host, CTL_RESET_SD, 0x0000);
> -	if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG)
> -		sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0000);
>  	usleep_range(10000, 11000);
>  	sd_ctrl_write16(host, CTL_RESET_SD, 0x0001);
> -	if (host->pdata->flags & TMIO_MMC_HAVE_HIGH_REG)
> -		sd_ctrl_write16(host, CTL_RESET_SDIO, 0x0001);
>  	usleep_range(10000, 11000);

... and have this simplified reset pattern either also in a seperate
function, or doing...

>  
> +	if (host->reset)
> +		host->reset(host);
	else
		simplified_reset_pattern

?

What's your opinion?

Regards,

   Wolfram


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-10-02 23:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-01 12:31 [PATCH 0/2] mmc: tmio: remove confusing TMIO_MMC_HAVE_HIGH_REG flag Masahiro Yamada
2018-10-01 12:31 ` [PATCH 1/2] mmc: tmio: move MFD variant reset to a platform hook Masahiro Yamada
2018-10-02 23:01   ` Wolfram Sang [this message]
2018-10-03 11:34     ` Masahiro Yamada
2018-10-01 12:31 ` [PATCH 2/2] mmc: tmio: remove TMIO_MMC_HAVE_HIGH_REG flag Masahiro Yamada

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=20181002230115.GB812@kunai \
    --to=wsa@the-dreams.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=yamada.masahiro@socionext.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