public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@samsung.com>
To: zhangfei <zhangfei.gao@linaro.org>,
	Shawn Lin <shawn.lin@kernel-upstream.org>,
	Guodong Xu <guodong.xu@linaro.org>,
	Shawn Lin <shawn.lin@rock-chips.com>
Cc: robh+dt@kernel.org, "Paweł Moll" <pawel.moll@arm.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	ijc+devicetree@hellion.org.uk,
	"Kumar Gala" <galak@codeaurora.org>,
	"Ulf Hansson" <ulf.hansson@linaro.org>,
	devicetree@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-mmc@vger.kernel.org,
	"Xinwei Kong" <kong.kongxinwei@hisilicon.com>
Subject: Re: [PATCH 2/2] mmc: dw_mmc: add resets support to dw_mmc
Date: Tue, 29 Mar 2016 17:30:16 +0900	[thread overview]
Message-ID: <56FA3D18.9070600@samsung.com> (raw)
In-Reply-To: <56FA3B70.2090902@linaro.org>

On 03/29/2016 05:23 PM, zhangfei wrote:
> 
> 
> On 03/29/2016 10:22 AM, Shawn Lin wrote:
> 
>>>
>>>
>>>
>>>         +               else if (IS_ERR(host->pdata)) {
>>>                                  dev_err(host->dev, "platform data not
>>>         available\n");
>>>                                  return -EINVAL;
>>>                          }
>>>         @@ -3012,6 +3022,9 @@ int dw_mci_probe(struct dw_mci *host)
>>>                          }
>>>                  }
>>>
>>>         +       if (host->pdata->rstc != NULL)
>>>         +               reset_control_deassert(host->pdata->rstc);
>>>         +
>>>
>>>
>>>     sorry, I can't follow your intention here. Shouldn't it be something
>>>     like "assert mmc -> may need delay -> deassert mmc". As your current
>>>     code, nothing happend right?
> Should be abstracted in reset driver.
> 
>>>
>>>
>>> The chip exits from bootloader with this bit asserted. And when entering
>>> kernel, we only need to deassert.
>>>
>>> In my current code, the driver deassert mmc in _probe(), and assert mmc
>>> in _remove().
>>
>> I catch your point. From the previous discussion, we add it to make sure
>> dw_mmc in good state after leaving bootloader to kernel. But My real
>> question is that you can assert it in  bootloader, so you can also
>> dessert it in bootloaer to make sure dw_mmc work fine when probing
>> in kernel. In that way, we don't need this patch?
> 
> uefi does not have exit point, and kernel may not assume mmc controller state is always correct when boot.
> If Uefi need copy Image from mmc, mmc controller is in working state.
> When jump to kernel, uefi mmc driver can not recover itself.
> If kernel assume mmc controller state is clean, mmc will be in abnormal state.
> Some controller will clear itself when set clock, however, hip660 does not, it need special register to access.
> 
> 
>>
>> More to think, Is it ok to match the behaviour of bootloader stage?
>> My bootloader doesn't assert the reset pin of dw_mmc, so it seams if
>> I want to fix you issue on kernel stage, I need a new round of
>> assert->delay->deassert.
> 
> The process like delay (if required) should be abstracted in reset driver.
> reset framework just export reset_control_assert/reset_control_deassert API.
> Unfortunately not find clear description in Documentation/.
> Suppose deassert is like start, while assert is like stop.

First, this patch need to resend after fixing.
Could you or Guodong resend these patches as V2 or V3?

Best Regards,
Jaehoon Chung

> 
> drivers/reset/core.c
> reset_control_deassert - deasserts the reset line
> reset_control_assert - asserts the reset line
> 
> More example:
> drivers/mmc/host/sdhci-st.c
> drivers/mmc/host/sunxi-mmc.c
> drivers/usb/host/ohci-platform.c
> drivers/i2c/busses/i2c-mv64xxx.c
> 
> Thanks
> 
> -- 
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

  reply	other threads:[~2016-03-29  8:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-06  8:47 [PATCH 1/2] Documentation: synopsys-dw-mshc: add binding for resets Guodong Xu
2016-03-06  8:47 ` [PATCH 2/2] mmc: dw_mmc: add resets support to dw_mmc Guodong Xu
2016-03-06  9:11   ` kbuild test robot
2016-03-06 14:16   ` Shawn Lin
     [not found]     ` <CAFGCpxz3GfFeduaz1Dkg0WvRJWs+GHdVu8uY0-wV=RGyRfBE=A@mail.gmail.com>
     [not found]       ` <56F9E6E5.9000100@kernel-upstream.org>
2016-03-29  5:56         ` Jaehoon Chung
2016-03-29  6:09           ` Shawn Lin
2016-03-29  6:15             ` Jaehoon Chung
2016-03-29  8:23         ` zhangfei
2016-03-29  8:30           ` Jaehoon Chung [this message]
2016-03-30  0:46           ` Shawn Lin
2016-03-30  1:18             ` zhangfei
2016-03-07  0:53 ` [PATCH 1/2] Documentation: synopsys-dw-mshc: add binding for resets Jaehoon Chung
2016-03-07  9:35   ` Shawn Lin
2016-03-07  9:51     ` Jaehoon Chung

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=56FA3D18.9070600@samsung.com \
    --to=jh80.chung@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=guodong.xu@linaro.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=kong.kongxinwei@hisilicon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=shawn.lin@kernel-upstream.org \
    --cc=shawn.lin@rock-chips.com \
    --cc=ulf.hansson@linaro.org \
    --cc=zhangfei.gao@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