* [PATCH] OMAP: Fix for bus width which improves SD card's peformance. @ 2010-02-11 14:20 kishore kadiyala 2010-02-11 17:34 ` Madhusudhan 0 siblings, 1 reply; 26+ messages in thread From: kishore kadiyala @ 2010-02-11 14:20 UTC (permalink / raw) To: linux-omap, linux-kernel; +Cc: jarkko.lavinen, madhu.cr [-- Attachment #1: Type: text/plain, Size: 1155 bytes --] This patch improves low speeds for SD cards. OMAP-MMC controller's can support maximum bus width of '8'. when bus width is mentioned as "8" in controller data,the SD stack will check whether bus width is "4" and if not it will set bus width to "1" and there by degrading peformance. This patch fixes the issue and improves the performance of SD cards. Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> --- Here are my experiment numbers, on a Class 6 SDHC card: Read peformance is increased by 220% Write Performance is increased by 52% drivers/mmc/host/omap_hsmmc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 83f0aff..8c97c22 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -2092,7 +2092,7 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) MMC_CAP_WAIT_WHILE_BUSY; if (mmc_slot(host).wires >= 8) - mmc->caps |= MMC_CAP_8_BIT_DATA; + mmc->caps |= (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA); else if (mmc_slot(host).wires >= 4) mmc->caps |= MMC_CAP_4_BIT_DATA; -- 1.6.3.3 [-- Attachment #2: 0001-Fix-for-bus-width-which-optimizes-SD-card-s-peforman.patch --] [-- Type: application/octet-stream, Size: 1391 bytes --] From 34b00872530e606678f86072d46d8ca89beaa19b Mon Sep 17 00:00:00 2001 From: Kishore Kadiyala <kishore.kadiyala@ti.com> Date: Thu, 11 Feb 2010 16:42:23 +0530 Subject: [PATCH] Fix for bus width which improves SD card's peformance. This patch improves low speeds for SD cards. OMAP-MMC controller's can support maximum bus width of '8'. when bus width is mentioned as "8" in controller data,the SD stack will check whether bus width is "4" and if not it will set bus width to "1" and there by degrading peformance. This patch fixes the issue and improves the performance of SD cards. Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> --- Here are my experiment numbers, on a Class 6 SDHC card: Read peformance is increased by 220% Write Performance is increased by 52% drivers/mmc/host/omap_hsmmc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 83f0aff..8c97c22 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -2092,7 +2092,7 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) MMC_CAP_WAIT_WHILE_BUSY; if (mmc_slot(host).wires >= 8) - mmc->caps |= MMC_CAP_8_BIT_DATA; + mmc->caps |= (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA); else if (mmc_slot(host).wires >= 4) mmc->caps |= MMC_CAP_4_BIT_DATA; -- 1.6.3.3 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* RE: [PATCH] OMAP: Fix for bus width which improves SD card's peformance. 2010-02-11 14:20 [PATCH] OMAP: Fix for bus width which improves SD card's peformance kishore kadiyala @ 2010-02-11 17:34 ` Madhusudhan 2010-03-31 6:07 ` [PATCH-V2] " kishore kadiyala 0 siblings, 1 reply; 26+ messages in thread From: Madhusudhan @ 2010-02-11 17:34 UTC (permalink / raw) To: 'kishore kadiyala', linux-omap, linux-kernel; +Cc: jarkko.lavinen > -----Original Message----- > From: kishore kadiyala [mailto:kishore.kadiyala@ti.com] > Sent: Thursday, February 11, 2010 8:20 AM > To: linux-omap@vger.kernel.org; linux-kernel@vger.kernel.org > Cc: jarkko.lavinen@nokia.com; madhu.cr@ti.com > Subject: [PATCH] OMAP: Fix for bus width which improves SD card's > peformance. > > This patch improves low speeds for SD cards. > OMAP-MMC controller's can support maximum bus width of '8'. > when bus width is mentioned as "8" in controller data,the SD > stack will check whether bus width is "4" and if not it will > set bus width to "1" and there by degrading peformance. > This patch fixes the issue and improves the performance of > SD cards. > > Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> ACK Acked-by: Madhusudhan Chikkature <madhu.cr@ti.com> > --- > Here are my experiment numbers, on a Class 6 SDHC card: > Read peformance is increased by 220% > Write Performance is increased by 52% > > drivers/mmc/host/omap_hsmmc.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c > index 83f0aff..8c97c22 100644 > --- a/drivers/mmc/host/omap_hsmmc.c > +++ b/drivers/mmc/host/omap_hsmmc.c > @@ -2092,7 +2092,7 @@ static int __init omap_hsmmc_probe(struct > platform_device > *pdev) > MMC_CAP_WAIT_WHILE_BUSY; > > if (mmc_slot(host).wires >= 8) > - mmc->caps |= MMC_CAP_8_BIT_DATA; > + mmc->caps |= (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA); > else if (mmc_slot(host).wires >= 4) > mmc->caps |= MMC_CAP_4_BIT_DATA; > > -- > 1.6.3.3 ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH-V2] OMAP: Fix for bus width which improves SD card's peformance. 2010-02-11 17:34 ` Madhusudhan @ 2010-03-31 6:07 ` kishore kadiyala 2010-03-31 6:27 ` Vimal Singh 0 siblings, 1 reply; 26+ messages in thread From: kishore kadiyala @ 2010-03-31 6:07 UTC (permalink / raw) To: Madhusudhan; +Cc: tony, svenkatr, linux-omap, linux-kernel, jarkko.lavinen This patch improves low speeds for SD cards. OMAP-MMC controller's can support maximum bus width of '8'. when bus width is mentioned as "8" in controller data,the SD stack will check whether bus width is "4" and if not it will set bus width to "1" and there by degrading performance. This patch fixes the issue and improves the performance of SD cards. Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> Signed-off-by: Venkatraman S <svenkatr@ti.com> Acked-by: Madhusudhan Chikkature <madhu.cr@ti.com> --- In V2 : Appended Signed-off by Venkat and Ack by Madhu Here are my experiment numbers, on a Class 6 SDHC card: Read peformance is increased by 220% Write Performance is increased by 52% drivers/mmc/host/omap_hsmmc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 83f0aff..8c97c22 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -2092,7 +2092,7 @@ static int __init omap_hsmmc_probe(struct MMC_CAP_WAIT_WHILE_BUSY; if (mmc_slot(host).wires >= 8) - mmc->caps |= MMC_CAP_8_BIT_DATA; + mmc->caps |= (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA); else if (mmc_slot(host).wires >= 4) mmc->caps |= MMC_CAP_4_BIT_DATA; -- 1.6.3.3 On Thu, Feb 11, 2010 at 11:04 PM, Madhusudhan <madhu.cr@ti.com> wrote: > > >> -----Original Message----- >> From: kishore kadiyala [mailto:kishore.kadiyala@ti.com] >> Sent: Thursday, February 11, 2010 8:20 AM >> To: linux-omap@vger.kernel.org; linux-kernel@vger.kernel.org >> Cc: jarkko.lavinen@nokia.com; madhu.cr@ti.com >> Subject: [PATCH] OMAP: Fix for bus width which improves SD card's >> peformance. >> >> This patch improves low speeds for SD cards. >> OMAP-MMC controller's can support maximum bus width of '8'. >> when bus width is mentioned as "8" in controller data,the SD >> stack will check whether bus width is "4" and if not it will >> set bus width to "1" and there by degrading peformance. >> This patch fixes the issue and improves the performance of >> SD cards. >> >> Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> > > ACK > > Acked-by: Madhusudhan Chikkature <madhu.cr@ti.com> > >> --- >> Here are my experiment numbers, on a Class 6 SDHC card: >> Read peformance is increased by 220% >> Write Performance is increased by 52% >> >> drivers/mmc/host/omap_hsmmc.c | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c >> index 83f0aff..8c97c22 100644 >> --- a/drivers/mmc/host/omap_hsmmc.c >> +++ b/drivers/mmc/host/omap_hsmmc.c >> @@ -2092,7 +2092,7 @@ static int __init omap_hsmmc_probe(struct >> platform_device >> *pdev) >> MMC_CAP_WAIT_WHILE_BUSY; >> >> if (mmc_slot(host).wires >= 8) >> - mmc->caps |= MMC_CAP_8_BIT_DATA; >> + mmc->caps |= (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA); >> else if (mmc_slot(host).wires >= 4) >> mmc->caps |= MMC_CAP_4_BIT_DATA; >> >> -- >> 1.6.3.3 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ > ^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH-V2] OMAP: Fix for bus width which improves SD card's peformance. 2010-03-31 6:07 ` [PATCH-V2] " kishore kadiyala @ 2010-03-31 6:27 ` Vimal Singh 2010-03-31 7:03 ` kishore kadiyala 0 siblings, 1 reply; 26+ messages in thread From: Vimal Singh @ 2010-03-31 6:27 UTC (permalink / raw) To: kishore kadiyala Cc: Madhusudhan, tony, svenkatr, linux-omap, linux-kernel, jarkko.lavinen > drivers/mmc/host/omap_hsmmc.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c > index 83f0aff..8c97c22 100644 > --- a/drivers/mmc/host/omap_hsmmc.c > +++ b/drivers/mmc/host/omap_hsmmc.c > @@ -2092,7 +2092,7 @@ static int __init omap_hsmmc_probe(struct > MMC_CAP_WAIT_WHILE_BUSY; > > if (mmc_slot(host).wires >= 8) > - mmc->caps |= MMC_CAP_8_BIT_DATA; > + mmc->caps |= (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA); > else if (mmc_slot(host).wires >= 4) > mmc->caps |= MMC_CAP_4_BIT_DATA; > Your mailer has some issue, 'tabs' got replaced by 'spaces' in this patch. Please fix it and repost. Also take care off deleting below unrelated content. - Regards, Vimal > > On Thu, Feb 11, 2010 at 11:04 PM, Madhusudhan <madhu.cr@ti.com> wrote: >> >> >>> -----Original Message----- >>> From: kishore kadiyala [mailto:kishore.kadiyala@ti.com] >>> Sent: Thursday, February 11, 2010 8:20 AM >>> To: linux-omap@vger.kernel.org; linux-kernel@vger.kernel.org >>> Cc: jarkko.lavinen@nokia.com; madhu.cr@ti.com >>> Subject: [PATCH] OMAP: Fix for bus width which improves SD card's >>> peformance. ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH-V2] OMAP: Fix for bus width which improves SD card's peformance. 2010-03-31 6:27 ` Vimal Singh @ 2010-03-31 7:03 ` kishore kadiyala 2010-03-31 13:11 ` Jarkko Nikula 2010-03-31 16:37 ` Madhusudhan 0 siblings, 2 replies; 26+ messages in thread From: kishore kadiyala @ 2010-03-31 7:03 UTC (permalink / raw) To: Vimal Singh Cc: Madhusudhan, tony, svenkatr, linux-omap, linux-kernel, jarkko.lavinen Sorry for that and here's the Updated one. From: Kishore Kadiyala <kishore.kadiyala@ti.com> This patch improves low speeds for SD cards. OMAP-MMC controller's can support maximum bus width of '8'. when bus width is mentioned as "8" in controller data,the SD stack will check whether bus width is "4" and if not it will set bus width to "1" and there by degrading performance. This patch fixes the issue and improves the performance of SD cards. Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> Signed-off-by: Venkatraman S <svenkatr@ti.com> Acked-by: Madhusudhan Chikkature <madhu.cr@ti.com> --- In V2 : Appended Signed-off by Venkat and Ack by Madhu Here are my experiment numbers, on a Class 6 SDHC card: Read peformance is increased by 220% Write Performance is increased by 52% drivers/mmc/host/omap_hsmmc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 83f0aff..8c97c22 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -2092,7 +2092,7 @@ static int __init omap_hsmmc_probe(struct MMC_CAP_WAIT_WHILE_BUSY; if (mmc_slot(host).wires >= 8) - mmc->caps |= MMC_CAP_8_BIT_DATA; + mmc->caps |= (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA); else if (mmc_slot(host).wires >= 4) mmc->caps |= MMC_CAP_4_BIT_DATA; -- 1.6.3.3 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH-V2] OMAP: Fix for bus width which improves SD card's peformance. 2010-03-31 7:03 ` kishore kadiyala @ 2010-03-31 13:11 ` Jarkko Nikula 2010-03-31 16:37 ` Madhusudhan 1 sibling, 0 replies; 26+ messages in thread From: Jarkko Nikula @ 2010-03-31 13:11 UTC (permalink / raw) To: kishore kadiyala Cc: Vimal Singh, Madhusudhan, tony, svenkatr, linux-omap, linux-kernel, jarkko.lavinen On Wed, 31 Mar 2010 12:33:01 +0530 kishore kadiyala <kishorek.kadiyala@gmail.com> wrote: > This patch improves low speeds for SD cards. > OMAP-MMC controller's can support maximum bus width of '8'. > when bus width is mentioned as "8" in controller data,the SD > stack will check whether bus width is "4" and if not it will > set bus width to "1" and there by degrading performance. > This patch fixes the issue and improves the performance of > SD cards. > > Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> > Signed-off-by: Venkatraman S <svenkatr@ti.com> > Acked-by: Madhusudhan Chikkature <madhu.cr@ti.com> > > --- > In V2 : Appended Signed-off by Venkat and Ack by Madhu > > Here are my experiment numbers, on a Class 6 SDHC card: > Read peformance is increased by 220% > Write Performance is increased by 52% > Some results from the BeagleBoard and 2 GB SD card: sync; time (dd if=/dev/zero of=`date +%s`.bin bs=1M count=100; sync) -> ~40 % improvement over 4 writes. time dd if=12700xxxxx.bin of=/dev/null -> ~96 % improvement over 4 reads. Feel free to add my tested-by. Tested-by: Jarkko Nikula <jhnikula@gmail.com> ^ permalink raw reply [flat|nested] 26+ messages in thread
* RE: [PATCH-V2] OMAP: Fix for bus width which improves SD card's peformance. 2010-03-31 7:03 ` kishore kadiyala 2010-03-31 13:11 ` Jarkko Nikula @ 2010-03-31 16:37 ` Madhusudhan 2010-04-01 6:31 ` kishore kadiyala 1 sibling, 1 reply; 26+ messages in thread From: Madhusudhan @ 2010-03-31 16:37 UTC (permalink / raw) To: 'kishore kadiyala', 'Vimal Singh' Cc: tony, svenkatr, linux-omap, linux-kernel, jarkko.lavinen > -----Original Message----- > From: kishore kadiyala [mailto:kishorek.kadiyala@gmail.com] > Sent: Wednesday, March 31, 2010 2:03 AM > To: Vimal Singh > Cc: Madhusudhan; tony@atomide.com; svenkatr@ti.com; linux- > omap@vger.kernel.org; linux-kernel@vger.kernel.org; > jarkko.lavinen@nokia.com > Subject: Re: [PATCH-V2] OMAP: Fix for bus width which improves SD card's > peformance. > > Sorry for that and here's the Updated one. > > From: Kishore Kadiyala <kishore.kadiyala@ti.com> > > This patch improves low speeds for SD cards. > OMAP-MMC controller's can support maximum bus width of '8'. > when bus width is mentioned as "8" in controller data,the SD > stack will check whether bus width is "4" and if not it will > set bus width to "1" and there by degrading performance. > This patch fixes the issue and improves the performance of > SD cards. > > Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> > Signed-off-by: Venkatraman S <svenkatr@ti.com> > Acked-by: Madhusudhan Chikkature <madhu.cr@ti.com> > > --- > In V2 : Appended Signed-off by Venkat and Ack by Madhu > > Here are my experiment numbers, on a Class 6 SDHC card: > Read peformance is increased by 220% > Write Performance is increased by 52% > > drivers/mmc/host/omap_hsmmc.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c > index 83f0aff..8c97c22 100644 > --- a/drivers/mmc/host/omap_hsmmc.c > +++ b/drivers/mmc/host/omap_hsmmc.c > @@ -2092,7 +2092,7 @@ static int __init omap_hsmmc_probe(struct > MMC_CAP_WAIT_WHILE_BUSY; > > if (mmc_slot(host).wires >= 8) > - mmc->caps |= MMC_CAP_8_BIT_DATA; > + mmc->caps |= (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA); > else if (mmc_slot(host).wires >= 4) > mmc->caps |= MMC_CAP_4_BIT_DATA; > Kishore, Since this patch is not yet pushed it makes sense to fix the readability issue. Since 8-bit is the max how about: if (mmc_slot(host).wires == 8) mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA; if (mmc_slot(host).wires == 4) mmc->caps |= MMC_CAP_4_BIT_DATA; This would be little easy to read the code. Can you please repost the patch?? Regards, Madhu > -- > 1.6.3.3 ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH-V2] OMAP: Fix for bus width which improves SD card's peformance. 2010-03-31 16:37 ` Madhusudhan @ 2010-04-01 6:31 ` kishore kadiyala 2010-04-01 15:41 ` Madhusudhan 0 siblings, 1 reply; 26+ messages in thread From: kishore kadiyala @ 2010-04-01 6:31 UTC (permalink / raw) To: Madhusudhan Cc: Vimal Singh, tony, svenkatr, linux-omap, linux-kernel, jarkko.lavinen On Wed, Mar 31, 2010 at 10:07 PM, Madhusudhan <madhu.cr@ti.com> wrote: > > >> -----Original Message----- >> From: kishore kadiyala [mailto:kishorek.kadiyala@gmail.com] >> Sent: Wednesday, March 31, 2010 2:03 AM >> To: Vimal Singh >> Cc: Madhusudhan; tony@atomide.com; svenkatr@ti.com; linux- >> omap@vger.kernel.org; linux-kernel@vger.kernel.org; >> jarkko.lavinen@nokia.com >> Subject: Re: [PATCH-V2] OMAP: Fix for bus width which improves SD card's >> peformance. >> >> Sorry for that and here's the Updated one. >> >> From: Kishore Kadiyala <kishore.kadiyala@ti.com> >> >> This patch improves low speeds for SD cards. >> OMAP-MMC controller's can support maximum bus width of '8'. >> when bus width is mentioned as "8" in controller data,the SD >> stack will check whether bus width is "4" and if not it will >> set bus width to "1" and there by degrading performance. >> This patch fixes the issue and improves the performance of >> SD cards. >> >> Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> >> Signed-off-by: Venkatraman S <svenkatr@ti.com> >> Acked-by: Madhusudhan Chikkature <madhu.cr@ti.com> >> >> --- >> In V2 : Appended Signed-off by Venkat and Ack by Madhu >> >> Here are my experiment numbers, on a Class 6 SDHC card: >> Read peformance is increased by 220% >> Write Performance is increased by 52% >> >> drivers/mmc/host/omap_hsmmc.c | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c >> index 83f0aff..8c97c22 100644 >> --- a/drivers/mmc/host/omap_hsmmc.c >> +++ b/drivers/mmc/host/omap_hsmmc.c >> @@ -2092,7 +2092,7 @@ static int __init omap_hsmmc_probe(struct >> MMC_CAP_WAIT_WHILE_BUSY; >> >> if (mmc_slot(host).wires >= 8) >> - mmc->caps |= MMC_CAP_8_BIT_DATA; >> + mmc->caps |= (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA); >> else if (mmc_slot(host).wires >= 4) >> mmc->caps |= MMC_CAP_4_BIT_DATA; >> > Kishore, > > Since this patch is not yet pushed it makes sense to fix the readability > issue. > > Since 8-bit is the max how about: > > if (mmc_slot(host).wires == 8) > mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA; > if (mmc_slot(host).wires == 4) > mmc->caps |= MMC_CAP_4_BIT_DATA; > Madhu, In the above snippet, it checks whether wires are 8 or 4 and if not neither set's capability to "1". Does it make sense to check whether the wires are 8,4,1 and if not any[8,4,1] throw error and come out. Regards, Kishore > This would be little easy to read the code. > > Can you please repost the patch?? > > Regards, > Madhu > >> -- >> 1.6.3.3 > > ^ permalink raw reply [flat|nested] 26+ messages in thread
* RE: [PATCH-V2] OMAP: Fix for bus width which improves SD card's peformance. 2010-04-01 6:31 ` kishore kadiyala @ 2010-04-01 15:41 ` Madhusudhan 2010-04-05 12:56 ` [PATCH v3] " kishore kadiyala 0 siblings, 1 reply; 26+ messages in thread From: Madhusudhan @ 2010-04-01 15:41 UTC (permalink / raw) To: 'kishore kadiyala' Cc: 'Vimal Singh', tony, svenkatr, linux-omap, linux-kernel, jarkko.lavinen > -----Original Message----- > From: kishore kadiyala [mailto:kishorek.kadiyala@gmail.com] > Sent: Thursday, April 01, 2010 1:32 AM > To: Madhusudhan > Cc: Vimal Singh; tony@atomide.com; svenkatr@ti.com; linux- > omap@vger.kernel.org; linux-kernel@vger.kernel.org; > jarkko.lavinen@nokia.com > Subject: Re: [PATCH-V2] OMAP: Fix for bus width which improves SD card's > peformance. > > On Wed, Mar 31, 2010 at 10:07 PM, Madhusudhan <madhu.cr@ti.com> wrote: > > > > > >> -----Original Message----- > >> From: kishore kadiyala [mailto:kishorek.kadiyala@gmail.com] > >> Sent: Wednesday, March 31, 2010 2:03 AM > >> To: Vimal Singh > >> Cc: Madhusudhan; tony@atomide.com; svenkatr@ti.com; linux- > >> omap@vger.kernel.org; linux-kernel@vger.kernel.org; > >> jarkko.lavinen@nokia.com > >> Subject: Re: [PATCH-V2] OMAP: Fix for bus width which improves SD > card's > >> peformance. > >> > >> Sorry for that and here's the Updated one. > >> > >> From: Kishore Kadiyala <kishore.kadiyala@ti.com> > >> > >> This patch improves low speeds for SD cards. > >> OMAP-MMC controller's can support maximum bus width of '8'. > >> when bus width is mentioned as "8" in controller data,the SD > >> stack will check whether bus width is "4" and if not it will > >> set bus width to "1" and there by degrading performance. > >> This patch fixes the issue and improves the performance of > >> SD cards. > >> > >> Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> > >> Signed-off-by: Venkatraman S <svenkatr@ti.com> > >> Acked-by: Madhusudhan Chikkature <madhu.cr@ti.com> > >> > >> --- > >> In V2 : Appended Signed-off by Venkat and Ack by Madhu > >> > >> Here are my experiment numbers, on a Class 6 SDHC card: > >> Read peformance is increased by 220% > >> Write Performance is increased by 52% > >> > >> drivers/mmc/host/omap_hsmmc.c | 2 +- > >> 1 files changed, 1 insertions(+), 1 deletions(-) > >> > >> diff --git a/drivers/mmc/host/omap_hsmmc.c > b/drivers/mmc/host/omap_hsmmc.c > >> index 83f0aff..8c97c22 100644 > >> --- a/drivers/mmc/host/omap_hsmmc.c > >> +++ b/drivers/mmc/host/omap_hsmmc.c > >> @@ -2092,7 +2092,7 @@ static int __init omap_hsmmc_probe(struct > >> MMC_CAP_WAIT_WHILE_BUSY; > >> > >> if (mmc_slot(host).wires >= 8) > >> - mmc->caps |= MMC_CAP_8_BIT_DATA; > >> + mmc->caps |= (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA); > >> else if (mmc_slot(host).wires >= 4) > >> mmc->caps |= MMC_CAP_4_BIT_DATA; > >> > > Kishore, > > > > Since this patch is not yet pushed it makes sense to fix the readability > > issue. > > > > Since 8-bit is the max how about: > > > > if (mmc_slot(host).wires == 8) > > mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA; > > if (mmc_slot(host).wires == 4) > > mmc->caps |= MMC_CAP_4_BIT_DATA; > > > Madhu, > > In the above snippet, it checks whether wires are 8 or 4 and if not > neither set's capability to "1". > Does it make sense to check whether the wires are 8,4,1 and if not > any[8,4,1] throw error and come out. > It is good enough to just check for 8-bit and 4-bit. The 1-bit does not need any explicit check since it is default. Regards, Madhu > Regards, > Kishore > > This would be little easy to read the code. > > > > Can you please repost the patch?? > > > > Regards, > > Madhu > > > >> -- > >> 1.6.3.3 > > > > ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v3] OMAP: Fix for bus width which improves SD card's peformance. 2010-04-01 15:41 ` Madhusudhan @ 2010-04-05 12:56 ` kishore kadiyala 2010-04-05 16:48 ` Felipe Balbi 0 siblings, 1 reply; 26+ messages in thread From: kishore kadiyala @ 2010-04-05 12:56 UTC (permalink / raw) To: Madhusudhan Cc: Vimal Singh, tony, svenkatr, linux-omap, linux-kernel, jarkko.lavinen From: Kishore Kadiyala <kishore.kadiyala@ti.com> This patch improves low speeds for SD cards. OMAP-MMC controller's can support maximum bus width of '8'. when bus width is mentioned as "8" in controller data,the SD stack will check whether bus width is "4" and if not it will set bus width to "1" and there by degrading performance. This patch fixes the issue and improves the performance of SD cards. Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> Signed-off-by: Venkatraman S <svenkatr@ti.com> Acked-by: Madhusudhan Chikkature <madhu.cr@ti.com> Tested-by: Jarkko Nikula <jhnikula@gmail.com> --- In V3 : Updated with Madhu's comments and appended Tested by Nikula In V2 : Appended Signed-off by Venkat and Ack by Madhu Here are my experiment numbers, on a Class 6 SDHC card: Read peformance is increased by 220% Write Performance is increased by 52% drivers/mmc/host/omap_hsmmc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) drivers/mmc/host/omap_hsmmc.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 83f0aff..44e79f7 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -2091,9 +2091,9 @@ static int __init omap_hsmmc_probe(struct mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | MMC_CAP_WAIT_WHILE_BUSY; - if (mmc_slot(host).wires >= 8) - mmc->caps |= MMC_CAP_8_BIT_DATA; - else if (mmc_slot(host).wires >= 4) + if (mmc_slot(host).wires == 8) + mmc->caps |= (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA); + else if (mmc_slot(host).wires == 4) mmc->caps |= MMC_CAP_4_BIT_DATA; if (mmc_slot(host).nonremovable) -- 1.6.3.3 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH v3] OMAP: Fix for bus width which improves SD card's peformance. 2010-04-05 12:56 ` [PATCH v3] " kishore kadiyala @ 2010-04-05 16:48 ` Felipe Balbi 2010-04-05 17:19 ` Madhusudhan 0 siblings, 1 reply; 26+ messages in thread From: Felipe Balbi @ 2010-04-05 16:48 UTC (permalink / raw) To: kishore kadiyala Cc: Madhusudhan, Vimal Singh, tony, svenkatr, linux-omap, linux-kernel, jarkko.lavinen Hi, On Mon, Apr 05, 2010 at 06:26:16PM +0530, kishore kadiyala wrote: > @@ -2091,9 +2091,9 @@ static int __init omap_hsmmc_probe(struct > mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | > MMC_CAP_WAIT_WHILE_BUSY; > > - if (mmc_slot(host).wires >= 8) > - mmc->caps |= MMC_CAP_8_BIT_DATA; > - else if (mmc_slot(host).wires >= 4) > + if (mmc_slot(host).wires == 8) > + mmc->caps |= (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA); > + else if (mmc_slot(host).wires == 4) > mmc->caps |= MMC_CAP_4_BIT_DATA; I believe it would be enough to just remove the 'else', so the code would look like: if (mmc_slot(host).wires >= 8) mmc->caps |= MMC_CAP_8_BIT_DATA; if (mmc_slot(host).wires >= 4) mmc->caps |= MMC_CAP_4_BIT_DATA; -- balbi ^ permalink raw reply [flat|nested] 26+ messages in thread
* RE: [PATCH v3] OMAP: Fix for bus width which improves SD card's peformance. 2010-04-05 16:48 ` Felipe Balbi @ 2010-04-05 17:19 ` Madhusudhan 2010-04-05 17:43 ` Madhusudhan 2010-04-06 5:00 ` Felipe Balbi 0 siblings, 2 replies; 26+ messages in thread From: Madhusudhan @ 2010-04-05 17:19 UTC (permalink / raw) To: me, 'kishore kadiyala' Cc: 'Vimal Singh', tony, svenkatr, linux-omap, linux-kernel, jarkko.lavinen > -----Original Message----- > From: Felipe Balbi [mailto:me@felipebalbi.com] > Sent: Monday, April 05, 2010 11:49 AM > To: kishore kadiyala > Cc: Madhusudhan; Vimal Singh; tony@atomide.com; svenkatr@ti.com; linux- > omap@vger.kernel.org; linux-kernel@vger.kernel.org; > jarkko.lavinen@nokia.com > Subject: Re: [PATCH v3] OMAP: Fix for bus width which improves SD card's > peformance. > > Hi, > > On Mon, Apr 05, 2010 at 06:26:16PM +0530, kishore kadiyala wrote: > > @@ -2091,9 +2091,9 @@ static int __init omap_hsmmc_probe(struct > > mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | > > MMC_CAP_WAIT_WHILE_BUSY; > > > > - if (mmc_slot(host).wires >= 8) > > - mmc->caps |= MMC_CAP_8_BIT_DATA; > > - else if (mmc_slot(host).wires >= 4) > > + if (mmc_slot(host).wires == 8) > > + mmc->caps |= (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA); > > + else if (mmc_slot(host).wires == 4) > > mmc->caps |= MMC_CAP_4_BIT_DATA; > > I believe it would be enough to just remove the 'else', so the code > would look like: > > if (mmc_slot(host).wires >= 8) > mmc->caps |= MMC_CAP_8_BIT_DATA; > if (mmc_slot(host).wires >= 4) Since the first if command already checks for the 8-bit the second check like >= 4 is definitely not readable in my opinion. Functionally do you see anything wrong with this patch?? > mmc->caps |= MMC_CAP_4_BIT_DATA; > > -- > balbi ^ permalink raw reply [flat|nested] 26+ messages in thread
* RE: [PATCH v3] OMAP: Fix for bus width which improves SD card's peformance. 2010-04-05 17:19 ` Madhusudhan @ 2010-04-05 17:43 ` Madhusudhan 2010-04-06 5:00 ` Felipe Balbi 1 sibling, 0 replies; 26+ messages in thread From: Madhusudhan @ 2010-04-05 17:43 UTC (permalink / raw) To: 'Madhusudhan', me, 'kishore kadiyala' Cc: 'Vimal Singh', tony, svenkatr, linux-omap, linux-kernel, jarkko.lavinen > -----Original Message----- > From: linux-omap-owner@vger.kernel.org [mailto:linux-omap- > owner@vger.kernel.org] On Behalf Of Madhusudhan > Sent: Monday, April 05, 2010 12:19 PM > To: me@felipebalbi.com; 'kishore kadiyala' > Cc: 'Vimal Singh'; tony@atomide.com; svenkatr@ti.com; linux- > omap@vger.kernel.org; linux-kernel@vger.kernel.org; > jarkko.lavinen@nokia.com > Subject: RE: [PATCH v3] OMAP: Fix for bus width which improves SD card's > peformance. > > > > > -----Original Message----- > > From: Felipe Balbi [mailto:me@felipebalbi.com] > > Sent: Monday, April 05, 2010 11:49 AM > > To: kishore kadiyala > > Cc: Madhusudhan; Vimal Singh; tony@atomide.com; svenkatr@ti.com; linux- > > omap@vger.kernel.org; linux-kernel@vger.kernel.org; > > jarkko.lavinen@nokia.com > > Subject: Re: [PATCH v3] OMAP: Fix for bus width which improves SD card's > > peformance. > > > > Hi, > > > > On Mon, Apr 05, 2010 at 06:26:16PM +0530, kishore kadiyala wrote: > > > @@ -2091,9 +2091,9 @@ static int __init omap_hsmmc_probe(struct > > > mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | > > > MMC_CAP_WAIT_WHILE_BUSY; > > > > > > - if (mmc_slot(host).wires >= 8) > > > - mmc->caps |= MMC_CAP_8_BIT_DATA; > > > - else if (mmc_slot(host).wires >= 4) > > > + if (mmc_slot(host).wires == 8) > > > + mmc->caps |= (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA); > > > + else if (mmc_slot(host).wires == 4) > > > mmc->caps |= MMC_CAP_4_BIT_DATA; > > > > I believe it would be enough to just remove the 'else', so the code > > would look like: > > > > if (mmc_slot(host).wires >= 8) > > mmc->caps |= MMC_CAP_8_BIT_DATA; > > if (mmc_slot(host).wires >= 4) > > Since the first if command already checks for the 8-bit the second check > like >= 4 is definitely not readable in my opinion. > > Functionally do you see anything wrong with this patch?? > Just to clarify my earlier comment on the patch was to resubmit like below: if (mmc_slot(host).wires == 8) mmc->caps |= (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA); if (mmc_slot(host).wires == 4) mmc->caps |= MMC_CAP_4_BIT_DATA; IMHO, this should be good enough. Regards, Madhu > > mmc->caps |= MMC_CAP_4_BIT_DATA; > > > > -- > > balbi > > -- > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v3] OMAP: Fix for bus width which improves SD card's peformance. 2010-04-05 17:19 ` Madhusudhan 2010-04-05 17:43 ` Madhusudhan @ 2010-04-06 5:00 ` Felipe Balbi 2010-04-06 16:16 ` Madhusudhan 1 sibling, 1 reply; 26+ messages in thread From: Felipe Balbi @ 2010-04-06 5:00 UTC (permalink / raw) To: Madhusudhan Cc: me, 'kishore kadiyala', 'Vimal Singh', tony, svenkatr, linux-omap, linux-kernel, jarkko.lavinen Hi, On Mon, Apr 05, 2010 at 12:19:29PM -0500, Madhusudhan wrote: > Since the first if command already checks for the 8-bit the second check > like >= 4 is definitely not readable in my opinion. how come ??? > Functionally do you see anything wrong with this patch?? functionally no, but (hypothetical situation) and if on omap4/5/6/whatever, omap controller supports a bigger bus width then you'll have to add a line like: + if (mmc_slot(host).wires == 16) + mmc->caps |= (MMC_CAP_16_BIT_DATA | MMC_CAP_8_BIT_DATA | + MMC_CAP_4_BIT_DATA); - if (mmc_slot(host).wires == 8) + else if (mmc_slot(host).wires == 8) do you see the problem ?? In my opinion it doesn't scale well. -- balbi ^ permalink raw reply [flat|nested] 26+ messages in thread
* RE: [PATCH v3] OMAP: Fix for bus width which improves SD card's peformance. 2010-04-06 5:00 ` Felipe Balbi @ 2010-04-06 16:16 ` Madhusudhan 2010-04-06 16:32 ` Felipe Balbi 0 siblings, 1 reply; 26+ messages in thread From: Madhusudhan @ 2010-04-06 16:16 UTC (permalink / raw) To: me Cc: 'kishore kadiyala', 'Vimal Singh', tony, svenkatr, linux-omap, linux-kernel, jarkko.lavinen > -----Original Message----- > From: Felipe Balbi [mailto:me@felipebalbi.com] > Sent: Tuesday, April 06, 2010 12:01 AM > To: Madhusudhan > Cc: me@felipebalbi.com; 'kishore kadiyala'; 'Vimal Singh'; > tony@atomide.com; svenkatr@ti.com; linux-omap@vger.kernel.org; linux- > kernel@vger.kernel.org; jarkko.lavinen@nokia.com > Subject: Re: [PATCH v3] OMAP: Fix for bus width which improves SD card's > peformance. > > Hi, > > On Mon, Apr 05, 2010 at 12:19:29PM -0500, Madhusudhan wrote: > > Since the first if command already checks for the 8-bit the second check > > like >= 4 is definitely not readable in my opinion. > > how come ??? > > > Functionally do you see anything wrong with this patch?? > > functionally no, but (hypothetical situation) and if on > omap4/5/6/whatever, omap controller supports a bigger bus width then > you'll have to add a line like: > > + if (mmc_slot(host).wires == 16) > + mmc->caps |= (MMC_CAP_16_BIT_DATA | MMC_CAP_8_BIT_DATA | > + MMC_CAP_4_BIT_DATA); > - if (mmc_slot(host).wires == 8) > + else if (mmc_slot(host).wires == 8) > > do you see the problem ?? In my opinion it doesn't scale well. > The point we should note here is that MMC spec supports a max bus width of 8-bit. So anything beyond 8-bit is not in the picture as of today. But, my bad on miss interpreting the snippet Felipe sent earlier. if (mmc_slot(host).wires >= 8) mmc->caps |= MMC_CAP_8_BIT_DATA; if (mmc_slot(host).wires >= 4) mmc->caps |= MMC_CAP_4_BIT_DATA; I missed the fact that you removed the setting of 4-bit from the first check. I am okay with the above snippet as it is a trivial change that we are trying to patch here which fixes an important issue. Regards, Madhu > -- > balbi ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v3] OMAP: Fix for bus width which improves SD card's peformance. 2010-04-06 16:16 ` Madhusudhan @ 2010-04-06 16:32 ` Felipe Balbi 2010-04-06 16:55 ` Nishanth Menon 0 siblings, 1 reply; 26+ messages in thread From: Felipe Balbi @ 2010-04-06 16:32 UTC (permalink / raw) To: ext Madhusudhan Cc: me@felipebalbi.com, 'kishore kadiyala', 'Vimal Singh', tony@atomide.com, svenkatr@ti.com, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Lavinen Jarkko (Nokia-D/Helsinki) On Tue, Apr 06, 2010 at 06:16:01PM +0200, ext Madhusudhan wrote: > > >> -----Original Message----- >> From: Felipe Balbi [mailto:me@felipebalbi.com] >> Sent: Tuesday, April 06, 2010 12:01 AM >> To: Madhusudhan >> Cc: me@felipebalbi.com; 'kishore kadiyala'; 'Vimal Singh'; >> tony@atomide.com; svenkatr@ti.com; linux-omap@vger.kernel.org; linux- >> kernel@vger.kernel.org; jarkko.lavinen@nokia.com >> Subject: Re: [PATCH v3] OMAP: Fix for bus width which improves SD card's >> peformance. >> >> Hi, >> >> On Mon, Apr 05, 2010 at 12:19:29PM -0500, Madhusudhan wrote: >> > Since the first if command already checks for the 8-bit the second check >> > like >= 4 is definitely not readable in my opinion. >> >> how come ??? >> >> > Functionally do you see anything wrong with this patch?? >> >> functionally no, but (hypothetical situation) and if on >> omap4/5/6/whatever, omap controller supports a bigger bus width then >> you'll have to add a line like: >> >> + if (mmc_slot(host).wires == 16) >> + mmc->caps |= (MMC_CAP_16_BIT_DATA | MMC_CAP_8_BIT_DATA | >> + MMC_CAP_4_BIT_DATA); >> - if (mmc_slot(host).wires == 8) >> + else if (mmc_slot(host).wires == 8) >> >> do you see the problem ?? In my opinion it doesn't scale well. >> > >The point we should note here is that MMC spec supports a max bus width of >8-bit. So anything beyond 8-bit is not in the picture as of today. in that case, the code could be: WARN_ON(mmc_slot(host).wires > 8); if (mmc_slot(host).wires == 8) mmc->caps |= MMC_CAP_8_BIT_DATA; if (mmc_slot(host).wires >= 4) mmc->caps |= MMC_CAP_4_BIT_DATA; -- balbi ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v3] OMAP: Fix for bus width which improves SD card's peformance. 2010-04-06 16:32 ` Felipe Balbi @ 2010-04-06 16:55 ` Nishanth Menon 2010-04-06 16:57 ` Felipe Balbi 0 siblings, 1 reply; 26+ messages in thread From: Nishanth Menon @ 2010-04-06 16:55 UTC (permalink / raw) To: felipe.balbi@nokia.com Cc: Chikkature Rajashekar, Madhusudhan, me@felipebalbi.com, 'kishore kadiyala', 'Vimal Singh', tony@atomide.com, S, Venkatraman, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Lavinen Jarkko (Nokia-D/Helsinki) Felipe Balbi had written, on 04/06/2010 11:32 AM, the following: > On Tue, Apr 06, 2010 at 06:16:01PM +0200, ext Madhusudhan wrote: >> >>> -----Original Message----- >>> From: Felipe Balbi [mailto:me@felipebalbi.com] >>> Sent: Tuesday, April 06, 2010 12:01 AM >>> To: Madhusudhan >>> Cc: me@felipebalbi.com; 'kishore kadiyala'; 'Vimal Singh'; >>> tony@atomide.com; svenkatr@ti.com; linux-omap@vger.kernel.org; linux- >>> kernel@vger.kernel.org; jarkko.lavinen@nokia.com >>> Subject: Re: [PATCH v3] OMAP: Fix for bus width which improves SD card's >>> peformance. >>> >>> Hi, >>> >>> On Mon, Apr 05, 2010 at 12:19:29PM -0500, Madhusudhan wrote: >>>> Since the first if command already checks for the 8-bit the second check >>>> like >= 4 is definitely not readable in my opinion. >>> how come ??? >>> >>>> Functionally do you see anything wrong with this patch?? >>> functionally no, but (hypothetical situation) and if on >>> omap4/5/6/whatever, omap controller supports a bigger bus width then >>> you'll have to add a line like: >>> >>> + if (mmc_slot(host).wires == 16) >>> + mmc->caps |= (MMC_CAP_16_BIT_DATA | MMC_CAP_8_BIT_DATA | >>> + MMC_CAP_4_BIT_DATA); >>> - if (mmc_slot(host).wires == 8) >>> + else if (mmc_slot(host).wires == 8) >>> >>> do you see the problem ?? In my opinion it doesn't scale well. >>> >> The point we should note here is that MMC spec supports a max bus width of >> 8-bit. So anything beyond 8-bit is not in the picture as of today. > > in that case, the code could be: > > WARN_ON(mmc_slot(host).wires > 8); > > if (mmc_slot(host).wires == 8) > mmc->caps |= MMC_CAP_8_BIT_DATA; > if (mmc_slot(host).wires >= 4) > mmc->caps |= MMC_CAP_4_BIT_DATA; > some reasons why i love switch statements ;) since I dont expect other than precisely 4 and 8 (do we expect 5,6,7 - i might be wrong).. but if it is so, wont the following be better? switch (mmc_slot(host).wires) { case 8: mmc->caps |= MMC_CAP_8_BIT_DATA; /* fall thru*/ case 4: mmc->caps |= MMC_CAP_4_BIT_DATA; break; default: WARN("bad width"); } -- Regards, Nishanth Menon ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v3] OMAP: Fix for bus width which improves SD card's peformance. 2010-04-06 16:55 ` Nishanth Menon @ 2010-04-06 16:57 ` Felipe Balbi 2010-04-06 23:23 ` Madhusudhan 0 siblings, 1 reply; 26+ messages in thread From: Felipe Balbi @ 2010-04-06 16:57 UTC (permalink / raw) To: ext Nishanth Menon Cc: Balbi Felipe (Nokia-D/Helsinki), Chikkature Rajashekar, Madhusudhan, me@felipebalbi.com, 'kishore kadiyala', 'Vimal Singh', tony@atomide.com, S, Venkatraman, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Lavinen Jarkko (Nokia-D/Helsinki) On Tue, Apr 06, 2010 at 06:55:03PM +0200, ext Nishanth Menon wrote: >some reasons why i love switch statements ;) since I dont expect other >than precisely 4 and 8 (do we expect 5,6,7 - i might be wrong).. but if >it is so, wont the following be better? > >switch (mmc_slot(host).wires) >{ >case 8: > mmc->caps |= MMC_CAP_8_BIT_DATA; > /* fall thru*/ >case 4: > mmc->caps |= MMC_CAP_4_BIT_DATA; > break; >default: > WARN("bad width"); >} I like that, but I remember Madhu (or someone else) saying he thinks it's less readable this way. Go figure... -- balbi ^ permalink raw reply [flat|nested] 26+ messages in thread
* RE: [PATCH v3] OMAP: Fix for bus width which improves SD card's peformance. 2010-04-06 16:57 ` Felipe Balbi @ 2010-04-06 23:23 ` Madhusudhan 2010-04-06 23:39 ` Nishanth Menon 0 siblings, 1 reply; 26+ messages in thread From: Madhusudhan @ 2010-04-06 23:23 UTC (permalink / raw) To: felipe.balbi, 'ext Nishanth Menon' Cc: me, 'kishore kadiyala', 'Vimal Singh', tony, 'S, Venkatraman', linux-omap, linux-kernel, 'Lavinen Jarkko (Nokia-D/Helsinki)' > -----Original Message----- > From: Felipe Balbi [mailto:felipe.balbi@nokia.com] > Sent: Tuesday, April 06, 2010 11:57 AM > To: ext Nishanth Menon > Cc: Balbi Felipe (Nokia-D/Helsinki); Chikkature Rajashekar, Madhusudhan; > me@felipebalbi.com; 'kishore kadiyala'; 'Vimal Singh'; tony@atomide.com; > S, Venkatraman; linux-omap@vger.kernel.org; linux-kernel@vger.kernel.org; > Lavinen Jarkko (Nokia-D/Helsinki) > Subject: Re: [PATCH v3] OMAP: Fix for bus width which improves SD card's > peformance. > > On Tue, Apr 06, 2010 at 06:55:03PM +0200, ext Nishanth Menon wrote: > >some reasons why i love switch statements ;) since I dont expect other > >than precisely 4 and 8 (do we expect 5,6,7 - i might be wrong).. but if > >it is so, wont the following be better? > > > >switch (mmc_slot(host).wires) > >{ > >case 8: > > mmc->caps |= MMC_CAP_8_BIT_DATA; > > /* fall thru*/ > >case 4: > > mmc->caps |= MMC_CAP_4_BIT_DATA; > > break; > >default: > > WARN("bad width"); > >} > > I like that, but I remember Madhu (or someone else) saying he thinks > it's less readable this way. Go figure... > Well, I did not comment on the usage of switch here. Note we only need to handle 8-bit and 4-bit.The board files need not setup 8-bit or 4-bit if the configuration of that board is 1-bit. The driver will still work in 1-bit mode which would mean there is nothing to do in default case and should not err out. Regards, Madhu > -- > balbi ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v3] OMAP: Fix for bus width which improves SD card's peformance. 2010-04-06 23:23 ` Madhusudhan @ 2010-04-06 23:39 ` Nishanth Menon 2010-04-07 0:16 ` Madhusudhan 0 siblings, 1 reply; 26+ messages in thread From: Nishanth Menon @ 2010-04-06 23:39 UTC (permalink / raw) To: Chikkature Rajashekar, Madhusudhan Cc: felipe.balbi@nokia.com, me@felipebalbi.com, 'kishore kadiyala', 'Vimal Singh', tony@atomide.com, S, Venkatraman, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, 'Lavinen Jarkko (Nokia-D/Helsinki)' [-- Attachment #1: Type: text/plain, Size: 1650 bytes --] Chikkature Rajashekar, Madhusudhan had written, on 04/06/2010 06:23 PM, the following: > >> -----Original Message----- >> From: Felipe Balbi [mailto:felipe.balbi@nokia.com] >> Sent: Tuesday, April 06, 2010 11:57 AM >> To: ext Nishanth Menon >> Cc: Balbi Felipe (Nokia-D/Helsinki); Chikkature Rajashekar, Madhusudhan; >> me@felipebalbi.com; 'kishore kadiyala'; 'Vimal Singh'; tony@atomide.com; >> S, Venkatraman; linux-omap@vger.kernel.org; linux-kernel@vger.kernel.org; >> Lavinen Jarkko (Nokia-D/Helsinki) >> Subject: Re: [PATCH v3] OMAP: Fix for bus width which improves SD card's >> peformance. >> >> On Tue, Apr 06, 2010 at 06:55:03PM +0200, ext Nishanth Menon wrote: >>> some reasons why i love switch statements ;) since I dont expect other >>> than precisely 4 and 8 (do we expect 5,6,7 - i might be wrong).. but if >>> it is so, wont the following be better? >>> >>> switch (mmc_slot(host).wires) >>> { >>> case 8: >>> mmc->caps |= MMC_CAP_8_BIT_DATA; >>> /* fall thru*/ >>> case 4: >>> mmc->caps |= MMC_CAP_4_BIT_DATA; >>> break; >>> default: >>> WARN("bad width"); >>> } >> I like that, but I remember Madhu (or someone else) saying he thinks >> it's less readable this way. Go figure... >> > Well, I did not comment on the usage of switch here. Note we only need to > handle 8-bit and 4-bit.The board files need not setup 8-bit or 4-bit if the > configuration of that board is 1-bit. The driver will still work in 1-bit > mode which would mean there is nothing to do in default case and should not > err out. check the attachment out.. hope that takes care of it.. just as a reference alone ofcourse.. -- Regards, Nishanth Menon [-- Attachment #2: 0001-OMAP-Fix-for-bus-width-which-improves-SD-card-s-pefo.patch --] [-- Type: text/x-patch, Size: 2370 bytes --] >From 09b55eb33749d308586c19485bf1e1723009fc9a Mon Sep 17 00:00:00 2001 From: kishore kadiyala <kishorek.kadiyala@gmail.com> Date: Wed, 31 Mar 2010 07:03:01 +0000 Subject: [PATCH Vn] OMAP: Fix for bus width which improves SD card's peformance. This patch improves low speeds for SD cards. OMAP-MMC controller's can support maximum bus width of '8'. when bus width is mentioned as "8" in controller data,the SD stack will check whether bus width is "4" and if not it will set bus width to "1" and there by degrading performance. This patch fixes the issue and improves the performance of SD cards. Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> Signed-off-by: Venkatraman S <svenkatr@ti.com> Acked-by: Madhusudhan Chikkature <madhu.cr@ti.com> Tested-by: Jarkko Nikula <jhnikula@gmail.com> --- NM Note: Completely untested/unreviewed.. just holding on to what was in https://patchwork.kernel.org/patch/89898/ with my suggested mods drivers/mmc/host/omap_hsmmc.c | 32 +++++++++++++++++++++++++++++--- 1 files changed, 29 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 83f0aff..89e26bc 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -2091,10 +2091,36 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | MMC_CAP_WAIT_WHILE_BUSY; - if (mmc_slot(host).wires >= 8) + switch(mmc_slot(host).wires) { + case 8: mmc->caps |= MMC_CAP_8_BIT_DATA; - else if (mmc_slot(host).wires >= 4) - mmc->caps |= MMC_CAP_4_BIT_DATA; + /* Fall through */ + case 4: + mmc->caps |= MMC_CAP_8_BIT_DATA; + break; + case 1: + /* + * I will still survive with this config.. but warn + * if the board file was goofed up + */ + dev_warn(mmc_dev(host->mmc), "Using potentially" + "unoptimal 1bit config\n"); + break; + default: + /* Completely unexpected.. dont wanna croak and die */ + dev_crit(mmc_dev(host->mmc), "Unknown width %d" + "used!\n",mmc_slot(host).wires); + mmc_host_disable(host->mmc); + if (host->got_dbclk) { + clk_disable(host->dbclk); + clk_put(host->dbclk); + } + clk_disable(host->iclk); + clk_put(host->iclk); + clk_put(host->fclk); + goto err1; + + } if (mmc_slot(host).nonremovable) mmc->caps |= MMC_CAP_NONREMOVABLE; -- 1.6.3.3 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* RE: [PATCH v3] OMAP: Fix for bus width which improves SD card's peformance. 2010-04-06 23:39 ` Nishanth Menon @ 2010-04-07 0:16 ` Madhusudhan 2010-04-07 0:57 ` Nishanth Menon 0 siblings, 1 reply; 26+ messages in thread From: Madhusudhan @ 2010-04-07 0:16 UTC (permalink / raw) To: 'Nishanth Menon' Cc: felipe.balbi, me, 'kishore kadiyala', 'Vimal Singh', tony, 'S, Venkatraman', linux-omap, linux-kernel, 'Lavinen Jarkko (Nokia-D/Helsinki)' > -----Original Message----- > From: Nishanth Menon [mailto:nm@ti.com] > Sent: Tuesday, April 06, 2010 6:39 PM > To: Chikkature Rajashekar, Madhusudhan > Cc: felipe.balbi@nokia.com; me@felipebalbi.com; 'kishore kadiyala'; 'Vimal > Singh'; tony@atomide.com; S, Venkatraman; linux-omap@vger.kernel.org; > linux-kernel@vger.kernel.org; 'Lavinen Jarkko (Nokia-D/Helsinki)' > Subject: Re: [PATCH v3] OMAP: Fix for bus width which improves SD card's > peformance. > > Chikkature Rajashekar, Madhusudhan had written, on 04/06/2010 06:23 PM, > the following: > > > >> -----Original Message----- > >> From: Felipe Balbi [mailto:felipe.balbi@nokia.com] > >> Sent: Tuesday, April 06, 2010 11:57 AM > >> To: ext Nishanth Menon > >> Cc: Balbi Felipe (Nokia-D/Helsinki); Chikkature Rajashekar, > Madhusudhan; > >> me@felipebalbi.com; 'kishore kadiyala'; 'Vimal Singh'; > tony@atomide.com; > >> S, Venkatraman; linux-omap@vger.kernel.org; linux- > kernel@vger.kernel.org; > >> Lavinen Jarkko (Nokia-D/Helsinki) > >> Subject: Re: [PATCH v3] OMAP: Fix for bus width which improves SD > card's > >> peformance. > >> > >> On Tue, Apr 06, 2010 at 06:55:03PM +0200, ext Nishanth Menon wrote: > >>> some reasons why i love switch statements ;) since I dont expect other > >>> than precisely 4 and 8 (do we expect 5,6,7 - i might be wrong).. but > if > >>> it is so, wont the following be better? > >>> > >>> switch (mmc_slot(host).wires) > >>> { > >>> case 8: > >>> mmc->caps |= MMC_CAP_8_BIT_DATA; > >>> /* fall thru*/ > >>> case 4: > >>> mmc->caps |= MMC_CAP_4_BIT_DATA; > >>> break; > >>> default: > >>> WARN("bad width"); > >>> } > >> I like that, but I remember Madhu (or someone else) saying he thinks > >> it's less readable this way. Go figure... > >> > > Well, I did not comment on the usage of switch here. Note we only need > to > > handle 8-bit and 4-bit.The board files need not setup 8-bit or 4-bit if > the > > configuration of that board is 1-bit. The driver will still work in 1- > bit > > mode which would mean there is nothing to do in default case and should > not > > err out. > check the attachment out.. hope that takes care of it.. just as a > reference alone ofcourse.. Nope. The default case is wrong. The assumption followed by controller drivers is that if the board file says 4-bit or 8-bit set the capabilities otherwise don't do any thing. The host will continue to work in 1-bit mode which is a must. Your patch violates that (can not design a board without connecting one data line at least :)) Also you can not say 1-bit is non-optimal because the board file dictates the configuration based on what it is capable of. Why through a warning? It is subjective. Regards, Madhu > -- > Regards, > Nishanth Menon ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v3] OMAP: Fix for bus width which improves SD card's peformance. 2010-04-07 0:16 ` Madhusudhan @ 2010-04-07 0:57 ` Nishanth Menon 2010-04-08 16:57 ` Madhusudhan 0 siblings, 1 reply; 26+ messages in thread From: Nishanth Menon @ 2010-04-07 0:57 UTC (permalink / raw) To: Chikkature Rajashekar, Madhusudhan Cc: felipe.balbi@nokia.com, me@felipebalbi.com, 'kishore kadiyala', 'Vimal Singh', tony@atomide.com, S, Venkatraman, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, 'Lavinen Jarkko (Nokia-D/Helsinki)' Chikkature Rajashekar, Madhusudhan had written, on 04/06/2010 07:16 PM, the following: > >> -----Original Message----- >> From: Nishanth Menon [mailto:nm@ti.com] >> Sent: Tuesday, April 06, 2010 6:39 PM >> To: Chikkature Rajashekar, Madhusudhan >> Cc: felipe.balbi@nokia.com; me@felipebalbi.com; 'kishore kadiyala'; 'Vimal >> Singh'; tony@atomide.com; S, Venkatraman; linux-omap@vger.kernel.org; >> linux-kernel@vger.kernel.org; 'Lavinen Jarkko (Nokia-D/Helsinki)' >> Subject: Re: [PATCH v3] OMAP: Fix for bus width which improves SD card's >> peformance. >> >> Chikkature Rajashekar, Madhusudhan had written, on 04/06/2010 06:23 PM, >> the following: >>>> -----Original Message----- >>>> From: Felipe Balbi [mailto:felipe.balbi@nokia.com] >>>> Sent: Tuesday, April 06, 2010 11:57 AM >>>> To: ext Nishanth Menon >>>> Cc: Balbi Felipe (Nokia-D/Helsinki); Chikkature Rajashekar, >> Madhusudhan; >>>> me@felipebalbi.com; 'kishore kadiyala'; 'Vimal Singh'; >> tony@atomide.com; >>>> S, Venkatraman; linux-omap@vger.kernel.org; linux- >> kernel@vger.kernel.org; >>>> Lavinen Jarkko (Nokia-D/Helsinki) >>>> Subject: Re: [PATCH v3] OMAP: Fix for bus width which improves SD >> card's >>>> peformance. >>>> >>>> On Tue, Apr 06, 2010 at 06:55:03PM +0200, ext Nishanth Menon wrote: >>>>> some reasons why i love switch statements ;) since I dont expect other >>>>> than precisely 4 and 8 (do we expect 5,6,7 - i might be wrong).. but >> if >>>>> it is so, wont the following be better? >>>>> >>>>> switch (mmc_slot(host).wires) >>>>> { >>>>> case 8: >>>>> mmc->caps |= MMC_CAP_8_BIT_DATA; >>>>> /* fall thru*/ >>>>> case 4: >>>>> mmc->caps |= MMC_CAP_4_BIT_DATA; >>>>> break; >>>>> default: >>>>> WARN("bad width"); >>>>> } >>>> I like that, but I remember Madhu (or someone else) saying he thinks >>>> it's less readable this way. Go figure... >>>> >>> Well, I did not comment on the usage of switch here. Note we only need >> to >>> handle 8-bit and 4-bit.The board files need not setup 8-bit or 4-bit if >> the >>> configuration of that board is 1-bit. The driver will still work in 1- >> bit >>> mode which would mean there is nothing to do in default case and should >> not >>> err out. >> check the attachment out.. hope that takes care of it.. just as a >> reference alone ofcourse.. > > Nope. The default case is wrong. The assumption followed by controller > drivers is that if the board file says 4-bit or 8-bit set the capabilities > otherwise don't do any thing. The host will continue to work in 1-bit mode > which is a must. Your patch violates that (can not design a board without > connecting one data line at least :)) > > Also you can not say 1-bit is non-optimal because the board file dictates > the configuration based on what it is capable of. Why through a warning? > It is subjective. Point noted. try n++: switch(mmc_slot(host).wires) { case 8: mmc->caps |= MMC_CAP_8_BIT_DATA; /* Fall through */ case 4: mmc->caps |= MMC_CAP_4_BIT_DATA; break; case 0: /* assuming nothing was given by board, use 1 */ case 1: /* nothing to crib here */ break; default: /* Completely unexpected.. try 1 bit instead */ dev_crit(mmc_dev(host->mmc), "Invalid width %d" " used! using 1 instead\n", mmc_slot(host).wires); } note: we should crib if the board file made a mistake here.. say it gave 10 wire or so.. I agree that we can recover by stepping back to 1 bit mode.. but we gotta tell the log that something aint right.. -- Regards, Nishanth Menon ^ permalink raw reply [flat|nested] 26+ messages in thread
* RE: [PATCH v3] OMAP: Fix for bus width which improves SD card's peformance. 2010-04-07 0:57 ` Nishanth Menon @ 2010-04-08 16:57 ` Madhusudhan 2010-04-19 15:36 ` [PATCH v4] " kishore kadiyala 0 siblings, 1 reply; 26+ messages in thread From: Madhusudhan @ 2010-04-08 16:57 UTC (permalink / raw) To: 'Nishanth Menon' Cc: felipe.balbi, me, 'kishore kadiyala', 'Vimal Singh', tony, 'S, Venkatraman', linux-omap, linux-kernel, 'Lavinen Jarkko (Nokia-D/Helsinki)' <snip> > Point noted. try n++: > switch(mmc_slot(host).wires) { > case 8: > mmc->caps |= MMC_CAP_8_BIT_DATA; > /* Fall through */ > case 4: > mmc->caps |= MMC_CAP_4_BIT_DATA; > break; > case 0: > /* assuming nothing was given by board, use 1 */ > case 1: > /* nothing to crib here */ > break; > default: > /* Completely unexpected.. try 1 bit instead */ > dev_crit(mmc_dev(host->mmc), "Invalid width %d" > " used! using 1 instead\n", > mmc_slot(host).wires); > } > > note: we should crib if the board file made a mistake here.. say it gave > 10 wire or so.. I agree that we can recover by stepping back to 1 bit > mode.. but we gotta tell the log that something aint right.. > Sure. It looks fine to me now. Regards, Madhu > -- > Regards, > Nishanth Menon ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v4] OMAP: Fix for bus width which improves SD card's peformance. 2010-04-08 16:57 ` Madhusudhan @ 2010-04-19 15:36 ` kishore kadiyala 2010-04-19 15:51 ` kishore kadiyala 0 siblings, 1 reply; 26+ messages in thread From: kishore kadiyala @ 2010-04-19 15:36 UTC (permalink / raw) To: Madhusudhan Cc: Nishanth Menon, felipe.balbi, me, Vimal Singh, tony, S, Venkatraman, linux-omap, linux-kernel, Lavinen Jarkko (Nokia-D/Helsinki) From: Kishore Kadiyala <kishore.kadiyala@ti.com> This patch improves low speeds for SD cards. OMAP-MMC controller's can support maximum bus width of '8'. when bus width is mentioned as "8" in controller data,the SD stack will check whether bus width is "4" and if not it will set bus width to "1" and there by degrading performance. This patch fixes the issue and improves the performance of SD cards. Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> Signed-off-by: Venkatraman S <svenkatr@ti.com> Signed-off-by: Nishant Menon <nm@ti.com> Acked-by: Madhusudhan Chikkature <madhu.cr@ti.com> Tested-by: Jarkko Nikula <jhnikula@gmail.com> --- In V4 : Updated with Nishant's comments and appened his Signed-off In V3 : Updated with Madhu's comments and appended Tested by Nikula In V2 : Appended Signed-off by Venkat and Ack by Madhu Here are my experiment numbers, on a Class 6 SDHC card: Read peformance is increased by 220% Write Performance is increased by 52% drivers/mmc/host/omap_hsmmc.c | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 8c97c22..9c1a60e 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -2091,10 +2091,23 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | MMC_CAP_WAIT_WHILE_BUSY; - if (mmc_slot(host).wires >= 8) - mmc->caps |= (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA); - else if (mmc_slot(host).wires >= 4) + switch (mmc_slot(host).wires) { + case 8: + mmc->caps |= MMC_CAP_8_BIT_DATA; + /* Fall through */ + case 4: mmc->caps |= MMC_CAP_4_BIT_DATA; + break; + case 1: + /* Nothing to crib here */ + case 0: + /* Assuming nothing was given by board, Core use's 1-Bit */ + break; + default: + /* Completely unexpected.. Core goes with 1-Bit Width */ + dev_crit(mmc_dev(host->mmc), "Invalid width %d\n used!" + "using 1 instead\n", mmc_slot(host).wires); + } if (mmc_slot(host).nonremovable) mmc->caps |= MMC_CAP_NONREMOVABLE; -- 1.6.3.3 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v4] OMAP: Fix for bus width which improves SD card's peformance. 2010-04-19 15:36 ` [PATCH v4] " kishore kadiyala @ 2010-04-19 15:51 ` kishore kadiyala 2010-04-22 0:26 ` Madhusudhan 0 siblings, 1 reply; 26+ messages in thread From: kishore kadiyala @ 2010-04-19 15:51 UTC (permalink / raw) To: Madhusudhan Cc: Nishanth Menon, felipe.balbi, me, Vimal Singh, tony, S, Venkatraman, linux-omap, linux-kernel, Lavinen Jarkko (Nokia-D/Helsinki) The previous patch was Line wrapped , resending correct patch. NM, Sorry I miss spelled your name correcting this time. Regards, Kishore From: Kishore Kadiyala <kishore.kadiyala@ti.com> This patch improves low speeds for SD cards. OMAP-MMC controller's can support maximum bus width of '8'. when bus width is mentioned as "8" in controller data,the SD stack will check whether bus width is "4" and if not it will set bus width to "1" and there by degrading performance. This patch fixes the issue and improves the performance of SD cards. Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> Signed-off-by: Venkatraman S <svenkatr@ti.com> Signed-off-by: Nishanth Menon <nm@ti.com> Acked-by: Madhusudhan Chikkature <madhu.cr@ti.com> Tested-by: Jarkko Nikula <jhnikula@gmail.com> --- In V4 : Updated with Nishant's comments and appened his Signed-off In V3 : Updated with Madhu's comments and appended Tested by Nikula In V2 : Appended Signed-off by Venkat and Ack by Madhu Here are my experiment numbers, on a Class 6 SDHC card: Read peformance is increased by 220% Write Performance is increased by 52% drivers/mmc/host/omap_hsmmc.c | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 8c97c22..9c1a60e 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -2091,10 +2091,23 @@ static int __init omap_hsmmc_probe(struct mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | MMC_CAP_WAIT_WHILE_BUSY; - if (mmc_slot(host).wires >= 8) - mmc->caps |= (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA); - else if (mmc_slot(host).wires >= 4) + switch (mmc_slot(host).wires) { + case 8: + mmc->caps |= MMC_CAP_8_BIT_DATA; + /* Fall through */ + case 4: mmc->caps |= MMC_CAP_4_BIT_DATA; + break; + case 1: + /* Nothing to crib here */ + case 0: + /* Assuming nothing was given by board, Core use's 1-Bit */ + break; + default: + /* Completely unexpected.. Core goes with 1-Bit Width */ + dev_crit(mmc_dev(host->mmc), "Invalid width %d\n used!" + "using 1 instead\n", mmc_slot(host).wires); + } if (mmc_slot(host).nonremovable) mmc->caps |= MMC_CAP_NONREMOVABLE; -- 1.6.3.3 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* RE: [PATCH v4] OMAP: Fix for bus width which improves SD card's peformance. 2010-04-19 15:51 ` kishore kadiyala @ 2010-04-22 0:26 ` Madhusudhan 0 siblings, 0 replies; 26+ messages in thread From: Madhusudhan @ 2010-04-22 0:26 UTC (permalink / raw) To: 'kishore kadiyala' Cc: 'Nishanth Menon', felipe.balbi, me, 'Vimal Singh', tony, 'S, Venkatraman', linux-omap, linux-kernel, 'Lavinen Jarkko (Nokia-D/Helsinki)' > -----Original Message----- > From: kishore kadiyala [mailto:kishorek.kadiyala@gmail.com] > Sent: Monday, April 19, 2010 10:52 AM > To: Madhusudhan > Cc: Nishanth Menon; felipe.balbi@nokia.com; me@felipebalbi.com; Vimal > Singh; tony@atomide.com; S, Venkatraman; linux-omap@vger.kernel.org; > linux-kernel@vger.kernel.org; Lavinen Jarkko (Nokia-D/Helsinki) > Subject: [PATCH v4] OMAP: Fix for bus width which improves SD card's > peformance. > > The previous patch was Line wrapped , resending > correct patch. > NM, Sorry I miss spelled your name correcting this time. > > Regards, > Kishore > Tony, I don't see any further comments on this patch. Can you please push this patch? Regards, Madhu > From: Kishore Kadiyala <kishore.kadiyala@ti.com> > > This patch improves low speeds for SD cards. > OMAP-MMC controller's can support maximum bus width of '8'. > when bus width is mentioned as "8" in controller data,the SD > stack will check whether bus width is "4" and if not it will > set bus width to "1" and there by degrading performance. > This patch fixes the issue and improves the performance of > SD cards. > > Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com> > Signed-off-by: Venkatraman S <svenkatr@ti.com> > Signed-off-by: Nishanth Menon <nm@ti.com> > Acked-by: Madhusudhan Chikkature <madhu.cr@ti.com> > Tested-by: Jarkko Nikula <jhnikula@gmail.com> > --- > In V4 : Updated with Nishant's comments and appened his Signed-off > In V3 : Updated with Madhu's comments and appended Tested by Nikula > In V2 : Appended Signed-off by Venkat and Ack by Madhu > > Here are my experiment numbers, on a Class 6 SDHC card: > Read peformance is increased by 220% > Write Performance is increased by 52% > > drivers/mmc/host/omap_hsmmc.c | 19 ++++++++++++++++--- > 1 files changed, 16 insertions(+), 3 deletions(-) > > diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c > index 8c97c22..9c1a60e 100644 > --- a/drivers/mmc/host/omap_hsmmc.c > +++ b/drivers/mmc/host/omap_hsmmc.c > @@ -2091,10 +2091,23 @@ static int __init omap_hsmmc_probe(struct > mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | > MMC_CAP_WAIT_WHILE_BUSY; > > - if (mmc_slot(host).wires >= 8) > - mmc->caps |= (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA); > - else if (mmc_slot(host).wires >= 4) > + switch (mmc_slot(host).wires) { > + case 8: > + mmc->caps |= MMC_CAP_8_BIT_DATA; > + /* Fall through */ > + case 4: > mmc->caps |= MMC_CAP_4_BIT_DATA; > + break; > + case 1: > + /* Nothing to crib here */ > + case 0: > + /* Assuming nothing was given by board, Core use's 1-Bit */ > + break; > + default: > + /* Completely unexpected.. Core goes with 1-Bit Width */ > + dev_crit(mmc_dev(host->mmc), "Invalid width %d\n used!" > + "using 1 instead\n", mmc_slot(host).wires); > + } > > if (mmc_slot(host).nonremovable) > mmc->caps |= MMC_CAP_NONREMOVABLE; > -- > 1.6.3.3 ^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2010-04-22 0:26 UTC | newest] Thread overview: 26+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-02-11 14:20 [PATCH] OMAP: Fix for bus width which improves SD card's peformance kishore kadiyala 2010-02-11 17:34 ` Madhusudhan 2010-03-31 6:07 ` [PATCH-V2] " kishore kadiyala 2010-03-31 6:27 ` Vimal Singh 2010-03-31 7:03 ` kishore kadiyala 2010-03-31 13:11 ` Jarkko Nikula 2010-03-31 16:37 ` Madhusudhan 2010-04-01 6:31 ` kishore kadiyala 2010-04-01 15:41 ` Madhusudhan 2010-04-05 12:56 ` [PATCH v3] " kishore kadiyala 2010-04-05 16:48 ` Felipe Balbi 2010-04-05 17:19 ` Madhusudhan 2010-04-05 17:43 ` Madhusudhan 2010-04-06 5:00 ` Felipe Balbi 2010-04-06 16:16 ` Madhusudhan 2010-04-06 16:32 ` Felipe Balbi 2010-04-06 16:55 ` Nishanth Menon 2010-04-06 16:57 ` Felipe Balbi 2010-04-06 23:23 ` Madhusudhan 2010-04-06 23:39 ` Nishanth Menon 2010-04-07 0:16 ` Madhusudhan 2010-04-07 0:57 ` Nishanth Menon 2010-04-08 16:57 ` Madhusudhan 2010-04-19 15:36 ` [PATCH v4] " kishore kadiyala 2010-04-19 15:51 ` kishore kadiyala 2010-04-22 0:26 ` Madhusudhan
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).