RE: [PATCH] powerpc/esdhc: enable the card insert/remove interrupt
Hello Huang, On Fri, Oct 26, 2012 at 02:42:36AM +, 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. I don't know why. I will resend these patches based on latest kernel. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] powerpc/esdhc: enable the card insert/remove interrupt
Hello Huang, On Fri, Oct 26, 2012 at 02:42:36AM +, 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. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: [PATCH] powerpc/esdhc: enable the card insert/remove interrupt
Hi, Anton. Could you have any comment about it? If not, I will resend this patch with v2. Best Regards Jerry Huang -Original Message- From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc- ow...@vger.kernel.org] On Behalf Of Huang Changming-R66093 Sent: Tuesday, October 23, 2012 4:40 PM To: Anton Vorontsov Cc: linux-...@vger.kernel.org; Chris Ball; Kumar Gala; linuxppc- d...@lists.ozlabs.org Subject: RE: [PATCH] powerpc/esdhc: enable the card insert/remove interrupt Hi, Anton For FSL SOCs, the interrupt mode is support for card detect. For some reasons, some board can't support this feature, such as mpc837xmds board, but mpc837xrdb board support it. I see your links, it is about the DMA (the first version of p2020 don't support DMA, need to enable the PIO mode, but the later version has fixed this issue). Best Regards Jerry Huang -Original Message- From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc- ow...@vger.kernel.org] On Behalf Of Anton Vorontsov Sent: Tuesday, October 23, 2012 4:27 PM To: Huang Changming-R66093 Cc: linux-...@vger.kernel.org; Huang Changming-R66093; Chris Ball; Kumar Gala; linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH] powerpc/esdhc: enable the card insert/remove interrupt On Tue, Oct 23, 2012 at 03:01:17PM +0800, r66...@freescale.com wrote: From: Jerry Huang chang-ming.hu...@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.hu...@freescale.com CC: Anton Vorontsov cbouatmai...@gmail.com CC: Chris Ball c...@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 majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html N r y b X ǧv ^ ){.n +{ g ^n r z h G h ( 階 ݢj m z ޖ f h ~ m ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] powerpc/esdhc: enable the card insert/remove interrupt
On Thu, Oct 25, 2012 at 10:05:44AM +, 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 cbouatmai...@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 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: [PATCH] powerpc/esdhc: enable the card insert/remove interrupt
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-ow...@vger.kernel.org [mailto:linux-mmc- ow...@vger.kernel.org] On Behalf Of Anton Vorontsov Sent: Thursday, October 25, 2012 6:31 PM To: Huang Changming-R66093 Cc: linux-...@vger.kernel.org; Chris Ball; Kumar Gala; linuxppc- d...@lists.ozlabs.org Subject: Re: [PATCH] powerpc/esdhc: enable the card insert/remove interrupt On Thu, Oct 25, 2012 at 10:05:44AM +, 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 cbouatmai...@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 majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 0002-MMC-SD-Add-callback-function-to-detect-card.patch Description: 0002-MMC-SD-Add-callback-function-to-detect-card.patch 0003-SDHCI-add-sdhci_get_cd-callback-to-detect-the-card.patch Description: 0003-SDHCI-add-sdhci_get_cd-callback-to-detect-the-card.patch 0004-ESDHC-add-callback-esdhc_of_get_cd-to-detect-card.patch Description: 0004-ESDHC-add-callback-esdhc_of_get_cd-to-detect-card.patch 0001-MMC-core-Add-f_min
Re: [PATCH] powerpc/esdhc: enable the card insert/remove interrupt
On Tue, Oct 23, 2012 at 03:01:17PM +0800, r66...@freescale.com wrote: From: Jerry Huang chang-ming.hu...@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.hu...@freescale.com CC: Anton Vorontsov cbouatmai...@gmail.com CC: Chris Ball c...@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 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: [PATCH] powerpc/esdhc: enable the card insert/remove interrupt
Hi, Anton For FSL SOCs, the interrupt mode is support for card detect. For some reasons, some board can't support this feature, such as mpc837xmds board, but mpc837xrdb board support it. I see your links, it is about the DMA (the first version of p2020 don't support DMA, need to enable the PIO mode, but the later version has fixed this issue). Best Regards Jerry Huang -Original Message- From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc- ow...@vger.kernel.org] On Behalf Of Anton Vorontsov Sent: Tuesday, October 23, 2012 4:27 PM To: Huang Changming-R66093 Cc: linux-...@vger.kernel.org; Huang Changming-R66093; Chris Ball; Kumar Gala; linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH] powerpc/esdhc: enable the card insert/remove interrupt On Tue, Oct 23, 2012 at 03:01:17PM +0800, r66...@freescale.com wrote: From: Jerry Huang chang-ming.hu...@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.hu...@freescale.com CC: Anton Vorontsov cbouatmai...@gmail.com CC: Chris Ball c...@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 majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev