All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: zhangfei <zhangfei.gao@linaro.org>
Cc: Jaehoon Chung <jh80.chung@samsung.com>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	Ulf Hansson <ulf.hansson@linaro.org>
Subject: Re: [PATCH] mmc: dw_mmc: dw_mci_get_cd check MMC_CAP_NONREMOVABLE
Date: Wed, 06 May 2015 09:23:56 +0200	[thread overview]
Message-ID: <5070892.H5Aty5Cb8i@wuerfel> (raw)
In-Reply-To: <5549B4FE.6080007@linaro.org>

On Wednesday 06 May 2015 14:30:22 zhangfei wrote:
> On 05/06/2015 02:13 PM, Jaehoon Chung wrote:
> >>>>>>>>> If you want to check it, use the "broken-cd" and "non-removable" 
> >>>>
> >>>> drivers/mmc/host/dw_mmc.c checks broken-cd, while mmc_of_parse checks non-removable.
> >>>> Yes, it works.
> >>>>
> >>>> But is it a workaround? and a little tricky.
> >>>> It costs me some time to find why non-removable does not work, someone else may meet the same issue.
> >>>> It does not align with Documentation/devicetree/bindings/mmc/mmc.txt, which is the guideline to write dts.
> >>>> And see drivers/mmc/host/sdhci.c: sdhci_do_get_cd, it also checks both.
> >>>
> >>> "non-removable" is assumed that card is not removed.
> >>> it's not also correct detect scheme. Then it's also able to say the broken card detection scheme.
> >>> (if CDETECT register can't use.)
> >>>
> >>> BROKEN_CARD_DETECTION quirk means that it has unreliable card detection.
> >>> When dw-mmc host controller has unreliable card detection scheme, it could be set.
> >>> Is this tricky? i don't think so.
> >>>
> >>> Though non-removable doesn't set, it has to work fine, isn't?
> >> If non-removable is not set, broken-cd has to be set.
> >> Or set both, but usually we may not consider this at first.
> >>
> >> When we first want to enable emmc, we naturally use non-removable, according to Documentation/devicetree/bindings/mmc/mmc.txt
> >
> > Why do you use naturally non-removable? eMMC can be removed at some SoC. (It's assumption.)
> > Is it common approach that consider how eMMC can be detected at host controller?
> The emmc chip we use is folded on board and can not be removed.
> non-removable will make mmc_rescan only executing once, while broken 
> will make mmc_rescan polling.

I agree. The current behavior of dw_mmc is different from what the
documentation says it is, and different from what the other host
controllers do.

Your patch looks correct to me, as it will make the dw_mmc driver behave
like the others but keep existing files working when they rely on the
nonstandard behavior.

	Arnd


      reply	other threads:[~2015-05-06  7:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-05  8:54 [PATCH] mmc: dw_mmc: dw_mci_get_cd check MMC_CAP_NONREMOVABLE Zhangfei Gao
2015-05-06  0:36 ` Jaehoon Chung
2015-05-06  1:14   ` Zhangfei Gao
2015-05-06  1:26     ` Jaehoon Chung
2015-05-06  1:33       ` zhangfei
2015-05-06  1:39         ` Jaehoon Chung
2015-05-06  1:53           ` zhangfei
2015-05-06  2:16           ` zhangfei
2015-05-06  4:21             ` Jaehoon Chung
2015-05-06  5:30               ` zhangfei
2015-05-06  6:13                 ` Jaehoon Chung
2015-05-06  6:30                   ` zhangfei
2015-05-06  7:23                     ` Arnd Bergmann [this message]

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=5070892.H5Aty5Cb8i@wuerfel \
    --to=arnd@arndb.de \
    --cc=jh80.chung@samsung.com \
    --cc=linux-mmc@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.