diff mbox

powerpc/esdhc: enable the card insert/remove interrupt

Message ID 1350975677-8195-1-git-send-email-r66093@freescale.com (mailing list archive)
State New, archived
Headers show

Commit Message

Huang Changming-R66093 Oct. 23, 2012, 7:01 a.m. UTC
From: Jerry Huang <Chang-Ming.Huang@freescale.com>

The current eSDHC driver use the poll mode to detect
if the SD/MMC card is inserted or removed, which will generate
many interrupts and impact the performance. 
Therefore, change the default card detect to interrupt mode,
if the board can't support this mode, we still use the poll mode.

Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
CC: Anton Vorontsov <cbouatmailru@gmail.com>
CC: Chris Ball <cjb@laptop.org>
---
 drivers/mmc/host/sdhci-of-esdhc.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Anton Vorontsov Oct. 23, 2012, 8:26 a.m. UTC | #1
On Tue, Oct 23, 2012 at 03:01:17PM +0800, r66093@freescale.com wrote:
> From: Jerry Huang <Chang-Ming.Huang@freescale.com>
> 
> The current eSDHC driver use the poll mode to detect
> if the SD/MMC card is inserted or removed, which will generate
> many interrupts and impact the performance. 
> Therefore, change the default card detect to interrupt mode,
> if the board can't support this mode, we still use the poll mode.
> 
> Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
> CC: Anton Vorontsov <cbouatmailru@gmail.com>
> CC: Chris Ball <cjb@laptop.org>
> ---

IIRC, the card detection is broken SOC-revision-wise, not board-wise. So
the change seems wrong.

Also, take a look at this:

	http://lkml.org/lkml/2010/7/14/127

I started the work but never finished, unfortunately it caused some
regressions for non-FSL hardware...

>  drivers/mmc/host/sdhci-of-esdhc.c |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
> index ffc1226..5dc362f 100644
> --- a/drivers/mmc/host/sdhci-of-esdhc.c
> +++ b/drivers/mmc/host/sdhci-of-esdhc.c
> @@ -196,6 +196,11 @@ static void esdhc_of_detect_limitation(struct platform_device *pdev,
>  	if (vvn == VENDOR_V_22)
>  		pdata->quirks2 |= SDHCI_QUIRK2_HOST_NO_CMD23;
>  
> +	/* P4080DS and MPC837XMDS board don't support interrupt mode */
> +	if (of_machine_is_compatible("fsl,mpc837xmds") ||
> +	    of_machine_is_compatible("fsl,P4080DS"))
> +		pdata->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
> +
>  	iounmap(ioaddr);
>  end:
>  	return;
> @@ -223,7 +228,7 @@ static struct sdhci_pltfm_data sdhci_esdhc_pdata = {
>  	 * card detection could be handled via GPIO
>  	 * eSDHC cannot support End Attribute in NOP ADMA descriptor
>  	 */
> -	.quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_BROKEN_CARD_DETECTION
> +	.quirks = ESDHC_DEFAULT_QUIRKS
>  		| SDHCI_QUIRK_NO_CARD_NO_RESET
>  		| SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
>  	.ops = &sdhci_esdhc_ops,
> -- 
> 1.7.9.5
--
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
Huang Changming-R66093 Oct. 23, 2012, 8:39 a.m. UTC | #2
SGksIEFudG9uDQpGb3IgRlNMIFNPQ3MsIHRoZSBpbnRlcnJ1cHQgbW9kZSBpcyBzdXBwb3J0IGZv
ciBjYXJkIGRldGVjdC4NCkZvciBzb21lIHJlYXNvbnMsIHNvbWUgYm9hcmQgY2FuJ3Qgc3VwcG9y
dCB0aGlzIGZlYXR1cmUsIHN1Y2ggYXMgbXBjODM3eG1kcyBib2FyZCwNCmJ1dCBtcGM4Mzd4cmRi
IGJvYXJkIHN1cHBvcnQgaXQuDQoNCkkgc2VlIHlvdXIgbGlua3MsIGl0IGlzIGFib3V0IHRoZSBE
TUEgKHRoZSBmaXJzdCB2ZXJzaW9uIG9mIHAyMDIwIGRvbid0IHN1cHBvcnQgRE1BL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KPiA+ICAJ
ICogY2FyZCBkZXRlY3Rpb24gY291bGQgYmUgaGFuZGxlZCB2aWEgR1BJTw0KPiA+ICAJICogZVNE
SEMgY2Fubm90IHN1cHBvcnQgRW5kIEF0dHJpYnV0ZSBpbiBOT1AgQURNQSBkZXNjcmlwdG9yDQo+
ID4gIAkgKi8NCj4gPiAtCS5xdWlya3MgPSBFU0RIQ19ERUZBVUxUX1FVSVJLUyB8IFNESENJX1FV
SVJLX0JST0tFTl9DQVJEX0RFVEVDVElPTg0KPiA+ICsJLnF1aXJrcyA9IEVTREhDX0RFRkFVTFRf
UVVJUktTDQo+ID4gIAkJfCBTREhDSV9RVUlSS19OT19DQVJEX05PX1JFU0VUDQo+ID4gIAkJfCBT
REhDSV9RVUlSS19OT19FTkRBVFRSX0lOX05PUERFU0MsDQo+ID4gIAkub3BzID0gJnNkaGNpX2Vz
ZGhjX29wcywNCj4gPiAtLQ0KPiA+IDEuNy45LjUNCj4gLS0NCj4gVG8gdW5zdWJzY3JpYmUgZnJv
bSB0aGlzIGxpc3Q6IHNlbmQgdGhlIGxpbmUgInVuc3Vic2NyaWJlIGxpbnV4LW1tYyIgaW4NCj4g
dGhlIGJvZHkgb2YgYSBtZXNzYWdlIHRvIG1ham9yZG9tb0B2Z2VyLmtlcm5lbC5vcmcgTW9yZSBt
YWpvcmRvbW8gaW5mbyBhdA0KPiBodHRwOi8vdmdlci5rZXJuZWwub3JnL21ham9yZG9tby1pbmZv
Lmh0bWwNCg0K

--
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
Huang Changming-R66093 Oct. 25, 2012, 10:05 a.m. UTC | #3
SGksIEFudG9uLg0KQ291bGQgeW91IGhhdmUgYW55IGNvbW1lbnQgYWJvdXQgaXQ/DQpJZiBub3Qs
IEkgd2lsbCByZXNlbmQgdGhpcyBwYXRjaCB3aXRoIHYyLg0KDQpCZXN0IFJlZ2FyZHMN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Hog3pYgICBmICAgaCAgIH4gbQ0K

--
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
Anton Vorontsov Oct. 25, 2012, 10:30 a.m. UTC | #4
On Thu, Oct 25, 2012 at 10:05:44AM +0000, Huang Changming-R66093 wrote:
> Hi, Anton.
> Could you have any comment about it?
> If not, I will resend this patch with v2.

Technically, the patch looks fine.

But again, as far as I recall, the card detection logic was broken on the
SOC level (it's actually very hard to break it on the board level -- it
would either work or not, but in the eSDHC case it was just unreliable,
again, if I recall everything correctly -- I might be wrong).

Of course you know the hardware much better, so your words weight more, so
you don't need my ack on the patch. :)

Although there's a second issue: for P4080DS and mpc837x boards you still
have the same problem with polling method, right? It is causing
performance drops/freezes every like 100 ms, and that's why you want to
avoid the polling.

So, you've "fixed" some boards, but left others to suffer. Ideally, the
best fix would be to also make the card polling cheap.

Anyways, using (d) clause of the "Reviewer's statement of oversight", I
can easily give this:

	Reviewed-by: Anton Vorontsov <cbouatmailru@gmail.com>

:)

Thanks!

[...]
> > > IIRC, the card detection is broken SOC-revision-wise, not board-wise.
> > > So the change seems wrong.
> > >
> > > Also, take a look at this:
> > >
> > > 	http://lkml.org/lkml/2010/7/14/127
> > >
> > > I started the work but never finished, unfortunately it caused some
> > > regressions for non-FSL hardware...
> > >
> > > >  drivers/mmc/host/sdhci-of-esdhc.c |    7 ++++++-
> > > >  1 file changed, 6 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/mmc/host/sdhci-of-esdhc.c
> > > > b/drivers/mmc/host/sdhci-of-esdhc.c
> > > > index ffc1226..5dc362f 100644
> > > > --- a/drivers/mmc/host/sdhci-of-esdhc.c
> > > > +++ b/drivers/mmc/host/sdhci-of-esdhc.c
> > > > @@ -196,6 +196,11 @@ static void esdhc_of_detect_limitation(struct
> > > platform_device *pdev,
> > > >  	if (vvn == VENDOR_V_22)
> > > >  		pdata->quirks2 |= SDHCI_QUIRK2_HOST_NO_CMD23;
> > > >
> > > > +	/* P4080DS and MPC837XMDS board don't support interrupt mode */
> > > > +	if (of_machine_is_compatible("fsl,mpc837xmds") ||
> > > > +	    of_machine_is_compatible("fsl,P4080DS"))
> > > > +		pdata->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
> > > > +
> > > >  	iounmap(ioaddr);
> > > >  end:
> > > >  	return;
> > > > @@ -223,7 +228,7 @@ static struct sdhci_pltfm_data sdhci_esdhc_pdata
> > > > =
> > > {
> > > >  	 * card detection could be handled via GPIO
> > > >  	 * eSDHC cannot support End Attribute in NOP ADMA descriptor
> > > >  	 */
> > > > -	.quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_BROKEN_CARD_DETECTION
> > > > +	.quirks = ESDHC_DEFAULT_QUIRKS
> > > >  		| SDHCI_QUIRK_NO_CARD_NO_RESET
> > > >  		| SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
> > > >  	.ops = &sdhci_esdhc_ops,
> > > > --
> > > > 1.7.9.5
--
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
Huang Changming-R66093 Oct. 26, 2012, 2:42 a.m. UTC | #5
Hi, Anton,
For the current polling mode, driver will send CMD13 to poll the card status periodically , which will cause too many interrupts.
Once I sent patches to detect the card when using polling mode last year: read the state register, instead of send CMD13. But, these patches were not accepted. Now I attach them for you.

Because these patches are not accepted, I think about the interrupt mode to detect card.
Of course, you are right, the p4080ds and mpc837xmds are still using polling mode, which just fix some boards.
The best way is for all.

Then, I will back to my previous patches, for FSL eSDHC, don't send CMD13, and just read state register to check it.
For all FSL silicones, the state bit is updated when card inserting or removing.

Now I have two ways to resolve this issue, I prefer to the polling mode (unfortunately, they are not accepted).
I will be greatly appreciated if you review these attachment patches again and give your comment.
If you think the attachment patches are OK, I will resend them to mail list.
If you don't, I will continue to work on the interrupt mode for FSL eSDHC.

Thanks. 

> -----Original Message-----

> From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-

> owner@vger.kernel.org] On Behalf Of Anton Vorontsov

> Sent: Thursday, October 25, 2012 6:31 PM

> To: Huang Changming-R66093

> Cc: linux-mmc@vger.kernel.org; Chris Ball; Kumar Gala; linuxppc-

> dev@lists.ozlabs.org

> Subject: Re: [PATCH] powerpc/esdhc: enable the card insert/remove

> interrupt

> 

> On Thu, Oct 25, 2012 at 10:05:44AM +0000, Huang Changming-R66093 wrote:

> > Hi, Anton.

> > Could you have any comment about it?

> > If not, I will resend this patch with v2.

> 

> Technically, the patch looks fine.

> 

> But again, as far as I recall, the card detection logic was broken on the

> SOC level (it's actually very hard to break it on the board level -- it

> would either work or not, but in the eSDHC case it was just unreliable,

> again, if I recall everything correctly -- I might be wrong).

> 

> Of course you know the hardware much better, so your words weight more,

> so you don't need my ack on the patch. :)

> 

> Although there's a second issue: for P4080DS and mpc837x boards you still

> have the same problem with polling method, right? It is causing

> performance drops/freezes every like 100 ms, and that's why you want to

> avoid the polling.

> 

> So, you've "fixed" some boards, but left others to suffer. Ideally, the

> best fix would be to also make the card polling cheap.

> 

> Anyways, using (d) clause of the "Reviewer's statement of oversight", I

> can easily give this:

> 

> 	Reviewed-by: Anton Vorontsov <cbouatmailru@gmail.com>

> 

> :)

> 

> Thanks!

> 

> [...]

> > > > IIRC, the card detection is broken SOC-revision-wise, not board-

> wise.

> > > > So the change seems wrong.

> > > >

> > > > Also, take a look at this:

> > > >

> > > > 	http://lkml.org/lkml/2010/7/14/127

> > > >

> > > > I started the work but never finished, unfortunately it caused

> > > > some regressions for non-FSL hardware...

> > > >

> > > > >  drivers/mmc/host/sdhci-of-esdhc.c |    7 ++++++-

> > > > >  1 file changed, 6 insertions(+), 1 deletion(-)

> > > > >

> > > > > diff --git a/drivers/mmc/host/sdhci-of-esdhc.c

> > > > > b/drivers/mmc/host/sdhci-of-esdhc.c

> > > > > index ffc1226..5dc362f 100644

> > > > > --- a/drivers/mmc/host/sdhci-of-esdhc.c

> > > > > +++ b/drivers/mmc/host/sdhci-of-esdhc.c

> > > > > @@ -196,6 +196,11 @@ static void

> > > > > esdhc_of_detect_limitation(struct

> > > > platform_device *pdev,

> > > > >  	if (vvn == VENDOR_V_22)

> > > > >  		pdata->quirks2 |= SDHCI_QUIRK2_HOST_NO_CMD23;

> > > > >

> > > > > +	/* P4080DS and MPC837XMDS board don't support interrupt mode

> */

> > > > > +	if (of_machine_is_compatible("fsl,mpc837xmds") ||

> > > > > +	    of_machine_is_compatible("fsl,P4080DS"))

> > > > > +		pdata->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;

> > > > > +

> > > > >  	iounmap(ioaddr);

> > > > >  end:

> > > > >  	return;

> > > > > @@ -223,7 +228,7 @@ static struct sdhci_pltfm_data

> > > > > sdhci_esdhc_pdata =

> > > > {

> > > > >  	 * card detection could be handled via GPIO

> > > > >  	 * eSDHC cannot support End Attribute in NOP ADMA descriptor

> > > > >  	 */

> > > > > -	.quirks = ESDHC_DEFAULT_QUIRKS |

> SDHCI_QUIRK_BROKEN_CARD_DETECTION

> > > > > +	.quirks = ESDHC_DEFAULT_QUIRKS

> > > > >  		| SDHCI_QUIRK_NO_CARD_NO_RESET

> > > > >  		| SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,

> > > > >  	.ops = &sdhci_esdhc_ops,

> > > > > --

> > > > > 1.7.9.5

> --

> 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
Anton Vorontsov Oct. 27, 2012, 1:12 a.m. UTC | #6
Hello Huang,

On Fri, Oct 26, 2012 at 02:42:36AM +0000, Huang Changming-R66093 wrote:
> For the current polling mode, driver will send CMD13 to poll the card status periodically , which will cause too many interrupts.
> Once I sent patches to detect the card when using polling mode last year: read the state register, instead of send CMD13. But, these patches were not accepted. Now I attach them for you.

Was there any specific reason why the patches didn't get accepted?

I very briefly looked at them, and they seem to be OK (there are a few
cosmetic details I'd comment on, tho -- but please send them in a normal
way (i.e. not as attachments).

Thanks,
Anton.
--
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
Huang Changming-R66093 Oct. 29, 2012, 1:40 a.m. UTC | #7
PiBIZWxsbyBIdWFuZywNCj4gDQo+IE9uIEZyaSwgT2N0IDI2LCAyMDEyIGF0IDAyOjQyOjM2QU0g
KzAwMDAsIEh1YW5nIENoYW5nbWluZy1SNjYwOTMgd3JvdGU6DQo+ID4gRm9yIHRoZSBjdXJyZW50
IHBvbGxpbmcgbW9kZSwgZHJpdmVyIHdpbGwgc2VuZCBDTUQxMyB0byBwb2xsIHRoZSBjYXJkDQo+
IHN0YXR1cyBwZXJpb2RpY2FsbHkgLCB3aGljaCB3aWxsIGNhdXNlIHRvbyBtYW55IGludGVycnVw
dHMuDQo+ID4gT25jZSBJIHNlbnQgcGF0Y2hlcyB0byBkZXRlY3QgdGhlIGNhcmQgd2hlbiB1c2lu
ZyBwb2xsaW5nIG1vZGUgbGFzdA0KPiB5ZWFyOiByZWFkIHRoZSBzdGF0ZSByZWdpc3RlciwgaW5z
dGVhZCBvZiBzZW5kIENNRDEzLiBCdXQsIHRoZXNlIHBhdGNoZXMNCj4gd2VyZSBub3QgYWNjZXB0
ZWQuIE5vdyBJIGF0dGFjaCB0aGVtIGZvciB5b3UuDQo+IA0KPiBXYXMgdGhlcmUgYW55IHNwZWNp
ZmljIHJlYXNvbiB3aHkgdGhlIHBhdGNoZXMgZGlkbid0IGdldCBhY2NlcHRlZD8NCj4gDQo+IEkg
dmVyeSBicmllZmx5IGxvb2tlZCBhdCB0aGVtLCBhbmQgdGhleSBzZWVtIHRvIGJlIE9LICh0aGVy
ZSBhcmUgYSBmZXcNCj4gY29zbWV0aWMgZGV0YWlscyBJJ2QgY29tbWVudCBvbiwgdGhvIC0tIGJ1
dCBwbGVhc2Ugc2VuZCB0aGVtIGluIGEgbm9ybWFsDQo+IHdheSAoaS5lLiBub3QgYXMgYXR0YWNo
bWVudHMpLg0KPiANCg0KVGhhbmtzLCBBbnRvbi4NCkkgZG9uJ3Qga25vdyB3aHkuDQpJIHdpbGwg
cmVzZW5kIHRoZXNlIHBhdGNoZXMgYmFzZWQgb24gbGF0ZXN0IGtlcm5lbC4NCg0K

--
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
diff mbox

Patch

diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
index ffc1226..5dc362f 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -196,6 +196,11 @@  static void esdhc_of_detect_limitation(struct platform_device *pdev,
 	if (vvn == VENDOR_V_22)
 		pdata->quirks2 |= SDHCI_QUIRK2_HOST_NO_CMD23;
 
+	/* P4080DS and MPC837XMDS board don't support interrupt mode */
+	if (of_machine_is_compatible("fsl,mpc837xmds") ||
+	    of_machine_is_compatible("fsl,P4080DS"))
+		pdata->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+
 	iounmap(ioaddr);
 end:
 	return;
@@ -223,7 +228,7 @@  static struct sdhci_pltfm_data sdhci_esdhc_pdata = {
 	 * card detection could be handled via GPIO
 	 * eSDHC cannot support End Attribute in NOP ADMA descriptor
 	 */
-	.quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_BROKEN_CARD_DETECTION
+	.quirks = ESDHC_DEFAULT_QUIRKS
 		| SDHCI_QUIRK_NO_CARD_NO_RESET
 		| SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
 	.ops = &sdhci_esdhc_ops,