linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shawn Lin <shawn.lin@rock-chips.com>
To: Haibo Chen <haibo.chen@nxp.com>, Ulf Hansson <ulf.hansson@linaro.org>
Cc: shawn.lin@rock-chips.com,
	"bcm-kernel-feedback-list@broadcom.com"
	<bcm-kernel-feedback-list@broadcom.com>,
	"linux-rpi-kernel@lists.infradead.org"
	<linux-rpi-kernel@lists.infradead.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 10/21] mmc: sdhci: remove SDHCI_QUIRK_BROKEN_CARD_DETECTION
Date: Wed, 27 Jan 2016 15:20:24 +0800	[thread overview]
Message-ID: <56A86FB8.5030006@rock-chips.com> (raw)
In-Reply-To: <DB3PR04MB055320DCE3EED80B3837D0C190D90@DB3PR04MB0553.eurprd04.prod.outlook.com>

On 2016/1/27 15:11, Haibo Chen wrote:
>
>
> Hi Shawn,
>
>

[...]

>> @@ -1618,7 +1618,8 @@ static int sdhci_do_get_cd(struct sdhci_host *host)
>>   		return 0;
>>
>>   	/* If nonremovable, assume that the card is always present. */
>> -	if (host->mmc->caps & MMC_CAP_NONREMOVABLE)
>> +	if (host->mmc->caps & MMC_CAP_NONREMOVABLE ||
>> +	    host->mmc->caps & MMC_CAP_NEEDS_POLL)
>>   		return 1;
>>
>>   	/*
>> @@ -1628,10 +1629,6 @@ static int sdhci_do_get_cd(struct sdhci_host *host)
>>   	if (!IS_ERR_VALUE(gpio_cd))
>>   		return !!gpio_cd;
>>
>> -	/* If polling, assume that the card is always present. */
>> -	if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION)
>> -		return 1;
>
> Why simply  remove these code rather than use this:
> If(host->mmc->caps & MMC_CAP_NEEDS_POLL)
>         Return 1;
>
> According to the comment, if polling, need to return 1,
> But if you just simply remove this code, it will read the sdhci register SDHCI_PRESENT_STATE

Hi Haibo

I have combine this check with "host->mmc->caps & MMC_CAP_NONREMOVABLE" 
above. :)

Thanks

>
>
> Best Regards
>
> Haibo Chen
>
>> -
>>   	/* Host native card detect */
>>   	return !!(sdhci_readl(host, SDHCI_PRESENT_STATE) &
>> SDHCI_CARD_PRESENT);  } @@ -2658,7 +2655,7 @@ void
>> sdhci_enable_irq_wakeups(struct sdhci_host *host)
>>   	val = sdhci_readb(host, SDHCI_WAKE_UP_CONTROL);
>>   	val |= mask ;
>>   	/* Avoid fake wake up */
>> -	if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION)
>> +	if (host->mmc->caps & MMC_CAP_NEEDS_POLL)
>>   		val &= ~(SDHCI_WAKE_ON_INSERT |
>> SDHCI_WAKE_ON_REMOVE);
>>   	sdhci_writeb(host, val, SDHCI_WAKE_UP_CONTROL);  } @@ -3112,8
>> +3109,7 @@ int sdhci_add_host(struct sdhci_host *host)
>>   	if (caps[0] & SDHCI_CAN_DO_HISPD)
>>   		mmc->caps |= MMC_CAP_SD_HIGHSPEED |
>> MMC_CAP_MMC_HIGHSPEED;
>>
>> -	if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) &&
>> -	    !(mmc->caps & MMC_CAP_NONREMOVABLE) &&
>> +	if (!(mmc->caps & MMC_CAP_NONREMOVABLE) &&
>>   	    IS_ERR_VALUE(mmc_gpio_get_cd(host->mmc)))
>>   		mmc->caps |= MMC_CAP_NEEDS_POLL;
>>
>> --
>> 2.3.7
>>
>>
>> --
>> 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
>
>
>


-- 
Best Regards
Shawn Lin


  reply	other threads:[~2016-01-27  7:20 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-27  5:05 [RFC PATCH 0/21] Totally remove SDHCI_QUIRK_BROKEN_CARD_DETECTION quirk Shawn Lin
2016-01-27  5:06 ` [RFC PATCH 01/21] mmc: sdhci-pltfm: consolidate parsing path Shawn Lin
2016-01-27  5:06 ` [RFC PATCH 02/21] mmc: sdhci-iproc: " Shawn Lin
2016-01-27  5:06 ` [RFC PATCH 03/21] mmc: sdhci-msm: " Shawn Lin
2016-01-27  5:06 ` [RFC PATCH 04/21] mmc: sdhci-of-arasan: " Shawn Lin
2016-01-27  5:06 ` [RFC PATCH 05/21] mmc: sdhci-of-at91: " Shawn Lin
2016-01-27  5:07 ` [RFC PATCH 06/21] mmc: sdhci-of-esdhc: " Shawn Lin
2016-01-27  5:07 ` [RFC PATCH 07/21] mmc: sdhci-pxav3: " Shawn Lin
2016-01-27  5:44   ` Jisheng Zhang
2016-01-27  6:17     ` Shawn Lin
2016-01-27  5:07 ` [RFC PATCH 08/21] mmc: sdhci-sirf: check sdhci_get_of_property return value Shawn Lin
2016-01-27  5:07 ` [RFC PATCH 09/21] mmc: sdhci_f_sdh30: " Shawn Lin
2016-01-27  5:08 ` [RFC PATCH 10/21] mmc: sdhci: remove SDHCI_QUIRK_BROKEN_CARD_DETECTION Shawn Lin
2016-01-27  7:11   ` Haibo Chen
2016-01-27  7:20     ` Shawn Lin [this message]
2016-01-27  5:08 ` [RFC PATCH 11/21] mmc: sdhci-acpi: " Shawn Lin
2016-01-27  5:08 ` [RFC PATCH 12/21] mmc: sdhci-bcm-kona: " Shawn Lin
2016-01-27  5:08 ` [RFC PATCH 13/21] mmc: sdhci-bcm2835: " Shawn Lin
2016-01-27  5:08 ` [RFC PATCH 14/21] mmc: sdhci-esdhc-imx: " Shawn Lin
     [not found]   ` <1453871318-3888-1-git-send-email-shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-01-27  6:54     ` Haibo Chen
2016-01-27  6:58       ` Shawn Lin
2016-01-27  5:08 ` [RFC PATCH 15/21] mmc: sdhci-msm: " Shawn Lin
2016-01-27  5:08 ` [RFC PATCH 16/21] mmc: sdhci-of-esdhc: " Shawn Lin
2016-01-27  5:09 ` [RFC PATCH 17/21] mmc: sdhci-pci-core: " Shawn Lin
2016-01-27  5:09 ` [RFC PATCH 18/21] mmc: sdhci-pltfm: " Shawn Lin
2016-01-27  5:09 ` [RFC PATCH 19/21] mmc: sdhci-pxav2: " Shawn Lin
2016-01-27  5:09 ` [RFC PATCH 20/21] mmc: sdhci-s3c: " Shawn Lin
2016-01-27  5:09 ` [RFC PATCH 21/21] mmc: sdhci.h: " Shawn Lin
2016-01-27 12:59 ` [RFC PATCH 0/21] Totally remove SDHCI_QUIRK_BROKEN_CARD_DETECTION quirk Adrian Hunter
2016-01-27 13:23   ` Russell King - ARM Linux
2016-01-27 15:07     ` Ulf Hansson
2016-01-28  2:17       ` Shawn Lin
2016-01-28 11:29         ` One Thousand Gnomes
2016-01-28 15:03           ` Ulf Hansson
2016-01-28 15:54             ` One Thousand Gnomes
2016-01-28 12:03       ` Adrian Hunter
2016-01-28 15:16         ` Ulf Hansson
2016-01-28 16:27           ` Russell King - ARM Linux
2016-01-29 12:08           ` Adrian Hunter
2016-01-29 17:28             ` Russell King - ARM Linux
2016-02-01 12:32               ` Adrian Hunter

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=56A86FB8.5030006@rock-chips.com \
    --to=shawn.lin@rock-chips.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=haibo.chen@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --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;
as well as URLs for NNTP newsgroup(s).