public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Javier Martinez Canillas <javier@dowhile0.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	linux-samsung-soc <linux-samsung-soc@vger.kernel.org>,
	Kukjin Kim <kgene@kernel.org>,
	Tobias Jakobi <liquid.acid@gmx.net>,
	Daniel Drake <drake@endlessm.com>,
	Sebastian Reichel <sre@kernel.org>,
	Seungwon Jeon <tgih.jun@samsung.com>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Chris Ball <chris@printf.net>,
	Joonyoung Shim <jy0922.shim@samsung.com>
Subject: Re: [PATCH 1/4] mmc: core: add support for hardware reset gpio line
Date: Thu, 29 Jan 2015 12:01:39 +0100	[thread overview]
Message-ID: <54CA1313.1090302@samsung.com> (raw)
In-Reply-To: <CABxcv=nbTcuzcmhYHKnDom5XFd+gqUbKRF0THCKsN5tL8-cBGA@mail.gmail.com>

Hello,

On 2015-01-29 11:56, Javier Martinez Canillas wrote:
> On Thu, Jan 29, 2015 at 10:15 AM, Marek Szyprowski
> <m.szyprowski@samsung.com> wrote:
>>> Also, I wonder whether we could extend the mmc-pwrseq to cover your
>>> case? Did you consider that as an option?
>> I didn't consider mmc-pwrseq yet. For me it looked straightforward to
> I agree with Ulf that using mmc-pwrseq would be a good solution and in
> fact I think the pwrseq_simple [0] driver will fit your use case since
> it supports a reset GPIO pin which is what many WLAN chips attached to
> a SDIO interface use.
>> implement
>> it just like card detect or write-protection gpio pins. I already noticed
>> that
>> there is code for some mmc host driver, which perform mmc hardware reset. If
>> you
>> think that extending pwrseq is the better approach, I will try to update my
>> patches. This will add reboot handler to mmc-pwrseq then. The only question
>> is
> I don't think that adding a reboot handler to mmc-pwrseq is needed.
> AFAICT the call chain is:
>
> sys_reboot() -> kernel_restart() -> device_shutdown() ->
> mmc_bus_shutdown() -> _mmc_suspend() -> mmc_power_off() ->
> mmc_pwrseq_power_off() -> struct mmc_pwrseq_ops .power_off
>
> So since the pwrseq_simple already asserts the reset GPIO in
> .power_off, it should be enough to ensure the eMMC will be reset to
> its default configuration for the iROM to work properly.

I think that I had to add reset handler, because device_shutdown() was not
called if reset was triggered from magic sysrq, but I will check it again.

> It also asserts the GPIO pin in .pre_power_on and de-asserts in
> .post_power_on which should be needed as well for the other case you
> mentioned when a broken bootloader left the emmc card in some unknown
> state.
>
>> weather to use it always when mmc-pwrseq has been enabled or only if some
>> additional property like 'reset-on-reboot' has been provided.
>>
> Having a reset GPIO is optional AFAIK so I don't think there is a need
> for an additional "reset-on-reboot" propery.
>
>> Best regards
>> --
>> Marek Szyprowski, PhD
>> Samsung R&D Institute Poland
>>
> Best regards,
> Javier
>
> [0]:
> FYI, these are the relevant commits in linux-next:
> fe1922d5d4d0 mmc: pwrseq_simple: Add support for a reset GPIO pin
> ec2017f2491f mmc: pwrseq: Initial support for the simple MMC power
> sequence provider
> fe1686658f9c mmc: pwrseq: Document DT bindings for the simple MMC power sequence
> 1b745e8a4627 mmc: core: Initial support for MMC power sequences

Ok, I will check it.

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

  reply	other threads:[~2015-01-29 11:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1422453595-21160-1-git-send-email-m.szyprowski@samsung.com>
2015-01-28 13:59 ` [PATCH 4/4] ARM: dts: exynos5422-odroidxu3: add eMMC reset line Marek Szyprowski
     [not found] ` <1422453595-21160-2-git-send-email-m.szyprowski@samsung.com>
2015-01-28 14:24   ` [PATCH 1/4] mmc: core: add support for hardware reset gpio line Ulf Hansson
2015-01-28 14:41     ` Tobias Jakobi
     [not found]     ` <CAPDyKFpowidghwadJS+gYP0EVo6gRUhAG8s14CMEbwatFadP2Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-29  9:15       ` Marek Szyprowski
     [not found]         ` <54C9FA48.5050705-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-01-29 10:56           ` Javier Martinez Canillas
2015-01-29 11:01             ` Marek Szyprowski [this message]
2015-01-30 10:37             ` Marek Szyprowski
2015-01-30 11:33               ` Ulf Hansson
2015-01-30 11:35               ` Sjoerd Simons

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=54CA1313.1090302@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=chris@printf.net \
    --cc=devicetree@vger.kernel.org \
    --cc=drake@endlessm.com \
    --cc=javier@dowhile0.org \
    --cc=jh80.chung@samsung.com \
    --cc=jy0922.shim@samsung.com \
    --cc=kgene@kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=liquid.acid@gmx.net \
    --cc=sre@kernel.org \
    --cc=tgih.jun@samsung.com \
    --cc=ulf.hansson@linaro.org \
    /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