Re: [PATCH] sdhci: disable MMC_CAP_NEEDS_POLL in nonremovable case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 27, 2010 at 4:09 PM, Matt Fleming <matt@xxxxxxxxxxxxxxxxx> wrote:
> On Fri, Aug 27, 2010 at 03:34:54PM +0900, Jaehoon Chung wrote:
>> If controller use SDHCI_QUIRK_BROKEN_CARD_DETECTION quirk,
>> controller need always polling detect
>>
>> In this case, always generated interrupt.Because controller checked card status.
>> I think that is not efficiently.
>>
>> But if card is nonremovable, we need not always polling.
>> So i added the check-point which is nonremovable or not
>>
>>  Signed-off-by: Jaehoon Chung <jh80.chung@xxxxxxxxxxx>
>> ---
>>  drivers/mmc/host/sdhci.c |    5 +++--
>>  1 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>> index 401527d..4bc5d3c 100644
>> --- a/drivers/mmc/host/sdhci.c
>> +++ b/drivers/mmc/host/sdhci.c
>> @@ -1826,8 +1826,9 @@ int sdhci_add_host(struct sdhci_host *host)
>>       if (caps & SDHCI_CAN_DO_HISPD)
>>               mmc->caps |= MMC_CAP_SD_HIGHSPEED;
>>
>> -     if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION)
>> -             mmc->caps |= MMC_CAP_NEEDS_POLL;
>> +     if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) &&
>> +             !(host->mmc->caps & MMC_CAP_NONREMOVABLE))
>> +                     mmc->caps |= MMC_CAP_NEEDS_POLL;
>>
>>       mmc->ocr_avail = 0;
>>       if (caps & SDHCI_CAN_VDD_330)
>> --
>> 1.6.0.4
>> --
>
> I don't have any non-removable hardware so I can't test this patch but I
> think it makes sense. The indentation looks a bit weird, but Andrew may
> fix that up if he thinks it's a problem.
>
> I'm assuming that you're testing this change with the sdhci-s3c.c
> driver? Is it a good idea that the driver is using
> SDHCI_QUIRK_BROKEN_CARD_DETECTION when it has a nonremovable card?
> Currently we seem to be using SDHCI_QUIRK_BROKEN_CARD_DETECTION and
> MMC_CAP_NONREMOVABLE to mean that same thing in some places which is
> really confusing.

There are some reason to use both.
s5pc110/c210 has 3 or 4 mmc devices and basically our board don't
connect the card detection pin to sdhci.
That's reason to define BROKEN_CARD_DETECTION. but some devices such
as eMMC and WiFi has connected permanently.
it's reason to define CAP_NONREMOVABLE for these devices.

The main reason of this patch is that don't poll anymore when it's
non-removable.

Thank you,
Kyungmin Park

>
> Like in drivers/mmc/host/sdhci.c we can enable card detection irqs for
> cards that are nonremovable which is a bit pointless (though obviously
> not harmful).
>
> But your patch seems fine unless anyone else has an issue with it, I'm
> just trying to see if we could clean this up ontop of your patch.
>
> Adding Andrew Morton to the CC list.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux