[merged] drivers-mmc-host-omapc-use-resource_size.patch removed from -mm tree

2011-03-23 Thread akpm

The patch titled
 drivers/mmc/host/omap.c: use resource_size()
has been removed from the -mm tree.  Its filename was
 drivers-mmc-host-omapc-use-resource_size.patch

This patch was dropped because it was merged into mainline or a subsystem tree

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: drivers/mmc/host/omap.c: use resource_size()
From: Chris Ball 

Signed-off-by: Chris Ball 
Cc: Jarkko Lavinen 
Cc: Tony Lindgren 
Acked-by: Kishore Kadiyala 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/omap.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff -puN drivers/mmc/host/omap.c~drivers-mmc-host-omapc-use-resource_size 
drivers/mmc/host/omap.c
--- a/drivers/mmc/host/omap.c~drivers-mmc-host-omapc-use-resource_size
+++ a/drivers/mmc/host/omap.c
@@ -1417,7 +1417,7 @@ static int __init mmc_omap_probe(struct 
if (res == NULL || irq < 0)
return -ENXIO;
 
-   res = request_mem_region(res->start, res->end - res->start + 1,
+   res = request_mem_region(res->start, resource_size(res),
 pdev->name);
if (res == NULL)
return -EBUSY;
@@ -1457,7 +1457,7 @@ static int __init mmc_omap_probe(struct 
 
host->irq = irq;
host->phys_base = host->mem_res->start;
-   host->virt_base = ioremap(res->start, res->end - res->start + 1);
+   host->virt_base = ioremap(res->start, resource_size(res));
if (!host->virt_base)
goto err_ioremap;
 
@@ -1514,7 +1514,7 @@ err_free_mmc_host:
 err_ioremap:
kfree(host);
 err_free_mem_region:
-   release_mem_region(res->start, res->end - res->start + 1);
+   release_mem_region(res->start, resource_size(res));
return ret;
 }
 
_

Patches currently in -mm which might be from c...@laptop.org are

origin.patch

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


[merged] drivers-mmc-host-omap_hsmmcc-use-resource_size.patch removed from -mm tree

2011-03-23 Thread akpm

The patch titled
 drivers/mmc/host/omap_hsmmc.c: use resource_size()
has been removed from the -mm tree.  Its filename was
 drivers-mmc-host-omap_hsmmcc-use-resource_size.patch

This patch was dropped because it was merged into mainline or a subsystem tree

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: drivers/mmc/host/omap_hsmmc.c: use resource_size()
From: Chris Ball 

Use resource_size().

Signed-off-by: Chris Ball 
Cc: Madhusudhan Chikkature 
Acked-by: Kishore Kadiyala 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/omap_hsmmc.c |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff -puN 
drivers/mmc/host/omap_hsmmc.c~drivers-mmc-host-omap_hsmmcc-use-resource_size 
drivers/mmc/host/omap_hsmmc.c
--- 
a/drivers/mmc/host/omap_hsmmc.c~drivers-mmc-host-omap_hsmmcc-use-resource_size
+++ a/drivers/mmc/host/omap_hsmmc.c
@@ -2047,8 +2047,7 @@ static int __init omap_hsmmc_probe(struc
 
res->start += pdata->reg_offset;
res->end += pdata->reg_offset;
-   res = request_mem_region(res->start, res->end - res->start + 1,
-   pdev->name);
+   res = request_mem_region(res->start, resource_size(res), pdev->name);
if (res == NULL)
return -EBUSY;
 
@@ -2287,7 +2286,7 @@ err1:
 err_alloc:
omap_hsmmc_gpio_free(pdata);
 err:
-   release_mem_region(res->start, res->end - res->start + 1);
+   release_mem_region(res->start, resource_size(res));
return ret;
 }
 
@@ -2324,7 +2323,7 @@ static int omap_hsmmc_remove(struct plat
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res)
-   release_mem_region(res->start, res->end - res->start + 1);
+   release_mem_region(res->start, resource_size(res));
platform_set_drvdata(pdev, NULL);
 
return 0;
_

Patches currently in -mm which might be from c...@laptop.org are

origin.patch

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


[patch 148/177] drivers/mmc/host/omap.c: use resource_size()

2011-03-22 Thread akpm
From: Chris Ball 

Signed-off-by: Chris Ball 
Cc: Jarkko Lavinen 
Cc: Tony Lindgren 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/omap.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff -puN drivers/mmc/host/omap.c~drivers-mmc-host-omapc-use-resource_size 
drivers/mmc/host/omap.c
--- a/drivers/mmc/host/omap.c~drivers-mmc-host-omapc-use-resource_size
+++ a/drivers/mmc/host/omap.c
@@ -1417,7 +1417,7 @@ static int __init mmc_omap_probe(struct 
if (res == NULL || irq < 0)
return -ENXIO;
 
-   res = request_mem_region(res->start, res->end - res->start + 1,
+   res = request_mem_region(res->start, resource_size(res),
 pdev->name);
if (res == NULL)
return -EBUSY;
@@ -1457,7 +1457,7 @@ static int __init mmc_omap_probe(struct 
 
host->irq = irq;
host->phys_base = host->mem_res->start;
-   host->virt_base = ioremap(res->start, res->end - res->start + 1);
+   host->virt_base = ioremap(res->start, resource_size(res));
if (!host->virt_base)
goto err_ioremap;
 
@@ -1514,7 +1514,7 @@ err_free_mmc_host:
 err_ioremap:
kfree(host);
 err_free_mem_region:
-   release_mem_region(res->start, res->end - res->start + 1);
+   release_mem_region(res->start, resource_size(res));
return ret;
 }
 
_
--
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


[patch 149/177] drivers/mmc/host/omap_hsmmc.c: use resource_size()

2011-03-22 Thread akpm
From: Chris Ball 

Use resource_size().

Signed-off-by: Chris Ball 
Cc: Madhusudhan Chikkature 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/omap_hsmmc.c |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff -puN 
drivers/mmc/host/omap_hsmmc.c~drivers-mmc-host-omap_hsmmcc-use-resource_size 
drivers/mmc/host/omap_hsmmc.c
--- 
a/drivers/mmc/host/omap_hsmmc.c~drivers-mmc-host-omap_hsmmcc-use-resource_size
+++ a/drivers/mmc/host/omap_hsmmc.c
@@ -2047,8 +2047,7 @@ static int __init omap_hsmmc_probe(struc
 
res->start += pdata->reg_offset;
res->end += pdata->reg_offset;
-   res = request_mem_region(res->start, res->end - res->start + 1,
-   pdev->name);
+   res = request_mem_region(res->start, resource_size(res), pdev->name);
if (res == NULL)
return -EBUSY;
 
@@ -2287,7 +2286,7 @@ err1:
 err_alloc:
omap_hsmmc_gpio_free(pdata);
 err:
-   release_mem_region(res->start, res->end - res->start + 1);
+   release_mem_region(res->start, resource_size(res));
return ret;
 }
 
@@ -2324,7 +2323,7 @@ static int omap_hsmmc_remove(struct plat
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res)
-   release_mem_region(res->start, res->end - res->start + 1);
+   release_mem_region(res->start, resource_size(res));
platform_set_drvdata(pdev, NULL);
 
return 0;
_
--
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


+ mmc-add-maintainers-entry.patch added to -mm tree

2010-09-10 Thread akpm

The patch titled
 mmc: add MAINTAINERS entry
has been added to the -mm tree.  Its filename is
 mmc-add-maintainers-entry.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc: add MAINTAINERS entry
From: Chris Ball 

Add myself as maintainer.

Signed-off-by: Chris Ball 
Cc: Pierre Ossman 
Cc: 
Signed-off-by: Andrew Morton 
---

 MAINTAINERS |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff -puN MAINTAINERS~mmc-add-maintainers-entry MAINTAINERS
--- a/MAINTAINERS~mmc-add-maintainers-entry
+++ a/MAINTAINERS
@@ -3936,8 +3936,10 @@ S:   Supported
 F: drivers/mfd/
 
 MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM
-S: Orphan
+M: Chris Ball 
 L: linux-mmc@vger.kernel.org
+T: git git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git
+S: Maintained
 F: drivers/mmc/
 F: include/linux/mmc/
 
@@ -5123,8 +5125,10 @@ S:   Maintained
 F: drivers/mmc/host/sdricoh_cs.c
 
 SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) DRIVER
-S: Orphan
+M: Chris Ball 
 L: linux-mmc@vger.kernel.org
+T: git git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git
+S: Maintained
 F: drivers/mmc/host/sdhci.*
 
 SECURE DIGITAL HOST CONTROLLER INTERFACE, OPEN FIRMWARE BINDINGS (SDHCI-OF)
_

Patches currently in -mm which might be from c...@laptop.org are

origin.patch
linux-next.patch
mmc-add-maintainers-entry.patch
mmc-mmc-44-ddr-support.patch
mmc-sdhci-make-consistent-use-of-config_mmc_debug-for-debugging.patch
mmc-at91_mcic-use-resource_size.patch
mmc-atmel-mcic-use-resource-size.patch
mmc-au1xmmcc-use-resource_size.patch
mmc-use-snprintf-not-sprintf.patch
drivers-mmc-host-omapc-use-resource_size.patch
drivers-mmc-host-omap_hsmmcc-use-resource_size.patch
mmc-make-id-freq-configurable.patch
mmc-make-id-freq-configurable-v5.patch
mmc_test-collect-data-and-show-it-via-sysfs-by-demand.patch

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


[patch 17/41] omap hsmmc: fix a racing case between kmmcd and omap_hsmmc_suspend

2010-09-09 Thread akpm
From: Ethan Du 

If suspend called when kmmcd is doing host->ops->disable, as kmmcd already
increased host->en_dis_recurs to 1, the mmc_host_enable in suspend
function will return directly without increase the nesting_cnt, which will
cause the followed register access carried out to the disabled host.

mmc_suspend_host will enable host itself.  No need to enable host before
it.  Also works on kmmcd will get flushed in mmc_suspend_host, enable host
after it will be safe.  So make the mmc_host_enable after it.

[cjb: rebase against current Linus]
Signed-off-by: Ethan 
Signed-off-by: Chris Ball 
Acked-by: Adrian Hunter 
Acked-by: Madhusudhan Chikkature 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/omap_hsmmc.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN 
drivers/mmc/host/omap_hsmmc.c~omap-hsmmc-fix-a-racing-case-between-kmmcd-and-omap_hsmmc_suspend
 drivers/mmc/host/omap_hsmmc.c
--- 
a/drivers/mmc/host/omap_hsmmc.c~omap-hsmmc-fix-a-racing-case-between-kmmcd-and-omap_hsmmc_suspend
+++ a/drivers/mmc/host/omap_hsmmc.c
@@ -2323,8 +2323,8 @@ static int omap_hsmmc_suspend(struct dev
}
}
cancel_work_sync(&host->mmc_carddetect_work);
-   mmc_host_enable(host->mmc);
ret = mmc_suspend_host(host->mmc);
+   mmc_host_enable(host->mmc);
if (ret == 0) {
omap_hsmmc_disable_irq(host);
OMAP_HSMMC_WRITE(host->base, HCTL,
_
--
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


[patch 15/41] omap_hsmmc: remove unused local `state'

2010-09-09 Thread akpm
From: Sergio Aguirre 

This fixes the following warning:

drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_suspend':
drivers/mmc/host/omap_hsmmc.c:2275: warning: unused variable 'state'

Introduced by commit ID:

  commit 1a13f8fa76c880be41d6b1e6a2b44404bcbfdf9e
  Author: Matt Fleming 
  Date:   Wed May 26 14:42:08 2010 -0700

  mmc: remove the "state" argument to mmc_suspend_host()

The unique usage of this var was removed there, and missed
removing the respective declaration aswell.

Signed-off-by: Sergio Aguirre 
Signed-off-by: Chris Ball 
Acked-by: Matt Fleming 
Cc: Madhusudhan Chikkature 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/omap_hsmmc.c |1 -
 1 file changed, 1 deletion(-)

diff -puN drivers/mmc/host/omap_hsmmc.c~omap_hsmmc-remove-unused-state-variable 
drivers/mmc/host/omap_hsmmc.c
--- a/drivers/mmc/host/omap_hsmmc.c~omap_hsmmc-remove-unused-state-variable
+++ a/drivers/mmc/host/omap_hsmmc.c
@@ -2305,7 +2305,6 @@ static int omap_hsmmc_suspend(struct dev
int ret = 0;
struct platform_device *pdev = to_platform_device(dev);
struct omap_hsmmc_host *host = platform_get_drvdata(pdev);
-   pm_message_t state = PMSG_SUSPEND; /* unused by MMC core */
 
if (host && host->suspended)
return 0;
_
--
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


[patch 14/41] ARM: SAMSUNG: MMC: fix build error when both DMA and PIO mode selected

2010-09-09 Thread akpm

From: Jiri Pinkava 
Date: Tue, 25 May 2010 09:48:58 +0200

[cjb: fix line-wrapped patch]
Signed-off-by: Jiri Pinkava 
Signed-off-by: Chris Ball 
Cc: Matt Fleming 
Cc: Russell King 
Cc: Ben Dooks 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/s3cmci.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN 
drivers/mmc/host/s3cmci.c~arm-samsung-mmc-fix-build-error-when-both-dma-and-pio-mode-selected
 drivers/mmc/host/s3cmci.c
--- 
a/drivers/mmc/host/s3cmci.c~arm-samsung-mmc-fix-build-error-when-both-dma-and-pio-mode-selected
+++ a/drivers/mmc/host/s3cmci.c
@@ -1600,7 +1600,7 @@ static int __devinit s3cmci_probe(struct
host->pio_active= XFER_NONE;
 
 #ifdef CONFIG_MMC_S3C_PIODMA
-   host->dodma = host->pdata->dma;
+   host->dodma = host->pdata->use_dma;
 #endif
 
host->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
_
--
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


[patch 12/41] tmio_mmc: don't clear unhandled pending interrupts

2010-09-09 Thread akpm
From: Yusuke Goda 

Previously, it was possible for ack_mmc_irqs() to clear pending interrupt
bits in the CTL_STATUS register, even though the interrupt handler had not
been called.  This was because of a race that existed when doing a
read-modify-write sequence on CTL_STATUS.  After the read step in this
sequence, if an interrupt occurred (causing one of the bits in CTL_STATUS
to be set) the write step would inadvertently clear it.

Observed with the TMIO_STAT_RXRDY bit together with CMD53 on AR6002 and
BCM4318 SDIO cards in polled mode.

This patch eliminates this race by only writing to CTL_STATUS and clearing
the interrupts that were passed as an argument to ack_mmc_irqs()."

[m...@console-pimps.org: rewrote changelog]
Signed-off-by: Yusuke Goda 
Acked-by: Magnus Damm "
Tested-by: Arnd Hannemann "
Acked-by: Ian Molton 
Cc: Matt Fleming 
Cc: Samuel Ortiz 
Cc: Paul Mundt 
Cc: 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/tmio_mmc.h |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff -puN 
drivers/mmc/host/tmio_mmc.h~tmio_mmc-dont-clear-unhandled-pending-interrupts 
drivers/mmc/host/tmio_mmc.h
--- 
a/drivers/mmc/host/tmio_mmc.h~tmio_mmc-dont-clear-unhandled-pending-interrupts
+++ a/drivers/mmc/host/tmio_mmc.h
@@ -82,10 +82,7 @@
 
 #define ack_mmc_irqs(host, i) \
do { \
-   u32 mask;\
-   mask  = sd_ctrl_read32((host), CTL_STATUS); \
-   mask &= ~((i) & TMIO_MASK_IRQ); \
-   sd_ctrl_write32((host), CTL_STATUS, mask); \
+   sd_ctrl_write32((host), CTL_STATUS, ~(i)); \
} while (0)
 
 
_
--
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


[patch 18/41] drivers/mmc/host/imxmmc.c: adjust confusing if indentation

2010-09-09 Thread akpm
From: Julia Lawall 

Move the second if (reg & ...) test into the branch indicated by its
indentation.  The test was previously always executed after the if
containing that branch, but it was always false unless the if branch was
taken.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// 
@r disable braces4@
position p1,p2;
statement S1,S2;
@@

(
if (...) { ... }
|
if (...) s...@p1 s...@p2
)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@

if (p1[0].column == p2[0].column):
  cocci.print_main("branch",p1)
  cocci.print_secs("after",p2)
// 

Signed-off-by: Julia Lawall 
Signed-off-by: Chris Ball 
Cc: Pavel Pisa 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/imxmmc.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -puN 
drivers/mmc/host/imxmmc.c~drivers-mmc-host-imxmmcc-adjust-confusing-if-indentation
 drivers/mmc/host/imxmmc.c
--- 
a/drivers/mmc/host/imxmmc.c~drivers-mmc-host-imxmmcc-adjust-confusing-if-indentation
+++ a/drivers/mmc/host/imxmmc.c
@@ -148,11 +148,12 @@ static int imxmci_start_clock(struct imx
 
while (delay--) {
reg = readw(host->base + MMC_REG_STATUS);
-   if (reg & STATUS_CARD_BUS_CLK_RUN)
+   if (reg & STATUS_CARD_BUS_CLK_RUN) {
/* Check twice before cut */
reg = readw(host->base + MMC_REG_STATUS);
if (reg & STATUS_CARD_BUS_CLK_RUN)
return 0;
+   }
 
if (test_bit(IMXMCI_PEND_STARTED_b, 
&host->pending_events))
return 0;
_
--
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


[patch 01/41] mmc: avoid getting CID on SDIO-only cards

2010-09-09 Thread akpm
From: David Vrabel 

The introduction of support for SD combo cards breaks the initialization
of all CSR SDIO chips.  The GO_IDLE (CMD0) in mmc_sd_get_cid() causes CSR
chips to be reset (this is non-standard behavior).

When initializing an SDIO card check for a combo card by using the memory
present bit in the R4 response to IO_SEND_OP_COND (CMD5).  This avoids the
call to mmc_sd_get_cid() on an SDIO-only card.

Signed-off-by: David Vrabel 
Acked-by: Michal Mirolaw 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/core/sdio.c  |5 ++---
 include/linux/mmc/sdio.h |2 ++
 2 files changed, 4 insertions(+), 3 deletions(-)

diff -puN drivers/mmc/core/sdio.c~mmc-avoid-getting-cid-on-sdio-only-cards 
drivers/mmc/core/sdio.c
--- a/drivers/mmc/core/sdio.c~mmc-avoid-getting-cid-on-sdio-only-cards
+++ a/drivers/mmc/core/sdio.c
@@ -362,9 +362,8 @@ static int mmc_sdio_init_card(struct mmc
goto err;
}
 
-   err = mmc_sd_get_cid(host, host->ocr & ocr, card->raw_cid);
-
-   if (!err) {
+   if (ocr & R4_MEMORY_PRESENT
+   && mmc_sd_get_cid(host, host->ocr & ocr, card->raw_cid) == 0) {
card->type = MMC_TYPE_SD_COMBO;
 
if (oldcard && (oldcard->type != MMC_TYPE_SD_COMBO ||
diff -puN include/linux/mmc/sdio.h~mmc-avoid-getting-cid-on-sdio-only-cards 
include/linux/mmc/sdio.h
--- a/include/linux/mmc/sdio.h~mmc-avoid-getting-cid-on-sdio-only-cards
+++ a/include/linux/mmc/sdio.h
@@ -38,6 +38,8 @@
  *  [8:0] Byte/block count
  */
 
+#define R4_MEMORY_PRESENT (1 << 27)
+
 /*
   SDIO status in R5
   Type
_
--
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


+ mmc-move-regulator-handling-closer-to-core-v4.patch added to -mm tree

2010-09-09 Thread akpm

The patch titled
 mmc-move-regulator-handling-closer-to-core-v4
has been added to the -mm tree.  Its filename is
 mmc-move-regulator-handling-closer-to-core-v4.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc-move-regulator-handling-closer-to-core-v4
From: Linus Walleij 

Propagate errors from regulator_set_ocr() properly in the
pxamci and mmci drivers, as far as is possible until we hit the
fact that mmc_set_ios() returns void and cannot handle error
codes.

Switched a pr_debug() in the PXA driver to a dev_dbg() as well
because it was disturbing to see it.

Cc: Mark Brown 
Cc: Liam Girdwood 
Cc: Tony Lindgren 
Cc: Adrian Hunter 
Cc: Robert Jarzmik 
Cc: Sundar Iyer 
Cc: Daniel Mack 
Cc: Pierre Ossman 
Cc: Matt Fleming 
Cc: David Brownell 
Cc: Russell King 
Cc: Eric Miao 
Cc: Cliff Brake 
Cc: Jarkko Lavinen 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/mmci.c   |   13 -
 drivers/mmc/host/pxamci.c |   31 +--
 2 files changed, 37 insertions(+), 7 deletions(-)

diff -puN drivers/mmc/host/mmci.c~mmc-move-regulator-handling-closer-to-core-v4 
drivers/mmc/host/mmci.c
--- a/drivers/mmc/host/mmci.c~mmc-move-regulator-handling-closer-to-core-v4
+++ a/drivers/mmc/host/mmci.c
@@ -531,8 +531,19 @@ static void mmci_set_ios(struct mmc_host
ret = mmc_regulator_set_ocr(mmc, host->vcc, 0);
break;
case MMC_POWER_UP:
-   if (host->vcc)
+   if (host->vcc) {
ret = mmc_regulator_set_ocr(mmc, host->vcc, ios->vdd);
+   if (ret) {
+   dev_err(mmc_dev(mmc), "unable to set OCR\n");
+   /*
+* The .set_ios() function in the mmc_host_ops
+* struct return void, and failing to set the
+* power should be rare so we print an error
+* and return here.
+*/
+   return;
+   }
+   }
if (host->plat->vdd_handler)
pwr |= host->plat->vdd_handler(mmc_dev(mmc), ios->vdd,
   ios->power_mode);
diff -puN 
drivers/mmc/host/pxamci.c~mmc-move-regulator-handling-closer-to-core-v4 
drivers/mmc/host/pxamci.c
--- a/drivers/mmc/host/pxamci.c~mmc-move-regulator-handling-closer-to-core-v4
+++ a/drivers/mmc/host/pxamci.c
@@ -99,7 +99,7 @@ static inline void pxamci_init_ocr(struc
}
 }
 
-static inline void pxamci_set_power(struct pxamci_host *host,
+static inline int pxamci_set_power(struct pxamci_host *host,
unsigned char power_mode,
unsigned int vdd)
 {
@@ -108,10 +108,15 @@ static inline void pxamci_set_power(stru
if (host->vcc) {
int ret;
 
-   if (power_mode == MMC_POWER_UP)
+   if (power_mode == MMC_POWER_UP) {
ret = mmc_regulator_set_ocr(host->mmc, host->vcc, vdd);
-   else if (power_mode == MMC_POWER_OFF)
+   if (ret)
+   return ret;
+   } else if (power_mode == MMC_POWER_OFF) {
ret = mmc_regulator_set_ocr(host->mmc, host->vcc, 0);
+   if (ret)
+   return ret;
+   }
}
if (!host->vcc && host->pdata &&
gpio_is_valid(host->pdata->gpio_power)) {
@@ -121,6 +126,8 @@ static inline void pxamci_set_power(stru
}
if (!host->vcc && host->pdata && host->pdata->setpower)
host->pdata->setpower(mmc_dev(host->mmc), vdd);
+
+   return 0;
 }
 
 static void pxamci_stop_clock(struct pxamci_host *host)
@@ -496,9 +503,21 @@ static void pxamci_set_ios(struct mmc_ho
}
 
if (host->power_mode != ios->power_mode) {
+   int ret;
+
host->power_mode = ios->power_mode;
 
-   pxamci_set_power(host, ios->power_mode, ios->vdd);
+   ret = pxamci_set_power(host, ios->power_mode, ios->vdd);
+   if (ret) {
+ 

+ mmc-move-regulator-handling-closer-to-core-v3-fix.patch added to -mm tree

2010-09-08 Thread akpm

The patch titled
 mmc-move-regulator-handling-closer-to-core-v3-fix
has been added to the -mm tree.  Its filename is
 mmc-move-regulator-handling-closer-to-core-v3-fix.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc-move-regulator-handling-closer-to-core-v3-fix
From: Andrew Morton 

- regularise the inline definitions

- make them static

- fixes a checkpatch warning

Cc: 
Cc: Adrian Hunter 
Cc: Cliff Brake 
Cc: Daniel Mack 
Cc: David Brownell 
Cc: Eric Miao 
Cc: Jarkko Lavinen 
Cc: Liam Girdwood 
Cc: Linus Walleij 
Cc: Mark Brown 
Cc: Matt Fleming 
Cc: Pierre Ossman 
Cc: Robert Jarzmik 
Cc: Russell King 
Cc: Sundar Iyer 
Cc: Tony Lindgren 
Signed-off-by: Andrew Morton 
---

 include/linux/mmc/host.h |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN 
include/linux/mmc/host.h~mmc-move-regulator-handling-closer-to-core-v3-fix 
include/linux/mmc/host.h
--- a/include/linux/mmc/host.h~mmc-move-regulator-handling-closer-to-core-v3-fix
+++ a/include/linux/mmc/host.h
@@ -265,12 +265,12 @@ int mmc_regulator_set_ocr(struct mmc_hos
struct regulator *supply,
unsigned short vdd_bit);
 #else
-int inline mmc_regulator_get_ocrmask(struct regulator *supply)
+static inline int mmc_regulator_get_ocrmask(struct regulator *supply)
 {
return 0;
 }
 
-int inline mmc_regulator_set_ocr(struct mmc_host *mmc,
+static inline int mmc_regulator_set_ocr(struct mmc_host *mmc,
 struct regulator *supply,
 unsigned short vdd_bit)
 {
_

Patches currently in -mm which might be from a...@linux-foundation.org are

origin.patch
linux-next.patch
next-remove-localversion.patch
fs-inodec-work-around-bug.patch
i-need-old-gcc.patch
cgroups-fix-api-thinko-fix.patch
vmstat-update-zone-stat-threshold-when-onlining-a-cpu.patch
mm-page-allocator-update-free-page-counters-after-pages-are-placed-on-the-free-list-fix.patch
mm-vmap-area-cache.patch
parport-prevent-arm-boards-frmo-crashing-when-cups-is-loaded-fix.patch
gcc-46-btrfs-clean-up-unused-variables-bugs.patch
hpet-factor-timer-allocate-from-open.patch
leds-route-kbd-leds-through-the-generic-leds-layer.patch
security-add-const-to-security_task_setscheduler.patch
sched-make-sched_param-argument-static-variables-in-some-sched_setscheduler-caller.patch
usb-storage-add-new-no_read_disc_info-quirk-fix.patch
mm.patch
oom-kill-all-threads-sharing-oom-killed-tasks-mm-fix.patch
oom-kill-all-threads-sharing-oom-killed-tasks-mm-fix-fix.patch
oom-rewrite-error-handling-for-oom_adj-and-oom_score_adj-tunables.patch
oom-fix-locking-for-oom_adj-and-oom_score_adj.patch
mm-only-build-per-node-scan_unevictable-functions-when-numa-is-enabled-cleanup.patch
memory-hotplug-unify-is_removable-and-offline-detection-code-checkpatch-fixes.patch
frv-duplicate-output_buffer-of-e03-checkpatch-fixes.patch
kernelh-add-minmax3-macros-fix.patch
include-linux-kernelh-add-__must_check-to-strict_strto.patch
sdhci-support-10-bit-divided-clock-mode-for-spec-30-checkpatch-fixes.patch
mmc-move-regulator-handling-closer-to-core-v3-fix.patch
sdhci-get-rid-of-card-detect-work-fix.patch
checkpatch-returning-errno-typically-should-be-negative.patch
select-rename-estimate_accuracy-to-select_estimate_accuracy.patch
cgroup_freezer-update_freezer_state-does-incorrect-state-transitions-checkpatch-fixes.patch
core_pattern-fix-long-parameters-was-truncated-by-core_pattern-handler-update.patch
core_pattern-fix-long-parameters-was-truncated-by-core_pattern-handler-update-2.patch
core_pattern-fix-long-parameters-was-truncated-by-core_pattern-handler-update-2-checkpatch-fixes.patch
delay-accounting-re-implement-c-for-getdelaysc-to-report-information-on-a-target-command-checkpatch-fixes.patch
pps-add-async-pps-event-handler-fix.patch
memstick-add-driver-for-ricoh-r5c592-card-reader-cleanups.patch
kernel-resourcec-handle-reinsertion-of-an-already-inserted-resource.patch
vfs-add-super-operation-writeback_inodes-fix.patch
reiser4-export-remove_from_page_cache-fix.patch
reiser4-export-find_get_pages.patch
reiser4.patch
reiser4-writeback_inodes-implementation-fix.patch
reiser4-fixups.patch
reiser4-broke.patch
journal_add_journal_head-debug.patch
slab-leaks3-default-y.patch
put_bh-debug.patch
getblk-handle-2tb-devices.patch

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majord...@vger.kernel.or

+ mmc-move-regulator-handling-closer-to-core-v3.patch added to -mm tree

2010-09-08 Thread akpm

The patch titled
 mmc: move regulator handling closer to core
has been added to the -mm tree.  Its filename is
 mmc-move-regulator-handling-closer-to-core-v3.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc: move regulator handling closer to core
From: Linus Walleij 

After discovering a problem in regulator reference counting I took Mark
Brown's advice to move the reference count into the MMC core by making the
regulator status a member of struct mmc_host.

I took this opportunity to also implement NULL versions of
the regulator functions so as to rid the driver code from
some ugly #ifdef CONFIG_REGULATOR clauses.

Signed-off-by: Linus Walleij 
Reviewed-by: Mark Brown 
Cc: Liam Girdwood 
Cc: Tony Lindgren 
Cc: Adrian Hunter 
Cc: Robert Jarzmik 
Cc: Sundar Iyer 
Cc: Daniel Mack 
Cc: Pierre Ossman 
Cc: Matt Fleming 
Cc: David Brownell 
Cc: Russell King 
Cc: Eric Miao 
Cc: Cliff Brake 
Cc: Jarkko Lavinen 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/core/core.c   |   26 --
 drivers/mmc/host/mmci.c   |   15 ++-
 drivers/mmc/host/omap_hsmmc.c |   21 +
 drivers/mmc/host/pxamci.c |   18 --
 include/linux/mmc/host.h  |   22 +-
 5 files changed, 68 insertions(+), 34 deletions(-)

diff -puN drivers/mmc/core/core.c~mmc-move-regulator-handling-closer-to-core-v3 
drivers/mmc/core/core.c
--- a/drivers/mmc/core/core.c~mmc-move-regulator-handling-closer-to-core-v3
+++ a/drivers/mmc/core/core.c
@@ -771,8 +771,9 @@ EXPORT_SYMBOL(mmc_regulator_get_ocrmask)
 
 /**
  * mmc_regulator_set_ocr - set regulator to match host->ios voltage
- * @vdd_bit: zero for power off, else a bit number (host->ios.vdd)
+ * @mmc: the host to regulate
  * @supply: regulator to use
+ * @vdd_bit: zero for power off, else a bit number (host->ios.vdd)
  *
  * Returns zero on success, else negative errno.
  *
@@ -780,15 +781,12 @@ EXPORT_SYMBOL(mmc_regulator_get_ocrmask)
  * a particular supply voltage.  This would normally be called from the
  * set_ios() method.
  */
-int mmc_regulator_set_ocr(struct regulator *supply, unsigned short vdd_bit)
+int mmc_regulator_set_ocr(struct mmc_host *mmc,
+   struct regulator *supply,
+   unsigned short vdd_bit)
 {
int result = 0;
int min_uV, max_uV;
-   int enabled;
-
-   enabled = regulator_is_enabled(supply);
-   if (enabled < 0)
-   return enabled;
 
if (vdd_bit) {
int tmp;
@@ -819,17 +817,25 @@ int mmc_regulator_set_ocr(struct regulat
else
result = 0;
 
-   if (result == 0 && !enabled)
+   if (result == 0 && !mmc->regulator_enabled) {
result = regulator_enable(supply);
-   } else if (enabled) {
+   if (!result)
+   mmc->regulator_enabled = true;
+   }
+   } else if (mmc->regulator_enabled) {
result = regulator_disable(supply);
+   if (result == 0)
+   mmc->regulator_enabled = false;
}
 
+   if (result)
+   dev_err(mmc_dev(mmc),
+   "could not set regulator OCR (%d)\n", result);
return result;
 }
 EXPORT_SYMBOL(mmc_regulator_set_ocr);
 
-#endif
+#endif /* CONFIG_REGULATOR */
 
 /*
  * Mask off any voltages we don't support and select
diff -puN drivers/mmc/host/mmci.c~mmc-move-regulator-handling-closer-to-core-v3 
drivers/mmc/host/mmci.c
--- a/drivers/mmc/host/mmci.c~mmc-move-regulator-handling-closer-to-core-v3
+++ a/drivers/mmc/host/mmci.c
@@ -523,19 +523,16 @@ static void mmci_set_ios(struct mmc_host
struct mmci_host *host = mmc_priv(mmc);
u32 pwr = 0;
unsigned long flags;
+   int ret;
 
switch (ios->power_mode) {
case MMC_POWER_OFF:
-   if(host->vcc &&
-  regulator_is_enabled(host->vcc))
-   regulator_disable(host->vcc);
+   if (host->vcc)
+   ret = mmc_regulator_set_ocr(mmc, host->vcc, 0);
break;
case MMC_POWER_UP:
-#ifdef CONFIG_REGULATOR
if (host->vcc)
-

+ mmc-make-id-freq-configurable-v5.patch added to -mm tree

2010-09-07 Thread akpm

The patch titled
 mmc-make-id-freq-configurable-v5
has been added to the -mm tree.  Its filename is
 mmc-make-id-freq-configurable-v5.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc-make-id-freq-configurable-v5
From: Hein_Tibosch 

Matt, Chris,

Thanks both for reviewing.

I never noticed that the host wasn't released because my f_min was low
enough so that all frequencies would be tried.  But yes, you're both
right.

Before somebody else makes the remark: "unsigned freqs[]" can be declared as
const.

Below, I changed the order of the if/else/else, and whenever no more
frequencies can be tried, it will release the host before branching out.

Signed-off-by: Hein Tibosch 
Reviewed-and-Tested-by: Chris Ball 
Cc: Matt Fleming 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/core/core.c |   18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff -puN drivers/mmc/core/core.c~mmc-make-id-freq-configurable-v5 
drivers/mmc/core/core.c
--- a/drivers/mmc/core/core.c~mmc-make-id-freq-configurable-v5
+++ a/drivers/mmc/core/core.c
@@ -1400,7 +1400,7 @@ void mmc_rescan(struct work_struct *work
int err;
unsigned long flags;
int i;
-   unsigned freqs[] = { 40, 30, 20, 10 };
+   const unsigned freqs[] = { 40, 30, 20, 10 };
 
spin_lock_irqsave(&host->lock, flags);
 
@@ -1445,12 +1445,15 @@ void mmc_rescan(struct work_struct *work
 
if (freqs[i] >= host->f_min)
host->f_init = freqs[i];
-   else if (i && freqs[i-1] <= host->f_min)
-   goto out;
-   else
+   else if (!i || freqs[i-1] > host->f_min)
host->f_init = host->f_min;
+   else {
+   mmc_release_host(host);
+   goto out;
+   }
+   pr_info("%s: %s: trying to init card at %u Hz\n",
+   mmc_hostname(host), __func__, host->f_init);
 
-   printk ("mmc_rescan: trying %u Hz\n", host->f_init);
mmc_power_up(host);
sdio_reset(host);
mmc_go_idle(host);
@@ -1464,7 +1467,10 @@ void mmc_rescan(struct work_struct *work
if (!err) {
if (mmc_attach_sdio(host, ocr)) {
mmc_claim_host(host);
-   /* try SDMEM (but not MMC) even if SDIO is 
broken */
+   /*
+* Try SDMEM (but not MMC) even if SDIO
+* is broken.
+   */
if (mmc_send_app_op_cond(host, 0, &ocr))
goto out_fail;
 
_

Patches currently in -mm which might be from hein_tibo...@yahoo.es are

mmc-make-id-freq-configurable.patch
mmc-make-id-freq-configurable-v5.patch
mmc-make-id-freq-configurable-checkpatch-fixes.patch

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


+ mmc_test-collect-data-and-show-it-via-sysfs-by-demand.patch added to -mm tree

2010-09-07 Thread akpm

The patch titled
 mmc_test: collect data and show it via sysfs by demand
has been added to the -mm tree.  Its filename is
 mmc_test-collect-data-and-show-it-via-sysfs-by-demand.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc_test: collect data and show it via sysfs by demand
From: Andy Shevchenko 

Make it possibile to get test results via sysfs.  It helps to do tests
non-interactively.

We have the file created under sysfs already and we could use it to out test
results.

Signed-off-by: Andy Shevchenko 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/card/mmc_test.c |  171 +-
 1 file changed, 169 insertions(+), 2 deletions(-)

diff -puN 
drivers/mmc/card/mmc_test.c~mmc_test-collect-data-and-show-it-via-sysfs-by-demand
 drivers/mmc/card/mmc_test.c
--- 
a/drivers/mmc/card/mmc_test.c~mmc_test-collect-data-and-show-it-via-sysfs-by-demand
+++ a/drivers/mmc/card/mmc_test.c
@@ -17,6 +17,7 @@
 
 #include 
 #include /* For nr_free_buffer_pages() */
+#include 
 
 #define RESULT_OK  0
 #define RESULT_FAIL1
@@ -73,12 +74,45 @@ struct mmc_test_area {
 };
 
 /**
+ * struct mmc_test_transfer_result - transfer results for performance tests.
+ * @link: double-linked list
+ * @count: amount of group of sectors to check
+ * @sectors: amount of sectors to check in one group
+ * @ts: time values of transfer
+ * @rate: calculated transfer rate
+ */
+struct mmc_test_transfer_result {
+   struct list_head link;
+   unsigned int count;
+   unsigned int sectors;
+   struct timespec ts;
+   unsigned int rate;
+};
+
+/**
+ * struct mmc_test_general_result - results for tests.
+ * @link: double-linked list
+ * @card: card under test
+ * @testcase: number of test case
+ * @result: result of test run
+ * @tr_lst: transfer measurements if any as mmc_test_transfer_result
+ */
+struct mmc_test_general_result {
+   struct list_head link;
+   struct mmc_card *card;
+   int testcase;
+   int result;
+   struct list_head tr_lst;
+};
+
+/**
  * struct mmc_test_card - test information.
  * @card: card under test
  * @scratch: transfer buffer
  * @buffer: transfer buffer
  * @highmem: buffer for highmem tests
  * @area: information for performance tests
+ * @gr: pointer to results of current testcase
  */
 struct mmc_test_card {
struct mmc_card *card;
@@ -88,7 +122,8 @@ struct mmc_test_card {
 #ifdef CONFIG_HIGHMEM
struct page *highmem;
 #endif
-   struct mmc_test_area area;
+   struct mmc_test_areaarea;
+   struct mmc_test_general_result  *gr;
 };
 
 /***/
@@ -421,6 +456,30 @@ static unsigned int mmc_test_rate(uint64
 }
 
 /*
+ * Save transfer results for future usage
+ */
+static void mmc_test_save_transfer_result(struct mmc_test_card *test,
+   unsigned int count, unsigned int sectors, struct timespec ts,
+   unsigned int rate)
+{
+   struct mmc_test_transfer_result *tr;
+
+   if (!test->gr)
+   return;
+
+   tr = kmalloc(sizeof(struct mmc_test_transfer_result), GFP_KERNEL);
+   if (!tr)
+   return;
+
+   tr->count = count;
+   tr->sectors = sectors;
+   tr->ts = ts;
+   tr->rate = rate;
+
+   list_add_tail(&tr->link, &test->gr->tr_lst);
+}
+
+/*
  * Print the transfer rate.
  */
 static void mmc_test_print_rate(struct mmc_test_card *test, uint64_t bytes,
@@ -438,6 +497,8 @@ static void mmc_test_print_rate(struct m
 mmc_hostname(test->card->host), sectors, sectors >> 1,
 (sectors == 1 ? ".5" : ""), (unsigned long)ts.tv_sec,
 (unsigned long)ts.tv_nsec, rate / 1000, rate / 1024);
+
+   mmc_test_save_transfer_result(test, 1, sectors, ts, rate);
 }
 
 /*
@@ -461,6 +522,8 @@ static void mmc_test_print_avg_rate(stru
 sectors >> 1, (sectors == 1 ? ".5" : ""),
 (unsigned long)ts.tv_sec, (unsigned long)ts.tv_nsec,
 rate / 1000, rate / 1024);
+
+   mmc_test_save_transfer_result(test, count, sectors, ts, rate);
 }
 
 /*
@@ -1853,6 +1916,8 @@ static const struct mmc_test_case mmc_te
 
 static DEFINE_MUTEX(mmc_test_lock);
 
+static LIST_HEAD(mmc_test_result);
+
 static v

+ mmc_test-change-simple_strtol-to-strict_strtol.patch added to -mm tree

2010-09-07 Thread akpm

The patch titled
 mmc_test: change simple_strtol() to strict_strtol()
has been added to the -mm tree.  Its filename is
 mmc_test-change-simple_strtol-to-strict_strtol.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc_test: change simple_strtol() to strict_strtol()
From: Andy Shevchenko 

It's better to use strict_strtol() to convert user's input and strictly check
it. At least it forbids to interpret wrong input as a 0 and prevents to run all
tests.

Signed-off-by: Andy Shevchenko 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/card/mmc_test.c |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff -puN 
drivers/mmc/card/mmc_test.c~mmc_test-change-simple_strtol-to-strict_strtol 
drivers/mmc/card/mmc_test.c
--- a/drivers/mmc/card/mmc_test.c~mmc_test-change-simple_strtol-to-strict_strtol
+++ a/drivers/mmc/card/mmc_test.c
@@ -1937,9 +1937,10 @@ static ssize_t mmc_test_store(struct dev
 {
struct mmc_card *card = mmc_dev_to_card(dev);
struct mmc_test_card *test;
-   int testcase;
+   long testcase;
 
-   testcase = simple_strtol(buf, NULL, 10);
+   if (strict_strtol(buf, 10, &testcase))
+   return -EINVAL;
 
test = kzalloc(sizeof(struct mmc_test_card), GFP_KERNEL);
if (!test)
_

Patches currently in -mm which might be from andy.shevche...@gmail.com are

linux-next.patch
lib-bitmapc-use-hex_to_bin.patch
mmc-make-dev_to_mmc_card-macro-public.patch
mmc-rename-dev_to_mmc_card-to-mmc_dev_to_card.patch
mmc_test-use-api-to-check-card-type.patch
mmc_test-change-simple_strtol-to-strict_strtol.patch
mmc_test-collect-data-and-show-it-via-sysfs-by-demand.patch

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


+ mmc_test-use-api-to-check-card-type.patch added to -mm tree

2010-09-07 Thread akpm

The patch titled
 mmc_test: use API to check card type
has been added to the -mm tree.  Its filename is
 mmc_test-use-api-to-check-card-type.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc_test: use API to check card type
From: Andy Shevchenko 

There are methods to check card type. Let's use them instead of direct checking
type bits.

Signed-off-by: Andy Shevchenko 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/card/mmc_test.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/mmc/card/mmc_test.c~mmc_test-use-api-to-check-card-type 
drivers/mmc/card/mmc_test.c
--- a/drivers/mmc/card/mmc_test.c~mmc_test-use-api-to-check-card-type
+++ a/drivers/mmc/card/mmc_test.c
@@ -1977,7 +1977,7 @@ static int mmc_test_probe(struct mmc_car
 {
int ret;
 
-   if ((card->type != MMC_TYPE_MMC) && (card->type != MMC_TYPE_SD))
+   if (!mmc_card_mmc(card) && !mmc_card_sd(card))
return -ENODEV;
 
ret = device_create_file(&card->dev, &dev_attr_test);
_

Patches currently in -mm which might be from andy.shevche...@gmail.com are

linux-next.patch
lib-bitmapc-use-hex_to_bin.patch
mmc-make-dev_to_mmc_card-macro-public.patch
mmc-rename-dev_to_mmc_card-to-mmc_dev_to_card.patch
mmc_test-use-api-to-check-card-type.patch
mmc_test-change-simple_strtol-to-strict_strtol.patch
mmc_test-collect-data-and-show-it-via-sysfs-by-demand.patch

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


+ mmc-make-id-freq-configurable-checkpatch-fixes.patch added to -mm tree

2010-09-03 Thread akpm

The patch titled
 mmc-make-id-freq-configurable-checkpatch-fixes
has been added to the -mm tree.  Its filename is
 mmc-make-id-freq-configurable-checkpatch-fixes.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc-make-id-freq-configurable-checkpatch-fixes
From: Andrew Morton 

WARNING: space prohibited between function name and open parenthesis '('
#76: FILE: drivers/mmc/core/core.c:1453:
+   printk ("mmc_rescan: trying %u Hz\n", host->f_init);

WARNING: line over 80 characters
#100: FILE: drivers/mmc/core/core.c:1467:
+   /* try SDMEM (but not MMC) even if SDIO is 
broken */

total: 0 errors, 2 warnings, 131 lines checked

./patches/mmc-make-id-freq-configurable.patch has style problems, please 
review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Please run checkpatch prior to sending patches

Cc: 
Cc: Adrian Hunter 
Cc: Ben Nizette 
Cc: Chris Ball 
Cc: Hein Tibosch 
Cc: Matt Fleming 
Cc: Pierre Ossman 
Cc: Sascha Hauer 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/core/core.c |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff -puN 
drivers/mmc/core/core.c~mmc-make-id-freq-configurable-checkpatch-fixes 
drivers/mmc/core/core.c
--- a/drivers/mmc/core/core.c~mmc-make-id-freq-configurable-checkpatch-fixes
+++ a/drivers/mmc/core/core.c
@@ -1450,7 +1450,9 @@ void mmc_rescan(struct work_struct *work
else
host->f_init = host->f_min;
 
-   printk ("mmc_rescan: trying %u Hz\n", host->f_init);
+   pr_info("%s: %s: trying to init card at %u Hz\n",
+   mmc_hostname(host), __func__, host->f_init);
+
mmc_power_up(host);
sdio_reset(host);
mmc_go_idle(host);
@@ -1464,7 +1466,10 @@ void mmc_rescan(struct work_struct *work
if (!err) {
if (mmc_attach_sdio(host, ocr)) {
mmc_claim_host(host);
-   /* try SDMEM (but not MMC) even if SDIO is 
broken */
+   /*
+* Try SDMEM (but not MMC) even if SDIO is
+* broken.
+*/
if (mmc_send_app_op_cond(host, 0, &ocr))
goto out_fail;
 
_

Patches currently in -mm which might be from a...@linux-foundation.org are

linux-next.patch
next-remove-localversion.patch
fs-inodec-work-around-bug.patch
i-need-old-gcc.patch
cgroups-fix-api-thinko-fix.patch
vmstat-update-zone-stat-threshold-when-onlining-a-cpu.patch
mm-page-allocator-update-free-page-counters-after-pages-are-placed-on-the-free-list-fix.patch
mm-vmap-area-cache.patch
drivers-gpu-drm-i915-intel_overlayc-needs-seq_fileh.patch
parport-prevent-arm-boards-frmo-crashing-when-cups-is-loaded-fix.patch
gcc-46-btrfs-clean-up-unused-variables-bugs.patch
hpet-factor-timer-allocate-from-open.patch
leds-route-kbd-leds-through-the-generic-leds-layer.patch
security-add-const-to-security_task_setscheduler.patch
sched-make-sched_param-argument-static-variables-in-some-sched_setscheduler-caller.patch
usb-storage-add-new-no_read_disc_info-quirk-fix.patch
mm.patch
oom-kill-all-threads-sharing-oom-killed-tasks-mm-fix.patch
oom-kill-all-threads-sharing-oom-killed-tasks-mm-fix-fix.patch
oom-rewrite-error-handling-for-oom_adj-and-oom_score_adj-tunables.patch
oom-fix-locking-for-oom_adj-and-oom_score_adj.patch
mm-only-build-per-node-scan_unevictable-functions-when-numa-is-enabled-cleanup.patch
frv-duplicate-output_buffer-of-e03-checkpatch-fixes.patch
kernelh-add-minmax3-macros-fix.patch
include-linux-kernelh-add-__must_check-to-strict_strto.patch
sdhci-support-10-bit-divided-clock-mode-for-spec-30-checkpatch-fixes.patch
mmc-make-id-freq-configurable-checkpatch-fixes.patch
sdhci-get-rid-of-card-detect-work-fix.patch
checkpatch-returning-errno-typically-should-be-negative.patch
select-rename-estimate_accuracy-to-select_estimate_accuracy.patch
cgroup_freezer-update_freezer_state-does-incorrect-state-transitions-checkpatch-fixes.patch
core_pattern-fix-long-parameters-was-truncated-by-core_pattern-handler-update.patch
core_pattern-fix-long-parameters-was-truncated-by-core_pattern-handler-update-2.patch

+ mmc-make-id-freq-configurable.patch added to -mm tree

2010-09-03 Thread akpm

The patch titled
 mmc: make ID freq configurable
has been added to the -mm tree.  Its filename is
 mmc-make-id-freq-configurable.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc: make ID freq configurable
From: Hein Tibosch 

In the latest releases of the mmc driver, the freq during initialization
is set to a fixed 400 Khz.  This was reportedly too fast for several
users.  As there doesn't seem to be an ideal frequency
which-works-for-all, Pierre suggested to let the driver try several
frequencies.

This patch implements that idea. It will try mmc-initialization using
several frequencies from an array 400, 300, 200 and 100.

In case SDIO is broken, it'll still try to detect SDMEM, also at different
freqs.

Signed-off-by: Hein Tibosch 
Cc: Pierre Ossman 
Reviewed-by: Chris Ball 
Tested-by: Chris Ball 
Cc: Ben Nizette 
Cc: Sascha Hauer 
Cc: Adrian Hunter 
Cc: Matt Fleming 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/core/core.c  |   96 +++--
 include/linux/mmc/host.h |1 
 2 files changed, 52 insertions(+), 45 deletions(-)

diff -puN drivers/mmc/core/core.c~mmc-make-id-freq-configurable 
drivers/mmc/core/core.c
--- a/drivers/mmc/core/core.c~mmc-make-id-freq-configurable
+++ a/drivers/mmc/core/core.c
@@ -907,12 +907,7 @@ static void mmc_power_up(struct mmc_host
 */
mmc_delay(10);
 
-   if (host->f_min > 40) {
-   pr_warning("%s: Minimum clock frequency too high for "
-   "identification mode\n", mmc_hostname(host));
-   host->ios.clock = host->f_min;
-   } else
-   host->ios.clock = 40;
+   host->ios.clock = host->f_init;
 
host->ios.power_mode = MMC_POWER_ON;
mmc_set_ios(host);
@@ -1404,6 +1399,8 @@ void mmc_rescan(struct work_struct *work
u32 ocr;
int err;
unsigned long flags;
+   int i;
+   unsigned freqs[] = { 40, 30, 20, 10 };
 
spin_lock_irqsave(&host->lock, flags);
 
@@ -1443,55 +1440,64 @@ void mmc_rescan(struct work_struct *work
if (host->ops->get_cd && host->ops->get_cd(host) == 0)
goto out;
 
-   mmc_claim_host(host);
+   for (i = 0; i < ARRAY_SIZE(freqs); i++) {
+   mmc_claim_host(host);
 
-   mmc_power_up(host);
-   sdio_reset(host);
-   mmc_go_idle(host);
+   if (freqs[i] >= host->f_min)
+   host->f_init = freqs[i];
+   else if (i && freqs[i-1] <= host->f_min)
+   goto out;
+   else
+   host->f_init = host->f_min;
 
-   mmc_send_if_cond(host, host->ocr_avail);
+   printk ("mmc_rescan: trying %u Hz\n", host->f_init);
+   mmc_power_up(host);
+   sdio_reset(host);
+   mmc_go_idle(host);
 
-   /*
-* First we search for SDIO...
-*/
-   err = mmc_send_io_op_cond(host, 0, &ocr);
-   if (!err) {
-   if (mmc_attach_sdio(host, ocr)) {
-   mmc_claim_host(host);
-   /* try SDMEM (but not MMC) even if SDIO is broken */
-   if (mmc_send_app_op_cond(host, 0, &ocr))
-   goto out_fail;
+   mmc_send_if_cond(host, host->ocr_avail);
+
+   /*
+* First we search for SDIO...
+*/
+   err = mmc_send_io_op_cond(host, 0, &ocr);
+   if (!err) {
+   if (mmc_attach_sdio(host, ocr)) {
+   mmc_claim_host(host);
+   /* try SDMEM (but not MMC) even if SDIO is 
broken */
+   if (mmc_send_app_op_cond(host, 0, &ocr))
+   goto out_fail;
+
+   if (mmc_attach_sd(host, ocr))
+   mmc_power_off(host);
+   }
+   goto out;
+   }
 
+   /*
+* ...then normal SD...
+*/
+   err = mmc_send_app_op_cond(host, 0, &ocr);
+   if (!err) {
if (mmc_attach_sd(host, ocr))
  

+ drivers-mmc-host-imxmmcc-adjust-confusing-if-indentation.patch added to -mm tree

2010-08-27 Thread akpm

The patch titled
 drivers/mmc/host/imxmmc.c: adjust confusing if indentation
has been added to the -mm tree.  Its filename is
 drivers-mmc-host-imxmmcc-adjust-confusing-if-indentation.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: drivers/mmc/host/imxmmc.c: adjust confusing if indentation
From: Julia Lawall 

Move the second if (reg & ...) test into the branch indicated by its
indentation.  The test was previously always executed after the if
containing that branch, but it was always false unless the if branch was
taken.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// 
@r disable braces4@
position p1,p2;
statement S1,S2;
@@

(
if (...) { ... }
|
if (...) s...@p1 s...@p2
)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@

if (p1[0].column == p2[0].column):
  cocci.print_main("branch",p1)
  cocci.print_secs("after",p2)
// 

Signed-off-by: Julia Lawall 
Signed-off-by: Chris Ball 
Cc: Pavel Pisa 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/imxmmc.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -puN 
drivers/mmc/host/imxmmc.c~drivers-mmc-host-imxmmcc-adjust-confusing-if-indentation
 drivers/mmc/host/imxmmc.c
--- 
a/drivers/mmc/host/imxmmc.c~drivers-mmc-host-imxmmcc-adjust-confusing-if-indentation
+++ a/drivers/mmc/host/imxmmc.c
@@ -148,11 +148,12 @@ static int imxmci_start_clock(struct imx
 
while (delay--) {
reg = readw(host->base + MMC_REG_STATUS);
-   if (reg & STATUS_CARD_BUS_CLK_RUN)
+   if (reg & STATUS_CARD_BUS_CLK_RUN) {
/* Check twice before cut */
reg = readw(host->base + MMC_REG_STATUS);
if (reg & STATUS_CARD_BUS_CLK_RUN)
return 0;
+   }
 
if (test_bit(IMXMCI_PEND_STARTED_b, 
&host->pending_events))
return 0;
_

Patches currently in -mm which might be from ju...@diku.dk are

origin.patch
linux-next.patch
drivers-mmc-host-imxmmcc-adjust-confusing-if-indentation.patch
fs-btrfs-use-memdup_user.patch
fs-btrfs-use-err_cast.patch

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


+ omap-hsmmc-fix-a-racing-case-between-kmmcd-and-omap_hsmmc_suspend.patch added to -mm tree

2010-08-27 Thread akpm

The patch titled
 omap hsmmc: fix a racing case between kmmcd and omap_hsmmc_suspend
has been added to the -mm tree.  Its filename is
 omap-hsmmc-fix-a-racing-case-between-kmmcd-and-omap_hsmmc_suspend.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: omap hsmmc: fix a racing case between kmmcd and omap_hsmmc_suspend
From: Ethan Du 

If suspend called when kmmcd is doing host->ops->disable, as kmmcd already
increased host->en_dis_recurs to 1, the mmc_host_enable in suspend
function will return directly without increase the nesting_cnt, which will
cause the followed register access carried out to the disabled host.

mmc_suspend_host will enable host itself.  No need to enable host before
it.  Also works on kmmcd will get flushed in mmc_suspend_host, enable host
after it will be safe.  So make the mmc_host_enable after it.

[cjb: rebase against current Linus]
Signed-off-by: Ethan 
Signed-off-by: Chris Ball 
Acked-by: Adrian Hunter 
Acked-by: Madhusudhan Chikkature 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/omap_hsmmc.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN 
drivers/mmc/host/omap_hsmmc.c~omap-hsmmc-fix-a-racing-case-between-kmmcd-and-omap_hsmmc_suspend
 drivers/mmc/host/omap_hsmmc.c
--- 
a/drivers/mmc/host/omap_hsmmc.c~omap-hsmmc-fix-a-racing-case-between-kmmcd-and-omap_hsmmc_suspend
+++ a/drivers/mmc/host/omap_hsmmc.c
@@ -2323,8 +2323,8 @@ static int omap_hsmmc_suspend(struct dev
}
}
cancel_work_sync(&host->mmc_carddetect_work);
-   mmc_host_enable(host->mmc);
ret = mmc_suspend_host(host->mmc);
+   mmc_host_enable(host->mmc);
if (ret == 0) {
omap_hsmmc_disable_irq(host);
OMAP_HSMMC_WRITE(host->base, HCTL,
_

Patches currently in -mm which might be from ethan@gmail.com are

omap-hsmmc-fix-a-racing-case-between-kmmcd-and-omap_hsmmc_suspend.patch

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


+ drivers-mmc-host-omap_hsmmcc-use-resource_size.patch added to -mm tree

2010-08-27 Thread akpm

The patch titled
 drivers/mmc/host/omap_hsmmc.c: use resource_size()
has been added to the -mm tree.  Its filename is
 drivers-mmc-host-omap_hsmmcc-use-resource_size.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: drivers/mmc/host/omap_hsmmc.c: use resource_size()
From: Chris Ball 

Use resource_size().

Signed-off-by: Chris Ball 
Cc: Madhusudhan Chikkature 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/omap_hsmmc.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff -puN 
drivers/mmc/host/omap_hsmmc.c~drivers-mmc-host-omap_hsmmcc-use-resource_size 
drivers/mmc/host/omap_hsmmc.c
--- 
a/drivers/mmc/host/omap_hsmmc.c~drivers-mmc-host-omap_hsmmcc-use-resource_size
+++ a/drivers/mmc/host/omap_hsmmc.c
@@ -2003,7 +2003,7 @@ static int __init omap_hsmmc_probe(struc
if (res == NULL || irq < 0)
return -ENXIO;
 
-   res = request_mem_region(res->start, res->end - res->start + 1,
+   res = request_mem_region(res->start, resource_size(res),
pdev->name);
if (res == NULL)
return -EBUSY;
@@ -2256,7 +2256,7 @@ err1:
 err_alloc:
omap_hsmmc_gpio_free(pdata);
 err:
-   release_mem_region(res->start, res->end - res->start + 1);
+   release_mem_region(res->start, resource_size(res));
return ret;
 }
 
@@ -2293,7 +2293,7 @@ static int omap_hsmmc_remove(struct plat
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res)
-   release_mem_region(res->start, res->end - res->start + 1);
+   release_mem_region(res->start, resource_size(res));
platform_set_drvdata(pdev, NULL);
 
return 0;
_

Patches currently in -mm which might be from c...@laptop.org are

linux-next.patch
arm-samsung-mmc-fix-build-error-when-both-dma-and-pio-mode-selected.patch
omap_hsmmc-remove-unused-state-variable.patch
mmc-at91_mci-add-missing-linux-highmemh-include.patch
mmc-mmc-44-ddr-support.patch
mmc-sdhci-make-consistent-use-of-config_mmc_debug-for-debugging.patch
mmc-at91_mcic-use-resource_size.patch
mmc-atmel-mcic-use-resource-size.patch
mmc-au1xmmcc-use-resource_size.patch
mmc-use-snprintf-not-sprintf.patch
drivers-mmc-host-omapc-use-resource_size.patch
drivers-mmc-host-omap_hsmmcc-use-resource_size.patch

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


+ drivers-mmc-host-omapc-use-resource_size.patch added to -mm tree

2010-08-27 Thread akpm

The patch titled
 drivers/mmc/host/omap.c: use resource_size()
has been added to the -mm tree.  Its filename is
 drivers-mmc-host-omapc-use-resource_size.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: drivers/mmc/host/omap.c: use resource_size()
From: Chris Ball 

Signed-off-by: Chris Ball 
Cc: Jarkko Lavinen 
Cc: Tony Lindgren 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/omap.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff -puN drivers/mmc/host/omap.c~drivers-mmc-host-omapc-use-resource_size 
drivers/mmc/host/omap.c
--- a/drivers/mmc/host/omap.c~drivers-mmc-host-omapc-use-resource_size
+++ a/drivers/mmc/host/omap.c
@@ -1416,7 +1416,7 @@ static int __init mmc_omap_probe(struct 
if (res == NULL || irq < 0)
return -ENXIO;
 
-   res = request_mem_region(res->start, res->end - res->start + 1,
+   res = request_mem_region(res->start, resource_size(res),
 pdev->name);
if (res == NULL)
return -EBUSY;
@@ -1456,7 +1456,7 @@ static int __init mmc_omap_probe(struct 
 
host->irq = irq;
host->phys_base = host->mem_res->start;
-   host->virt_base = ioremap(res->start, res->end - res->start + 1);
+   host->virt_base = ioremap(res->start, resource_size(res));
if (!host->virt_base)
goto err_ioremap;
 
@@ -1513,7 +1513,7 @@ err_free_mmc_host:
 err_ioremap:
kfree(host);
 err_free_mem_region:
-   release_mem_region(res->start, res->end - res->start + 1);
+   release_mem_region(res->start, resource_size(res));
return ret;
 }
 
_

Patches currently in -mm which might be from c...@laptop.org are

linux-next.patch
arm-samsung-mmc-fix-build-error-when-both-dma-and-pio-mode-selected.patch
omap_hsmmc-remove-unused-state-variable.patch
mmc-at91_mci-add-missing-linux-highmemh-include.patch
mmc-mmc-44-ddr-support.patch
mmc-sdhci-make-consistent-use-of-config_mmc_debug-for-debugging.patch
mmc-at91_mcic-use-resource_size.patch
mmc-atmel-mcic-use-resource-size.patch
mmc-au1xmmcc-use-resource_size.patch
mmc-use-snprintf-not-sprintf.patch
drivers-mmc-host-omapc-use-resource_size.patch
drivers-mmc-host-omap_hsmmcc-use-resource_size.patch

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


+ mmc-use-snprintf-not-sprintf.patch added to -mm tree

2010-08-27 Thread akpm

The patch titled
 drivers/mmc/card/block.c: use snprintf not sprintf
has been added to the -mm tree.  Its filename is
 mmc-use-snprintf-not-sprintf.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: drivers/mmc/card/block.c: use snprintf not sprintf
From: JiebingLi 

Fix an issue found by klockwork. Just paranoia.

Signed-off-by: JiebingLi 
Signed-off-by: Alan Cox 
Signed-off-by: Chris Ball 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/card/block.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -puN drivers/mmc/card/block.c~mmc-use-snprintf-not-sprintf 
drivers/mmc/card/block.c
--- a/drivers/mmc/card/block.c~mmc-use-snprintf-not-sprintf
+++ a/drivers/mmc/card/block.c
@@ -620,7 +620,8 @@ static struct mmc_blk_data *mmc_blk_allo
 * messages to tell when the card is present.
 */
 
-   sprintf(md->disk->disk_name, "mmcblk%d", devidx);
+   snprintf(md->disk->disk_name, sizeof(md->disk->disk_name),
+   "mmcblk%d", devidx);
 
blk_queue_logical_block_size(md->queue.queue, 512);
 
_

Patches currently in -mm which might be from jiebing...@intel.com are

mmc-use-snprintf-not-sprintf.patch

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


+ omap_hsmmc-remove-unused-state-variable.patch added to -mm tree

2010-08-27 Thread akpm

The patch titled
 omap_hsmmc: remove unused local `state'
has been added to the -mm tree.  Its filename is
 omap_hsmmc-remove-unused-state-variable.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: omap_hsmmc: remove unused local `state'
From: Sergio Aguirre 

This fixes the following warning:

drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_suspend':
drivers/mmc/host/omap_hsmmc.c:2275: warning: unused variable 'state'

Introduced by commit ID:

  commit 1a13f8fa76c880be41d6b1e6a2b44404bcbfdf9e
  Author: Matt Fleming 
  Date:   Wed May 26 14:42:08 2010 -0700

  mmc: remove the "state" argument to mmc_suspend_host()

The unique usage of this var was removed there, and missed
removing the respective declaration aswell.

Signed-off-by: Sergio Aguirre 
Signed-off-by: Chris Ball 
Acked-by: Matt Fleming 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/omap_hsmmc.c |1 -
 1 file changed, 1 deletion(-)

diff -puN drivers/mmc/host/omap_hsmmc.c~omap_hsmmc-remove-unused-state-variable 
drivers/mmc/host/omap_hsmmc.c
--- a/drivers/mmc/host/omap_hsmmc.c~omap_hsmmc-remove-unused-state-variable
+++ a/drivers/mmc/host/omap_hsmmc.c
@@ -2305,7 +2305,6 @@ static int omap_hsmmc_suspend(struct dev
int ret = 0;
struct platform_device *pdev = to_platform_device(dev);
struct omap_hsmmc_host *host = platform_get_drvdata(pdev);
-   pm_message_t state = PMSG_SUSPEND; /* unused by MMC core */
 
if (host && host->suspended)
return 0;
_

Patches currently in -mm which might be from saagui...@ti.com are

omap_hsmmc-remove-unused-state-variable.patch

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


+ arm-samsung-mmc-fix-build-error-when-both-dma-and-pio-mode-selected.patch added to -mm tree

2010-08-27 Thread akpm

The patch titled
 ARM: SAMSUNG: MMC: fix build error when both DMA and PIO mode selected
has been added to the -mm tree.  Its filename is
 arm-samsung-mmc-fix-build-error-when-both-dma-and-pio-mode-selected.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: ARM: SAMSUNG: MMC: fix build error when both DMA and PIO mode selected
From: Jiri Pinkava 

Date: Tue, 25 May 2010 09:48:58 +0200

[cjb: fix line-wrapped patch]
Signed-off-by: Jiri Pinkava 
Signed-off-by: Chris Ball 
Cc: Matt Fleming 
Cc: Russell King 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/s3cmci.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN 
drivers/mmc/host/s3cmci.c~arm-samsung-mmc-fix-build-error-when-both-dma-and-pio-mode-selected
 drivers/mmc/host/s3cmci.c
--- 
a/drivers/mmc/host/s3cmci.c~arm-samsung-mmc-fix-build-error-when-both-dma-and-pio-mode-selected
+++ a/drivers/mmc/host/s3cmci.c
@@ -1600,7 +1600,7 @@ static int __devinit s3cmci_probe(struct
host->pio_active= XFER_NONE;
 
 #ifdef CONFIG_MMC_S3C_PIODMA
-   host->dodma = host->pdata->dma;
+   host->dodma = host->pdata->use_dma;
 #endif
 
host->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
_

Patches currently in -mm which might be from jiri.pink...@vscht.cz are

arm-samsung-mmc-fix-build-error-when-both-dma-and-pio-mode-selected.patch

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


+ mmc-sdhci-make-consistent-use-of-config_mmc_debug-for-debugging.patch added to -mm tree

2010-08-27 Thread akpm

The patch titled
 mmc: sdhci: make consistent use of CONFIG_MMC_DEBUG for "DEBUG"ging
has been added to the -mm tree.  Its filename is
 mmc-sdhci-make-consistent-use-of-config_mmc_debug-for-debugging.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc: sdhci: make consistent use of CONFIG_MMC_DEBUG for "DEBUG"ging
From: "George G. Davis" 

The "6882a8c sdhci: Add better ADMA error reporting" commit added
sdhci_show_adma_error() which is built when DEBUG is defined.  Since we
already have CONFIG_MMC_DEBUG used elsewhere in this driver, may as well
make consistent use of that config knob instead.

Signed-off-by: George G. Davis 
Signed-off-by: Chris Ball 
Cc: Ben Dooks 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/sdhci.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN 
drivers/mmc/host/sdhci.c~mmc-sdhci-make-consistent-use-of-config_mmc_debug-for-debugging
 drivers/mmc/host/sdhci.c
--- 
a/drivers/mmc/host/sdhci.c~mmc-sdhci-make-consistent-use-of-config_mmc_debug-for-debugging
+++ a/drivers/mmc/host/sdhci.c
@@ -1440,7 +1440,7 @@ static void sdhci_cmd_irq(struct sdhci_h
sdhci_finish_command(host);
 }
 
-#ifdef DEBUG
+#ifdef CONFIG_MMC_DEBUG
 static void sdhci_show_adma_error(struct sdhci_host *host)
 {
const char *name = mmc_hostname(host->mmc);
_

Patches currently in -mm which might be from gda...@mvista.com are

mmc-sdhci-make-consistent-use-of-config_mmc_debug-for-debugging.patch

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


+ mmc-au1xmmcc-use-resource_size.patch added to -mm tree

2010-08-27 Thread akpm

The patch titled
 mmc: au1xmmc.c: use resource_size()
has been added to the -mm tree.  Its filename is
 mmc-au1xmmcc-use-resource_size.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc: au1xmmc.c: use resource_size()
From: H Hartley Sweeten 

Use resource_size().

[cjb: rebased patch against Linus]
Signed-off-by: H Hartley Sweeten 
Signed-off-by: Chris Ball 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/au1xmmc.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/mmc/host/au1xmmc.c~mmc-au1xmmcc-use-resource_size 
drivers/mmc/host/au1xmmc.c
--- a/drivers/mmc/host/au1xmmc.c~mmc-au1xmmcc-use-resource_size
+++ a/drivers/mmc/host/au1xmmc.c
@@ -964,7 +964,7 @@ static int __devinit au1xmmc_probe(struc
goto out1;
}
 
-   host->ioarea = request_mem_region(r->start, r->end - r->start + 1,
+   host->ioarea = request_mem_region(r->start, resource_size(r),
   pdev->name);
if (!host->ioarea) {
dev_err(&pdev->dev, "mmio already in use\n");
_

Patches currently in -mm which might be from hswee...@visionengravers.com are

kernelh-add-minmax3-macros.patch
replace-nested-max-min-macros-with-maxmin3-macro.patch
mmc-at91_mcic-use-resource_size.patch
mmc-atmel-mcic-use-resource-size.patch
mmc-au1xmmcc-use-resource_size.patch

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


+ mmc-at91_mcic-use-resource_size.patch added to -mm tree

2010-08-27 Thread akpm

The patch titled
 mmc: at91_mci.c: use resource_size()
has been added to the -mm tree.  Its filename is
 mmc-at91_mcic-use-resource_size.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc: at91_mci.c: use resource_size()
From: H Hartley Sweeten 

Use resource_size().

[cjb: rebased patch against Linus]
Signed-off-by: H Hartley Sweeten 
Signed-off-by: Chris Ball 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/at91_mci.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff -puN drivers/mmc/host/at91_mci.c~mmc-at91_mcic-use-resource_size 
drivers/mmc/host/at91_mci.c
--- a/drivers/mmc/host/at91_mci.c~mmc-at91_mcic-use-resource_size
+++ a/drivers/mmc/host/at91_mci.c
@@ -927,7 +927,7 @@ static int __init at91_mci_probe(struct 
if (!res)
return -ENXIO;
 
-   if (!request_mem_region(res->start, res->end - res->start + 1, 
DRIVER_NAME))
+   if (!request_mem_region(res->start, resource_size(res), DRIVER_NAME))
return -EBUSY;
 
mmc = mmc_alloc_host(sizeof(struct at91mci_host), &pdev->dev);
@@ -1016,7 +1016,7 @@ static int __init at91_mci_probe(struct 
/*
 * Map I/O region
 */
-   host->baseaddr = ioremap(res->start, res->end - res->start + 1);
+   host->baseaddr = ioremap(res->start, resource_size(res));
if (!host->baseaddr) {
ret = -ENOMEM;
goto fail1;
@@ -1092,7 +1092,7 @@ fail4b:
 fail5:
mmc_free_host(mmc);
 fail6:
-   release_mem_region(res->start, res->end - res->start + 1);
+   release_mem_region(res->start, resource_size(res));
dev_err(&pdev->dev, "probe failed, err %d\n", ret);
return ret;
 }
@@ -1137,7 +1137,7 @@ static int __exit at91_mci_remove(struct
 
iounmap(host->baseaddr);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   release_mem_region(res->start, res->end - res->start + 1);
+   release_mem_region(res->start, resource_size(res));
 
mmc_free_host(mmc);
platform_set_drvdata(pdev, NULL);
_

Patches currently in -mm which might be from hswee...@visionengravers.com are

kernelh-add-minmax3-macros.patch
replace-nested-max-min-macros-with-maxmin3-macro.patch
mmc-at91_mcic-use-resource_size.patch
mmc-atmel-mcic-use-resource-size.patch
mmc-au1xmmcc-use-resource_size.patch

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


+ mmc-atmel-mcic-use-resource-size.patch added to -mm tree

2010-08-27 Thread akpm

The patch titled
 mmc: atmel-mci.c: use resource size()
has been added to the -mm tree.  Its filename is
 mmc-atmel-mcic-use-resource-size.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc: atmel-mci.c: use resource size()
From: H Hartley Sweeten 

Use resource_size().

[cjb: rebased patch against Linus]
Signed-off-by: H Hartley Sweeten 
Signed-off-by: Chris Ball 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/atmel-mci.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/mmc/host/atmel-mci.c~mmc-atmel-mcic-use-resource-size 
drivers/mmc/host/atmel-mci.c
--- a/drivers/mmc/host/atmel-mci.c~mmc-atmel-mcic-use-resource-size
+++ a/drivers/mmc/host/atmel-mci.c
@@ -1777,7 +1777,7 @@ static int __init atmci_probe(struct pla
}
 
ret = -ENOMEM;
-   host->regs = ioremap(regs->start, regs->end - regs->start + 1);
+   host->regs = ioremap(regs->start, resource_size(regs));
if (!host->regs)
goto err_ioremap;
 
_

Patches currently in -mm which might be from hswee...@visionengravers.com are

kernelh-add-minmax3-macros.patch
replace-nested-max-min-macros-with-maxmin3-macro.patch
mmc-at91_mcic-use-resource_size.patch
mmc-atmel-mcic-use-resource-size.patch
mmc-au1xmmcc-use-resource_size.patch

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


+ mmc-add-support-for-the-marvell-platform-sdhci-controller.patch added to -mm tree

2010-08-25 Thread akpm

The patch titled
 mmx: add support for the Marvell platform SDHCI controller
has been added to the -mm tree.  Its filename is
 mmc-add-support-for-the-marvell-platform-sdhci-controller.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmx: add support for the Marvell platform SDHCI controller
From: Saeed Bishara 

Implement a driver for the platfrom SDHCI controllers that is found on
some of Marvell's SoC's.

Signed-off-by: Saeed Bishara 
Cc: Matt Fleming 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/Kconfig|   12 +
 drivers/mmc/host/Makefile   |1 
 drivers/mmc/host/sdhci-mv.c |  243 ++
 3 files changed, 256 insertions(+)

diff -puN 
drivers/mmc/host/Kconfig~mmc-add-support-for-the-marvell-platform-sdhci-controller
 drivers/mmc/host/Kconfig
--- 
a/drivers/mmc/host/Kconfig~mmc-add-support-for-the-marvell-platform-sdhci-controller
+++ a/drivers/mmc/host/Kconfig
@@ -130,6 +130,18 @@ config MMC_SDHCI_CNS3XXX
 
  If unsure, say N.
 
+config MMC_SDHCI_MV
+   tristate "SDHCI support on Marvell's soc"
+   depends on MMC_SDHCI
+   select MMC_SDHCI_IO_ACCESSORS
+   help
+ This selects the Secure Digital Host Controller Interface in
+ Marvell's SoC controllers.
+
+ If you have a controller with this interface, say Y or M here.
+
+ If unsure, say N.
+
 config MMC_SDHCI_S3C
tristate "SDHCI support on Samsung S3C SoC"
depends on MMC_SDHCI && PLAT_SAMSUNG
diff -puN 
drivers/mmc/host/Makefile~mmc-add-support-for-the-marvell-platform-sdhci-controller
 drivers/mmc/host/Makefile
--- 
a/drivers/mmc/host/Makefile~mmc-add-support-for-the-marvell-platform-sdhci-controller
+++ a/drivers/mmc/host/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_MMC_PXA) += pxamci.o
 obj-$(CONFIG_MMC_IMX)  += imxmmc.o
 obj-$(CONFIG_MMC_MXC)  += mxcmmc.o
 obj-$(CONFIG_MMC_SDHCI)+= sdhci.o
+obj-$(CONFIG_MMC_SDHCI_MV) += sdhci-mv.o
 obj-$(CONFIG_MMC_SDHCI_PCI)+= sdhci-pci.o
 obj-$(CONFIG_MMC_SDHCI_S3C)+= sdhci-s3c.o
 obj-$(CONFIG_MMC_SDHCI_SPEAR)  += sdhci-spear.o
diff -puN /dev/null drivers/mmc/host/sdhci-mv.c
--- /dev/null
+++ a/drivers/mmc/host/sdhci-mv.c
@@ -0,0 +1,243 @@
+/*
+ * sdhci-mv.c Support for SDHCI platform devices
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* Supports:
+ * SDHCI platform devices found on Marvell SoC's
+ *
+ * Based on  sdhci-pltfm.c
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "sdhci.h"
+
+struct sdhci_mv_host {
+#if defined(CONFIG_HAVE_CLK)
+   struct clk  *clk;
+#endif
+};
+
+/*\
+ *   *
+ * SDHCI core callbacks  *
+ *   *
+\*/
+static u16 mv_readw(struct sdhci_host *host, int reg)
+{
+   u16 ret;
+
+   switch (reg) {
+   case SDHCI_HOST_VERSION:
+   case SDHCI_SLOT_INT_STATUS:
+   /* those registers don't exist */
+   return 0;
+   default:
+   ret = readw(host->ioaddr + reg);
+   }
+   return ret;
+}
+
+static u32 mv_readl(struct sdhci_host *host, int reg)
+{
+   u32 ret;
+
+   switch (reg) {
+   case SDHCI_CAPABILITIES:
+   ret = readl(host->ioaddr + reg);
+   /* Mask the support for 3.0V */
+   ret &= ~SDHCI_CAN_VDD_300;
+   break;
+   default:
+   ret = readl(host->ioaddr + reg);
+ 

+ tmio_mmc-dont-clear-unhandled-pending-interrupts.patch added to -mm tree

2010-08-25 Thread akpm

The patch titled
 tmio_mmc: don't clear unhandled pending interrupts
has been added to the -mm tree.  Its filename is
 tmio_mmc-dont-clear-unhandled-pending-interrupts.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: tmio_mmc: don't clear unhandled pending interrupts
From: Yusuke Goda 

Previously, it was possible for ack_mmc_irqs() to clear pending interrupt
bits in the CTL_STATUS register, even though the interrupt handler had not
been called.  This was because of a race that existed when doing a
read-modify-write sequence on CTL_STATUS.  After the read step in this
sequence, if an interrupt occurred (causing one of the bits in CTL_STATUS
to be set) the write step would inadvertently clear it.

This patch eliminates this race by only writing to CTL_STATUS and clearing
the interrupts that were passed as an argument to ack_mmc_irqs()."

[m...@console-pimps.org: rewrote changelog]
Signed-off-by: Yusuke Goda 
Cc: Magnus Damm 
Cc: Matt Fleming 
Cc: Ian Molton 
Cc: Samuel Ortiz 
Cc: Paul Mundt 
Cc: 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/tmio_mmc.h |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff -puN 
drivers/mmc/host/tmio_mmc.h~tmio_mmc-dont-clear-unhandled-pending-interrupts 
drivers/mmc/host/tmio_mmc.h
--- 
a/drivers/mmc/host/tmio_mmc.h~tmio_mmc-dont-clear-unhandled-pending-interrupts
+++ a/drivers/mmc/host/tmio_mmc.h
@@ -82,10 +82,7 @@
 
 #define ack_mmc_irqs(host, i) \
do { \
-   u32 mask;\
-   mask  = sd_ctrl_read32((host), CTL_STATUS); \
-   mask &= ~((i) & TMIO_MASK_IRQ); \
-   sd_ctrl_write32((host), CTL_STATUS, mask); \
+   sd_ctrl_write32((host), CTL_STATUS, ~(i)); \
} while (0)
 
 
_

Patches currently in -mm which might be from yusuke.goda...@renesas.com are

tmio_mmc-dont-clear-unhandled-pending-interrupts.patch
tmio_mmc-revise-a-limit-of-the-data-size.patch
tmio_mmc-revise-a-limit-of-the-data-size-fix.patch

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


+ mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors-update.patch added to -mm tree

2010-08-23 Thread akpm

The patch titled
 mmc: add config and runtime option for number of mmcblk minors
has been added to the -mm tree.  Its filename is
 mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors-update.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc: add config and runtime option for number of mmcblk minors
From: Olof Johansson 

Changes since v1:
* Runtime override of config default
* Better help text
* DIV_ROUND_UP for max_devices calculation
* Clarify mmcblk device count limitations

Changes since v2 based on feedback from Mandeep Baines:
* DIV_ROUND_UP is doing the wrong thing, we'll end up using
  the last fractional range of minors which we shouldn't.
* Documentation/devices.txt update
* No need to compute max_devices twice, just do it at runtime.
* Permission fix for the module_param -- it's readonly.

Signed-off-by: Olof Johansson 
Cc: Mandeep Baines 
Cc: 
Signed-off-by: Andrew Morton 
---

 Documentation/devices.txt |6 ++
 drivers/mmc/card/block.c  |   10 +-
 2 files changed, 11 insertions(+), 5 deletions(-)

diff -puN 
Documentation/devices.txt~mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors-update
 Documentation/devices.txt
--- 
a/Documentation/devices.txt~mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors-update
+++ a/Documentation/devices.txt
@@ -2519,6 +2519,12 @@ Your cooperation is appreciated.
  8 = /dev/mmcblk1  Second SD/MMC card
...
 
+   The start of next SD/MMC card can be configured with
+   CONFIG_MMC_BLOCK_MINORS, or overridden at boot/modprobe
+   time using the mmcblk.perdev_minors option. That would
+   bump the offset between each card to be the configured
+   value instead of the default 8.
+
 179 char   CCube DVXChip-based PCI products
  0 = /dev/dvxirq0  First DVX device
  1 = /dev/dvxirq1  Second DVX device
diff -puN 
drivers/mmc/card/block.c~mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors-update
 drivers/mmc/card/block.c
--- 
a/drivers/mmc/card/block.c~mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors-update
+++ a/drivers/mmc/card/block.c
@@ -60,7 +60,7 @@ static int perdev_minors = CONFIG_MMC_BL
  * We've only got one major, so number of mmcblk devices is
  * limited to 256 / number of minors per device.
  */
-static int max_devices = DIV_ROUND_UP(256, CONFIG_MMC_BLOCK_MINORS);
+static int max_devices;
 
 /* 256 minors, so at most 256 separate devices */
 static DECLARE_BITMAP(dev_use, 256);
@@ -79,7 +79,7 @@ struct mmc_blk_data {
 
 static DEFINE_MUTEX(open_lock);
 
-module_param(perdev_minors, int, 0644);
+module_param(perdev_minors, int, 0444);
 MODULE_PARM_DESC(perdev_minors, "Minors numbers to allocate per device");
 
 static struct mmc_blk_data *mmc_blk_get(struct gendisk *disk)
@@ -782,10 +782,10 @@ static int __init mmc_blk_init(void)
 {
int res;
 
-   if (perdev_minors != CONFIG_MMC_BLOCK_MINORS) {
+   if (perdev_minors != CONFIG_MMC_BLOCK_MINORS)
pr_info("mmcblk: using %d minors per device\n", perdev_minors);
-   max_devices = DIV_ROUND_UP(256, perdev_minors);
-   }
+
+   max_devices = 256 / perdev_minors;
 
res = register_blkdev(MMC_BLOCK_MAJOR, "mmc");
if (res)
_

Patches currently in -mm which might be from o...@lixom.net are

linux-next.patch
mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors.patch
mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors-update.patch

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


+ mmc-mmc-44-ddr-support.patch added to -mm tree

2010-08-23 Thread akpm

The patch titled
 mmc: MMC 4.4 DDR support
has been added to the -mm tree.  Its filename is
 mmc-mmc-44-ddr-support.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc: MMC 4.4 DDR support
From: Hanumath Prasad 

Add support for Dual Data Rate MMC cards as defined in the 4.4
specification.

Signed-off-by: Hanumath Prasad 
Acked-by: Linus Walleij 
Cc: 
Cc: Chris Ball 
Cc: Matt Fleming 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/card/block.c |   10 +++---
 drivers/mmc/core/mmc.c   |   37 +++--
 include/linux/mmc/card.h |5 +
 include/linux/mmc/core.h |1 +
 include/linux/mmc/host.h |4 
 include/linux/mmc/mmc.h  |   11 +--
 6 files changed, 61 insertions(+), 7 deletions(-)

diff -puN drivers/mmc/card/block.c~mmc-mmc-44-ddr-support 
drivers/mmc/card/block.c
--- a/drivers/mmc/card/block.c~mmc-mmc-44-ddr-support
+++ a/drivers/mmc/card/block.c
@@ -388,7 +388,8 @@ static int mmc_blk_issue_rw_rq(struct mm
readcmd = MMC_READ_SINGLE_BLOCK;
writecmd = MMC_WRITE_BLOCK;
}
-
+   if (mmc_card_ddr_mode(card))
+   brq.data.flags |= MMC_DDR_MODE;
if (rq_data_dir(req) == READ) {
brq.cmd.opcode = readcmd;
brq.data.flags |= MMC_DATA_READ;
@@ -669,8 +670,11 @@ mmc_blk_set_blksize(struct mmc_blk_data 
struct mmc_command cmd;
int err;
 
-   /* Block-addressed cards ignore MMC_SET_BLOCKLEN. */
-   if (mmc_card_blockaddr(card))
+   /*
+* Block-addressed and ddr mode supported cards
+* ignore MMC_SET_BLOCKLEN.
+*/
+   if (mmc_card_blockaddr(card) || mmc_card_ddr_mode(card))
return 0;
 
mmc_claim_host(card->host);
diff -puN drivers/mmc/core/mmc.c~mmc-mmc-44-ddr-support drivers/mmc/core/mmc.c
--- a/drivers/mmc/core/mmc.c~mmc-mmc-44-ddr-support
+++ a/drivers/mmc/core/mmc.c
@@ -258,6 +258,21 @@ static int mmc_read_ext_csd(struct mmc_c
}
 
switch (ext_csd[EXT_CSD_CARD_TYPE] & EXT_CSD_CARD_TYPE_MASK) {
+   case EXT_CSD_CARD_TYPE_DDR_52 | EXT_CSD_CARD_TYPE_52 |
+EXT_CSD_CARD_TYPE_26:
+   card->ext_csd.hs_max_dtr = 5200;
+   card->ext_csd.card_type = EXT_CSD_CARD_TYPE_DDR_52;
+   break;
+   case EXT_CSD_CARD_TYPE_DDR_1_2V | EXT_CSD_CARD_TYPE_52 |
+EXT_CSD_CARD_TYPE_26:
+   card->ext_csd.hs_max_dtr = 5200;
+   card->ext_csd.card_type = EXT_CSD_CARD_TYPE_DDR_1_2V;
+   break;
+   case EXT_CSD_CARD_TYPE_DDR_1_8V | EXT_CSD_CARD_TYPE_52 |
+EXT_CSD_CARD_TYPE_26:
+   card->ext_csd.hs_max_dtr = 5200;
+   card->ext_csd.card_type = EXT_CSD_CARD_TYPE_DDR_1_8V;
+   break;
case EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26:
card->ext_csd.hs_max_dtr = 5200;
break;
@@ -503,6 +518,18 @@ static int mmc_init_card(struct mmc_host
mmc_set_clock(host, max_dtr);
 
/*
+* Activate DDR50 mode (if supported).
+*/
+   if (mmc_card_highspeed(card)) {
+   if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_8V)
+   && (host->caps & (MMC_CAP_1_8V_DDR)))
+   mmc_card_set_ddr_mode(card);
+   else if ((card->ext_csd.card_type & EXT_CSD_CARD_TYPE_DDR_1_2V)
+   && (host->caps & (MMC_CAP_1_2V_DDR)))
+   mmc_card_set_ddr_mode(card);
+   }
+
+   /*
 * Activate wide bus (if supported).
 */
if ((card->csd.mmca_vsn >= CSD_SPEC_VER_4) &&
@@ -510,10 +537,16 @@ static int mmc_init_card(struct mmc_host
unsigned ext_csd_bit, bus_width;
 
if (host->caps & MMC_CAP_8_BIT_DATA) {
-   ext_csd_bit = EXT_CSD_BUS_WIDTH_8;
+   if (mmc_card_ddr_mode(card))
+   ext_csd_bit = EXT_CSD_DDR_BUS_WIDTH_8;
+   else
+   ext_csd_bit = EXT_CSD_BUS_WIDTH_8;
bus_width = MMC_BUS_WIDTH_8;
} else {
-   ext_csd_bit = EXT_CSD_BUS_WIDTH_4;
+

+ mmc-rename-dev_to_mmc_card-to-mmc_dev_to_card.patch added to -mm tree

2010-08-23 Thread akpm

The patch titled
 mmc: rename dev_to_mmc_card() to mmc_dev_to_card()
has been added to the -mm tree.  Its filename is
 mmc-rename-dev_to_mmc_card-to-mmc_dev_to_card.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc: rename dev_to_mmc_card() to mmc_dev_to_card()
From: Andy Shevchenko 

Global symbols should use their subsystem name in a prefixed fashion.

Signed-off-by: Andy Shevchenko 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/card/mmc_test.c |2 +-
 drivers/mmc/core/bus.c  |   14 +++---
 drivers/mmc/core/bus.h  |2 +-
 include/linux/mmc/card.h|2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

diff -puN 
drivers/mmc/card/mmc_test.c~mmc-rename-dev_to_mmc_card-to-mmc_dev_to_card 
drivers/mmc/card/mmc_test.c
--- a/drivers/mmc/card/mmc_test.c~mmc-rename-dev_to_mmc_card-to-mmc_dev_to_card
+++ a/drivers/mmc/card/mmc_test.c
@@ -1935,7 +1935,7 @@ static ssize_t mmc_test_show(struct devi
 static ssize_t mmc_test_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
 {
-   struct mmc_card *card = dev_to_mmc_card(dev);
+   struct mmc_card *card = mmc_dev_to_card(dev);
struct mmc_test_card *test;
int testcase;
 
diff -puN drivers/mmc/core/bus.c~mmc-rename-dev_to_mmc_card-to-mmc_dev_to_card 
drivers/mmc/core/bus.c
--- a/drivers/mmc/core/bus.c~mmc-rename-dev_to_mmc_card-to-mmc_dev_to_card
+++ a/drivers/mmc/core/bus.c
@@ -27,7 +27,7 @@
 static ssize_t mmc_type_show(struct device *dev,
struct device_attribute *attr, char *buf)
 {
-   struct mmc_card *card = dev_to_mmc_card(dev);
+   struct mmc_card *card = mmc_dev_to_card(dev);
 
switch (card->type) {
case MMC_TYPE_MMC:
@@ -61,7 +61,7 @@ static int mmc_bus_match(struct device *
 static int
 mmc_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
 {
-   struct mmc_card *card = dev_to_mmc_card(dev);
+   struct mmc_card *card = mmc_dev_to_card(dev);
const char *type;
int retval = 0;
 
@@ -104,7 +104,7 @@ mmc_bus_uevent(struct device *dev, struc
 static int mmc_bus_probe(struct device *dev)
 {
struct mmc_driver *drv = to_mmc_driver(dev->driver);
-   struct mmc_card *card = dev_to_mmc_card(dev);
+   struct mmc_card *card = mmc_dev_to_card(dev);
 
return drv->probe(card);
 }
@@ -112,7 +112,7 @@ static int mmc_bus_probe(struct device *
 static int mmc_bus_remove(struct device *dev)
 {
struct mmc_driver *drv = to_mmc_driver(dev->driver);
-   struct mmc_card *card = dev_to_mmc_card(dev);
+   struct mmc_card *card = mmc_dev_to_card(dev);
 
drv->remove(card);
 
@@ -122,7 +122,7 @@ static int mmc_bus_remove(struct device 
 static int mmc_bus_suspend(struct device *dev, pm_message_t state)
 {
struct mmc_driver *drv = to_mmc_driver(dev->driver);
-   struct mmc_card *card = dev_to_mmc_card(dev);
+   struct mmc_card *card = mmc_dev_to_card(dev);
int ret = 0;
 
if (dev->driver && drv->suspend)
@@ -133,7 +133,7 @@ static int mmc_bus_suspend(struct device
 static int mmc_bus_resume(struct device *dev)
 {
struct mmc_driver *drv = to_mmc_driver(dev->driver);
-   struct mmc_card *card = dev_to_mmc_card(dev);
+   struct mmc_card *card = mmc_dev_to_card(dev);
int ret = 0;
 
if (dev->driver && drv->resume)
@@ -188,7 +188,7 @@ EXPORT_SYMBOL(mmc_unregister_driver);
 
 static void mmc_release_card(struct device *dev)
 {
-   struct mmc_card *card = dev_to_mmc_card(dev);
+   struct mmc_card *card = mmc_dev_to_card(dev);
 
sdio_free_common_cis(card);
 
diff -puN drivers/mmc/core/bus.h~mmc-rename-dev_to_mmc_card-to-mmc_dev_to_card 
drivers/mmc/core/bus.h
--- a/drivers/mmc/core/bus.h~mmc-rename-dev_to_mmc_card-to-mmc_dev_to_card
+++ a/drivers/mmc/core/bus.h
@@ -14,7 +14,7 @@
 #define MMC_DEV_ATTR(name, fmt, args...)   
\
 static ssize_t mmc_##name##_show (struct device *dev, struct device_attribute 
*attr, char *buf)\
 {  
\
-   struct mmc_card *card = dev_to_mmc_card(dev);   
\
+   struct mmc_card *card = mmc_dev_to_card(dev

+ sdhci-support-mmc_cap_mmc_highspeed.patch added to -mm tree

2010-08-23 Thread akpm

The patch titled
 sdhci: support MMC_CAP_MMC_HIGHSPEED
has been added to the -mm tree.  Its filename is
 sdhci-support-mmc_cap_mmc_highspeed.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: sdhci: support MMC_CAP_MMC_HIGHSPEED
From: zhangfei gao 

With MMC_CAP_MMC_HIGHSPEED, mmc & emmc could negotiate up to 50M,
otherwise only 25M could be reached.

Signed-off-by: Zhangfei Gao 
Acked-by: Matt Fleming  
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/sdhci.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/mmc/host/sdhci.c~sdhci-support-mmc_cap_mmc_highspeed 
drivers/mmc/host/sdhci.c
--- a/drivers/mmc/host/sdhci.c~sdhci-support-mmc_cap_mmc_highspeed
+++ a/drivers/mmc/host/sdhci.c
@@ -1824,7 +1824,7 @@ int sdhci_add_host(struct sdhci_host *ho
mmc->caps |= MMC_CAP_4_BIT_DATA;
 
if (caps & SDHCI_CAN_DO_HISPD)
-   mmc->caps |= MMC_CAP_SD_HIGHSPEED;
+   mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
 
if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION)
mmc->caps |= MMC_CAP_NEEDS_POLL;
_

Patches currently in -mm which might be from zhangfei@gmail.com are

sdhci-support-mmc_cap_mmc_highspeed.patch

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


+ mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors.patch added to -mm tree

2010-08-19 Thread akpm

The patch titled
 mmc: add config and runtime option for number of mmcblk minors
has been added to the -mm tree.  Its filename is
 mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc: add config and runtime option for number of mmcblk minors
From: Olof Johansson 

The old limit of number of minor numbers per mmcblk device was hardcoded
at 8.  This isn't enough for some of the more elaborate partitioning
schemes, for example those used by Chrome OS.

Since there might be a bunch of systems out there with static /dev
contents that relies on the old numbering scheme, let's make it a
build-time option with the default set to the previous 8.

Also provide a boot/modprobe-time parameter to override the config
default: mmcblk.perdev_minors.

Signed-off-by: Olof Johansson 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/card/Kconfig |   17 +++
 drivers/mmc/card/block.c |   41 +++--
 2 files changed, 47 insertions(+), 11 deletions(-)

diff -puN 
drivers/mmc/card/Kconfig~mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors
 drivers/mmc/card/Kconfig
--- 
a/drivers/mmc/card/Kconfig~mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors
+++ a/drivers/mmc/card/Kconfig
@@ -14,6 +14,23 @@ config MMC_BLOCK
  mount the filesystem. Almost everyone wishing MMC support
  should say Y or M here.
 
+config MMC_BLOCK_MINORS
+   int "Number of minors per block device"
+   range 4 256
+   default 8
+   help
+ Number of minors per block device. One is needed for every
+ partition on the disk (plus one for the whole disk).
+
+ Number of total MMC minors available is 256, so your number
+ of supported block devices will be limited to 256 divided
+ by this number.
+
+ Default is 8 to be backwards compatible with previous
+ hardwired device numbering.
+
+ If unsure, say 8 here.
+
 config MMC_BLOCK_BOUNCE
bool "Use bounce buffer for simple hosts"
depends on MMC_BLOCK
diff -puN 
drivers/mmc/card/block.c~mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors
 drivers/mmc/card/block.c
--- 
a/drivers/mmc/card/block.c~mmc-add-config-and-runtime-option-for-number-of-mmcblk-minors
+++ a/drivers/mmc/card/block.c
@@ -44,14 +44,26 @@
 #include "queue.h"
 
 MODULE_ALIAS("mmc:block");
+#ifdef MODULE_PARAM_PREFIX
+#undef MODULE_PARAM_PREFIX
+#endif
+#define MODULE_PARAM_PREFIX "mmcblk."
+
+
+/*
+ * The defaults come from config options but can be overriden by module
+ * or bootarg options.
+ */
+static int perdev_minors = CONFIG_MMC_BLOCK_MINORS;
 
 /*
- * max 8 partitions per card
+ * We've only got one major, so number of mmcblk devices is
+ * limited to 256 / number of minors per device.
  */
-#define MMC_SHIFT  3
-#define MMC_NUM_MINORS (256 >> MMC_SHIFT)
+static int max_devices = DIV_ROUND_UP(256, CONFIG_MMC_BLOCK_MINORS);
 
-static DECLARE_BITMAP(dev_use, MMC_NUM_MINORS);
+/* 256 minors, so at most 256 separate devices */
+static DECLARE_BITMAP(dev_use, 256);
 
 /*
  * There is one mmc_blk_data per slot.
@@ -67,6 +79,9 @@ struct mmc_blk_data {
 
 static DEFINE_MUTEX(open_lock);
 
+module_param(perdev_minors, int, 0644);
+MODULE_PARM_DESC(perdev_minors, "Minors numbers to allocate per device");
+
 static struct mmc_blk_data *mmc_blk_get(struct gendisk *disk)
 {
struct mmc_blk_data *md;
@@ -88,10 +103,10 @@ static void mmc_blk_put(struct mmc_blk_d
md->usage--;
if (md->usage == 0) {
int devmaj = MAJOR(disk_devt(md->disk));
-   int devidx = MINOR(disk_devt(md->disk)) >> MMC_SHIFT;
+   int devidx = MINOR(disk_devt(md->disk)) / perdev_minors;
 
if (!devmaj)
-   devidx = md->disk->first_minor >> MMC_SHIFT;
+   devidx = md->disk->first_minor / perdev_minors;
 
blk_cleanup_queue(md->queue.queue);
 
@@ -567,8 +582,8 @@ static struct mmc_blk_data *mmc_blk_allo
struct mmc_blk_data *md;
int devidx, ret;
 
-   devidx = find_first_zero_bit(dev_use, MMC_NUM_MINORS);
-   if (devidx >= MMC_NUM_MINORS)
+   devidx = find_first_zero_bit(dev_use, max_devices);
+   if (de

+ mmc-avoid-getting-cid-on-sdio-only-cards.patch added to -mm tree

2010-08-19 Thread akpm

The patch titled
 mmc: avoid getting CID on SDIO-only cards
has been added to the -mm tree.  Its filename is
 mmc-avoid-getting-cid-on-sdio-only-cards.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc: avoid getting CID on SDIO-only cards
From: David Vrabel 

The introduction of support for SD combo cards breaks the initialization
of all CSR SDIO chips.  The GO_IDLE (CMD0) in mmc_sd_get_cid() causes CSR
chips to be reset (this is non-standard behavior).

When initializing an SDIO card check for a combo card by using the memory
present bit in the R4 response to IO_SEND_OP_COND (CMD5).  This avoids the
call to mmc_sd_get_cid() on an SDIO-only card.

Signed-off-by: David Vrabel 
Acked-by: Michal Mirolaw 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/core/sdio.c  |5 ++---
 include/linux/mmc/sdio.h |2 ++
 2 files changed, 4 insertions(+), 3 deletions(-)

diff -puN drivers/mmc/core/sdio.c~mmc-avoid-getting-cid-on-sdio-only-cards 
drivers/mmc/core/sdio.c
--- a/drivers/mmc/core/sdio.c~mmc-avoid-getting-cid-on-sdio-only-cards
+++ a/drivers/mmc/core/sdio.c
@@ -362,9 +362,8 @@ static int mmc_sdio_init_card(struct mmc
goto err;
}
 
-   err = mmc_sd_get_cid(host, host->ocr & ocr, card->raw_cid);
-
-   if (!err) {
+   if (ocr & R4_MEMORY_PRESENT
+   && mmc_sd_get_cid(host, host->ocr & ocr, card->raw_cid) == 0) {
card->type = MMC_TYPE_SD_COMBO;
 
if (oldcard && (oldcard->type != MMC_TYPE_SD_COMBO ||
diff -puN include/linux/mmc/sdio.h~mmc-avoid-getting-cid-on-sdio-only-cards 
include/linux/mmc/sdio.h
--- a/include/linux/mmc/sdio.h~mmc-avoid-getting-cid-on-sdio-only-cards
+++ a/include/linux/mmc/sdio.h
@@ -38,6 +38,8 @@
  *  [8:0] Byte/block count
  */
 
+#define R4_MEMORY_PRESENT (1 << 27)
+
 /*
   SDIO status in R5
   Type
_

Patches currently in -mm which might be from david.vra...@csr.com are

mmc-avoid-getting-cid-on-sdio-only-cards.patch
linux-next.patch

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


+ mmc-make-dev_to_mmc_card-macro-public.patch added to -mm tree

2010-08-19 Thread akpm

The patch titled
 mmc: make dev_to_mmc_card() macro public
has been added to the -mm tree.  Its filename is
 mmc-make-dev_to_mmc_card-macro-public.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc: make dev_to_mmc_card() macro public
From: Andy Shevchenko 

Conversion from struct device to struct mmc_card is used more than in one
place.  Due to this it's better to have public macro for such thing.

Signed-off-by: Andy Shevchenko 
Cc: Adrian Hunter 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/card/mmc_test.c |4 +---
 drivers/mmc/core/bus.c  |1 -
 drivers/mmc/core/bus.h  |2 +-
 include/linux/mmc/card.h|2 ++
 4 files changed, 4 insertions(+), 5 deletions(-)

diff -puN drivers/mmc/card/mmc_test.c~mmc-make-dev_to_mmc_card-macro-public 
drivers/mmc/card/mmc_test.c
--- a/drivers/mmc/card/mmc_test.c~mmc-make-dev_to_mmc_card-macro-public
+++ a/drivers/mmc/card/mmc_test.c
@@ -1935,12 +1935,10 @@ static ssize_t mmc_test_show(struct devi
 static ssize_t mmc_test_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
 {
-   struct mmc_card *card;
+   struct mmc_card *card = dev_to_mmc_card(dev);
struct mmc_test_card *test;
int testcase;
 
-   card = container_of(dev, struct mmc_card, dev);
-
testcase = simple_strtol(buf, NULL, 10);
 
test = kzalloc(sizeof(struct mmc_test_card), GFP_KERNEL);
diff -puN drivers/mmc/core/bus.c~mmc-make-dev_to_mmc_card-macro-public 
drivers/mmc/core/bus.c
--- a/drivers/mmc/core/bus.c~mmc-make-dev_to_mmc_card-macro-public
+++ a/drivers/mmc/core/bus.c
@@ -22,7 +22,6 @@
 #include "sdio_cis.h"
 #include "bus.h"
 
-#define dev_to_mmc_card(d) container_of(d, struct mmc_card, dev)
 #define to_mmc_driver(d)   container_of(d, struct mmc_driver, drv)
 
 static ssize_t mmc_type_show(struct device *dev,
diff -puN drivers/mmc/core/bus.h~mmc-make-dev_to_mmc_card-macro-public 
drivers/mmc/core/bus.h
--- a/drivers/mmc/core/bus.h~mmc-make-dev_to_mmc_card-macro-public
+++ a/drivers/mmc/core/bus.h
@@ -14,7 +14,7 @@
 #define MMC_DEV_ATTR(name, fmt, args...)   
\
 static ssize_t mmc_##name##_show (struct device *dev, struct device_attribute 
*attr, char *buf)\
 {  
\
-   struct mmc_card *card = container_of(dev, struct mmc_card, dev);
\
+   struct mmc_card *card = dev_to_mmc_card(dev);   
\
return sprintf(buf, fmt, args); 
\
 }  
\
 static DEVICE_ATTR(name, S_IRUGO, mmc_##name##_show, NULL)
diff -puN include/linux/mmc/card.h~mmc-make-dev_to_mmc_card-macro-public 
include/linux/mmc/card.h
--- a/include/linux/mmc/card.h~mmc-make-dev_to_mmc_card-macro-public
+++ a/include/linux/mmc/card.h
@@ -173,6 +173,8 @@ static inline int mmc_blksz_for_byte_mod
 #define mmc_card_name(c)   ((c)->cid.prod_name)
 #define mmc_card_id(c) (dev_name(&(c)->dev))
 
+#define dev_to_mmc_card(d) container_of(d, struct mmc_card, dev)
+
 #define mmc_list_to_card(l)container_of(l, struct mmc_card, node)
 #define mmc_get_drvdata(c) dev_get_drvdata(&(c)->dev)
 #define mmc_set_drvdata(c,d)   dev_set_drvdata(&(c)->dev, d)
_

Patches currently in -mm which might be from andy.shevche...@gmail.com are

linux-next.patch
mmc-make-dev_to_mmc_card-macro-public.patch

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


[patch 13/20] mmc: avoid getting CID on SDIO-only cards

2010-08-19 Thread akpm
From: David Vrabel 

The introduction of support for SD combo cards breaks the initialization
of all CSR SDIO chips.  The GO_IDLE (CMD0) in mmc_sd_get_cid() causes CSR
chips to be reset (this is non-standard behavior).

When initializing an SDIO card check for a combo card by using the memory
present bit in the R4 response to IO_SEND_OP_COND (CMD5).  This avoids the
call to mmc_sd_get_cid() on an SDIO-only card.

Signed-off-by: David Vrabel 
Cc: Michal Miroslaw 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/core/sdio.c  |8 +---
 include/linux/mmc/sdio.h |2 ++
 2 files changed, 7 insertions(+), 3 deletions(-)

diff -puN drivers/mmc/core/sdio.c~mmc-avoid-getting-cid-on-sdio-only-cards 
drivers/mmc/core/sdio.c
--- a/drivers/mmc/core/sdio.c~mmc-avoid-getting-cid-on-sdio-only-cards
+++ a/drivers/mmc/core/sdio.c
@@ -362,11 +362,13 @@ static int mmc_sdio_init_card(struct mmc
goto err;
}
 
-   err = mmc_sd_get_cid(host, host->ocr & ocr, card->raw_cid);
-
-   if (!err) {
+   if (ocr & R4_MEMORY_PRESENT) {
card->type = MMC_TYPE_SD_COMBO;
 
+   err = mmc_sd_get_cid(host, host->ocr & ocr, card->raw_cid);
+   if (err)
+   goto remove;
+
if (oldcard && (oldcard->type != MMC_TYPE_SD_COMBO ||
memcmp(card->raw_cid, oldcard->raw_cid, 
sizeof(card->raw_cid)) != 0)) {
mmc_remove_card(card);
diff -puN include/linux/mmc/sdio.h~mmc-avoid-getting-cid-on-sdio-only-cards 
include/linux/mmc/sdio.h
--- a/include/linux/mmc/sdio.h~mmc-avoid-getting-cid-on-sdio-only-cards
+++ a/include/linux/mmc/sdio.h
@@ -38,6 +38,8 @@
  *  [8:0] Byte/block count
  */
 
+#define R4_MEMORY_PRESENT (1 << 27)
+
 /*
   SDIO status in R5
   Type
_
--
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


[patch 14/20] drivers/mmc/host/sdhci-s3c.c: use the correct mutex and card detect function

2010-08-19 Thread akpm
From: Kyungmin Park 

There's some merge problem between sdhic core and sdhci-s3c host.  After
mutex is changed to spinlock.  It needs to use use spin lock functions and
use the correct card detection function.

Signed-off-by: Kyungmin Park 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/sdhci-s3c.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff -puN 
drivers/mmc/host/sdhci-s3c.c~drivers-mmc-host-sdhci-s3cc-use-the-correct-mutex-and-card-detect-function
 drivers/mmc/host/sdhci-s3c.c
--- 
a/drivers/mmc/host/sdhci-s3c.c~drivers-mmc-host-sdhci-s3cc-use-the-correct-mutex-and-card-detect-function
+++ a/drivers/mmc/host/sdhci-s3c.c
@@ -242,7 +242,7 @@ static void sdhci_s3c_notify_change(stru
 {
struct sdhci_host *host = platform_get_drvdata(dev);
if (host) {
-   mutex_lock(&host->lock);
+   spin_lock(&host->lock);
if (state) {
dev_dbg(&dev->dev, "card inserted.\n");
host->flags &= ~SDHCI_DEVICE_DEAD;
@@ -252,8 +252,8 @@ static void sdhci_s3c_notify_change(stru
host->flags |= SDHCI_DEVICE_DEAD;
host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
}
-   sdhci_card_detect(host);
-   mutex_unlock(&host->lock);
+   tasklet_schedule(&host->card_tasklet);
+   spin_unlock(&host->lock);
}
 }
 
_
--
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


[patch 11/20] s5pc110: SDHCI-s3c support on s5pc110

2010-08-19 Thread akpm
From: Kyungmin Park 

s5pc110 (aka s5pv210) uses the same SDHCI IP.

Signed-off-by: Kyungmin Park 

Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/Kconfig |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/mmc/host/Kconfig~s5pc110-sdhci-s3c-support-on-s5pc110 
drivers/mmc/host/Kconfig
--- a/drivers/mmc/host/Kconfig~s5pc110-sdhci-s3c-support-on-s5pc110
+++ a/drivers/mmc/host/Kconfig
@@ -132,7 +132,7 @@ config MMC_SDHCI_CNS3XXX
 
 config MMC_SDHCI_S3C
tristate "SDHCI support on Samsung S3C SoC"
-   depends on MMC_SDHCI && (PLAT_S3C24XX || PLAT_S3C64XX)
+   depends on MMC_SDHCI && PLAT_SAMSUNG
help
  This selects the Secure Digital Host Controller Interface (SDHCI)
  often referrered to as the HSMMC block in some of the Samsung S3C
_
--
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


[patch 12/20] sdhci: add no hi-speed bit quirk support

2010-08-19 Thread akpm
From: Kyungmin Park 

Some SDHCI controllers like s5pc110 don't have an HISPD bit in the HOSTCTL
register.

Signed-off-by: Kyungmin Park 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/sdhci.c |3 ++-
 drivers/mmc/host/sdhci.h |2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff -puN drivers/mmc/host/sdhci.c~sdhci-add-no-hi-speed-bit-quirk-support 
drivers/mmc/host/sdhci.c
--- a/drivers/mmc/host/sdhci.c~sdhci-add-no-hi-speed-bit-quirk-support
+++ a/drivers/mmc/host/sdhci.c
@@ -1180,7 +1180,8 @@ static void sdhci_set_ios(struct mmc_hos
else
ctrl &= ~SDHCI_CTRL_4BITBUS;
 
-   if (ios->timing == MMC_TIMING_SD_HS)
+   if (ios->timing == MMC_TIMING_SD_HS &&
+   !(host->quirks & SDHCI_QUIRK_NO_HISPD_BIT))
ctrl |= SDHCI_CTRL_HISPD;
else
ctrl &= ~SDHCI_CTRL_HISPD;
diff -puN drivers/mmc/host/sdhci.h~sdhci-add-no-hi-speed-bit-quirk-support 
drivers/mmc/host/sdhci.h
--- a/drivers/mmc/host/sdhci.h~sdhci-add-no-hi-speed-bit-quirk-support
+++ a/drivers/mmc/host/sdhci.h
@@ -245,6 +245,8 @@ struct sdhci_host {
 #define SDHCI_QUIRK_MISSING_CAPS   (1<<27)
 /* Controller uses Auto CMD12 command to stop the transfer */
 #define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (1<<28)
+/* Controller doesn't have HISPD bit field in HI-SPEED SD card */
+#define SDHCI_QUIRK_NO_HISPD_BIT   (1<<29)
 
int irq;/* Device IRQ */
void __iomem *  ioaddr; /* Mapped address */
_
--
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


[patch 10/20] s5pc110: SDHCI-s3c can override host capabilities

2010-08-19 Thread akpm
From: Kyungmin Park 

Each board can override the default sdhci host capabilities.
Some board has broken features by hardwares and support 8-bit bandwidth.

Signed-off-by: Kyungmin Park 
Cc: 
Signed-off-by: Andrew Morton 
---

 arch/arm/plat-samsung/dev-hsmmc.c  |2 ++
 arch/arm/plat-samsung/dev-hsmmc1.c |2 ++
 arch/arm/plat-samsung/dev-hsmmc2.c |2 ++
 3 files changed, 6 insertions(+)

diff -puN 
arch/arm/plat-samsung/dev-hsmmc.c~s5pc110-sdhci-s3c-can-override-host-capabilities
 arch/arm/plat-samsung/dev-hsmmc.c
--- 
a/arch/arm/plat-samsung/dev-hsmmc.c~s5pc110-sdhci-s3c-can-override-host-capabilities
+++ a/arch/arm/plat-samsung/dev-hsmmc.c
@@ -70,4 +70,6 @@ void s3c_sdhci0_set_platdata(struct s3c_
set->cfg_gpio = pd->cfg_gpio;
if (pd->cfg_card)
set->cfg_card = pd->cfg_card;
+   if (pd->host_caps)
+   set->host_caps = pd->host_caps;
 }
diff -puN 
arch/arm/plat-samsung/dev-hsmmc1.c~s5pc110-sdhci-s3c-can-override-host-capabilities
 arch/arm/plat-samsung/dev-hsmmc1.c
--- 
a/arch/arm/plat-samsung/dev-hsmmc1.c~s5pc110-sdhci-s3c-can-override-host-capabilities
+++ a/arch/arm/plat-samsung/dev-hsmmc1.c
@@ -70,4 +70,6 @@ void s3c_sdhci1_set_platdata(struct s3c_
set->cfg_gpio = pd->cfg_gpio;
if (pd->cfg_card)
set->cfg_card = pd->cfg_card;
+   if (pd->host_caps)
+   set->host_caps = pd->host_caps;
 }
diff -puN 
arch/arm/plat-samsung/dev-hsmmc2.c~s5pc110-sdhci-s3c-can-override-host-capabilities
 arch/arm/plat-samsung/dev-hsmmc2.c
--- 
a/arch/arm/plat-samsung/dev-hsmmc2.c~s5pc110-sdhci-s3c-can-override-host-capabilities
+++ a/arch/arm/plat-samsung/dev-hsmmc2.c
@@ -71,4 +71,6 @@ void s3c_sdhci2_set_platdata(struct s3c_
set->cfg_gpio = pd->cfg_gpio;
if (pd->cfg_card)
set->cfg_card = pd->cfg_card;
+   if (pd->host_caps)
+   set->host_caps = pd->host_caps;
 }
_
--
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


+ drivers-mmc-host-sdhci-s3cc-use-the-correct-mutex-and-card-detect-function.patch added to -mm tree

2010-08-18 Thread akpm

The patch titled
 drivers/mmc/host/sdhci-s3c.c: use the correct mutex and card detect 
function
has been added to the -mm tree.  Its filename is
 
drivers-mmc-host-sdhci-s3cc-use-the-correct-mutex-and-card-detect-function.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: drivers/mmc/host/sdhci-s3c.c: use the correct mutex and card detect 
function
From: Kyungmin Park 

There's some merge problem between sdhic core and sdhci-s3c host.  After
mutex is changed to spinlock.  It needs to use use spin lock functions and
use the correct card detection function.

Signed-off-by: Kyungmin Park 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/sdhci-s3c.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff -puN 
drivers/mmc/host/sdhci-s3c.c~drivers-mmc-host-sdhci-s3cc-use-the-correct-mutex-and-card-detect-function
 drivers/mmc/host/sdhci-s3c.c
--- 
a/drivers/mmc/host/sdhci-s3c.c~drivers-mmc-host-sdhci-s3cc-use-the-correct-mutex-and-card-detect-function
+++ a/drivers/mmc/host/sdhci-s3c.c
@@ -242,7 +242,7 @@ static void sdhci_s3c_notify_change(stru
 {
struct sdhci_host *host = platform_get_drvdata(dev);
if (host) {
-   mutex_lock(&host->lock);
+   spin_lock(&host->lock);
if (state) {
dev_dbg(&dev->dev, "card inserted.\n");
host->flags &= ~SDHCI_DEVICE_DEAD;
@@ -252,8 +252,8 @@ static void sdhci_s3c_notify_change(stru
host->flags |= SDHCI_DEVICE_DEAD;
host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
}
-   sdhci_card_detect(host);
-   mutex_unlock(&host->lock);
+   tasklet_schedule(&host->card_tasklet);
+   spin_unlock(&host->lock);
}
 }
 
_

Patches currently in -mm which might be from kyungmin.p...@samsung.com are

drivers-mmc-host-sdhci-s3cc-use-the-correct-mutex-and-card-detect-function.patch
linux-next.patch
s5pc110-sdhci-s3c-can-override-host-capabilities.patch
s5pc110-sdhci-s3c-support-on-s5pc110.patch
sdhci-add-no-hi-speed-bit-quirk-support.patch
ramoops-use-the-platform-data-structure-instead-of-module-params.patch

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


+ mmc-avoid-getting-cid-on-sdio-only-cards.patch added to -mm tree

2010-08-18 Thread akpm

The patch titled
 mmc: avoid getting CID on SDIO-only cards
has been added to the -mm tree.  Its filename is
 mmc-avoid-getting-cid-on-sdio-only-cards.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc: avoid getting CID on SDIO-only cards
From: David Vrabel 

The introduction of support for SD combo cards breaks the initialization
of all CSR SDIO chips.  The GO_IDLE (CMD0) in mmc_sd_get_cid() causes CSR
chips to be reset (this is non-standard behavior).

When initializing an SDIO card check for a combo card by using the memory
present bit in the R4 response to IO_SEND_OP_COND (CMD5).  This avoids the
call to mmc_sd_get_cid() on an SDIO-only card.

Signed-off-by: David Vrabel 
Cc: Michal Miroslaw 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/core/sdio.c  |8 +---
 include/linux/mmc/sdio.h |2 ++
 2 files changed, 7 insertions(+), 3 deletions(-)

diff -puN drivers/mmc/core/sdio.c~mmc-avoid-getting-cid-on-sdio-only-cards 
drivers/mmc/core/sdio.c
--- a/drivers/mmc/core/sdio.c~mmc-avoid-getting-cid-on-sdio-only-cards
+++ a/drivers/mmc/core/sdio.c
@@ -362,11 +362,13 @@ static int mmc_sdio_init_card(struct mmc
goto err;
}
 
-   err = mmc_sd_get_cid(host, host->ocr & ocr, card->raw_cid);
-
-   if (!err) {
+   if (ocr & R4_MEMORY_PRESENT) {
card->type = MMC_TYPE_SD_COMBO;
 
+   err = mmc_sd_get_cid(host, host->ocr & ocr, card->raw_cid);
+   if (err)
+   goto remove;
+
if (oldcard && (oldcard->type != MMC_TYPE_SD_COMBO ||
memcmp(card->raw_cid, oldcard->raw_cid, 
sizeof(card->raw_cid)) != 0)) {
mmc_remove_card(card);
diff -puN include/linux/mmc/sdio.h~mmc-avoid-getting-cid-on-sdio-only-cards 
include/linux/mmc/sdio.h
--- a/include/linux/mmc/sdio.h~mmc-avoid-getting-cid-on-sdio-only-cards
+++ a/include/linux/mmc/sdio.h
@@ -38,6 +38,8 @@
  *  [8:0] Byte/block count
  */
 
+#define R4_MEMORY_PRESENT (1 << 27)
+
 /*
   SDIO status in R5
   Type
_

Patches currently in -mm which might be from david.vra...@csr.com are

mmc-avoid-getting-cid-on-sdio-only-cards.patch
linux-next.patch

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


[patch 15/24] mmc: add erase, secure erase, trim and secure trim operations

2010-08-11 Thread akpm
From: Adrian Hunter 

SD/MMC cards tend to support an erase operation.  In addition, eMMC v4.4
cards can support secure erase, trim and secure trim operations that are
all variants of the basic erase command.

SD/MMC device attributes "erase_size" and "preferred_erase_size" have been
added.

"erase_size" is the minimum size, in bytes, of an erase operation.  For
MMC, "erase_size" is the erase group size reported by the card.  Note that
"erase_size" does not apply to trim or secure trim operations where the
minimum size is always one 512 byte sector.  For SD, "erase_size" is 512
if the card is block-addressed, 0 otherwise.

SD/MMC cards can erase an arbitrarily large area up to and
including the whole card.  When erasing a large area it may
be desirable to do it in smaller chunks for three reasons:

1. A single erase command will make all other I/O on the card
   wait.  This is not a problem if the whole card is being erased, but
   erasing one partition will make I/O for another partition on the
   same card wait for the duration of the erase - which could be a
   several minutes.

2. To be able to inform the user of erase progress.

3. The erase timeout becomes too large to be very useful. 
   Because the erase timeout contains a margin which is multiplied by
   the size of the erase area, the value can end up being several
   minutes for large areas.

"erase_size" is not the most efficient unit to erase (especially for SD
where it is just one sector), hence "preferred_erase_size" provides a good
chunk size for erasing large areas.

For MMC, "preferred_erase_size" is the high-capacity erase size if a card
specifies one, otherwise it is based on the capacity of the card.

For SD, "preferred_erase_size" is the allocation unit size specified by
the card.

"preferred_erase_size" is in bytes.

Signed-off-by: Adrian Hunter 
Acked-by: Jens Axboe 
Cc: Kyungmin Park 
Cc: Madhusudhan Chikkature 
Cc: Christoph Hellwig 
Cc: Ben Gardiner 
Cc: 
Signed-off-by: Andrew Morton 
---

 Documentation/00-INDEX  |2 
 Documentation/mmc/00-INDEX  |4 
 Documentation/mmc/mmc-dev-attrs.txt |   56 
 drivers/mmc/core/core.c |  346 ++
 drivers/mmc/core/core.h |2 
 drivers/mmc/core/mmc.c  |   47 +++
 drivers/mmc/core/sd.c   |   82 ++
 drivers/mmc/core/sd_ops.c   |   48 +++
 drivers/mmc/core/sd_ops.h   |1 
 include/linux/mmc/card.h|   20 +
 include/linux/mmc/core.h|   19 +
 include/linux/mmc/host.h|1 
 include/linux/mmc/mmc.h |   26 +
 include/linux/mmc/sd.h  |5 
 14 files changed, 651 insertions(+), 8 deletions(-)

diff -puN 
Documentation/00-INDEX~mmc-add-erase-secure-erase-trim-and-secure-trim-operations
 Documentation/00-INDEX
--- 
a/Documentation/00-INDEX~mmc-add-erase-secure-erase-trim-and-secure-trim-operations
+++ a/Documentation/00-INDEX
@@ -232,6 +232,8 @@ memory.txt
- info on typical Linux memory problems.
 mips/
- directory with info about Linux on MIPS architecture.
+mmc/
+   - directory with info about the MMC subsystem
 mono.txt
- how to execute Mono-based .NET binaries with the help of BINFMT_MISC.
 mutex-design.txt
diff -puN /dev/null Documentation/mmc/00-INDEX
--- /dev/null
+++ a/Documentation/mmc/00-INDEX
@@ -0,0 +1,4 @@
+00-INDEX
+- this file
+mmc-dev-attrs.txt
+- info on SD and MMC device attributes
diff -puN /dev/null Documentation/mmc/mmc-dev-attrs.txt
--- /dev/null
+++ a/Documentation/mmc/mmc-dev-attrs.txt
@@ -0,0 +1,56 @@
+SD and MMC Device Attributes
+
+
+All attributes are read-only.
+
+   cid Card Identifaction Register
+   csd Card Specific Data Register
+   scr SD Card Configuration Register (SD only)
+   dateManufacturing Date (from CID Register)
+   fwrev   Firmware/Product Revision (from CID Register) 
(SD and MMCv1 only)
+   hwrev   Hardware/Product Revision (from CID Register) 
(SD and MMCv1 only)
+   manfid  Manufacturer ID (from CID Register)
+   nameProduct Name (from CID Register)
+   oemid   OEM/Application ID (from CID Register)
+   serial  Product Serial Number (from CID Register)
+   erase_size  Erase group size
+   preferred_erase_sizePreferred erase size
+
+Note on Erase Size and Preferred Erase Size:
+
+   "erase_size" is the  minimum size, in bytes, of an erase
+   operation.  For MMC, "erase_size" is the erase group size
+   reported by the card.  Note that "erase_size" does not apply
+   to trim or secure trim operations where the minimum size is
+   always one 512 byte sector.  For SD, "erase_size" is 512
+   if the car

[patch 16/24] mmc_block: add discard support

2010-08-11 Thread akpm
From: Adrian Hunter 

Enable MMC to service discard requests.  In the case of SD and MMC cards
that do not support trim, discards become erases.  In the case of cards
(MMC) that only allow erases in multiples of erase group size, round to
the nearest completely discarded erase group.

Signed-off-by: Adrian Hunter 
Acked-by: Jens Axboe 
Cc: Kyungmin Park 
Cc: Madhusudhan Chikkature 
Cc: Christoph Hellwig 
Cc: Ben Gardiner 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/card/block.c |   42 -
 drivers/mmc/card/queue.c |   16 --
 2 files changed, 55 insertions(+), 3 deletions(-)

diff -puN drivers/mmc/card/block.c~mmc_block-add-discard-support 
drivers/mmc/card/block.c
--- a/drivers/mmc/card/block.c~mmc_block-add-discard-support
+++ a/drivers/mmc/card/block.c
@@ -247,7 +247,40 @@ static u32 get_card_status(struct mmc_ca
return cmd.resp[0];
 }
 
-static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
+static int mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req)
+{
+   struct mmc_blk_data *md = mq->data;
+   struct mmc_card *card = md->queue.card;
+   unsigned int from, nr, arg;
+   int err = 0;
+
+   mmc_claim_host(card->host);
+
+   if (!mmc_can_erase(card)) {
+   err = -EOPNOTSUPP;
+   goto out;
+   }
+
+   from = blk_rq_pos(req);
+   nr = blk_rq_sectors(req);
+
+   if (mmc_can_trim(card))
+   arg = MMC_TRIM_ARG;
+   else
+   arg = MMC_ERASE_ARG;
+
+   err = mmc_erase(card, from, nr, arg);
+out:
+   spin_lock_irq(&md->lock);
+   __blk_end_request(req, err, blk_rq_bytes(req));
+   spin_unlock_irq(&md->lock);
+
+   mmc_release_host(card->host);
+
+   return err ? 0 : 1;
+}
+
+static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *req)
 {
struct mmc_blk_data *md = mq->data;
struct mmc_card *card = md->queue.card;
@@ -475,6 +508,13 @@ static int mmc_blk_issue_rq(struct mmc_q
return 0;
 }
 
+static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
+{
+   if (req->cmd_flags & REQ_DISCARD)
+   return mmc_blk_issue_discard_rq(mq, req);
+   else
+   return mmc_blk_issue_rw_rq(mq, req);
+}
 
 static inline int mmc_blk_readonly(struct mmc_card *card)
 {
diff -puN drivers/mmc/card/queue.c~mmc_block-add-discard-support 
drivers/mmc/card/queue.c
--- a/drivers/mmc/card/queue.c~mmc_block-add-discard-support
+++ a/drivers/mmc/card/queue.c
@@ -30,9 +30,9 @@
 static int mmc_prep_request(struct request_queue *q, struct request *req)
 {
/*
-* We only like normal block requests.
+* We only like normal block requests and discards.
 */
-   if (req->cmd_type != REQ_TYPE_FS) {
+   if (req->cmd_type != REQ_TYPE_FS && !(req->cmd_flags & REQ_DISCARD)) {
blk_dump_rq_flags(req, "MMC bad request");
return BLKPREP_KILL;
}
@@ -130,6 +130,18 @@ int mmc_init_queue(struct mmc_queue *mq,
blk_queue_prep_rq(mq->queue, mmc_prep_request);
blk_queue_ordered(mq->queue, QUEUE_ORDERED_DRAIN);
queue_flag_set_unlocked(QUEUE_FLAG_NONROT, mq->queue);
+   if (mmc_can_erase(card)) {
+   queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, mq->queue);
+   mq->queue->limits.max_discard_sectors = UINT_MAX;
+   if (card->erased_byte == 0)
+   mq->queue->limits.discard_zeroes_data = 1;
+   if (!mmc_can_trim(card) && is_power_of_2(card->erase_size)) {
+   mq->queue->limits.discard_granularity =
+   card->erase_size << 9;
+   mq->queue->limits.discard_alignment =
+   card->erase_size << 9;
+   }
+   }
 
 #ifdef CONFIG_MMC_BLOCK_BOUNCE
if (host->max_hw_segs == 1) {
_
--
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


[patch 18/24] block: add secure discard

2010-08-11 Thread akpm
From: Adrian Hunter 

Secure discard is the same as discard except that all copies of the
discarded sectors (perhaps created by garbage collection) must also be
erased.

Signed-off-by: Adrian Hunter 
Acked-by: Jens Axboe 
Cc: Kyungmin Park 
Cc: Madhusudhan Chikkature 
Cc: Christoph Hellwig 
Cc: Ben Gardiner 
Cc: 
Signed-off-by: Andrew Morton 
---

 block/blk-core.c  |5 -
 block/blk-lib.c   |6 ++
 block/compat_ioctl.c  |1 +
 block/elevator.c  |6 ++
 block/ioctl.c |   15 ++-
 include/linux/blk_types.h |2 ++
 include/linux/blkdev.h|7 ++-
 include/linux/fs.h|2 ++
 kernel/trace/blktrace.c   |8 
 9 files changed, 45 insertions(+), 7 deletions(-)

diff -puN block/blk-core.c~block-add-secure-discard block/blk-core.c
--- a/block/blk-core.c~block-add-secure-discard
+++ a/block/blk-core.c
@@ -1514,7 +1514,10 @@ static inline void __generic_make_reques
if (bio_check_eod(bio, nr_sectors))
goto end_io;
 
-   if ((bio->bi_rw & REQ_DISCARD) && !blk_queue_discard(q)) {
+   if ((bio->bi_rw & REQ_DISCARD) &&
+   (!blk_queue_discard(q) ||
+((bio->bi_rw & REQ_SECURE) &&
+ !blk_queue_secdiscard(q {
err = -EOPNOTSUPP;
goto end_io;
}
diff -puN block/blk-lib.c~block-add-secure-discard block/blk-lib.c
--- a/block/blk-lib.c~block-add-secure-discard
+++ a/block/blk-lib.c
@@ -62,6 +62,12 @@ int blkdev_issue_discard(struct block_de
max_discard_sectors &= ~(disc_sects - 1);
}
 
+   if (flags & BLKDEV_IFL_SECURE) {
+   if (!blk_queue_secdiscard(q))
+   return -EOPNOTSUPP;
+   type |= DISCARD_SECURE;
+   }
+
while (nr_sects && !ret) {
bio = bio_alloc(gfp_mask, 1);
if (!bio) {
diff -puN block/compat_ioctl.c~block-add-secure-discard block/compat_ioctl.c
--- a/block/compat_ioctl.c~block-add-secure-discard
+++ a/block/compat_ioctl.c
@@ -703,6 +703,7 @@ long compat_blkdev_ioctl(struct file *fi
case BLKFLSBUF:
case BLKROSET:
case BLKDISCARD:
+   case BLKSECDISCARD:
/*
 * the ones below are implemented in blkdev_locked_ioctl,
 * but we call blkdev_ioctl, which gets the lock for us
diff -puN block/elevator.c~block-add-secure-discard block/elevator.c
--- a/block/elevator.c~block-add-secure-discard
+++ a/block/elevator.c
@@ -83,6 +83,12 @@ int elv_rq_merge_ok(struct request *rq, 
return 0;
 
/*
+* Don't merge discard requests and secure discard requests
+*/
+   if ((bio->bi_rw & REQ_SECURE) != (rq->bio->bi_rw & REQ_SECURE))
+   return 0;
+
+   /*
 * different data direction or already started, don't merge
 */
if (bio_data_dir(bio) != rq_data_dir(rq))
diff -puN block/ioctl.c~block-add-secure-discard block/ioctl.c
--- a/block/ioctl.c~block-add-secure-discard
+++ a/block/ioctl.c
@@ -114,8 +114,10 @@ static int blkdev_reread_part(struct blo
 }
 
 static int blk_ioctl_discard(struct block_device *bdev, uint64_t start,
-uint64_t len)
+uint64_t len, int secure)
 {
+   unsigned long flags = BLKDEV_IFL_WAIT;
+
if (start & 511)
return -EINVAL;
if (len & 511)
@@ -125,8 +127,9 @@ static int blk_ioctl_discard(struct bloc
 
if (start + len > (bdev->bd_inode->i_size >> 9))
return -EINVAL;
-   return blkdev_issue_discard(bdev, start, len, GFP_KERNEL,
-   BLKDEV_IFL_WAIT);
+   if (secure)
+   flags |= BLKDEV_IFL_SECURE;
+   return blkdev_issue_discard(bdev, start, len, GFP_KERNEL, flags);
 }
 
 static int put_ushort(unsigned long arg, unsigned short val)
@@ -213,7 +216,8 @@ int blkdev_ioctl(struct block_device *bd
set_device_ro(bdev, n);
return 0;
 
-   case BLKDISCARD: {
+   case BLKDISCARD:
+   case BLKSECDISCARD: {
uint64_t range[2];
 
if (!(mode & FMODE_WRITE))
@@ -222,7 +226,8 @@ int blkdev_ioctl(struct block_device *bd
if (copy_from_user(range, (void __user *)arg, sizeof(range)))
return -EFAULT;
 
-   return blk_ioctl_discard(bdev, range[0], range[1]);
+   return blk_ioctl_discard(bdev, range[0], range[1],
+cmd == BLKSECDISCARD);
}
 
case HDIO_GETGEO: {
diff -puN include/linux/blk_types.h~block-add-secure-discard 
include/linux/blk_types.h
--- a/include/linux/blk_types.h~block-add-secure-discard
+++ a/include/linux/blk_types.h
@@ -150,6 +150,7 @@ enum rq_flag_bits {
__REQ_FLUSH,/* request for cache flush */
__REQ_IO_STAT,

[patch 19/24] mmc_block: add support for secure discard

2010-08-11 Thread akpm
From: Adrian Hunter 

Secure discard is implemented by Secure Trim if the discard is unaligned
or Secure Erase otherwise.

Signed-off-by: Adrian Hunter 
Acked-by: Jens Axboe 
Cc: Kyungmin Park 
Cc: Madhusudhan Chikkature 
Cc: Christoph Hellwig 
Cc: Ben Gardiner 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/card/block.c |   46 ++---
 drivers/mmc/card/queue.c |3 ++
 2 files changed, 46 insertions(+), 3 deletions(-)

diff -puN drivers/mmc/card/block.c~mmc_block-add-support-for-secure-discard 
drivers/mmc/card/block.c
--- a/drivers/mmc/card/block.c~mmc_block-add-support-for-secure-discard
+++ a/drivers/mmc/card/block.c
@@ -280,6 +280,42 @@ out:
return err ? 0 : 1;
 }
 
+static int mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq,
+  struct request *req)
+{
+   struct mmc_blk_data *md = mq->data;
+   struct mmc_card *card = md->queue.card;
+   unsigned int from, nr, arg;
+   int err = 0;
+
+   mmc_claim_host(card->host);
+
+   if (!mmc_can_secure_erase_trim(card)) {
+   err = -EOPNOTSUPP;
+   goto out;
+   }
+
+   from = blk_rq_pos(req);
+   nr = blk_rq_sectors(req);
+
+   if (mmc_can_trim(card) && !mmc_erase_group_aligned(card, from, nr))
+   arg = MMC_SECURE_TRIM1_ARG;
+   else
+   arg = MMC_SECURE_ERASE_ARG;
+
+   err = mmc_erase(card, from, nr, arg);
+   if (!err && arg == MMC_SECURE_TRIM1_ARG)
+   err = mmc_erase(card, from, nr, MMC_SECURE_TRIM2_ARG);
+out:
+   spin_lock_irq(&md->lock);
+   __blk_end_request(req, err, blk_rq_bytes(req));
+   spin_unlock_irq(&md->lock);
+
+   mmc_release_host(card->host);
+
+   return err ? 0 : 1;
+}
+
 static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *req)
 {
struct mmc_blk_data *md = mq->data;
@@ -510,10 +546,14 @@ static int mmc_blk_issue_rw_rq(struct mm
 
 static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
 {
-   if (req->cmd_flags & REQ_DISCARD)
-   return mmc_blk_issue_discard_rq(mq, req);
-   else
+   if (req->cmd_flags & REQ_DISCARD) {
+   if (req->cmd_flags & REQ_SECURE)
+   return mmc_blk_issue_secdiscard_rq(mq, req);
+   else
+   return mmc_blk_issue_discard_rq(mq, req);
+   } else {
return mmc_blk_issue_rw_rq(mq, req);
+   }
 }
 
 static inline int mmc_blk_readonly(struct mmc_card *card)
diff -puN drivers/mmc/card/queue.c~mmc_block-add-support-for-secure-discard 
drivers/mmc/card/queue.c
--- a/drivers/mmc/card/queue.c~mmc_block-add-support-for-secure-discard
+++ a/drivers/mmc/card/queue.c
@@ -141,6 +141,9 @@ int mmc_init_queue(struct mmc_queue *mq,
mq->queue->limits.discard_alignment =
card->erase_size << 9;
}
+   if (mmc_can_secure_erase_trim(card))
+   queue_flag_set_unlocked(QUEUE_FLAG_SECDISCARD,
+   mq->queue);
}
 
 #ifdef CONFIG_MMC_BLOCK_BOUNCE
_
--
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


[patch 17/24] omap_hsmmc: add erase capability

2010-08-11 Thread akpm
From: Adrian Hunter 

Disable the data (busy) timeout for erases and set the MMC_CAP_ERASE
capability.

Signed-off-by: Adrian Hunter 
Acked-by: Jens Axboe 
Cc: Kyungmin Park 
Cc: Madhusudhan Chikkature 
Cc: Christoph Hellwig 
Cc: Ben Gardiner 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/omap_hsmmc.c |   13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff -puN drivers/mmc/host/omap_hsmmc.c~omap_hsmmc-add-erase-capability 
drivers/mmc/host/omap_hsmmc.c
--- a/drivers/mmc/host/omap_hsmmc.c~omap_hsmmc-add-erase-capability
+++ a/drivers/mmc/host/omap_hsmmc.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -78,6 +79,7 @@
 #define INT_EN_MASK0x307F0033
 #define BWR_ENABLE (1 << 4)
 #define BRR_ENABLE (1 << 5)
+#define DTO_ENABLE (1 << 20)
 #define INIT_STREAM(1 << 1)
 #define DP_SELECT  (1 << 21)
 #define DDIR   (1 << 4)
@@ -523,7 +525,8 @@ static void omap_hsmmc_stop_clock(struct
dev_dbg(mmc_dev(host->mmc), "MMC Clock is not stoped\n");
 }
 
-static void omap_hsmmc_enable_irq(struct omap_hsmmc_host *host)
+static void omap_hsmmc_enable_irq(struct omap_hsmmc_host *host,
+ struct mmc_command *cmd)
 {
unsigned int irq_mask;
 
@@ -532,6 +535,10 @@ static void omap_hsmmc_enable_irq(struct
else
irq_mask = INT_EN_MASK;
 
+   /* Disable timeout for erases */
+   if (cmd->opcode == MMC_ERASE)
+   irq_mask &= ~DTO_ENABLE;
+
OMAP_HSMMC_WRITE(host->base, STAT, STAT_CLEAR);
OMAP_HSMMC_WRITE(host->base, ISE, irq_mask);
OMAP_HSMMC_WRITE(host->base, IE, irq_mask);
@@ -782,7 +789,7 @@ omap_hsmmc_start_command(struct omap_hsm
mmc_hostname(host->mmc), cmd->opcode, cmd->arg);
host->cmd = cmd;
 
-   omap_hsmmc_enable_irq(host);
+   omap_hsmmc_enable_irq(host, cmd);
 
host->response_busy = 0;
if (cmd->flags & MMC_RSP_PRESENT) {
@@ -2107,7 +2114,7 @@ static int __init omap_hsmmc_probe(struc
mmc->max_seg_size = mmc->max_req_size;
 
mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
-MMC_CAP_WAIT_WHILE_BUSY;
+MMC_CAP_WAIT_WHILE_BUSY | MMC_CAP_ERASE;
 
switch (mmc_slot(host).wires) {
case 8:
_
--
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


[patch 20/24] mmc_test: add performance tests

2010-08-11 Thread akpm
From: Adrian Hunter 

mmc_test provides tests aimed at testing SD/MMC hosts.  This patch adds
performance tests.

It is advantageous to have performance tests in a kernel
module like mmc_test for the following reasons:
- transfer times can be measured very accurately
- arbitrarily large transfers are possible
- the effect of contiguous vs scattered pages
can be determined

The new tests are:

23. Best-case read performance
24. Best-case write performance
25. Best-case read performance into scattered pages
26. Best-case write performance from scattered pages
27. Single read performance by transfer size
28. Single write performance by transfer size
29. Single trim performance by transfer size
30. Consecutive read performance by transfer size
31. Consecutive write performance by transfer size
32. Consecutive trim performance by transfer size

Signed-off-by: Adrian Hunter 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/card/mmc_test.c |  793 +-
 1 file changed, 791 insertions(+), 2 deletions(-)

diff -puN drivers/mmc/card/mmc_test.c~mmc_test-add-performance-tests 
drivers/mmc/card/mmc_test.c
--- a/drivers/mmc/card/mmc_test.c~mmc_test-add-performance-tests
+++ a/drivers/mmc/card/mmc_test.c
@@ -25,6 +25,54 @@
 #define BUFFER_ORDER   2
 #define BUFFER_SIZE(PAGE_SIZE << BUFFER_ORDER)
 
+/**
+ * struct mmc_test_pages - pages allocated by 'alloc_pages()'.
+ * @page: first page in the allocation
+ * @order: order of the number of pages allocated
+ */
+struct mmc_test_pages {
+   struct page *page;
+   unsigned int order;
+};
+
+/**
+ * struct mmc_test_mem - allocated memory.
+ * @arr: array of allocations
+ * @cnt: number of allocations
+ */
+struct mmc_test_mem {
+   struct mmc_test_pages *arr;
+   unsigned int cnt;
+};
+
+/**
+ * struct mmc_test_area - information for performance tests.
+ * @dev_addr: address on card at which to do performance tests
+ * @max_sz: test area size (in bytes)
+ * @max_segs: maximum segments in scatterlist @sg
+ * @blocks: number of (512 byte) blocks currently mapped by @sg
+ * @sg_len: length of currently mapped scatterlist @sg
+ * @mem: allocated memory
+ * @sg: scatterlist
+ */
+struct mmc_test_area {
+   unsigned int dev_addr;
+   unsigned int max_sz;
+   unsigned int max_segs;
+   unsigned int blocks;
+   unsigned int sg_len;
+   struct mmc_test_mem *mem;
+   struct scatterlist *sg;
+};
+
+/**
+ * struct mmc_test_card - test information.
+ * @card: card under test
+ * @scratch: transfer buffer
+ * @buffer: transfer buffer
+ * @highmem: buffer for highmem tests
+ * @area: information for performance tests
+ */
 struct mmc_test_card {
struct mmc_card *card;
 
@@ -33,6 +81,7 @@ struct mmc_test_card {
 #ifdef CONFIG_HIGHMEM
struct page *highmem;
 #endif
+   struct mmc_test_area area;
 };
 
 /***/
@@ -97,6 +146,12 @@ static void mmc_test_prepare_mrq(struct 
mmc_set_data_timeout(mrq->data, test->card);
 }
 
+static int mmc_test_busy(struct mmc_command *cmd)
+{
+   return !(cmd->resp[0] & R1_READY_FOR_DATA) ||
+   (R1_CURRENT_STATE(cmd->resp[0]) == 7);
+}
+
 /*
  * Wait for the card to finish the busy state
  */
@@ -117,13 +172,13 @@ static int mmc_test_wait_busy(struct mmc
if (ret)
break;
 
-   if (!busy && !(cmd.resp[0] & R1_READY_FOR_DATA)) {
+   if (!busy && mmc_test_busy(&cmd)) {
busy = 1;
printk(KERN_INFO "%s: Warning: Host did not "
"wait for busy state to end.\n",
mmc_hostname(test->card->host));
}
-   } while (!(cmd.resp[0] & R1_READY_FOR_DATA));
+   } while (mmc_test_busy(&cmd));
 
return ret;
 }
@@ -170,6 +225,246 @@ static int mmc_test_buffer_transfer(stru
return 0;
 }
 
+static void mmc_test_free_mem(struct mmc_test_mem *mem)
+{
+   if (!mem)
+   return;
+   while (mem->cnt--)
+   __free_pages(mem->arr[mem->cnt].page,
+mem->arr[mem->cnt].order);
+   kfree(mem->arr);
+   kfree(mem);
+}
+
+/*
+ * Allocate a lot of memory, preferrably max_sz but at least min_sz.  In case
+ * there isn't much memory do not exceed 1/16th total RAM.
+ */
+static struct mmc_test_mem *mmc_test_alloc_mem(unsigned int min_sz,
+  unsigned int max_sz)
+{
+   unsigned int max_page_cnt = DIV_ROUND_UP(max_sz, PAGE_SIZE);
+   unsigned int min_page_cnt = DIV_ROUND_UP(min_sz, PAGE_SIZE);
+   unsigned int page_cnt = 0;
+   struct mmc_test_mem *mem;
+   struct sysinfo si;
+
+   si_meminfo(&si);
+   if (max_page_cnt > si.totalram >> 4)
+

[patch 046/177] omap: pandora: pass wl1251 information to SDIO core

2010-08-10 Thread akpm
From: Grazvydas Ignotas 

Pandora has TI WL1251 attached on MMC3, which is non-standard SDIO chip.
Make use MMC_QUIRK_NONSTD_SDIO to tell SDIO core about it.

Signed-off-by: Grazvydas Ignotas 
Cc: Adrian Hunter 
Cc: Tony Lindgren 
Cc: Bob Copeland 
Cc: Kalle Valo 
Cc: Madhusudhan Chikkature 
Cc: Kishore Kadiyala 
Cc: Russell King 
Cc: 
Signed-off-by: Andrew Morton 
---

 arch/arm/mach-omap2/board-omap3pandora.c |   16 
 arch/arm/mach-omap2/hsmmc.c  |1 +
 arch/arm/mach-omap2/hsmmc.h  |4 
 3 files changed, 21 insertions(+)

diff -puN 
arch/arm/mach-omap2/board-omap3pandora.c~omap-pandora-pass-wl1251-information-to-sdio-core
 arch/arm/mach-omap2/board-omap3pandora.c
--- 
a/arch/arm/mach-omap2/board-omap3pandora.c~omap-pandora-pass-wl1251-information-to-sdio-core
+++ a/arch/arm/mach-omap2/board-omap3pandora.c
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -258,6 +259,20 @@ static struct platform_device pandora_ds
},
 };
 
+static void pandora_wl1251_init_card(struct mmc_card *card)
+{
+   /*
+* We have TI wl1251 attached to MMC3. Pass this information to
+* SDIO core because it can't be probed by normal methods.
+*/
+   card->quirks |= MMC_QUIRK_NONSTD_SDIO;
+   card->cccr.wide_bus = 1;
+   card->cis.vendor = 0x104c;
+   card->cis.device = 0x9066;
+   card->cis.blksize = 512;
+   card->cis.max_dtr = 2000;
+}
+
 static struct omap2_hsmmc_info omap3pandora_mmc[] = {
{
.mmc= 1,
@@ -279,6 +294,7 @@ static struct omap2_hsmmc_info omap3pand
.wires  = 4,
.gpio_cd= -EINVAL,
.gpio_wp= -EINVAL,
+   .init_card  = pandora_wl1251_init_card,
},
{}  /* Terminator */
 };
diff -puN 
arch/arm/mach-omap2/hsmmc.c~omap-pandora-pass-wl1251-information-to-sdio-core 
arch/arm/mach-omap2/hsmmc.c
--- 
a/arch/arm/mach-omap2/hsmmc.c~omap-pandora-pass-wl1251-information-to-sdio-core
+++ a/arch/arm/mach-omap2/hsmmc.c
@@ -268,6 +268,7 @@ void __init omap2_hsmmc_init(struct omap
mmc->slots[0].gpio_wp = c->gpio_wp;
 
mmc->slots[0].remux = c->remux;
+   mmc->slots[0].init_card = c->init_card;
 
if (c->cover_only)
mmc->slots[0].cover = 1;
diff -puN 
arch/arm/mach-omap2/hsmmc.h~omap-pandora-pass-wl1251-information-to-sdio-core 
arch/arm/mach-omap2/hsmmc.h
--- 
a/arch/arm/mach-omap2/hsmmc.h~omap-pandora-pass-wl1251-information-to-sdio-core
+++ a/arch/arm/mach-omap2/hsmmc.h
@@ -6,6 +6,8 @@
  * published by the Free Software Foundation.
  */
 
+struct mmc_card;
+
 struct omap2_hsmmc_info {
u8  mmc;/* controller 1/2/3 */
u8  wires;  /* 1/4/8 wires */
@@ -23,6 +25,8 @@ struct omap2_hsmmc_info {
int ocr_mask;   /* temporary HACK */
/* Remux (pad configuation) when powering on/off */
void (*remux)(struct device *dev, int slot, int power_on);
+   /* init some special card */
+   void (*init_card)(struct mmc_card *card);
 };
 
 #if defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
_
--
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


[patch 054/177] sdhci: add auto CMD12 support for eSDHC driver

2010-08-10 Thread akpm
From: Jerry Huang 

Add auto CMD12 command support for eSDHC driver.  This is needed by P4080
and P1022 for block read/write.  Manual asynchronous CMD12 abort operation
causes protocol violations on these silicons.

Signed-off-by: Jerry Huang 
Signed-off-by: Roy Zang 
Cc: Benjamin Herrenschmidt 
Cc: Kumar Gala 
Cc: Grant Likely 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/sdhci-of-core.c |4 
 drivers/mmc/host/sdhci.c |   14 --
 drivers/mmc/host/sdhci.h |2 ++
 3 files changed, 18 insertions(+), 2 deletions(-)

diff -puN 
drivers/mmc/host/sdhci-of-core.c~sdhci-add-auto-cmd12-support-for-esdhc-driver 
drivers/mmc/host/sdhci-of-core.c
--- 
a/drivers/mmc/host/sdhci-of-core.c~sdhci-add-auto-cmd12-support-for-esdhc-driver
+++ a/drivers/mmc/host/sdhci-of-core.c
@@ -154,6 +154,10 @@ static int __devinit sdhci_of_probe(stru
host->ops = &sdhci_of_data->ops;
}
 
+   if (of_get_property(np, "sdhci,auto-cmd12", NULL))
+   host->quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12;
+
+
if (of_get_property(np, "sdhci,1-bit-only", NULL))
host->quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA;
 
diff -puN 
drivers/mmc/host/sdhci.c~sdhci-add-auto-cmd12-support-for-esdhc-driver 
drivers/mmc/host/sdhci.c
--- a/drivers/mmc/host/sdhci.c~sdhci-add-auto-cmd12-support-for-esdhc-driver
+++ a/drivers/mmc/host/sdhci.c
@@ -818,8 +818,12 @@ static void sdhci_set_transfer_mode(stru
WARN_ON(!host->data);
 
mode = SDHCI_TRNS_BLK_CNT_EN;
-   if (data->blocks > 1)
-   mode |= SDHCI_TRNS_MULTI;
+   if (data->blocks > 1) {
+   if (host->quirks & SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)
+   mode |= SDHCI_TRNS_MULTI | SDHCI_TRNS_ACMD12;
+   else
+   mode |= SDHCI_TRNS_MULTI;
+   }
if (data->flags & MMC_DATA_READ)
mode |= SDHCI_TRNS_READ;
if (host->flags & SDHCI_REQ_USE_DMA)
@@ -1109,6 +1113,12 @@ static void sdhci_request(struct mmc_hos
 #ifndef SDHCI_USE_LEDS_CLASS
sdhci_activate_led(host);
 #endif
+   if (host->quirks & SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12) {
+   if (mrq->stop) {
+   mrq->data->stop = NULL;
+   mrq->stop = NULL;
+   }
+   }
 
host->mrq = mrq;
 
diff -puN 
drivers/mmc/host/sdhci.h~sdhci-add-auto-cmd12-support-for-esdhc-driver 
drivers/mmc/host/sdhci.h
--- a/drivers/mmc/host/sdhci.h~sdhci-add-auto-cmd12-support-for-esdhc-driver
+++ a/drivers/mmc/host/sdhci.h
@@ -243,6 +243,8 @@ struct sdhci_host {
 #define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC  (1<<26)
 /* Controller is missing device caps. Use caps provided by host */
 #define SDHCI_QUIRK_MISSING_CAPS   (1<<27)
+/* Controller uses Auto CMD12 command to stop the transfer */
+#define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (1<<28)
 
int irq;/* Device IRQ */
void __iomem *  ioaddr; /* Mapped address */
_
--
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


[patch 055/177] dts: add sdhci,auto-cmd12 field for p4080 device tree

2010-08-10 Thread akpm
From: Roy Zang 

Signed-off-by: Roy Zang 
Cc: Jerry Huang 
Cc: Benjamin Herrenschmidt 
Cc: Kumar Gala 
Cc: Grant Likely 
Cc: 
Signed-off-by: Andrew Morton 
---

 Documentation/powerpc/dts-bindings/fsl/esdhc.txt |2 ++
 arch/powerpc/boot/dts/p4080ds.dts|1 +
 2 files changed, 3 insertions(+)

diff -puN 
Documentation/powerpc/dts-bindings/fsl/esdhc.txt~dts-add-sdhciauto-cmd12-field-for-p4080-device-tree
 Documentation/powerpc/dts-bindings/fsl/esdhc.txt
--- 
a/Documentation/powerpc/dts-bindings/fsl/esdhc.txt~dts-add-sdhciauto-cmd12-field-for-p4080-device-tree
+++ a/Documentation/powerpc/dts-bindings/fsl/esdhc.txt
@@ -14,6 +14,8 @@ Required properties:
 reports inverted write-protect state;
   - sdhci,1-bit-only : (optional) specifies that a controller can
 only handle 1-bit data transfers.
+  - sdhci,auto-cmd12: (optional) specifies that a controller can
+only handle auto CMD12.
 
 Example:
 
diff -puN 
arch/powerpc/boot/dts/p4080ds.dts~dts-add-sdhciauto-cmd12-field-for-p4080-device-tree
 arch/powerpc/boot/dts/p4080ds.dts
--- 
a/arch/powerpc/boot/dts/p4080ds.dts~dts-add-sdhciauto-cmd12-field-for-p4080-device-tree
+++ a/arch/powerpc/boot/dts/p4080ds.dts
@@ -280,6 +280,7 @@
reg = <0x114000 0x1000>;
interrupts = <48 2>;
interrupt-parent = <&mpic>;
+   sdhci,auto-cmd12;
};
 
i...@118000 {
_
--
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


[patch 056/177] dts: add ESDHC weird voltage bits workaround

2010-08-10 Thread akpm
From: Roy Zang 

P4080 ESDHC controller does not support 1.8V and 3.0V voltage.  but the
host controller capabilities register wrongly set the bits.  This patch
adds the workaround to correct the weird voltage setting bits.  Only 3.3V
voltage is supported for P4080 ESDHC controller.

Signed-off-by: Roy Zang 
Cc: Jerry Huang 
Cc: Benjamin Herrenschmidt 
Cc: Kumar Gala 
Cc: Grant Likely 
Cc: 
Signed-off-by: Andrew Morton 
---

 arch/powerpc/boot/dts/p4080ds.dts |1 +
 1 file changed, 1 insertion(+)

diff -puN 
arch/powerpc/boot/dts/p4080ds.dts~dts-add-esdhc-weird-voltage-bits-workaround 
arch/powerpc/boot/dts/p4080ds.dts
--- 
a/arch/powerpc/boot/dts/p4080ds.dts~dts-add-esdhc-weird-voltage-bits-workaround
+++ a/arch/powerpc/boot/dts/p4080ds.dts
@@ -280,6 +280,7 @@
reg = <0x114000 0x1000>;
interrupts = <48 2>;
interrupt-parent = <&mpic>;
+   voltage-ranges = <3300 3300>;
sdhci,auto-cmd12;
};
 
_
--
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


[patch 035/177] mmc: make sdhci work with ricoh mmc controller

2010-08-10 Thread akpm
From: Maxim Levitsky 

The current way of disabling it is not well tested by vendor and has all
kinds of bugs that show up on resume from ram/disk.  A very good example
is a dead SDHCI controller.

Old way of disabling is still supported by continuing to use
CONFIG_MMC_RICOH_MMC.

Based on 'http://list.drzeus.cx/pipermail/sdhci-devel/2007-December/002085.html'
Therefore most of the credit for this goes to Andrew de Quincey

Signed-off-by: Maxim Levitsky 
Cc: Andrew de Quincey 
Acked-by: Philip Langdale 
Cc: "Rafael J. Wysocki" 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/sdhci-pci.c |   41 +
 drivers/mmc/host/sdhci.c |3 +-
 drivers/mmc/host/sdhci.h |4 +++
 3 files changed, 47 insertions(+), 1 deletion(-)

diff -puN 
drivers/mmc/host/sdhci-pci.c~mmc-make-sdhci-work-with-ricoh-mmc-controller 
drivers/mmc/host/sdhci-pci.c
--- a/drivers/mmc/host/sdhci-pci.c~mmc-make-sdhci-work-with-ricoh-mmc-controller
+++ a/drivers/mmc/host/sdhci-pci.c
@@ -17,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -84,7 +85,30 @@ static int ricoh_probe(struct sdhci_pci_
if (chip->pdev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG ||
chip->pdev->subsystem_vendor == PCI_VENDOR_ID_SONY)
chip->quirks |= SDHCI_QUIRK_NO_CARD_NO_RESET;
+   return 0;
+}
+
+static int ricoh_mmc_probe_slot(struct sdhci_pci_slot *slot)
+{
+   slot->host->caps =
+   ((0x21 << SDHCI_TIMEOUT_CLK_SHIFT)
+   & SDHCI_TIMEOUT_CLK_MASK) |
+
+   ((0x21 << SDHCI_CLOCK_BASE_SHIFT)
+   & SDHCI_CLOCK_BASE_MASK) |
 
+   SDHCI_TIMEOUT_CLK_UNIT |
+   SDHCI_CAN_VDD_330 |
+   SDHCI_CAN_DO_SDMA;
+   return 0;
+}
+
+static int ricoh_mmc_resume(struct sdhci_pci_chip *chip)
+{
+   /* Apply a delay to allow controller to settle */
+   /* Otherwise it becomes confused if card state changed
+   during suspend */
+   msleep(500);
return 0;
 }
 
@@ -95,6 +119,15 @@ static const struct sdhci_pci_fixes sdhc
  SDHCI_QUIRK_CLOCK_BEFORE_RESET,
 };
 
+static const struct sdhci_pci_fixes sdhci_ricoh_mmc = {
+   .probe_slot = ricoh_mmc_probe_slot,
+   .resume = ricoh_mmc_resume,
+   .quirks = SDHCI_QUIRK_32BIT_DMA_ADDR |
+ SDHCI_QUIRK_CLOCK_BEFORE_RESET |
+ SDHCI_QUIRK_NO_CARD_NO_RESET |
+ SDHCI_QUIRK_MISSING_CAPS
+};
+
 static const struct sdhci_pci_fixes sdhci_ene_712 = {
.quirks = SDHCI_QUIRK_SINGLE_POWER_WRITE |
  SDHCI_QUIRK_BROKEN_DMA,
@@ -374,6 +407,14 @@ static const struct pci_device_id pci_id
},
 
{
+   .vendor = PCI_VENDOR_ID_RICOH,
+   .device = 0x843,
+   .subvendor  = PCI_ANY_ID,
+   .subdevice  = PCI_ANY_ID,
+   .driver_data= (kernel_ulong_t)&sdhci_ricoh_mmc,
+   },
+
+   {
.vendor = PCI_VENDOR_ID_ENE,
.device = PCI_DEVICE_ID_ENE_CB712_SD,
.subvendor  = PCI_ANY_ID,
diff -puN 
drivers/mmc/host/sdhci.c~mmc-make-sdhci-work-with-ricoh-mmc-controller 
drivers/mmc/host/sdhci.c
--- a/drivers/mmc/host/sdhci.c~mmc-make-sdhci-work-with-ricoh-mmc-controller
+++ a/drivers/mmc/host/sdhci.c
@@ -1687,7 +1687,8 @@ int sdhci_add_host(struct sdhci_host *ho
host->version);
}
 
-   caps = sdhci_readl(host, SDHCI_CAPABILITIES);
+   caps = (host->quirks & SDHCI_QUIRK_MISSING_CAPS) ? host->caps :
+   sdhci_readl(host, SDHCI_CAPABILITIES);
 
if (host->quirks & SDHCI_QUIRK_FORCE_DMA)
host->flags |= SDHCI_USE_SDMA;
diff -puN 
drivers/mmc/host/sdhci.h~mmc-make-sdhci-work-with-ricoh-mmc-controller 
drivers/mmc/host/sdhci.h
--- a/drivers/mmc/host/sdhci.h~mmc-make-sdhci-work-with-ricoh-mmc-controller
+++ a/drivers/mmc/host/sdhci.h
@@ -240,6 +240,8 @@ struct sdhci_host {
 #define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN  (1<<25)
 /* Controller cannot support End Attribute in NOP ADMA descriptor */
 #define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC  (1<<26)
+/* Controller is missing device caps. Use caps provided by host */
+#define SDHCI_QUIRK_MISSING_CAPS   (1<<27)
 
int irq;/* Device IRQ */
void __iomem *  ioaddr; /* Mapped address */
@@ -292,6 +294,8 @@ struct sdhci_host {
 
struct timer_list   timer;  /* Timer for timeouts */
 
+   unsigned intcaps;   /* Alternative capabilities */
+
unsigned long   private[0] cacheline_aligned;
 };
 
_
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majord...@vger.kernel.org
More majordomo inf

[patch 031/177] mmc: recognize CSD structure

2010-08-10 Thread akpm
From: Kyungmin Park 

The eMMC spec 4.4 and 4.3 + additional feature chips has CSD structure
version 3 and version 3 have to check the CSD_STRUCTURE byte in the
EXT_CSD register.

Also fix EXT_CSD revision message.

[a...@linux-foundation.org: fix comment, per Chris Ball]
Signed-off-by: Kyungmin Park 
Cc: Adrian Hunter 
Cc: Chris Ball 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/core/mmc.c   |   26 +++---
 include/linux/mmc/card.h |1 +
 include/linux/mmc/mmc.h  |1 +
 3 files changed, 21 insertions(+), 7 deletions(-)

diff -puN drivers/mmc/core/mmc.c~mmc-recognize-csd-structure 
drivers/mmc/core/mmc.c
--- a/drivers/mmc/core/mmc.c~mmc-recognize-csd-structure
+++ a/drivers/mmc/core/mmc.c
@@ -114,17 +114,18 @@ static int mmc_decode_cid(struct mmc_car
 static int mmc_decode_csd(struct mmc_card *card)
 {
struct mmc_csd *csd = &card->csd;
-   unsigned int e, m, csd_struct;
+   unsigned int e, m;
u32 *resp = card->raw_csd;
 
/*
 * We only understand CSD structure v1.1 and v1.2.
 * v1.2 has extra information in bits 15, 11 and 10.
+* We also support eMMC v4.4 & v4.41.
 */
-   csd_struct = UNSTUFF_BITS(resp, 126, 2);
-   if (csd_struct != 1 && csd_struct != 2) {
+   csd->structure = UNSTUFF_BITS(resp, 126, 2);
+   if (csd->structure == 0) {
printk(KERN_ERR "%s: unrecognised CSD structure version %d\n",
-   mmc_hostname(card->host), csd_struct);
+   mmc_hostname(card->host), csd->structure);
return -EINVAL;
}
 
@@ -207,11 +208,22 @@ static int mmc_read_ext_csd(struct mmc_c
goto out;
}
 
+   /* Version is coded in the CSD_STRUCTURE byte in the EXT_CSD register */
+   if (card->csd.structure == 3) {
+   int ext_csd_struct = ext_csd[EXT_CSD_STRUCTURE];
+   if (ext_csd_struct > 2) {
+   printk(KERN_ERR "%s: unrecognised EXT_CSD structure "
+   "version %d\n", mmc_hostname(card->host),
+   ext_csd_struct);
+   err = -EINVAL;
+   goto out;
+   }
+   }
+
card->ext_csd.rev = ext_csd[EXT_CSD_REV];
if (card->ext_csd.rev > 5) {
-   printk(KERN_ERR "%s: unrecognised EXT_CSD structure "
-   "version %d\n", mmc_hostname(card->host),
-   card->ext_csd.rev);
+   printk(KERN_ERR "%s: unrecognised EXT_CSD revision %d\n",
+   mmc_hostname(card->host), card->ext_csd.rev);
err = -EINVAL;
goto out;
}
diff -puN include/linux/mmc/card.h~mmc-recognize-csd-structure 
include/linux/mmc/card.h
--- a/include/linux/mmc/card.h~mmc-recognize-csd-structure
+++ a/include/linux/mmc/card.h
@@ -24,6 +24,7 @@ struct mmc_cid {
 };
 
 struct mmc_csd {
+   unsigned char   structure;
unsigned char   mmca_vsn;
unsigned short  cmdclass;
unsigned short  tacc_clks;
diff -puN include/linux/mmc/mmc.h~mmc-recognize-csd-structure 
include/linux/mmc/mmc.h
--- a/include/linux/mmc/mmc.h~mmc-recognize-csd-structure
+++ a/include/linux/mmc/mmc.h
@@ -254,6 +254,7 @@ struct _mmc_csd {
 #define EXT_CSD_BUS_WIDTH  183 /* R/W */
 #define EXT_CSD_HS_TIMING  185 /* R/W */
 #define EXT_CSD_CARD_TYPE  196 /* RO */
+#define EXT_CSD_STRUCTURE  194 /* RO */
 #define EXT_CSD_REV192 /* RO */
 #define EXT_CSD_SEC_CNT212 /* RO, 4 bytes */
 #define EXT_CSD_S_A_TIMEOUT217
_
--
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


[patch 032/177] mmc: split mmc_sd_init_card()

2010-08-10 Thread akpm
From: Michal Miroslaw 

This series adds support for SD combo cards to MMC/SD driver stack.

SD combo consists of SD memory and SDIO parts in one package.  Since the
parts have a separate SD command sets, after initialization, they can be
treated as independent cards on one bus.

Changes are divided into two patches.  First is just moving initialization
code around so that SD memory part init can be called from SDIO init. 
Second patch is a proper change enabling SD memory along SDIO.  I tried to
move as much no-op changes to the first patch so that it's easier to
follow the required changes to initialization flow for SDIO cards.

This is based on Simplified SDIO spec v.2.00.  The init sequence is
slightly modified to follow current SD memory init implementation. 
Command sequences, assuming SD memory and SDIO indeed ignore unknown
commands, are the same as before for both parts.


This patch:

Prepare for SD-combo (IO+mem) support by splitting SD memory
card init and related functions.

Signed-off-by: Michal Miroslaw 
Cc: Adrian Hunter 
Cc: Chris Ball 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/core/sd.c   |  249 ++
 drivers/mmc/core/sd.h   |   17 ++
 drivers/mmc/core/sdio.c |   39 +++--
 3 files changed, 186 insertions(+), 119 deletions(-)

diff -puN drivers/mmc/core/sd.c~mmc-split-mmc_sd_init_card drivers/mmc/core/sd.c
--- a/drivers/mmc/core/sd.c~mmc-split-mmc_sd_init_card
+++ a/drivers/mmc/core/sd.c
@@ -59,7 +59,7 @@ static const unsigned int tacc_mant[] = 
 /*
  * Given the decoded CSD structure, decode the raw CID to our CID structure.
  */
-static void mmc_decode_cid(struct mmc_card *card)
+void mmc_decode_cid(struct mmc_card *card)
 {
u32 *resp = card->raw_cid;
 
@@ -238,7 +238,7 @@ out:
 /*
  * Test if the card supports high-speed mode and, if so, switch to it.
  */
-static int mmc_switch_hs(struct mmc_card *card)
+int mmc_sd_switch_hs(struct mmc_card *card)
 {
int err;
u8 *status;
@@ -272,9 +272,9 @@ static int mmc_switch_hs(struct mmc_card
printk(KERN_WARNING "%s: Problem switching card "
"into high-speed mode!\n",
mmc_hostname(card->host));
+   err = 0;
} else {
-   mmc_card_set_highspeed(card);
-   mmc_set_timing(card->host, MMC_TIMING_SD_HS);
+   err = 1;
}
 
 out:
@@ -320,26 +320,16 @@ static const struct attribute_group *sd_
NULL,
 };
 
-static struct device_type sd_type = {
+struct device_type sd_type = {
.groups = sd_attr_groups,
 };
 
 /*
- * Handle the detection and initialisation of a card.
- *
- * In the case of a resume, "oldcard" will contain the card
- * we're trying to reinitialise.
+ * Fetch CID from card.
  */
-static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
-   struct mmc_card *oldcard)
+int mmc_sd_get_cid(struct mmc_host *host, u32 ocr, u32 *cid)
 {
-   struct mmc_card *card;
int err;
-   u32 cid[4];
-   unsigned int max_dtr;
-
-   BUG_ON(!host);
-   WARN_ON(!host->claimed);
 
/*
 * Since we're changing the OCR value, we seem to
@@ -361,23 +351,136 @@ static int mmc_sd_init_card(struct mmc_h
 
err = mmc_send_app_op_cond(host, ocr, NULL);
if (err)
-   goto err;
+   return err;
 
-   /*
-* Fetch CID from card.
-*/
if (mmc_host_is_spi(host))
err = mmc_send_cid(host, cid);
else
err = mmc_all_send_cid(host, cid);
+
+   return err;
+}
+
+int mmc_sd_get_csd(struct mmc_host *host, struct mmc_card *card)
+{
+   int err;
+
+   /*
+* Fetch CSD from card.
+*/
+   err = mmc_send_csd(card, card->raw_csd);
if (err)
-   goto err;
+   return err;
 
-   if (oldcard) {
-   if (memcmp(cid, oldcard->raw_cid, sizeof(cid)) != 0) {
-   err = -ENOENT;
-   goto err;
+   err = mmc_decode_csd(card);
+   if (err)
+   return err;
+
+   return 0;
+}
+
+int mmc_sd_setup_card(struct mmc_host *host, struct mmc_card *card,
+   bool reinit)
+{
+   int err;
+
+   if (!reinit) {
+   /*
+* Fetch SCR from card.
+*/
+   err = mmc_app_send_scr(card, card->raw_scr);
+   if (err)
+   return err;
+
+   err = mmc_decode_scr(card);
+   if (err)
+   return err;
+
+   /*
+* Fetch switch information from card.
+*/
+   err = mmc_read_switch(card);
+   if (err)
+   return err;
+   }
+
+   /*
+* For SPI, enable CRC as appropriate.
+* This CRC enable is located AFTER the reading of the
+* card registers because some SDHC cards are not able
+* to p

[patch 049/177] sdhci-s3c: add SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK quirk

2010-08-10 Thread akpm
From: Hyuk Lee 

On Samsung's SDMMC hosts the timeout clock is derivied from the SD Clock
which is set dynamically.  So checked SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK
quirk and removed 'sdhci_s3c_get_timeout_clk' callback which doesn't need
any more.

Signed-off-by: Hyuk Lee 
Signed-off-by: Kukjin Kim 
Cc: Ben Dooks 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/sdhci-s3c.c |   10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

diff -puN 
drivers/mmc/host/sdhci-s3c.c~sdhci-s3c-add-sdhci_quirk_data_timeout_uses_sdclk-quirk
 drivers/mmc/host/sdhci-s3c.c
--- 
a/drivers/mmc/host/sdhci-s3c.c~sdhci-s3c-add-sdhci_quirk_data_timeout_uses_sdclk-quirk
+++ a/drivers/mmc/host/sdhci-s3c.c
@@ -110,11 +110,6 @@ static unsigned int sdhci_s3c_get_max_cl
return max;
 }
 
-static unsigned int sdhci_s3c_get_timeout_clk(struct sdhci_host *host)
-{
-   return sdhci_s3c_get_max_clk(host) / 100;
-}
-
 /**
  * sdhci_s3c_consider_clock - consider one the bus clocks for current setting
  * @ourhost: Our SDHCI instance.
@@ -188,7 +183,6 @@ static void sdhci_s3c_set_clock(struct s
 
ourhost->cur_clk = best_src;
host->max_clk = clk_get_rate(clk);
-   host->timeout_clk = sdhci_s3c_get_timeout_clk(host);
 
ctrl = readl(host->ioaddr + S3C_SDHCI_CONTROL2);
ctrl &= ~S3C_SDHCI_CTRL2_SELBASECLK_MASK;
@@ -211,7 +205,6 @@ static void sdhci_s3c_set_clock(struct s
 
 static struct sdhci_ops sdhci_s3c_ops = {
.get_max_clock  = sdhci_s3c_get_max_clk,
-   .get_timeout_clock  = sdhci_s3c_get_timeout_clk,
.set_clock  = sdhci_s3c_set_clock,
 };
 
@@ -335,6 +328,9 @@ static int __devinit sdhci_s3c_probe(str
host->quirks |= (SDHCI_QUIRK_32BIT_DMA_ADDR |
 SDHCI_QUIRK_32BIT_DMA_SIZE);
 
+   /* HSMMC on Samsung SoCs uses SDCLK as timeout clock */
+   host->quirks |= SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK;
+
ret = sdhci_add_host(host);
if (ret) {
dev_err(dev, "sdhci_add_host() failed\n");
_
--
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


[patch 033/177] mmc: implement SD-combo (IO+mem) support

2010-08-10 Thread akpm
From: Michal Miroslaw 

Signed-off-by: Michal Miroslaw 
Cc: Adrian Hunter 
Cc: Chris Ball 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/core/bus.c   |9 ++
 drivers/mmc/core/core.c  |   12 ++-
 drivers/mmc/core/sdio.c  |  135 +++--
 include/linux/mmc/card.h |1 
 4 files changed, 134 insertions(+), 23 deletions(-)

diff -puN drivers/mmc/core/bus.c~mmc-implement-sd-combo-iomem-support 
drivers/mmc/core/bus.c
--- a/drivers/mmc/core/bus.c~mmc-implement-sd-combo-iomem-support
+++ a/drivers/mmc/core/bus.c
@@ -37,6 +37,8 @@ static ssize_t mmc_type_show(struct devi
return sprintf(buf, "SD\n");
case MMC_TYPE_SDIO:
return sprintf(buf, "SDIO\n");
+   case MMC_TYPE_SD_COMBO:
+   return sprintf(buf, "SDcombo\n");
default:
return -EFAULT;
}
@@ -74,6 +76,9 @@ mmc_bus_uevent(struct device *dev, struc
case MMC_TYPE_SDIO:
type = "SDIO";
break;
+   case MMC_TYPE_SD_COMBO:
+   type = "SDcombo";
+   break;
default:
type = NULL;
}
@@ -239,6 +244,10 @@ int mmc_add_card(struct mmc_card *card)
case MMC_TYPE_SDIO:
type = "SDIO";
break;
+   case MMC_TYPE_SD_COMBO:
+   type = "SD-combo";
+   if (mmc_card_blockaddr(card))
+   type = "SDHC-combo";
default:
type = "?";
break;
diff -puN drivers/mmc/core/core.c~mmc-implement-sd-combo-iomem-support 
drivers/mmc/core/core.c
--- a/drivers/mmc/core/core.c~mmc-implement-sd-combo-iomem-support
+++ a/drivers/mmc/core/core.c
@@ -1099,8 +1099,15 @@ void mmc_rescan(struct work_struct *work
 */
err = mmc_send_io_op_cond(host, 0, &ocr);
if (!err) {
-   if (mmc_attach_sdio(host, ocr))
-   mmc_power_off(host);
+   if (mmc_attach_sdio(host, ocr)) {
+   mmc_claim_host(host);
+   /* try SDMEM (but not MMC) even if SDIO is broken */
+   if (mmc_send_app_op_cond(host, 0, &ocr))
+   goto out_fail;
+
+   if (mmc_attach_sd(host, ocr))
+   mmc_power_off(host);
+   }
goto out;
}
 
@@ -1124,6 +1131,7 @@ void mmc_rescan(struct work_struct *work
goto out;
}
 
+out_fail:
mmc_release_host(host);
mmc_power_off(host);
 
diff -puN drivers/mmc/core/sdio.c~mmc-implement-sd-combo-iomem-support 
drivers/mmc/core/sdio.c
--- a/drivers/mmc/core/sdio.c~mmc-implement-sd-combo-iomem-support
+++ a/drivers/mmc/core/sdio.c
@@ -160,9 +160,7 @@ static int sdio_enable_wide(struct mmc_c
if (ret)
return ret;
 
-   mmc_set_bus_width(card->host, MMC_BUS_WIDTH_4);
-
-   return 0;
+   return 1;
 }
 
 /*
@@ -222,10 +220,34 @@ static int sdio_disable_wide(struct mmc_
return 0;
 }
 
+
+static int sdio_enable_4bit_bus(struct mmc_card *card)
+{
+   int err;
+
+   if (card->type == MMC_TYPE_SDIO)
+   return sdio_enable_wide(card);
+
+   if ((card->host->caps & MMC_CAP_4_BIT_DATA) &&
+   (card->scr.bus_widths & SD_SCR_BUS_WIDTH_4)) {
+   err = mmc_app_set_bus_width(card, MMC_BUS_WIDTH_4);
+   if (err)
+   return err;
+   } else
+   return 0;
+
+   err = sdio_enable_wide(card);
+   if (err <= 0)
+   mmc_app_set_bus_width(card, MMC_BUS_WIDTH_1);
+
+   return err;
+}
+
+
 /*
  * Test if the card supports high-speed mode and, if so, switch to it.
  */
-static int sdio_enable_hs(struct mmc_card *card)
+static int mmc_sdio_switch_hs(struct mmc_card *card, int enable)
 {
int ret;
u8 speed;
@@ -240,7 +262,10 @@ static int sdio_enable_hs(struct mmc_car
if (ret)
return ret;
 
-   speed |= SDIO_SPEED_EHS;
+   if (enable)
+   speed |= SDIO_SPEED_EHS;
+   else
+   speed &= ~SDIO_SPEED_EHS;
 
ret = mmc_io_rw_direct(card, 1, 0, SDIO_CCCR_SPEED, speed, NULL);
if (ret)
@@ -249,6 +274,24 @@ static int sdio_enable_hs(struct mmc_car
return 1;
 }
 
+/*
+ * Enable SDIO/combo card's high-speed mode. Return 0/1 if [not]supported.
+ */
+static int sdio_enable_hs(struct mmc_card *card)
+{
+   int ret;
+
+   ret = mmc_sdio_switch_hs(card, true);
+   if (ret <= 0 || card->type == MMC_TYPE_SDIO)
+   return ret;
+
+   ret = mmc_sd_switch_hs(card);
+   if (ret <= 0)
+   mmc_sdio_switch_hs(card, false);
+
+   return ret;
+}
+
 static unsigned mmc_sdio_get_max_clock(struct mmc_card *card)
 {
unsigned max_dtr;
@@ -265,6 +308,9 @@ static unsigned mmc_sdio_get_max_clock(s
max_dtr = card->cis.max_dtr;
}
 
+   if 

[patch 053/177] sdhci: add regulator support

2010-08-10 Thread akpm
From: Marek Szyprowski 

This patch adds support for regulator API to sdhci core driver. 
Regulators can be used to disable power in suspended state to reduce
dissipated energy.

Signed-off-by: Marek Szyprowski 
Signed-off-by: Kyungmin Park 
Acked-by: Mark Brown 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/sdhci.c |   26 +-
 drivers/mmc/host/sdhci.h |2 ++
 2 files changed, 27 insertions(+), 1 deletion(-)

diff -puN drivers/mmc/host/sdhci.c~sdhci-add-regulator-support 
drivers/mmc/host/sdhci.c
--- a/drivers/mmc/host/sdhci.c~sdhci-add-regulator-support
+++ a/drivers/mmc/host/sdhci.c
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -1608,7 +1609,10 @@ int sdhci_suspend_host(struct sdhci_host
 
free_irq(host->irq, host);
 
-   return 0;
+   if (host->vmmc)
+   ret = regulator_disable(host->vmmc);
+
+   return ret;
 }
 
 EXPORT_SYMBOL_GPL(sdhci_suspend_host);
@@ -1617,6 +1621,13 @@ int sdhci_resume_host(struct sdhci_host 
 {
int ret;
 
+   if (host->vmmc) {
+   int ret = regulator_enable(host->vmmc);
+   if (ret)
+   return ret;
+   }
+
+
if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA)) {
if (host->ops->enable_dma)
host->ops->enable_dma(host);
@@ -1889,6 +1900,14 @@ int sdhci_add_host(struct sdhci_host *ho
if (ret)
goto untasklet;
 
+   host->vmmc = regulator_get(mmc_dev(mmc), "vmmc");
+   if (IS_ERR(host->vmmc)) {
+   printk(KERN_INFO "%s: no vmmc regulator found\n", 
mmc_hostname(mmc));
+   host->vmmc = NULL;
+   } else {
+   regulator_enable(host->vmmc);
+   }
+
sdhci_init(host, 0);
 
 #ifdef CONFIG_MMC_DEBUG
@@ -1973,6 +1992,11 @@ void sdhci_remove_host(struct sdhci_host
tasklet_kill(&host->card_tasklet);
tasklet_kill(&host->finish_tasklet);
 
+   if (host->vmmc) {
+   regulator_disable(host->vmmc);
+   regulator_put(host->vmmc);
+   }
+
kfree(host->adma_desc);
kfree(host->align_buffer);
 
diff -puN drivers/mmc/host/sdhci.h~sdhci-add-regulator-support 
drivers/mmc/host/sdhci.h
--- a/drivers/mmc/host/sdhci.h~sdhci-add-regulator-support
+++ a/drivers/mmc/host/sdhci.h
@@ -249,6 +249,8 @@ struct sdhci_host {
 
const struct sdhci_ops  *ops;   /* Low level hw interface */
 
+   struct regulator*vmmc;  /* Power regulator */
+
/* Internal data */
struct mmc_host *mmc;   /* MMC structure */
u64 dma_mask;   /* custom DMA mask */
_
--
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


[patch 034/177] mmc: fix all hangs related to mmc/sd card insert/removal during suspend/resume

2010-08-10 Thread akpm
From: Maxim Levitsky 

If you don't use CONFIG_MMC_UNSAFE_RESUME, as soon as you attempt to
suspend, the card will be removed, therefore this patch doesn't change the
behavior of this option.

However the removal will be done by pm notifier, which runs while
userspace is still not frozen and thus can freely use del_gendisk, without
the risk of deadlock which would happen otherwise.

Card detect workqueue is now disabled while userspace is frozen, Therefore
if you do use CONFIG_MMC_UNSAFE_RESUME, and remove the card during
suspend, the removal will be detected as soon as userspace is unfrozen,
again at the moment it is safe to call del_gendisk.

Tested with and without CONFIG_MMC_UNSAFE_RESUME with suspend and hibernate.

[a...@linux-foundation.org: clean up function prototype]
[a...@linux-foundation.org: fix CONFIG_PM-n linkage, small cleanups]
[a...@linux-foundation.org: coding-style fixes]
Signed-off-by: Maxim Levitsky 
Cc: David Brownell 
Cc: Alan Stern 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/core/core.c  |   83 +
 drivers/mmc/core/host.c  |4 +
 include/linux/mmc/host.h |3 +
 3 files changed, 64 insertions(+), 26 deletions(-)

diff -puN 
drivers/mmc/core/core.c~mmc-fix-all-hangs-related-to-mmc-sd-card-insert-removal-during-suspend-resume
 drivers/mmc/core/core.c
--- 
a/drivers/mmc/core/core.c~mmc-fix-all-hangs-related-to-mmc-sd-card-insert-removal-during-suspend-resume
+++ a/drivers/mmc/core/core.c
@@ -1057,6 +1057,17 @@ void mmc_rescan(struct work_struct *work
container_of(work, struct mmc_host, detect.work);
u32 ocr;
int err;
+   unsigned long flags;
+
+   spin_lock_irqsave(&host->lock, flags);
+
+   if (host->rescan_disable) {
+   spin_unlock_irqrestore(&host->lock, flags);
+   return;
+   }
+
+   spin_unlock_irqrestore(&host->lock, flags);
+
 
mmc_bus_get(host);
 
@@ -1274,19 +1285,6 @@ int mmc_suspend_host(struct mmc_host *ho
if (host->bus_ops && !host->bus_dead) {
if (host->bus_ops->suspend)
err = host->bus_ops->suspend(host);
-   if (err == -ENOSYS || !host->bus_ops->resume) {
-   /*
-* We simply "remove" the card in this case.
-* It will be redetected on resume.
-*/
-   if (host->bus_ops->remove)
-   host->bus_ops->remove(host);
-   mmc_claim_host(host);
-   mmc_detach_bus(host);
-   mmc_release_host(host);
-   host->pm_flags = 0;
-   err = 0;
-   }
}
mmc_bus_put(host);
 
@@ -1318,28 +1316,61 @@ int mmc_resume_host(struct mmc_host *hos
printk(KERN_WARNING "%s: error %d during resume "
"(card was removed?)\n",
mmc_hostname(host), err);
-   if (host->bus_ops->remove)
-   host->bus_ops->remove(host);
-   mmc_claim_host(host);
-   mmc_detach_bus(host);
-   mmc_release_host(host);
-   /* no need to bother upper layers */
err = 0;
}
}
mmc_bus_put(host);
 
-   /*
-* We add a slight delay here so that resume can progress
-* in parallel.
-*/
-   mmc_detect_change(host, 1);
-
return err;
 }
-
 EXPORT_SYMBOL(mmc_resume_host);
 
+/* Do the card removal on suspend if card is assumed removeable
+ * Do that in pm notifier while userspace isn't yet frozen, so we will be able
+   to sync the card.
+*/
+int mmc_pm_notify(struct notifier_block *notify_block,
+   unsigned long mode, void *unused)
+{
+   struct mmc_host *host = container_of(
+   notify_block, struct mmc_host, pm_notify);
+   unsigned long flags;
+
+
+   switch (mode) {
+   case PM_HIBERNATION_PREPARE:
+   case PM_SUSPEND_PREPARE:
+
+   spin_lock_irqsave(&host->lock, flags);
+   host->rescan_disable = 1;
+   spin_unlock_irqrestore(&host->lock, flags);
+   cancel_delayed_work_sync(&host->detect);
+
+   if (!host->bus_ops || host->bus_ops->suspend)
+   break;
+
+   mmc_claim_host(host);
+
+   if (host->bus_ops->remove)
+   host->bus_ops->remove(host);
+
+   mmc_detach_bus(host);
+   mmc_release_host(host);
+   host->pm_flags = 0;
+   break;
+
+   case PM_POST_SUSPEND:
+   case PM_POST_HIBERNATION:
+
+   spin_lock_irqsave(&host->lock, flags);
+   host->rescan_disable = 0;
+   spin_unl

[patch 052/177] sdhci-s3c: add support for new card detection methods

2010-08-10 Thread akpm
From: Marek Szyprowski 

On some Samsung SoCs not all SDHCI controllers have card detect (CD) line.
 For some embedded designs it is not even needed, because ususally the
device (like SDIO flash memory or wifi controller) is permanently wired to
the controller.  There are also systems which have a card detect line
connected to some of the external interrupt lines or the presence of the
card depends on some other actions (like enabling a power regulator).

This patch adds support for all these cases.  The following card detection
methods are possible:

1. internal sdhci host card detect line
2. external event
3. external gpio interrupt
4. no card detect line, controller will poll for the card
5. no card detect line, card is permanently wired to the controller
(once detected host won't poll it any more)

By default, all existing code would use method #1, what is compatible with
the previous version of the driver.

In case of external event, two callbacks must be provided in platdata:
ext_cd_init and ext_cd_cleanup.  Both of them get a callback to a function
that notifies the s3c-sdhci host contoller as their argument.  That
callback function should be called from the even dispatcher to let host
notice the card insertion/removal.

In case of external gpio interrupt, a gpio pin number must be provided in
platdata (ext_cd_gpio parameter), as well as the information about the
polarity of that gpio pin (ext_cd_gpio_invert).  By default
(ext_cd_gpio_invert == 0) gpio value 0 means 'card has been removed', but
this can be changed to 'card has been removed' when ext_cd_gpio_invert ==
1.

This patch adds all required changes to sdhci-s3c driver.

Signed-off-by: Marek Szyprowski 
Signed-off-by: Kyungmin Park 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/sdhci-s3c.c |   85 +
 drivers/mmc/host/sdhci.h |1 
 2 files changed, 86 insertions(+)

diff -puN 
drivers/mmc/host/sdhci-s3c.c~sdhci-s3c-add-support-for-new-card-detection-methods
 drivers/mmc/host/sdhci-s3c.c
--- 
a/drivers/mmc/host/sdhci-s3c.c~sdhci-s3c-add-support-for-new-card-detection-methods
+++ a/drivers/mmc/host/sdhci-s3c.c
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -44,6 +45,8 @@ struct sdhci_s3c {
struct resource *ioarea;
struct s3c_sdhci_platdata *pdata;
unsigned intcur_clk;
+   int ext_cd_irq;
+   int ext_cd_gpio;
 
struct clk  *clk_io;
struct clk  *clk_bus[MAX_BUS_CLK];
@@ -235,6 +238,61 @@ static struct sdhci_ops sdhci_s3c_ops = 
.get_min_clock  = sdhci_s3c_get_min_clock,
 };
 
+static void sdhci_s3c_notify_change(struct platform_device *dev, int state)
+{
+   struct sdhci_host *host = platform_get_drvdata(dev);
+   if (host) {
+   mutex_lock(&host->lock);
+   if (state) {
+   dev_dbg(&dev->dev, "card inserted.\n");
+   host->flags &= ~SDHCI_DEVICE_DEAD;
+   host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+   } else {
+   dev_dbg(&dev->dev, "card removed.\n");
+   host->flags |= SDHCI_DEVICE_DEAD;
+   host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+   }
+   sdhci_card_detect(host);
+   mutex_unlock(&host->lock);
+   }
+}
+
+static irqreturn_t sdhci_s3c_gpio_card_detect_thread(int irq, void *dev_id)
+{
+   struct sdhci_s3c *sc = dev_id;
+   int status = gpio_get_value(sc->ext_cd_gpio);
+   if (sc->pdata->ext_cd_gpio_invert)
+   status = !status;
+   sdhci_s3c_notify_change(sc->pdev, status);
+   return IRQ_HANDLED;
+}
+
+static void sdhci_s3c_setup_card_detect_gpio(struct sdhci_s3c *sc)
+{
+   struct s3c_sdhci_platdata *pdata = sc->pdata;
+   struct device *dev = &sc->pdev->dev;
+
+   if (gpio_request(pdata->ext_cd_gpio, "SDHCI EXT CD") == 0) {
+   sc->ext_cd_gpio = pdata->ext_cd_gpio;
+   sc->ext_cd_irq = gpio_to_irq(pdata->ext_cd_gpio);
+   if (sc->ext_cd_irq &&
+   request_threaded_irq(sc->ext_cd_irq, NULL,
+sdhci_s3c_gpio_card_detect_thread,
+IRQF_TRIGGER_RISING | 
IRQF_TRIGGER_FALLING,
+dev_name(dev), sc) == 0) {
+   int status = gpio_get_value(sc->ext_cd_gpio);
+   if (pdata->ext_cd_gpio_invert)
+   status = !status;
+   sdhci_s3c_notify_change(sc->pdev, status);
+   } else {
+   dev_warn(dev, "cannot request irq for card detect\n");
+   sc->ext_cd_irq = 0;
+   }
+   } else {
+   dev_err(dev, "cannot request gpio for card detect\n")

[patch 050/177] sdhci-s3c: add support for the non standard minimal clock value

2010-08-10 Thread akpm
From: Marek Szyprowski 

S3C SDHCI host controller can change the source for generating mmc clock. 
By default host bus clock is used, what causes some problems on machines
with 133MHz bus, because the SDHCI divider cannot be as high get proper
clock value for identification mode.  This is not a problem for the
controller, because it can generate lower frequencies from other clock
sources.  This patch changes sdhci driver to use get_min_clock() call if
it has been provided.

This fixes the flood of the following warnings on Samsung S5PV210 SoCs:
mmc0: Minimum clock frequency too high for identification mode

Signed-off-by: Marek Szyprowski 
Signed-off-by: Kyungmin Park 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/sdhci-s3c.c |   27 +++
 drivers/mmc/host/sdhci.c |3 +--
 2 files changed, 28 insertions(+), 2 deletions(-)

diff -puN 
drivers/mmc/host/sdhci-s3c.c~sdhci-s3c-add-support-for-the-non-standard-minimal-clock-value
 drivers/mmc/host/sdhci-s3c.c
--- 
a/drivers/mmc/host/sdhci-s3c.c~sdhci-s3c-add-support-for-the-non-standard-minimal-clock-value
+++ a/drivers/mmc/host/sdhci-s3c.c
@@ -203,9 +203,36 @@ static void sdhci_s3c_set_clock(struct s
}
 }
 
+/**
+ * sdhci_s3c_get_min_clock - callback to get minimal supported clock value
+ * @host: The SDHCI host being queried
+ *
+ * To init mmc host properly a minimal clock value is needed. For high system
+ * bus clock's values the standard formula gives values out of allowed range.
+ * The clock still can be set to lower values, if clock source other then
+ * system bus is selected.
+*/
+static unsigned int sdhci_s3c_get_min_clock(struct sdhci_host *host)
+{
+   struct sdhci_s3c *ourhost = to_s3c(host);
+   unsigned int delta, min = UINT_MAX;
+   int src;
+
+   for (src = 0; src < MAX_BUS_CLK; src++) {
+   delta = sdhci_s3c_consider_clock(ourhost, src, 0);
+   if (delta == UINT_MAX)
+   continue;
+   /* delta is a negative value in this case */
+   if (-delta < min)
+   min = -delta;
+   }
+   return min;
+}
+
 static struct sdhci_ops sdhci_s3c_ops = {
.get_max_clock  = sdhci_s3c_get_max_clk,
.set_clock  = sdhci_s3c_set_clock,
+   .get_min_clock  = sdhci_s3c_get_min_clock,
 };
 
 static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
diff -puN 
drivers/mmc/host/sdhci.c~sdhci-s3c-add-support-for-the-non-standard-minimal-clock-value
 drivers/mmc/host/sdhci.c
--- 
a/drivers/mmc/host/sdhci.c~sdhci-s3c-add-support-for-the-non-standard-minimal-clock-value
+++ a/drivers/mmc/host/sdhci.c
@@ -1791,8 +1791,7 @@ int sdhci_add_host(struct sdhci_host *ho
 * Set host parameters.
 */
mmc->ops = &sdhci_ops;
-   if (host->quirks & SDHCI_QUIRK_NONSTANDARD_CLOCK &&
-   host->ops->get_min_clock)
+   if (host->ops->get_min_clock)
mmc->f_min = host->ops->get_min_clock(host);
else
mmc->f_min = host->max_clk / 256;
_
--
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


[patch 037/177] sdhci: 8-bit data transfer width support

2010-08-10 Thread akpm
From: Kyungmin Park 

Some host controllers such as s5pc110 support the WIDE8 feature.

Signed-off-by: Kyungmin Park 
Cc: Grant Likely 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/sdhci.c |5 +
 drivers/mmc/host/sdhci.h |1 +
 2 files changed, 6 insertions(+)

diff -puN drivers/mmc/host/sdhci.c~sdhci-8-bit-data-transfer-width-support 
drivers/mmc/host/sdhci.c
--- a/drivers/mmc/host/sdhci.c~sdhci-8-bit-data-transfer-width-support
+++ a/drivers/mmc/host/sdhci.c
@@ -1159,6 +1159,11 @@ static void sdhci_set_ios(struct mmc_hos
 
ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
 
+   if (ios->bus_width == MMC_BUS_WIDTH_8)
+   ctrl |= SDHCI_CTRL_8BITBUS;
+   else
+   ctrl &= ~SDHCI_CTRL_8BITBUS;
+
if (ios->bus_width == MMC_BUS_WIDTH_4)
ctrl |= SDHCI_CTRL_4BITBUS;
else
diff -puN drivers/mmc/host/sdhci.h~sdhci-8-bit-data-transfer-width-support 
drivers/mmc/host/sdhci.h
--- a/drivers/mmc/host/sdhci.h~sdhci-8-bit-data-transfer-width-support
+++ a/drivers/mmc/host/sdhci.h
@@ -72,6 +72,7 @@
 #define   SDHCI_CTRL_ADMA1 0x08
 #define   SDHCI_CTRL_ADMA320x10
 #define   SDHCI_CTRL_ADMA640x18
+#define  SDHCI_CTRL_8BITBUS0x20
 
 #define SDHCI_POWER_CONTROL0x29
 #define  SDHCI_POWER_ON0x01
_
--
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


[patch 051/177] sdhci-s3c: enable SDHCI_QUIRK_NO_HISPD_BIT quirk

2010-08-10 Thread akpm
From: Marek Szyprowski 

This patch enables SDHCI_QUIRK_NO_HISPD_BIT on Samsung SDHCI driver.  This
solves detection problems with some external SD cards.  This change has
been tested on S5PC100 and S5PC110.  It has no inpact on driver speed.

Signed-off-by: Kyungmin Park 
Signed-off-by: Marek Szyprowski 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/sdhci-s3c.c |1 +
 1 file changed, 1 insertion(+)

diff -puN 
drivers/mmc/host/sdhci-s3c.c~sdhci-s3c-enable-sdhci_quirk_no_hispd_bit-quirk 
drivers/mmc/host/sdhci-s3c.c
--- 
a/drivers/mmc/host/sdhci-s3c.c~sdhci-s3c-enable-sdhci_quirk_no_hispd_bit-quirk
+++ a/drivers/mmc/host/sdhci-s3c.c
@@ -338,6 +338,7 @@ static int __devinit sdhci_s3c_probe(str
 
/* Setup quirks for the controller */
host->quirks |= SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC;
+   host->quirks |= SDHCI_QUIRK_NO_HISPD_BIT;
 
 #ifndef CONFIG_MMC_SDHCI_S3C_DMA
 
_
--
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


[patch 038/177] sdhci: don't assign mmc->caps at SDHCI directly

2010-08-10 Thread akpm
From: Kyungmin Park 

Some host controllers can set mmc->caps before sdhci_add_host().

Signed-off-by: Kyungmin Park 
Cc: Grant Likely 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/sdhci.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/mmc/host/sdhci.c~sdhci-dont-assign-mmc-caps-at-sdhci-directly 
drivers/mmc/host/sdhci.c
--- a/drivers/mmc/host/sdhci.c~sdhci-dont-assign-mmc-caps-at-sdhci-directly
+++ a/drivers/mmc/host/sdhci.c
@@ -1797,7 +1797,7 @@ int sdhci_add_host(struct sdhci_host *ho
else
mmc->f_min = host->max_clk / 256;
mmc->f_max = host->max_clk;
-   mmc->caps = MMC_CAP_SDIO_IRQ;
+   mmc->caps |= MMC_CAP_SDIO_IRQ;
 
if (!(host->quirks & SDHCI_QUIRK_FORCE_1_BIT_DATA))
mmc->caps |= MMC_CAP_4_BIT_DATA;
_
--
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


[patch 036/177] sdhci: remove useless set_clock() check

2010-08-10 Thread akpm
From: Kyungmin Park 

When using QUIRK_NONSTANDARD_CLOCK, it checks the set_clock() function
which is not used actually.  So delete it.

Signed-off-by: Kyungmin Park 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/sdhci.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/mmc/host/sdhci.c~sdhci-remove-useless-set_clock-check 
drivers/mmc/host/sdhci.c
--- a/drivers/mmc/host/sdhci.c~sdhci-remove-useless-set_clock-check
+++ a/drivers/mmc/host/sdhci.c
@@ -1787,7 +1787,7 @@ int sdhci_add_host(struct sdhci_host *ho
 */
mmc->ops = &sdhci_ops;
if (host->quirks & SDHCI_QUIRK_NONSTANDARD_CLOCK &&
-   host->ops->set_clock && host->ops->get_min_clock)
+   host->ops->get_min_clock)
mmc->f_min = host->ops->get_min_clock(host);
else
mmc->f_min = host->max_clk / 256;
_
--
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


[patch 044/177] sdio: allow non-standard SDIO cards

2010-08-10 Thread akpm
From: Grazvydas Ignotas 

There are some chips (like TI WL12xx series) that can be interfaced over
SDIO but don't support the SDIO specification, meaning that they are
missing CIA (Common I/O Area) with all it's registers.  Current Linux SDIO
implementation relies on those registers to identify and configure the
card, so non-standard cards can not function and cause lots of warnings
from the core when it reads invalid data from non-existent registers.

After this patch, init_card() host callback can now set new quirk
MMC_QUIRK_NONSTD_SDIO, which means that SDIO core should not try to access
any standard SDIO registers and rely on init_card() to fill all SDIO
structures instead.  As those cards are usually embedded chips, all the
required information can be obtained from machine board files by the host
driver when it's called through init_card() callback.

Signed-off-by: Grazvydas Ignotas 
Cc: Adrian Hunter 
Cc: Tony Lindgren 
Cc: Bob Copeland 
Cc: Kalle Valo 
Cc: Madhusudhan Chikkature 
Cc: Kishore Kadiyala 
Cc: Russell King 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/core/sdio.c  |   36 ++--
 include/linux/mmc/card.h |2 ++
 2 files changed, 32 insertions(+), 6 deletions(-)

diff -puN drivers/mmc/core/sdio.c~sdio-allow-non-standard-sdio-cards 
drivers/mmc/core/sdio.c
--- a/drivers/mmc/core/sdio.c~sdio-allow-non-standard-sdio-cards
+++ a/drivers/mmc/core/sdio.c
@@ -63,13 +63,19 @@ static int sdio_init_func(struct mmc_car
 
func->num = fn;
 
-   ret = sdio_read_fbr(func);
-   if (ret)
-   goto fail;
+   if (!(card->quirks & MMC_QUIRK_NONSTD_SDIO)) {
+   ret = sdio_read_fbr(func);
+   if (ret)
+   goto fail;
 
-   ret = sdio_read_func_cis(func);
-   if (ret)
-   goto fail;
+   ret = sdio_read_func_cis(func);
+   if (ret)
+   goto fail;
+   } else {
+   func->vendor = func->card->cis.vendor;
+   func->device = func->card->cis.device;
+   func->max_blksize = func->card->cis.blksize;
+   }
 
card->sdio_func[fn - 1] = func;
 
@@ -412,6 +418,23 @@ static int mmc_sdio_init_card(struct mmc
goto remove;
}
 
+   if (card->quirks & MMC_QUIRK_NONSTD_SDIO) {
+   /*
+* This is non-standard SDIO device, meaning it doesn't
+* have any CIA (Common I/O area) registers present.
+* It's host's responsibility to fill cccr and cis
+* structures in init_card().
+*/
+   mmc_set_clock(host, card->cis.max_dtr);
+
+   if (card->cccr.high_speed) {
+   mmc_card_set_highspeed(card);
+   mmc_set_timing(card->host, MMC_TIMING_SD_HS);
+   }
+
+   goto finish;
+   }
+
/*
 * Read the common registers.
 */
@@ -480,6 +503,7 @@ static int mmc_sdio_init_card(struct mmc
else if (err)
goto remove;
 
+finish:
if (!oldcard)
host->card = card;
return 0;
diff -puN include/linux/mmc/card.h~sdio-allow-non-standard-sdio-cards 
include/linux/mmc/card.h
--- a/include/linux/mmc/card.h~sdio-allow-non-standard-sdio-cards
+++ a/include/linux/mmc/card.h
@@ -103,6 +103,8 @@ struct mmc_card {
 #define MMC_QUIRK_LENIENT_FN0  (1<<0)  /* allow SDIO FN0 writes 
outside of the VS CCCR range */
 #define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1)   /* use func->cur_blksize */
/* for byte mode */
+#define MMC_QUIRK_NONSTD_SDIO  (1<<2)  /* non-standard SDIO card 
attached */
+   /* (missing CIA registers) */
 
u32 raw_cid[4]; /* raw card CID */
u32 raw_csd[4]; /* raw card CSD */
_
--
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


[patch 045/177] omap_hsmmc: add init_card pass-through callback

2010-08-10 Thread akpm
From: Grazvydas Ignotas 

This will allow us to set up special cards in machine drivers just after
they are detected by MMC core.

Signed-off-by: Grazvydas Ignotas 
Cc: Adrian Hunter 
Cc: Tony Lindgren 
Cc: Bob Copeland 
Cc: Kalle Valo 
Cc: Madhusudhan Chikkature 
Cc: Kishore Kadiyala 
Cc: Russell King 
Cc: 
Signed-off-by: Andrew Morton 
---

 arch/arm/plat-omap/include/plat/mmc.h |2 ++
 drivers/mmc/host/omap_hsmmc.c |   10 ++
 2 files changed, 12 insertions(+)

diff -puN 
arch/arm/plat-omap/include/plat/mmc.h~omap_hsmmc-add-init_card-pass-through-callback
 arch/arm/plat-omap/include/plat/mmc.h
--- 
a/arch/arm/plat-omap/include/plat/mmc.h~omap_hsmmc-add-init_card-pass-through-callback
+++ a/arch/arm/plat-omap/include/plat/mmc.h
@@ -122,6 +122,8 @@ struct omap_mmc_platform_data {
/* Call back after enabling / disabling regulators */
void (*after_set_reg)(struct device *dev, int slot,
  int power_on, int vdd);
+   /* if we have special card, init it using this callback */
+   void (*init_card)(struct mmc_card *card);
 
/* return MMC cover switch state, can be NULL if not supported.
 *
diff -puN 
drivers/mmc/host/omap_hsmmc.c~omap_hsmmc-add-init_card-pass-through-callback 
drivers/mmc/host/omap_hsmmc.c
--- 
a/drivers/mmc/host/omap_hsmmc.c~omap_hsmmc-add-init_card-pass-through-callback
+++ a/drivers/mmc/host/omap_hsmmc.c
@@ -1598,6 +1598,14 @@ static int omap_hsmmc_get_ro(struct mmc_
return mmc_slot(host).get_ro(host->dev, 0);
 }
 
+static void omap_hsmmc_init_card(struct mmc_host *mmc, struct mmc_card *card)
+{
+   struct omap_hsmmc_host *host = mmc_priv(mmc);
+
+   if (mmc_slot(host).init_card)
+   mmc_slot(host).init_card(card);
+}
+
 static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host)
 {
u32 hctl, capa, value;
@@ -1869,6 +1877,7 @@ static const struct mmc_host_ops omap_hs
.set_ios = omap_hsmmc_set_ios,
.get_cd = omap_hsmmc_get_cd,
.get_ro = omap_hsmmc_get_ro,
+   .init_card = omap_hsmmc_init_card,
/* NYET -- enable_sdio_irq */
 };
 
@@ -1879,6 +1888,7 @@ static const struct mmc_host_ops omap_hs
.set_ios = omap_hsmmc_set_ios,
.get_cd = omap_hsmmc_get_cd,
.get_ro = omap_hsmmc_get_ro,
+   .init_card = omap_hsmmc_init_card,
/* NYET -- enable_sdio_irq */
 };
 
_
--
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


[patch 042/177] sdhci-pltfm: reorganize Makefile entries to support SoC devices

2010-08-10 Thread akpm
From: Anton Vorontsov 

Due to build system limitations, intermediate and final objects can't have
the same names.  And as we're going to start building SoC-specific
objects, let's rename the module to sdhci-platform, into which we'll link
sdhci-pltfm and SoC-specifc objects.

There should be no issue in renaming as the driver uses modalias
mechanism.

This is exactly the same approach as in sdhci-of driver.

Signed-off-by: Anton Vorontsov 
Cc: Ben Dooks 
Cc: Richard Röjfors  
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/Makefile |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff -puN 
drivers/mmc/host/Makefile~sdhci-pltfm-reorganize-makefile-entries-to-support-soc-devices
 drivers/mmc/host/Makefile
--- 
a/drivers/mmc/host/Makefile~sdhci-pltfm-reorganize-makefile-entries-to-support-soc-devices
+++ a/drivers/mmc/host/Makefile
@@ -12,7 +12,6 @@ obj-$(CONFIG_MMC_IMX) += imxmmc.o
 obj-$(CONFIG_MMC_MXC)  += mxcmmc.o
 obj-$(CONFIG_MMC_SDHCI)+= sdhci.o
 obj-$(CONFIG_MMC_SDHCI_PCI)+= sdhci-pci.o
-obj-$(CONFIG_MMC_SDHCI_PLTFM)  += sdhci-pltfm.o
 obj-$(CONFIG_MMC_SDHCI_S3C)+= sdhci-s3c.o
 obj-$(CONFIG_MMC_SDHCI_SPEAR)  += sdhci-spear.o
 obj-$(CONFIG_MMC_WBSD) += wbsd.o
@@ -38,6 +37,9 @@ obj-$(CONFIG_SDH_BFIN)+= bfin_sdh.o
 obj-$(CONFIG_MMC_SH_MMCIF) += sh_mmcif.o
 obj-$(CONFIG_MMC_JZ4740)   += jz4740_mmc.o
 
+obj-$(CONFIG_MMC_SDHCI_PLTFM)  += sdhci-platform.o
+sdhci-platform-y   := sdhci-pltfm.o
+
 obj-$(CONFIG_MMC_SDHCI_OF) += sdhci-of.o
 sdhci-of-y := sdhci-of-core.o
 sdhci-of-$(CONFIG_MMC_SDHCI_OF_ESDHC)  += sdhci-of-esdhc.o
_
--
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


[patch 041/177] sdhci-pltfm: switch to module device table matching

2010-08-10 Thread akpm
From: Anton Vorontsov 

Sometimes want to place SoC-specific parts alongside with the generic
driver, and to do so, we have to switch the driver over to the module
device table matching.

Note that drivers/mmc/host/sdhci-pltfm.h is so far empty, but it'll hold
SoC-specific driver data handlers soon.

Signed-off-by: Anton Vorontsov 
Cc: Ben Dooks 
Cc: Richard Röjfors  
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/sdhci-pltfm.c |   14 +-
 drivers/mmc/host/sdhci-pltfm.h |   14 ++
 2 files changed, 27 insertions(+), 1 deletion(-)

diff -puN 
drivers/mmc/host/sdhci-pltfm.c~sdhci-pltfm-switch-to-module-device-table-matching
 drivers/mmc/host/sdhci-pltfm.c
--- 
a/drivers/mmc/host/sdhci-pltfm.c~sdhci-pltfm-switch-to-module-device-table-matching
+++ a/drivers/mmc/host/sdhci-pltfm.c
@@ -24,6 +24,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -32,6 +33,7 @@
 #include 
 
 #include "sdhci.h"
+#include "sdhci-pltfm.h"
 
 /*\
  *   *
@@ -51,10 +53,14 @@ static struct sdhci_ops sdhci_pltfm_ops 
 static int __devinit sdhci_pltfm_probe(struct platform_device *pdev)
 {
struct sdhci_pltfm_data *pdata = pdev->dev.platform_data;
+   const struct platform_device_id *platid = platform_get_device_id(pdev);
struct sdhci_host *host;
struct resource *iomem;
int ret;
 
+   if (!pdata && platid && platid->driver_data)
+   pdata = (void *)platid->driver_data;
+
iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!iomem) {
ret = -ENOMEM;
@@ -150,6 +156,12 @@ static int __devexit sdhci_pltfm_remove(
return 0;
 }
 
+static const struct platform_device_id sdhci_pltfm_ids[] = {
+   { "sdhci", },
+   { },
+};
+MODULE_DEVICE_TABLE(platform, sdhci_pltfm_ids);
+
 static struct platform_driver sdhci_pltfm_driver = {
.driver = {
.name   = "sdhci",
@@ -157,6 +169,7 @@ static struct platform_driver sdhci_pltf
},
.probe  = sdhci_pltfm_probe,
.remove = __devexit_p(sdhci_pltfm_remove),
+   .id_table   = sdhci_pltfm_ids,
 };
 
 /*\
@@ -181,4 +194,3 @@ module_exit(sdhci_drv_exit);
 MODULE_DESCRIPTION("Secure Digital Host Controller Interface platform driver");
 MODULE_AUTHOR("Mocean Laboratories ");
 MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:sdhci");
diff -puN /dev/null drivers/mmc/host/sdhci-pltfm.h
--- /dev/null
+++ a/drivers/mmc/host/sdhci-pltfm.h
@@ -0,0 +1,14 @@
+/*
+ * Copyright 2010 MontaVista Software, LLC.
+ *
+ * Author: Anton Vorontsov 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef _DRIVERS_MMC_SDHCI_PLTFM_H
+#define _DRIVERS_MMC_SDHCI_PLTFM_H
+
+#endif /* _DRIVERS_MMC_SDHCI_PLTFM_H */
_
--
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


[patch 040/177] mmc: omap: fix for bus width which improves SD card's peformance.

2010-08-10 Thread akpm
From: Kishore Kadiyala 

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 
Signed-off-by: Venkatraman S 
Signed-off-by: Nishanth Menon 
Acked-by: Madhusudhan Chikkature 
Tested-by: Jarkko Nikula 
Cc: Adrian Hunter 
Cc: Matt Fleming 
Cc: Tony Lindgren 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/omap_hsmmc.c |   17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff -puN 
drivers/mmc/host/omap_hsmmc.c~mmc-omap-fix-for-bus-width-which-improves-sd-cards-peformance
 drivers/mmc/host/omap_hsmmc.c
--- 
a/drivers/mmc/host/omap_hsmmc.c~mmc-omap-fix-for-bus-width-which-improves-sd-cards-peformance
+++ a/drivers/mmc/host/omap_hsmmc.c
@@ -2096,10 +2096,23 @@ static int __init omap_hsmmc_probe(struc
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)
+   /* 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;
_
--
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


[patch 047/177] drivers/mmc/host/msm-sdcc: remove dead config options

2010-08-10 Thread akpm
From: Christian Dietrich 

CONFIG_MMC_MSM7X00A_RESUME_IN_WQ and CONFIG_MMC_EMBEDDED_SDIO don't exist
in Kconfig and is never defined anywhere else, therefore removing all
references for it from the source code.

Signed-off-by: Christian Dietrich 
Acked-by: David Brown 
Cc: Daniel Walker 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/msm_sdcc.c |   25 -
 drivers/mmc/host/msm_sdcc.h |4 
 2 files changed, 29 deletions(-)

diff -puN 
drivers/mmc/host/msm_sdcc.c~drivers-mmc-host-msm-sdcc-remove-dead-config-options
 drivers/mmc/host/msm_sdcc.c
--- 
a/drivers/mmc/host/msm_sdcc.c~drivers-mmc-host-msm-sdcc-remove-dead-config-options
+++ a/drivers/mmc/host/msm_sdcc.c
@@ -1057,22 +1057,6 @@ msmsdcc_init_dma(struct msmsdcc_host *ho
return 0;
 }
 
-#ifdef CONFIG_MMC_MSM7X00A_RESUME_IN_WQ
-static void
-do_resume_work(struct work_struct *work)
-{
-   struct msmsdcc_host *host =
-   container_of(work, struct msmsdcc_host, resume_task);
-   struct mmc_host *mmc = host->mmc;
-
-   if (mmc) {
-   mmc_resume_host(mmc);
-   if (host->stat_irq)
-   enable_irq(host->stat_irq);
-   }
-}
-#endif
-
 static int
 msmsdcc_probe(struct platform_device *pdev)
 {
@@ -1145,15 +1129,6 @@ msmsdcc_probe(struct platform_device *pd
host->dmares = dmares;
spin_lock_init(&host->lock);
 
-#ifdef CONFIG_MMC_EMBEDDED_SDIO
-   if (plat->embedded_sdio)
-   mmc_set_embedded_sdio_data(mmc,
-  &plat->embedded_sdio->cis,
-  &plat->embedded_sdio->cccr,
-  plat->embedded_sdio->funcs,
-  plat->embedded_sdio->num_funcs);
-#endif
-
/*
 * Setup DMA
 */
diff -puN 
drivers/mmc/host/msm_sdcc.h~drivers-mmc-host-msm-sdcc-remove-dead-config-options
 drivers/mmc/host/msm_sdcc.h
--- 
a/drivers/mmc/host/msm_sdcc.h~drivers-mmc-host-msm-sdcc-remove-dead-config-options
+++ a/drivers/mmc/host/msm_sdcc.h
@@ -235,10 +235,6 @@ struct msmsdcc_host {
int cmdpoll;
struct msmsdcc_statsstats;
 
-#ifdef CONFIG_MMC_MSM7X00A_RESUME_IN_WQ
-   struct work_struct  resume_task;
-#endif
-
/* Command parameters */
unsigned intcmd_timeout;
unsigned intcmd_pio_irqmask;
_
--
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


[patch 043/177] sdhci-pltfm: add support for CNS3xxx SoC devices

2010-08-10 Thread akpm
From: Anton Vorontsov 

There's nothing special, just SoC-specific ops and quirks.

Signed-off-by: Anton Vorontsov 
Cc: Ben Dooks 
Cc: Richard Röjfors  
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/Kconfig |9 ++
 drivers/mmc/host/Makefile|1 
 drivers/mmc/host/sdhci-cns3xxx.c |   97 +
 drivers/mmc/host/sdhci-pltfm.c   |3 
 drivers/mmc/host/sdhci-pltfm.h   |4 +
 5 files changed, 114 insertions(+)

diff -puN 
drivers/mmc/host/Kconfig~sdhci-pltfm-add-support-for-cns3xxx-soc-devices 
drivers/mmc/host/Kconfig
--- a/drivers/mmc/host/Kconfig~sdhci-pltfm-add-support-for-cns3xxx-soc-devices
+++ a/drivers/mmc/host/Kconfig
@@ -121,6 +121,15 @@ config MMC_SDHCI_PLTFM
 
  If unsure, say N.
 
+config MMC_SDHCI_CNS3XXX
+   bool "SDHCI support on the Cavium Networks CNS3xxx SoC"
+   depends on ARCH_CNS3XXX
+   depends on MMC_SDHCI_PLTFM
+   help
+ This selects the SDHCI support for CNS3xxx System-on-Chip devices.
+
+ If unsure, say N.
+
 config MMC_SDHCI_S3C
tristate "SDHCI support on Samsung S3C SoC"
depends on MMC_SDHCI && (PLAT_S3C24XX || PLAT_S3C64XX)
diff -puN 
drivers/mmc/host/Makefile~sdhci-pltfm-add-support-for-cns3xxx-soc-devices 
drivers/mmc/host/Makefile
--- a/drivers/mmc/host/Makefile~sdhci-pltfm-add-support-for-cns3xxx-soc-devices
+++ a/drivers/mmc/host/Makefile
@@ -39,6 +39,7 @@ obj-$(CONFIG_MMC_JZ4740)  += jz4740_mmc.o
 
 obj-$(CONFIG_MMC_SDHCI_PLTFM)  += sdhci-platform.o
 sdhci-platform-y   := sdhci-pltfm.o
+sdhci-platform-$(CONFIG_MMC_SDHCI_CNS3XXX) += sdhci-cns3xxx.o
 
 obj-$(CONFIG_MMC_SDHCI_OF) += sdhci-of.o
 sdhci-of-y := sdhci-of-core.o
diff -puN /dev/null drivers/mmc/host/sdhci-cns3xxx.c
--- /dev/null
+++ a/drivers/mmc/host/sdhci-cns3xxx.c
@@ -0,0 +1,97 @@
+/*
+ * SDHCI support for CNS3xxx SoC
+ *
+ * Copyright 2008 Cavium Networks
+ * Copyright 2010 MontaVista Software, LLC.
+ *
+ * Authors: Scott Shu
+ * Anton Vorontsov 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "sdhci.h"
+#include "sdhci-pltfm.h"
+
+static unsigned int sdhci_cns3xxx_get_max_clk(struct sdhci_host *host)
+{
+   return 15000;
+}
+
+static void sdhci_cns3xxx_set_clock(struct sdhci_host *host, unsigned int 
clock)
+{
+   struct device *dev = mmc_dev(host->mmc);
+   int div = 1;
+   u16 clk;
+   unsigned long timeout;
+
+   if (clock == host->clock)
+   return;
+
+   sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);
+
+   if (clock == 0)
+   goto out;
+
+   while (host->max_clk / div > clock) {
+   /*
+* On CNS3xxx divider grows linearly up to 4, and then
+* exponentially up to 256.
+*/
+   if (div < 4)
+   div += 1;
+   else if (div < 256)
+   div *= 2;
+   else
+   break;
+   }
+
+   dev_dbg(dev, "desired SD clock: %d, actual: %d\n",
+   clock, host->max_clk / div);
+
+   /* Divide by 3 is special. */
+   if (div != 3)
+   div >>= 1;
+
+   clk = div << SDHCI_DIVIDER_SHIFT;
+   clk |= SDHCI_CLOCK_INT_EN;
+   sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
+
+   timeout = 20;
+   while (!((clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL))
+   & SDHCI_CLOCK_INT_STABLE)) {
+   if (timeout == 0) {
+   dev_warn(dev, "clock is unstable");
+   break;
+   }
+   timeout--;
+   mdelay(1);
+   }
+
+   clk |= SDHCI_CLOCK_CARD_EN;
+   sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
+out:
+   host->clock = clock;
+}
+
+static struct sdhci_ops sdhci_cns3xxx_ops = {
+   .get_max_clock  = sdhci_cns3xxx_get_max_clk,
+   .set_clock  = sdhci_cns3xxx_set_clock,
+};
+
+struct sdhci_pltfm_data sdhci_cns3xxx_pdata = {
+   .ops = &sdhci_cns3xxx_ops,
+   .quirks = SDHCI_QUIRK_BROKEN_DMA |
+ SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
+ SDHCI_QUIRK_INVERTED_WRITE_PROTECT |
+ SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN |
+ SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
+ SDHCI_QUIRK_NONSTANDARD_CLOCK,
+};
diff -puN 
drivers/mmc/host/sdhci-pltfm.c~sdhci-pltfm-add-support-for-cns3xxx-soc-devices 
drivers/mmc/host/sdhci-pltfm.c
--- 
a/drivers/mmc/host/sdhci-pltfm.c~sdhci-pltfm-add-support-for-cns3xxx-soc-devices
+++ a/drivers/mmc/host/sdhci-pltfm.c
@@ -158,6 +158,9 @@ static int __devexit sdhci_pltfm_remove(
 
 static const struct platform_device_id sdhci_pltfm_ids[] = {
   

[patch 039/177] mmc: only set blockaddressed for > 2GiB cards

2010-08-10 Thread akpm
From: Hanumath Prasad 

A non-zero value of SEC_COUNT does not indicate that the card is sector
addressed.  According to the MMC specification, cards with a density
greater than 2GiB are sector addressed.

Acked-by: Linus Walleij 
Signed-off-by: Hanumath Prasad 
Signed-off-by: Rabin Vincent 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/core/mmc.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff -puN drivers/mmc/core/mmc.c~mmc-only-set-blockaddressed-for-2gib-cards 
drivers/mmc/core/mmc.c
--- a/drivers/mmc/core/mmc.c~mmc-only-set-blockaddressed-for-2gib-cards
+++ a/drivers/mmc/core/mmc.c
@@ -234,7 +234,9 @@ static int mmc_read_ext_csd(struct mmc_c
ext_csd[EXT_CSD_SEC_CNT + 1] << 8 |
ext_csd[EXT_CSD_SEC_CNT + 2] << 16 |
ext_csd[EXT_CSD_SEC_CNT + 3] << 24;
-   if (card->ext_csd.sectors)
+
+   /* Cards with density > 2GiB are sector addressed */
+   if (card->ext_csd.sectors > (2u * 1024 * 1024 * 1024) / 512)
mmc_card_set_blockaddr(card);
}
 
_
--
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


[patch 048/177] omap hsmmc: fix processing of all dma interrupts as block completion

2010-08-10 Thread akpm
From: Venkatraman S 

If other informative interrupts are enabled for the DMA channel used by
hsmmc, those are incorrectly treated as block completion.  This patch lets
only the block completion interrupt to be processed.

Signed-off-by: Venkatraman S 
Acked-by: Madhusudhan Chikkature 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/omap_hsmmc.c |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff -puN 
drivers/mmc/host/omap_hsmmc.c~omap-hsmmc-fix-processing-of-all-dma-interrupts-as-block-completion
 drivers/mmc/host/omap_hsmmc.c
--- 
a/drivers/mmc/host/omap_hsmmc.c~omap-hsmmc-fix-processing-of-all-dma-interrupts-as-block-completion
+++ a/drivers/mmc/host/omap_hsmmc.c
@@ -1273,8 +1273,11 @@ static void omap_hsmmc_dma_cb(int lch, u
struct mmc_data *data = host->mrq->data;
int dma_ch, req_in_progress;
 
-   if (ch_status & OMAP2_DMA_MISALIGNED_ERR_IRQ)
-   dev_dbg(mmc_dev(host->mmc), "MISALIGNED_ADRS_ERR\n");
+   if (!(ch_status & OMAP_DMA_BLOCK_IRQ)) {
+   dev_warn(mmc_dev(host->mmc), "unexpected dma status %x\n",
+   ch_status);
+   return;
+   }
 
spin_lock(&host->irq_lock);
if (host->dma_ch < 0) {
_
--
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


+ omap_hsmmc-remove-ugly-hack-workaround-regulator-framework-bugs.patch added to -mm tree

2010-08-05 Thread akpm

The patch titled
 omap_hsmmc: remove 'UGLY HACK:  workaround regulator framework bugs'
has been added to the -mm tree.  Its filename is
 omap_hsmmc-remove-ugly-hack-workaround-regulator-framework-bugs.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: omap_hsmmc: remove 'UGLY HACK:  workaround regulator framework bugs'
From: Adrian Hunter 

The framework is fixed.  The hack can be removed.

Signed-off-by: Adrian Hunter 
Cc: Madhusudhan Chikkature 
Cc: Matt Fleming 
Cc: Tony Lindgren 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/omap_hsmmc.c |   19 ---
 1 file changed, 19 deletions(-)

diff -puN 
drivers/mmc/host/omap_hsmmc.c~omap_hsmmc-remove-ugly-hack-workaround-regulator-framework-bugs
 drivers/mmc/host/omap_hsmmc.c
--- 
a/drivers/mmc/host/omap_hsmmc.c~omap_hsmmc-remove-ugly-hack-workaround-regulator-framework-bugs
+++ a/drivers/mmc/host/omap_hsmmc.c
@@ -401,25 +401,6 @@ static int omap_hsmmc_reg_get(struct oma
/* Allow an aux regulator */
reg = regulator_get(host->dev, "vmmc_aux");
host->vcc_aux = IS_ERR(reg) ? NULL : reg;
-
-   /*
-   * UGLY HACK:  workaround regulator framework bugs.
-   * When the bootloader leaves a supply active, it's
-   * initialized with zero usecount ... and we can't
-   * disable it without first enabling it.  Until the
-   * framework is fixed, we need a workaround like this
-   * (which is safe for MMC, but not in general).
-   */
-   if (regulator_is_enabled(host->vcc) > 0) {
-   regulator_enable(host->vcc);
-   regulator_disable(host->vcc);
-   }
-   if (host->vcc_aux) {
-   if (regulator_is_enabled(reg) > 0) {
-   regulator_enable(reg);
-   regulator_disable(reg);
-   }
-   }
}
 
return 0;
_

Patches currently in -mm which might be from adrian.hun...@nokia.com are

origin.patch
linux-next.patch
mmc-recognize-csd-structure.patch
mmc-recognize-csd-structure-fix.patch
mmc-split-mmc_sd_init_card.patch
mmc-implement-sd-combo-iomem-support.patch
mmc-omap-fix-for-bus-width-which-improves-sd-cards-peformance.patch
sdio-allow-non-standard-sdio-cards.patch
omap_hsmmc-add-init_card-pass-through-callback.patch
omap-pandora-pass-wl1251-information-to-sdio-core.patch
mmc-add-erase-secure-erase-trim-and-secure-trim-operations.patch
mmc_block-add-discard-support.patch
omap_hsmmc-add-erase-capability.patch
block-add-secure-discard.patch
mmc_block-add-support-for-secure-discard.patch
mmc_test-add-performance-tests.patch
mmc_test-fix-large-memory-allocation.patch
mmc-use-regulator-framework-correctly.patch
omap_hsmmc-remove-ugly-hack-workaround-regulator-framework-bugs.patch

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


+ mmc-use-regulator-framework-correctly.patch added to -mm tree

2010-08-05 Thread akpm

The patch titled
 mmc: use regulator framework correctly
has been added to the -mm tree.  Its filename is
 mmc-use-regulator-framework-correctly.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc: use regulator framework correctly
From: Adrian Hunter 

Issues with the regulator framework no longer exist, so regulator_enable()
/ regulator_disable() should be used correctly.

Signed-off-by: Adrian Hunter 
Cc: Liam Girdwood 
Cc: Mark Brown 
Cc: Samuel Ortiz 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/core/core.c |9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff -puN drivers/mmc/core/core.c~mmc-use-regulator-framework-correctly 
drivers/mmc/core/core.c
--- a/drivers/mmc/core/core.c~mmc-use-regulator-framework-correctly
+++ a/drivers/mmc/core/core.c
@@ -784,11 +784,6 @@ int mmc_regulator_set_ocr(struct regulat
 {
int result = 0;
int min_uV, max_uV;
-   int enabled;
-
-   enabled = regulator_is_enabled(supply);
-   if (enabled < 0)
-   return enabled;
 
if (vdd_bit) {
int tmp;
@@ -819,9 +814,9 @@ int mmc_regulator_set_ocr(struct regulat
else
result = 0;
 
-   if (result == 0 && !enabled)
+   if (result == 0)
result = regulator_enable(supply);
-   } else if (enabled) {
+   } else {
result = regulator_disable(supply);
}
 
_

Patches currently in -mm which might be from adrian.hun...@nokia.com are

origin.patch
linux-next.patch
mmc-recognize-csd-structure.patch
mmc-recognize-csd-structure-fix.patch
mmc-split-mmc_sd_init_card.patch
mmc-implement-sd-combo-iomem-support.patch
mmc-omap-fix-for-bus-width-which-improves-sd-cards-peformance.patch
sdio-allow-non-standard-sdio-cards.patch
omap_hsmmc-add-init_card-pass-through-callback.patch
omap-pandora-pass-wl1251-information-to-sdio-core.patch
mmc-add-erase-secure-erase-trim-and-secure-trim-operations.patch
mmc_block-add-discard-support.patch
omap_hsmmc-add-erase-capability.patch
block-add-secure-discard.patch
mmc_block-add-support-for-secure-discard.patch
mmc_test-add-performance-tests.patch
mmc_test-fix-large-memory-allocation.patch
mmc-use-regulator-framework-correctly.patch

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


+ dts-add-esdhc-weird-voltage-bits-workaround.patch added to -mm tree

2010-08-03 Thread akpm

The patch titled
 dts: add ESDHC weird voltage bits workaround
has been added to the -mm tree.  Its filename is
 dts-add-esdhc-weird-voltage-bits-workaround.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: dts: add ESDHC weird voltage bits workaround
From: Roy Zang 

P4080 ESDHC controller does not support 1.8V and 3.0V voltage.  but the
host controller capabilities register wrongly set the bits.  This patch
adds the workaround to correct the weird voltage setting bits.  Only 3.3V
voltage is supported for P4080 ESDHC controller.

Signed-off-by: Roy Zang 
Cc: Jerry Huang 
Cc: Benjamin Herrenschmidt 
Cc: Kumar Gala 
Cc: Grant Likely 
Cc: 
Signed-off-by: Andrew Morton 
---

 arch/powerpc/boot/dts/p4080ds.dts |1 +
 1 file changed, 1 insertion(+)

diff -puN 
arch/powerpc/boot/dts/p4080ds.dts~dts-add-esdhc-weird-voltage-bits-workaround 
arch/powerpc/boot/dts/p4080ds.dts
--- 
a/arch/powerpc/boot/dts/p4080ds.dts~dts-add-esdhc-weird-voltage-bits-workaround
+++ a/arch/powerpc/boot/dts/p4080ds.dts
@@ -280,6 +280,7 @@
reg = <0x114000 0x1000>;
interrupts = <48 2>;
interrupt-parent = <&mpic>;
+   voltage-ranges = <3300 3300>;
sdhci,auto-cmd12;
};
 
_

Patches currently in -mm which might be from tie-fei.z...@freescale.com are

sdhci-add-auto-cmd12-support-for-esdhc-driver.patch
dts-add-sdhciauto-cmd12-field-for-p4080-device-tree.patch
dts-add-esdhc-weird-voltage-bits-workaround.patch
rtc-add-support-for-ds3232-rtc.patch
rtc-add-support-for-ds3232-rtc-fix.patch

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


+ dts-add-sdhciauto-cmd12-field-for-p4080-device-tree.patch added to -mm tree

2010-08-03 Thread akpm

The patch titled
 dts: add sdhci,auto-cmd12 field for p4080 device tree
has been added to the -mm tree.  Its filename is
 dts-add-sdhciauto-cmd12-field-for-p4080-device-tree.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: dts: add sdhci,auto-cmd12 field for p4080 device tree
From: Roy Zang 

Signed-off-by: Roy Zang 
Cc: Jerry Huang 
Cc: Benjamin Herrenschmidt 
Cc: Kumar Gala 
Cc: Grant Likely 
Cc: 
Signed-off-by: Andrew Morton 
---

 Documentation/powerpc/dts-bindings/fsl/esdhc.txt |2 ++
 arch/powerpc/boot/dts/p4080ds.dts|1 +
 2 files changed, 3 insertions(+)

diff -puN 
Documentation/powerpc/dts-bindings/fsl/esdhc.txt~dts-add-sdhciauto-cmd12-field-for-p4080-device-tree
 Documentation/powerpc/dts-bindings/fsl/esdhc.txt
--- 
a/Documentation/powerpc/dts-bindings/fsl/esdhc.txt~dts-add-sdhciauto-cmd12-field-for-p4080-device-tree
+++ a/Documentation/powerpc/dts-bindings/fsl/esdhc.txt
@@ -14,6 +14,8 @@ Required properties:
 reports inverted write-protect state;
   - sdhci,1-bit-only : (optional) specifies that a controller can
 only handle 1-bit data transfers.
+  - sdhci,auto-cmd12: (optional) specifies that a controller can
+only handle auto CMD12.
 
 Example:
 
diff -puN 
arch/powerpc/boot/dts/p4080ds.dts~dts-add-sdhciauto-cmd12-field-for-p4080-device-tree
 arch/powerpc/boot/dts/p4080ds.dts
--- 
a/arch/powerpc/boot/dts/p4080ds.dts~dts-add-sdhciauto-cmd12-field-for-p4080-device-tree
+++ a/arch/powerpc/boot/dts/p4080ds.dts
@@ -280,6 +280,7 @@
reg = <0x114000 0x1000>;
interrupts = <48 2>;
interrupt-parent = <&mpic>;
+   sdhci,auto-cmd12;
};
 
i...@118000 {
_

Patches currently in -mm which might be from tie-fei.z...@freescale.com are

sdhci-add-auto-cmd12-support-for-esdhc-driver.patch
dts-add-sdhciauto-cmd12-field-for-p4080-device-tree.patch
dts-add-esdhc-weird-voltage-bits-workaround.patch
rtc-add-support-for-ds3232-rtc.patch
rtc-add-support-for-ds3232-rtc-fix.patch

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


+ sdhci-add-auto-cmd12-support-for-esdhc-driver.patch added to -mm tree

2010-08-03 Thread akpm

The patch titled
 sdhci: add auto CMD12 support for eSDHC driver
has been added to the -mm tree.  Its filename is
 sdhci-add-auto-cmd12-support-for-esdhc-driver.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: sdhci: add auto CMD12 support for eSDHC driver
From: Jerry Huang 

Add auto CMD12 command support for eSDHC driver.  This is needed by P4080
and P1022 for block read/write.  Manual asynchronous CMD12 abort operation
causes protocol violations on these silicons.

Signed-off-by: Jerry Huang 
Signed-off-by: Roy Zang 
Cc: Benjamin Herrenschmidt 
Cc: Kumar Gala 
Cc: Grant Likely 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/sdhci-of-core.c |4 
 drivers/mmc/host/sdhci.c |   14 --
 drivers/mmc/host/sdhci.h |2 ++
 3 files changed, 18 insertions(+), 2 deletions(-)

diff -puN 
drivers/mmc/host/sdhci-of-core.c~sdhci-add-auto-cmd12-support-for-esdhc-driver 
drivers/mmc/host/sdhci-of-core.c
--- 
a/drivers/mmc/host/sdhci-of-core.c~sdhci-add-auto-cmd12-support-for-esdhc-driver
+++ a/drivers/mmc/host/sdhci-of-core.c
@@ -154,6 +154,10 @@ static int __devinit sdhci_of_probe(stru
host->ops = &sdhci_of_data->ops;
}
 
+   if (of_get_property(np, "sdhci,auto-cmd12", NULL))
+   host->quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12;
+
+
if (of_get_property(np, "sdhci,1-bit-only", NULL))
host->quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA;
 
diff -puN 
drivers/mmc/host/sdhci.c~sdhci-add-auto-cmd12-support-for-esdhc-driver 
drivers/mmc/host/sdhci.c
--- a/drivers/mmc/host/sdhci.c~sdhci-add-auto-cmd12-support-for-esdhc-driver
+++ a/drivers/mmc/host/sdhci.c
@@ -820,8 +820,12 @@ static void sdhci_set_transfer_mode(stru
WARN_ON(!host->data);
 
mode = SDHCI_TRNS_BLK_CNT_EN;
-   if (data->blocks > 1)
-   mode |= SDHCI_TRNS_MULTI;
+   if (data->blocks > 1) {
+   if (host->quirks & SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)
+   mode |= SDHCI_TRNS_MULTI | SDHCI_TRNS_ACMD12;
+   else
+   mode |= SDHCI_TRNS_MULTI;
+   }
if (data->flags & MMC_DATA_READ)
mode |= SDHCI_TRNS_READ;
if (host->flags & SDHCI_REQ_USE_DMA)
@@ -1109,6 +1113,12 @@ static void sdhci_request(struct mmc_hos
 #ifndef SDHCI_USE_LEDS_CLASS
sdhci_activate_led(host);
 #endif
+   if (host->quirks & SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12) {
+   if (mrq->stop) {
+   mrq->data->stop = NULL;
+   mrq->stop = NULL;
+   }
+   }
 
host->mrq = mrq;
 
diff -puN 
drivers/mmc/host/sdhci.h~sdhci-add-auto-cmd12-support-for-esdhc-driver 
drivers/mmc/host/sdhci.h
--- a/drivers/mmc/host/sdhci.h~sdhci-add-auto-cmd12-support-for-esdhc-driver
+++ a/drivers/mmc/host/sdhci.h
@@ -247,6 +247,8 @@ struct sdhci_host {
 #define SDHCI_QUIRK_NO_HISPD_BIT   (1<<27)
 /* Controller is missing device caps. Use caps provided by host */
 #define SDHCI_QUIRK_MISSING_CAPS   (1<<28)
+/* Controller uses Auto CMD12 command to stop the transfer */
+#define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (1<<29)
 
int irq;/* Device IRQ */
void __iomem *  ioaddr; /* Mapped address */
_

Patches currently in -mm which might be from chang-ming.hu...@freescale.com are

sdhci-add-auto-cmd12-support-for-esdhc-driver.patch
dts-add-sdhciauto-cmd12-field-for-p4080-device-tree.patch
dts-add-esdhc-weird-voltage-bits-workaround.patch

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


+ mmc-fix-all-hangs-related-to-mmc-sd-card-insert-removal-during-suspend-resume-update-2.patch added to -mm tree

2010-08-02 Thread akpm

The patch titled
 
mmc-fix-all-hangs-related-to-mmc-sd-card-insert-removal-during-suspend-resume-update-2
has been added to the -mm tree.  Its filename is
 
mmc-fix-all-hangs-related-to-mmc-sd-card-insert-removal-during-suspend-resume-update-2.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: 
mmc-fix-all-hangs-related-to-mmc-sd-card-insert-removal-during-suspend-resume-update-2
From: Maxim Levitsky 

If you don't use CONFIG_MMC_UNSAFE_RESUME, as soon as you attempt to
suspend, the card will be removed, therefore this patch doesn't change the
behavior of this option.

However the removal will be done by pm notifier, which runs while
userspace is still not frozen and thus can freely use del_gendisk, without
the risk of deadlock which would happen otherwise.

Card detect workqueue is now disabled while userspace is frozen, Therefore
if you do use CONFIG_MMC_UNSAFE_RESUME, and remove the card during
suspend, the removal will be detected as soon as userspace is unfrozen,
again at the moment it is safe to call del_gendisk.

Tested with and without CONFIG_MMC_UNSAFE_RESUME with suspend and hibernate.

Signed-off-by: Maxim Levitsky 
Cc: David Brownell 
Cc: Alan Stern 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/core/core.c  |4 ++--
 drivers/mmc/core/host.c  |1 -
 include/linux/mmc/host.h |1 -
 3 files changed, 2 insertions(+), 4 deletions(-)

diff -puN 
drivers/mmc/core/core.c~mmc-fix-all-hangs-related-to-mmc-sd-card-insert-removal-during-suspend-resume-update-2
 drivers/mmc/core/core.c
--- 
a/drivers/mmc/core/core.c~mmc-fix-all-hangs-related-to-mmc-sd-card-insert-removal-during-suspend-resume-update-2
+++ a/drivers/mmc/core/core.c
@@ -1323,6 +1323,7 @@ int mmc_resume_host(struct mmc_host *hos
 
return err;
 }
+EXPORT_SYMBOL(mmc_resume_host);
 
 /* Do the card removal on suspend if card is assumed removeable
  * Do that in pm notifier while userspace isn't yet frozen, so we will be able
@@ -1343,6 +1344,7 @@ int mmc_pm_notify(struct notifier_block 
spin_lock_irqsave(&host->lock, flags);
host->rescan_disable = 1;
spin_unlock_irqrestore(&host->lock, flags);
+   cancel_delayed_work_sync(&host->detect);
 
if (!host->bus_ops || host->bus_ops->suspend)
break;
@@ -1369,8 +1371,6 @@ int mmc_pm_notify(struct notifier_block 
 
return 0;
 }
-EXPORT_SYMBOL(mmc_resume_host);
-
 #endif
 
 static int __init mmc_init(void)
diff -puN 
drivers/mmc/core/host.c~mmc-fix-all-hangs-related-to-mmc-sd-card-insert-removal-during-suspend-resume-update-2
 drivers/mmc/core/host.c
--- 
a/drivers/mmc/core/host.c~mmc-fix-all-hangs-related-to-mmc-sd-card-insert-removal-during-suspend-resume-update-2
+++ a/drivers/mmc/core/host.c
@@ -88,7 +88,6 @@ struct mmc_host *mmc_alloc_host(int extr
INIT_DELAYED_WORK_DEFERRABLE(&host->disable, mmc_host_deeper_disable);
host->pm_notify.notifier_call = mmc_pm_notify;
 
-
/*
 * By default, hosts do not support SGIO or large requests.
 * They have to set these according to their abilities.
diff -puN 
include/linux/mmc/host.h~mmc-fix-all-hangs-related-to-mmc-sd-card-insert-removal-during-suspend-resume-update-2
 include/linux/mmc/host.h
--- 
a/include/linux/mmc/host.h~mmc-fix-all-hangs-related-to-mmc-sd-card-insert-removal-during-suspend-resume-update-2
+++ a/include/linux/mmc/host.h
@@ -261,7 +261,6 @@ int mmc_host_disable(struct mmc_host *ho
 int mmc_host_lazy_disable(struct mmc_host *host);
 int mmc_pm_notify(struct notifier_block *notify_block, unsigned long, void *);
 
-
 static inline void mmc_set_disable_delay(struct mmc_host *host,
 unsigned int disable_delay)
 {
_

Patches currently in -mm which might be from maximlevit...@gmail.com are

linux-next.patch
maintainers-update-ricoh-smartmedia-xd-driver-file-patterns.patch
mmc-fix-all-hangs-related-to-mmc-sd-card-insert-removal-during-suspend-resume.patch
mmc-fix-all-hangs-related-to-mmc-sd-card-insert-removal-during-suspend-resume-update-2.patch
mmc-make-sdhci-work-with-ricoh-mmc-controller.patch

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


+ mmc-fix-all-hangs-related-to-mmc-sd-card-insert-removal-during-suspend-resume-update.patch added to -mm tree

2010-07-30 Thread akpm

The patch titled
 
mmc-fix-all-hangs-related-to-mmc-sd-card-insert-removal-during-suspend-resume-update
has been added to the -mm tree.  Its filename is
 
mmc-fix-all-hangs-related-to-mmc-sd-card-insert-removal-during-suspend-resume-update.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: 
mmc-fix-all-hangs-related-to-mmc-sd-card-insert-removal-during-suspend-resume-update
From: Maxim Levitsky 

If you don't use CONFIG_MMC_UNSAFE_RESUME, as soon as you attempt to
suspend, the card will be removed, therefore this patch doesn't change
the behavior of this option.

However the removal will be done by pm notifier, which runs while
userspace is still not frozen and thus can freely use del_gendisk,
without the risk of deadlock which would happen otherwise.

Card detect workqueue is now disabled while userspace is frozen,
Therefore if you do use CONFIG_MMC_UNSAFE_RESUME,
and remove the card during suspend, the removal will be
detected as soon as userspace is unfrozen, again at the moment
it is safe to call del_gendisk.

Tested with and without CONFIG_MMC_UNSAFE_RESUME with suspend and hibernate.

Signed-off-by: Maxim Levitsky 
Cc: David Brownell 
Cc: Alan Stern 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/core/core.c  |   45 +++--
 drivers/mmc/core/host.c  |1 
 include/linux/mmc/host.h |9 ++-
 3 files changed, 37 insertions(+), 18 deletions(-)

diff -puN 
drivers/mmc/core/core.c~mmc-fix-all-hangs-related-to-mmc-sd-card-insert-removal-during-suspend-resume-update
 drivers/mmc/core/core.c
--- 
a/drivers/mmc/core/core.c~mmc-fix-all-hangs-related-to-mmc-sd-card-insert-removal-during-suspend-resume-update
+++ a/drivers/mmc/core/core.c
@@ -1057,6 +1057,17 @@ void mmc_rescan(struct work_struct *work
container_of(work, struct mmc_host, detect.work);
u32 ocr;
int err;
+   unsigned long flags;
+
+   spin_lock_irqsave(&host->lock, flags);
+
+   if (host->rescan_disable) {
+   spin_unlock_irqrestore(&host->lock, flags);
+   return;
+   }
+
+   spin_unlock_irqrestore(&host->lock, flags);
+
 
mmc_bus_get(host);
 
@@ -1267,6 +1278,8 @@ int mmc_suspend_host(struct mmc_host *ho
 
if (host->caps & MMC_CAP_DISABLE)
cancel_delayed_work(&host->disable);
+   cancel_delayed_work(&host->detect);
+   mmc_flush_scheduled_work();
 
mmc_bus_get(host);
if (host->bus_ops && !host->bus_dead) {
@@ -1308,54 +1321,64 @@ int mmc_resume_host(struct mmc_host *hos
}
mmc_bus_put(host);
 
-   /*
-* We add a slight delay here so that resume can progress
-* in parallel.
-*/
-   mmc_detect_change(host, 1);
-
return err;
 }
-EXPORT_SYMBOL(mmc_resume_host);
 
 /* Do the card removal on suspend if card is assumed removeable
  * Do that in pm notifier while userspace isn't yet frozen, so we will be able
- * to sync the card.
- */
+   to sync the card.
+*/
 int mmc_pm_notify(struct notifier_block *notify_block,
unsigned long mode, void *unused)
 {
struct mmc_host *host = container_of(
notify_block, struct mmc_host, pm_notify);
+   unsigned long flags;
 
 
switch (mode) {
case PM_HIBERNATION_PREPARE:
case PM_SUSPEND_PREPARE:
 
+   spin_lock_irqsave(&host->lock, flags);
+   host->rescan_disable = 1;
+   spin_unlock_irqrestore(&host->lock, flags);
+
if (!host->bus_ops || host->bus_ops->suspend)
break;
 
+   mmc_claim_host(host);
+
if (host->bus_ops->remove)
host->bus_ops->remove(host);
-   mmc_claim_host(host);
+
mmc_detach_bus(host);
mmc_release_host(host);
host->pm_flags = 0;
break;
 
+   case PM_POST_SUSPEND:
+   case PM_POST_HIBERNATION:
+
+   spin_lock_irqsave(&host->lock, flags);
+   host->rescan_disable = 0;
+   spin_unlock_irqrestore(&host->lock, flags);
+   mmc_detect_change(host, 0);
+
}
 
return 0;
 }
 
+EXPORT_SYMBOL(mmc_resume_host);
+
 #endif
 
 static int __init

+ sdhci-add-regulator-support.patch added to -mm tree

2010-07-29 Thread akpm

The patch titled
 sdhci: add regulator support
has been added to the -mm tree.  Its filename is
 sdhci-add-regulator-support.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: sdhci: add regulator support
From: Marek Szyprowski 

This patch adds support for regulator API to sdhci core driver. 
Regulators can be used to disable power in suspended state to reduce
dissipated energy.

Signed-off-by: Marek Szyprowski 
Signed-off-by: Kyungmin Park 
Acked-by: Mark Brown 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/sdhci.c |   26 +-
 drivers/mmc/host/sdhci.h |2 ++
 2 files changed, 27 insertions(+), 1 deletion(-)

diff -puN drivers/mmc/host/sdhci.c~sdhci-add-regulator-support 
drivers/mmc/host/sdhci.c
--- a/drivers/mmc/host/sdhci.c~sdhci-add-regulator-support
+++ a/drivers/mmc/host/sdhci.c
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -1573,7 +1574,10 @@ int sdhci_suspend_host(struct sdhci_host
 
free_irq(host->irq, host);
 
-   return 0;
+   if (host->vmmc)
+   ret = regulator_disable(host->vmmc);
+
+   return ret;
 }
 
 EXPORT_SYMBOL_GPL(sdhci_suspend_host);
@@ -1582,6 +1586,13 @@ int sdhci_resume_host(struct sdhci_host 
 {
int ret;
 
+   if (host->vmmc) {
+   int ret = regulator_enable(host->vmmc);
+   if (ret)
+   return ret;
+   }
+
+
if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA)) {
if (host->ops->enable_dma)
host->ops->enable_dma(host);
@@ -1878,6 +1889,14 @@ int sdhci_add_host(struct sdhci_host *ho
if (ret)
return ret;
 
+   host->vmmc = regulator_get(mmc_dev(mmc), "vmmc");
+   if (IS_ERR(host->vmmc)) {
+   printk(KERN_INFO "%s: no vmmc regulator found\n", 
mmc_hostname(mmc));
+   host->vmmc = NULL;
+   } else {
+   regulator_enable(host->vmmc);
+   }
+
sdhci_init(host, 0);
 
 #ifdef CONFIG_MMC_DEBUG
@@ -1955,6 +1974,11 @@ void sdhci_remove_host(struct sdhci_host
 
flush_work(&host->finish_work);
 
+   if (host->vmmc) {
+   regulator_disable(host->vmmc);
+   regulator_put(host->vmmc);
+   }
+
kfree(host->adma_desc);
kfree(host->align_buffer);
 
diff -puN drivers/mmc/host/sdhci.h~sdhci-add-regulator-support 
drivers/mmc/host/sdhci.h
--- a/drivers/mmc/host/sdhci.h~sdhci-add-regulator-support
+++ a/drivers/mmc/host/sdhci.h
@@ -253,6 +253,8 @@ struct sdhci_host {
 
const struct sdhci_ops  *ops;   /* Low level hw interface */
 
+   struct regulator*vmmc;  /* Power regulator */
+
/* Internal data */
struct mmc_host *mmc;   /* MMC structure */
u64 dma_mask;   /* custom DMA mask */
_

Patches currently in -mm which might be from m.szyprow...@samsung.com are

linux-next.patch
sdhci-s3c-add-support-for-the-non-standard-minimal-clock-value.patch
sdhci-s3c-enable-sdhci_quirk_no_hispd_bit-quirk.patch
sdhci-s3c-add-support-for-new-card-detection-methods.patch
sdhci-add-regulator-support.patch
s3c-fb-change-to-depending-on-config_s3c_fb_dev.patch
s3c-fb-add-default-window-feature.patch
s3c-fb-fix-distortedness-situation-for-the-mode-more-then-24bpp.patch
s3c-fb-only-init-window-colour-key-controls-for-windows-with-blending.patch
s3c-fb-initial-move-to-unifying-the-header-files.patch
s3c-fb-udpate-to-support-s3c2416-s3c2443-style-hardware.patch
s3c-fb-integrate-palette-setup-code-into-main-driver.patch
s3c-fb-fix-various-null-references-on-framebuffer-memory-alloc-failure.patch
s3c-fb-correct-framesel1-bitfield-defines-for-vidintcon0-register.patch
s3c-fb-separate-s5pc100-and-s5pv210-framebuffer-driver-data-structures.patch
s3c-fb-add-device-name-initialization.patch
s3c-fb-add-support-for-display-panning.patch
s3c-fb-add-wait-for-vsync-ioctl.patch
s3c-fb-window-3-of-64xx-does-not-have-an-osd_d-register.patch
s3c-fb-add-shadowcon-shadow-register-locking-support-for-s5pv210.patch
s3c-fb-correct-window-osd-size-and-alpha-register-handling.patch
s3c-fb-protect-window-specific-registers-during-updates.patch
s3c-fb-fix-section-mismatch.patch
s3c-fb-add-support-for-dma-channel-control-on-s5pv210.patch
s3c-fb-automatically-calculate-pixel-

+ sdhci-s3c-add-support-for-new-card-detection-methods.patch added to -mm tree

2010-07-29 Thread akpm

The patch titled
 sdhci-s3c: add support for new card detection methods
has been added to the -mm tree.  Its filename is
 sdhci-s3c-add-support-for-new-card-detection-methods.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: sdhci-s3c: add support for new card detection methods
From: Marek Szyprowski 

On some Samsung SoCs not all SDHCI controllers have card detect (CD) line.
 For some embedded designs it is not even needed, because ususally the
device (like SDIO flash memory or wifi controller) is permanently wired to
the controller.  There are also systems which have a card detect line
connected to some of the external interrupt lines or the presence of the
card depends on some other actions (like enabling a power regulator).

This patch adds support for all these cases.  The following card detection
methods are possible:

1. internal sdhci host card detect line
2. external event
3. external gpio interrupt
4. no card detect line, controller will poll for the card
5. no card detect line, card is permanently wired to the controller
(once detected host won't poll it any more)

By default, all existing code would use method #1, what is compatible with
the previous version of the driver.

In case of external event, two callbacks must be provided in platdata:
ext_cd_init and ext_cd_cleanup.  Both of them get a callback to a function
that notifies the s3c-sdhci host contoller as their argument.  That
callback function should be called from the even dispatcher to let host
notice the card insertion/removal.

In case of external gpio interrupt, a gpio pin number must be provided in
platdata (ext_cd_gpio parameter), as well as the information about the
polarity of that gpio pin (ext_cd_gpio_invert).  By default
(ext_cd_gpio_invert == 0) gpio value 0 means 'card has been removed', but
this can be changed to 'card has been removed' when ext_cd_gpio_invert ==
1.

This patch adds all required changes to sdhci-s3c driver.

Signed-off-by: Marek Szyprowski 
Signed-off-by: Kyungmin Park 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/sdhci-s3c.c |   85 +
 drivers/mmc/host/sdhci.c |   47 ++
 drivers/mmc/host/sdhci.h |1 
 3 files changed, 113 insertions(+), 20 deletions(-)

diff -puN 
drivers/mmc/host/sdhci-s3c.c~sdhci-s3c-add-support-for-new-card-detection-methods
 drivers/mmc/host/sdhci-s3c.c
--- 
a/drivers/mmc/host/sdhci-s3c.c~sdhci-s3c-add-support-for-new-card-detection-methods
+++ a/drivers/mmc/host/sdhci-s3c.c
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -44,6 +45,8 @@ struct sdhci_s3c {
struct resource *ioarea;
struct s3c_sdhci_platdata *pdata;
unsigned intcur_clk;
+   int ext_cd_irq;
+   int ext_cd_gpio;
 
struct clk  *clk_io;
struct clk  *clk_bus[MAX_BUS_CLK];
@@ -235,6 +238,61 @@ static struct sdhci_ops sdhci_s3c_ops = 
.get_min_clock  = sdhci_s3c_get_min_clock,
 };
 
+static void sdhci_s3c_notify_change(struct platform_device *dev, int state)
+{
+   struct sdhci_host *host = platform_get_drvdata(dev);
+   if (host) {
+   mutex_lock(&host->lock);
+   if (state) {
+   dev_dbg(&dev->dev, "card inserted.\n");
+   host->flags &= ~SDHCI_DEVICE_DEAD;
+   host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+   } else {
+   dev_dbg(&dev->dev, "card removed.\n");
+   host->flags |= SDHCI_DEVICE_DEAD;
+   host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+   }
+   sdhci_card_detect(host);
+   mutex_unlock(&host->lock);
+   }
+}
+
+static irqreturn_t sdhci_s3c_gpio_card_detect_thread(int irq, void *dev_id)
+{
+   struct sdhci_s3c *sc = dev_id;
+   int status = gpio_get_value(sc->ext_cd_gpio);
+   if (sc->pdata->ext_cd_gpio_invert)
+   status = !status;
+   sdhci_s3c_notify_change(sc->pdev, status);
+   return IRQ_HANDLED;
+}
+
+static void sdhci_s3c_setup_card_detect_gpio(struct sdhci_s3c *sc)
+{
+   struct s3c_sdhci_platdata *pdata = sc->pdata;
+   struct device *dev 

+ sdhci-s3c-enable-sdhci_quirk_no_hispd_bit-quirk.patch added to -mm tree

2010-07-29 Thread akpm

The patch titled
 sdhci-s3c: enable SDHCI_QUIRK_NO_HISPD_BIT quirk
has been added to the -mm tree.  Its filename is
 sdhci-s3c-enable-sdhci_quirk_no_hispd_bit-quirk.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: sdhci-s3c: enable SDHCI_QUIRK_NO_HISPD_BIT quirk
From: Marek Szyprowski 

This patch enables SDHCI_QUIRK_NO_HISPD_BIT on Samsung SDHCI driver.  This
solves detection problems with some external SD cards.  This change has
been tested on S5PC100 and S5PC110.  It has no inpact on driver speed.

Signed-off-by: Kyungmin Park 
Signed-off-by: Marek Szyprowski 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/sdhci-s3c.c |1 +
 1 file changed, 1 insertion(+)

diff -puN 
drivers/mmc/host/sdhci-s3c.c~sdhci-s3c-enable-sdhci_quirk_no_hispd_bit-quirk 
drivers/mmc/host/sdhci-s3c.c
--- 
a/drivers/mmc/host/sdhci-s3c.c~sdhci-s3c-enable-sdhci_quirk_no_hispd_bit-quirk
+++ a/drivers/mmc/host/sdhci-s3c.c
@@ -338,6 +338,7 @@ static int __devinit sdhci_s3c_probe(str
 
/* Setup quirks for the controller */
host->quirks |= SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC;
+   host->quirks |= SDHCI_QUIRK_NO_HISPD_BIT;
 
 #ifndef CONFIG_MMC_SDHCI_S3C_DMA
 
_

Patches currently in -mm which might be from m.szyprow...@samsung.com are

linux-next.patch
sdhci-s3c-add-support-for-the-non-standard-minimal-clock-value.patch
sdhci-s3c-enable-sdhci_quirk_no_hispd_bit-quirk.patch
sdhci-s3c-add-support-for-new-card-detection-methods.patch
sdhci-add-regulator-support.patch
s3c-fb-change-to-depending-on-config_s3c_fb_dev.patch
s3c-fb-add-default-window-feature.patch
s3c-fb-fix-distortedness-situation-for-the-mode-more-then-24bpp.patch
s3c-fb-only-init-window-colour-key-controls-for-windows-with-blending.patch
s3c-fb-initial-move-to-unifying-the-header-files.patch
s3c-fb-udpate-to-support-s3c2416-s3c2443-style-hardware.patch
s3c-fb-integrate-palette-setup-code-into-main-driver.patch
s3c-fb-fix-various-null-references-on-framebuffer-memory-alloc-failure.patch
s3c-fb-correct-framesel1-bitfield-defines-for-vidintcon0-register.patch
s3c-fb-separate-s5pc100-and-s5pv210-framebuffer-driver-data-structures.patch
s3c-fb-add-device-name-initialization.patch
s3c-fb-add-support-for-display-panning.patch
s3c-fb-add-wait-for-vsync-ioctl.patch
s3c-fb-window-3-of-64xx-does-not-have-an-osd_d-register.patch
s3c-fb-add-shadowcon-shadow-register-locking-support-for-s5pv210.patch
s3c-fb-correct-window-osd-size-and-alpha-register-handling.patch
s3c-fb-protect-window-specific-registers-during-updates.patch
s3c-fb-fix-section-mismatch.patch
s3c-fb-add-support-for-dma-channel-control-on-s5pv210.patch
s3c-fb-automatically-calculate-pixel-clock-when-none-is-given.patch
arm-samsung-remove-pixclock-from-several-boards.patch

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


+ sdhci-s3c-add-support-for-the-non-standard-minimal-clock-value.patch added to -mm tree

2010-07-29 Thread akpm

The patch titled
 sdhci-s3c: add support for the non standard minimal clock value
has been added to the -mm tree.  Its filename is
 sdhci-s3c-add-support-for-the-non-standard-minimal-clock-value.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: sdhci-s3c: add support for the non standard minimal clock value
From: Marek Szyprowski 

S3C SDHCI host controller can change the source for generating mmc clock. 
By default host bus clock is used, what causes some problems on machines
with 133MHz bus, because the SDHCI divider cannot be as high get proper
clock value for identification mode.  This is not a problem for the
controller, because it can generate lower frequencies from other clock
sources.  This patch changes sdhci driver to use get_min_clock() call if
it has been provided.

This fixes the flood of the following warnings on Samsung S5PV210 SoCs:
mmc0: Minimum clock frequency too high for identification mode

Signed-off-by: Marek Szyprowski 
Signed-off-by: Kyungmin Park 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/sdhci-s3c.c |   27 +++
 drivers/mmc/host/sdhci.c |3 +--
 2 files changed, 28 insertions(+), 2 deletions(-)

diff -puN 
drivers/mmc/host/sdhci-s3c.c~sdhci-s3c-add-support-for-the-non-standard-minimal-clock-value
 drivers/mmc/host/sdhci-s3c.c
--- 
a/drivers/mmc/host/sdhci-s3c.c~sdhci-s3c-add-support-for-the-non-standard-minimal-clock-value
+++ a/drivers/mmc/host/sdhci-s3c.c
@@ -203,9 +203,36 @@ static void sdhci_s3c_set_clock(struct s
}
 }
 
+/**
+ * sdhci_s3c_get_min_clock - callback to get minimal supported clock value
+ * @host: The SDHCI host being queried
+ *
+ * To init mmc host properly a minimal clock value is needed. For high system
+ * bus clock's values the standard formula gives values out of allowed range.
+ * The clock still can be set to lower values, if clock source other then
+ * system bus is selected.
+*/
+static unsigned int sdhci_s3c_get_min_clock(struct sdhci_host *host)
+{
+   struct sdhci_s3c *ourhost = to_s3c(host);
+   unsigned int delta, min = UINT_MAX;
+   int src;
+
+   for (src = 0; src < MAX_BUS_CLK; src++) {
+   delta = sdhci_s3c_consider_clock(ourhost, src, 0);
+   if (delta == UINT_MAX)
+   continue;
+   /* delta is a negative value in this case */
+   if (-delta < min)
+   min = -delta;
+   }
+   return min;
+}
+
 static struct sdhci_ops sdhci_s3c_ops = {
.get_max_clock  = sdhci_s3c_get_max_clk,
.set_clock  = sdhci_s3c_set_clock,
+   .get_min_clock  = sdhci_s3c_get_min_clock,
 };
 
 static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
diff -puN 
drivers/mmc/host/sdhci.c~sdhci-s3c-add-support-for-the-non-standard-minimal-clock-value
 drivers/mmc/host/sdhci.c
--- 
a/drivers/mmc/host/sdhci.c~sdhci-s3c-add-support-for-the-non-standard-minimal-clock-value
+++ a/drivers/mmc/host/sdhci.c
@@ -1776,8 +1776,7 @@ int sdhci_add_host(struct sdhci_host *ho
 * Set host parameters.
 */
mmc->ops = &sdhci_ops;
-   if (host->quirks & SDHCI_QUIRK_NONSTANDARD_CLOCK &&
-   host->ops->get_min_clock)
+   if (host->ops->get_min_clock)
mmc->f_min = host->ops->get_min_clock(host);
else
mmc->f_min = host->max_clk / 256;
_

Patches currently in -mm which might be from m.szyprow...@samsung.com are

linux-next.patch
sdhci-s3c-add-support-for-the-non-standard-minimal-clock-value.patch
sdhci-s3c-enable-sdhci_quirk_no_hispd_bit-quirk.patch
sdhci-s3c-add-support-for-new-card-detection-methods.patch
sdhci-add-regulator-support.patch
s3c-fb-change-to-depending-on-config_s3c_fb_dev.patch
s3c-fb-add-default-window-feature.patch
s3c-fb-fix-distortedness-situation-for-the-mode-more-then-24bpp.patch
s3c-fb-only-init-window-colour-key-controls-for-windows-with-blending.patch
s3c-fb-initial-move-to-unifying-the-header-files.patch
s3c-fb-udpate-to-support-s3c2416-s3c2443-style-hardware.patch
s3c-fb-integrate-palette-setup-code-into-main-driver.patch
s3c-fb-fix-various-null-references-on-framebuffer-memory-alloc-failure.patch
s3c-fb-correct-framesel1-bitfield-defines-for-vidintcon0-register.patch
s3c-fb-separate-s5pc100-and-s5pv210-framebuffer-driver-data-structures.patch
s3c-fb-a

+ sdhci-s3c-add-sdhci_quirk_data_timeout_uses_sdclk-quirk.patch added to -mm tree

2010-07-26 Thread akpm

The patch titled
 sdhci-s3c: add SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK quirk
has been added to the -mm tree.  Its filename is
 sdhci-s3c-add-sdhci_quirk_data_timeout_uses_sdclk-quirk.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: sdhci-s3c: add SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK quirk
From: Hyuk Lee 

On Samsung's SDMMC hosts the timeout clock is derivied from the SD Clock
which is set dynamically.  So checked SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK
quirk and removed 'sdhci_s3c_get_timeout_clk' callback which doesn't need
any more.

Signed-off-by: Hyuk Lee 
Signed-off-by: Kukjin Kim 
Cc: Ben Dooks 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/sdhci-s3c.c |   10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

diff -puN 
drivers/mmc/host/sdhci-s3c.c~sdhci-s3c-add-sdhci_quirk_data_timeout_uses_sdclk-quirk
 drivers/mmc/host/sdhci-s3c.c
--- 
a/drivers/mmc/host/sdhci-s3c.c~sdhci-s3c-add-sdhci_quirk_data_timeout_uses_sdclk-quirk
+++ a/drivers/mmc/host/sdhci-s3c.c
@@ -110,11 +110,6 @@ static unsigned int sdhci_s3c_get_max_cl
return max;
 }
 
-static unsigned int sdhci_s3c_get_timeout_clk(struct sdhci_host *host)
-{
-   return sdhci_s3c_get_max_clk(host) / 100;
-}
-
 /**
  * sdhci_s3c_consider_clock - consider one the bus clocks for current setting
  * @ourhost: Our SDHCI instance.
@@ -188,7 +183,6 @@ static void sdhci_s3c_set_clock(struct s
 
ourhost->cur_clk = best_src;
host->max_clk = clk_get_rate(clk);
-   host->timeout_clk = sdhci_s3c_get_timeout_clk(host);
 
ctrl = readl(host->ioaddr + S3C_SDHCI_CONTROL2);
ctrl &= ~S3C_SDHCI_CTRL2_SELBASECLK_MASK;
@@ -211,7 +205,6 @@ static void sdhci_s3c_set_clock(struct s
 
 static struct sdhci_ops sdhci_s3c_ops = {
.get_max_clock  = sdhci_s3c_get_max_clk,
-   .get_timeout_clock  = sdhci_s3c_get_timeout_clk,
.set_clock  = sdhci_s3c_set_clock,
 };
 
@@ -335,6 +328,9 @@ static int __devinit sdhci_s3c_probe(str
host->quirks |= (SDHCI_QUIRK_32BIT_DMA_ADDR |
 SDHCI_QUIRK_32BIT_DMA_SIZE);
 
+   /* HSMMC on Samsung SoCs uses SDCLK as timeout clock */
+   host->quirks |= SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK;
+
ret = sdhci_add_host(host);
if (ret) {
dev_err(dev, "sdhci_add_host() failed\n");
_

Patches currently in -mm which might be from hyuk1@samsung.com are

linux-next.patch
sdhci-s3c-add-sdhci_quirk_data_timeout_uses_sdclk-quirk.patch

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


+ tmio_mmc-allow-2-byte-requests-in-4-bit-mode.patch added to -mm tree

2010-07-26 Thread akpm

The patch titled
 tmio_mmc: allow 2 byte requests in 4-bit mode
has been added to the -mm tree.  Its filename is
 tmio_mmc-allow-2-byte-requests-in-4-bit-mode.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: tmio_mmc: allow 2 byte requests in 4-bit mode
From: Yusuke Goda 

Adjust the tmio_mmc block size check to accept 2-byte requests in 4-bit
mode.  Tested with the SDHI hardware block included in sh7724.

Signed-off-by: Yusuke Goda 
Tested-by: Magnus Damm 
Acked-by: Magnus Damm 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/tmio_mmc.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN 
drivers/mmc/host/tmio_mmc.c~tmio_mmc-allow-2-byte-requests-in-4-bit-mode 
drivers/mmc/host/tmio_mmc.c
--- a/drivers/mmc/host/tmio_mmc.c~tmio_mmc-allow-2-byte-requests-in-4-bit-mode
+++ a/drivers/mmc/host/tmio_mmc.c
@@ -660,8 +660,8 @@ static int tmio_mmc_start_data(struct tm
pr_debug("setup data transfer: blocksize %08x  nr_blocks %d\n",
 data->blksz, data->blocks);
 
-   /* Hardware cannot perform 1 and 2 byte requests in 4 bit mode */
-   if (data->blksz < 4 && host->mmc->ios.bus_width == MMC_BUS_WIDTH_4) {
+   /* Hardware cannot perform 1 byte requests in 4 bit mode */
+   if (data->blksz < 2 && host->mmc->ios.bus_width == MMC_BUS_WIDTH_4) {
pr_err("%s: %d byte block unsupported in 4 bit mode\n",
   mmc_hostname(host->mmc), data->blksz);
return -EINVAL;
_

Patches currently in -mm which might be from yusuke.goda...@renesas.com are

tmio_mmc-prevent-unexpected-status-clear.patch
tmio_mmc-allow-2-byte-requests-in-4-bit-mode.patch

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


+ mmc_test-add-performance-tests.patch added to -mm tree

2010-07-26 Thread akpm

The patch titled
 mmc_test: add performance tests
has been added to the -mm tree.  Its filename is
 mmc_test-add-performance-tests.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc_test: add performance tests
From: Adrian Hunter 

mmc_test provides tests aimed at testing SD/MMC hosts.  This patch adds
performance tests.

It is advantageous to have performance tests in a kernel
module like mmc_test for the following reasons:
- transfer times can be measured very accurately
- arbitrarily large transfers are possible
- the effect of contiguous vs scattered pages
can be determined

The new tests are:

23. Best-case read performance
24. Best-case write performance
25. Best-case read performance into scattered pages
26. Best-case write performance from scattered pages
27. Single read performance by transfer size
28. Single write performance by transfer size
29. Single trim performance by transfer size
30. Consecutive read performance by transfer size
31. Consecutive write performance by transfer size
32. Consecutive trim performance by transfer size

Signed-off-by: Adrian Hunter 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/card/mmc_test.c |  793 +-
 1 file changed, 791 insertions(+), 2 deletions(-)

diff -puN drivers/mmc/card/mmc_test.c~mmc_test-add-performance-tests 
drivers/mmc/card/mmc_test.c
--- a/drivers/mmc/card/mmc_test.c~mmc_test-add-performance-tests
+++ a/drivers/mmc/card/mmc_test.c
@@ -25,6 +25,54 @@
 #define BUFFER_ORDER   2
 #define BUFFER_SIZE(PAGE_SIZE << BUFFER_ORDER)
 
+/**
+ * struct mmc_test_pages - pages allocated by 'alloc_pages()'.
+ * @page: first page in the allocation
+ * @order: order of the number of pages allocated
+ */
+struct mmc_test_pages {
+   struct page *page;
+   unsigned int order;
+};
+
+/**
+ * struct mmc_test_mem - allocated memory.
+ * @arr: array of allocations
+ * @cnt: number of allocations
+ */
+struct mmc_test_mem {
+   struct mmc_test_pages *arr;
+   unsigned int cnt;
+};
+
+/**
+ * struct mmc_test_area - information for performance tests.
+ * @dev_addr: address on card at which to do performance tests
+ * @max_sz: test area size (in bytes)
+ * @max_segs: maximum segments in scatterlist @sg
+ * @blocks: number of (512 byte) blocks currently mapped by @sg
+ * @sg_len: length of currently mapped scatterlist @sg
+ * @mem: allocated memory
+ * @sg: scatterlist
+ */
+struct mmc_test_area {
+   unsigned int dev_addr;
+   unsigned int max_sz;
+   unsigned int max_segs;
+   unsigned int blocks;
+   unsigned int sg_len;
+   struct mmc_test_mem *mem;
+   struct scatterlist *sg;
+};
+
+/**
+ * struct mmc_test_card - test information.
+ * @card: card under test
+ * @scratch: transfer buffer
+ * @buffer: transfer buffer
+ * @highmem: buffer for highmem tests
+ * @area: information for performance tests
+ */
 struct mmc_test_card {
struct mmc_card *card;
 
@@ -33,6 +81,7 @@ struct mmc_test_card {
 #ifdef CONFIG_HIGHMEM
struct page *highmem;
 #endif
+   struct mmc_test_area area;
 };
 
 /***/
@@ -97,6 +146,12 @@ static void mmc_test_prepare_mrq(struct 
mmc_set_data_timeout(mrq->data, test->card);
 }
 
+static int mmc_test_busy(struct mmc_command *cmd)
+{
+   return !(cmd->resp[0] & R1_READY_FOR_DATA) ||
+   (R1_CURRENT_STATE(cmd->resp[0]) == 7);
+}
+
 /*
  * Wait for the card to finish the busy state
  */
@@ -117,13 +172,13 @@ static int mmc_test_wait_busy(struct mmc
if (ret)
break;
 
-   if (!busy && !(cmd.resp[0] & R1_READY_FOR_DATA)) {
+   if (!busy && mmc_test_busy(&cmd)) {
busy = 1;
printk(KERN_INFO "%s: Warning: Host did not "
"wait for busy state to end.\n",
mmc_hostname(test->card->host));
}
-   } while (!(cmd.resp[0] & R1_READY_FOR_DATA));
+   } while (mmc_test_busy(&cmd));
 
return ret;
 }
@@ -170,6 +225,246 @@ static int mmc_test_buffer_transfer(stru
return 0;
 }
 
+static void mm

+ omap-hsmmc-fix-processing-of-all-dma-interrupts-as-block-completion.patch added to -mm tree

2010-07-21 Thread akpm

The patch titled
 omap hsmmc: fix processing of all dma interrupts as block completion
has been added to the -mm tree.  Its filename is
 omap-hsmmc-fix-processing-of-all-dma-interrupts-as-block-completion.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: omap hsmmc: fix processing of all dma interrupts as block completion
From: Venkatraman S 

If other informative interrupts are enabled for the DMA channel used by
hsmmc, those are incorrectly treated as block completion.  This patch lets
only the block completion interrupt to be processed.

Signed-off-by: Venkatraman S 
Acked-by: Madhusudhan Chikkature 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/omap_hsmmc.c |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff -puN 
drivers/mmc/host/omap_hsmmc.c~omap-hsmmc-fix-processing-of-all-dma-interrupts-as-block-completion
 drivers/mmc/host/omap_hsmmc.c
--- 
a/drivers/mmc/host/omap_hsmmc.c~omap-hsmmc-fix-processing-of-all-dma-interrupts-as-block-completion
+++ a/drivers/mmc/host/omap_hsmmc.c
@@ -1280,8 +1280,11 @@ static void omap_hsmmc_dma_cb(int lch, u
struct mmc_data *data = host->mrq->data;
int dma_ch, req_in_progress;
 
-   if (ch_status & OMAP2_DMA_MISALIGNED_ERR_IRQ)
-   dev_dbg(mmc_dev(host->mmc), "MISALIGNED_ADRS_ERR\n");
+   if (!(ch_status & OMAP_DMA_BLOCK_IRQ)) {
+   dev_warn(mmc_dev(host->mmc), "unexpected dma status %x\n",
+   ch_status);
+   return;
+   }
 
spin_lock(&host->irq_lock);
if (host->dma_ch < 0) {
_

Patches currently in -mm which might be from svenk...@ti.com are

mmc-omap-fix-for-bus-width-which-improves-sd-cards-peformance.patch
omap-hsmmc-fix-processing-of-all-dma-interrupts-as-block-completion.patch

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


+ drivers-mmc-host-msm-sdcc-remove-dead-config-options.patch added to -mm tree

2010-07-21 Thread akpm

The patch titled
 drivers/mmc/host/msm-sdcc: remove dead config options
has been added to the -mm tree.  Its filename is
 drivers-mmc-host-msm-sdcc-remove-dead-config-options.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: drivers/mmc/host/msm-sdcc: remove dead config options
From: Christian Dietrich 

CONFIG_MMC_MSM7X00A_RESUME_IN_WQ and CONFIG_MMC_EMBEDDED_SDIO don't exist
in Kconfig and is never defined anywhere else, therefore removing all
references for it from the source code.

Signed-off-by: Christian Dietrich 
Acked-by: David Brown 
Cc: Daniel Walker 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/msm_sdcc.c |   25 -
 drivers/mmc/host/msm_sdcc.h |4 
 2 files changed, 29 deletions(-)

diff -puN 
drivers/mmc/host/msm_sdcc.c~drivers-mmc-host-msm-sdcc-remove-dead-config-options
 drivers/mmc/host/msm_sdcc.c
--- 
a/drivers/mmc/host/msm_sdcc.c~drivers-mmc-host-msm-sdcc-remove-dead-config-options
+++ a/drivers/mmc/host/msm_sdcc.c
@@ -1129,15 +1129,6 @@ msmsdcc_probe(struct platform_device *pd
host->dmares = dmares;
spin_lock_init(&host->lock);
 
-#ifdef CONFIG_MMC_EMBEDDED_SDIO
-   if (plat->embedded_sdio)
-   mmc_set_embedded_sdio_data(mmc,
-  &plat->embedded_sdio->cis,
-  &plat->embedded_sdio->cccr,
-  plat->embedded_sdio->funcs,
-  plat->embedded_sdio->num_funcs);
-#endif
-
/*
 * Setup DMA
 */
@@ -1299,22 +1290,6 @@ msmsdcc_probe(struct platform_device *pd
 }
 
 #ifdef CONFIG_PM
-#ifdef CONFIG_MMC_MSM7X00A_RESUME_IN_WQ
-static void
-do_resume_work(struct work_struct *work)
-{
-   struct msmsdcc_host *host =
-   container_of(work, struct msmsdcc_host, resume_task);
-   struct mmc_host *mmc = host->mmc;
-
-   if (mmc) {
-   mmc_resume_host(mmc);
-   if (host->stat_irq)
-   enable_irq(host->stat_irq);
-   }
-}
-#endif
-
 
 static int
 msmsdcc_suspend(struct platform_device *dev, pm_message_t state)
diff -puN 
drivers/mmc/host/msm_sdcc.h~drivers-mmc-host-msm-sdcc-remove-dead-config-options
 drivers/mmc/host/msm_sdcc.h
--- 
a/drivers/mmc/host/msm_sdcc.h~drivers-mmc-host-msm-sdcc-remove-dead-config-options
+++ a/drivers/mmc/host/msm_sdcc.h
@@ -235,10 +235,6 @@ struct msmsdcc_host {
int cmdpoll;
struct msmsdcc_statsstats;
 
-#ifdef CONFIG_MMC_MSM7X00A_RESUME_IN_WQ
-   struct work_struct  resume_task;
-#endif
-
/* Command parameters */
unsigned intcmd_timeout;
unsigned intcmd_pio_irqmask;
_

Patches currently in -mm which might be from 
qy03f...@stud.informatik.uni-erlangen.de are

drivers-mmc-host-msm-sdcc-remove-dead-config-options.patch
drivers-rtc-remove-unneeded-ifdef-config_pm.patch

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


+ mmc-add-jz4740-mmc-driver-v6.patch added to -mm tree

2010-07-15 Thread akpm

The patch titled
 From: Lars-Peter Clausen 
has been added to the -mm tree.  Its filename is
 mmc-add-jz4740-mmc-driver-v6.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: From: Lars-Peter Clausen 


- Rework Kconfig entry
- Avoid reloading the fifo address before each read/write

Signed-off-by: Lars-Peter Clausen 
Cc: Matt Fleming 
Cc: Ralf Baechle 
Cc: 
Signed-off-by: Andrew Morton 
---

 arch/mips/include/asm/mach-jz4740/jz4740_mmc.h |   15 
 drivers/mmc/host/Kconfig   |   17 
 drivers/mmc/host/jz4740_mmc.c  |  490 ---
 include/linux/mmc/jz4740_mmc.h |   15 
 4 files changed, 301 insertions(+), 236 deletions(-)

diff -puN /dev/null arch/mips/include/asm/mach-jz4740/jz4740_mmc.h
--- /dev/null
+++ a/arch/mips/include/asm/mach-jz4740/jz4740_mmc.h
@@ -0,0 +1,15 @@
+#ifndef __LINUX_MMC_JZ4740_MMC
+#define __LINUX_MMC_JZ4740_MMC
+
+struct jz4740_mmc_platform_data {
+   int gpio_power;
+   int gpio_card_detect;
+   int gpio_read_only;
+   unsigned card_detect_active_low:1;
+   unsigned read_only_active_low:1;
+   unsigned power_active_low:1;
+
+   unsigned data_1bit:1;
+};
+
+#endif
diff -puN drivers/mmc/host/Kconfig~mmc-add-jz4740-mmc-driver-v6 
drivers/mmc/host/Kconfig
--- a/drivers/mmc/host/Kconfig~mmc-add-jz4740-mmc-driver-v6
+++ a/drivers/mmc/host/Kconfig
@@ -81,14 +81,6 @@ config MMC_RICOH_MMC
 
  If unsure, say Y.
 
-config MMC_JZ4740
-   tristate "JZ4740 SD/Multimedia Card Interface support"
-   depends on MACH_JZ4740
-   help
- This selects the Ingenic Z4740 SD/Multimedia card Interface.
- If you have an ngenic platform with a Multimedia Card slot,
- say Y or M here.
-
 config MMC_SDHCI_OF
tristate "SDHCI support on OpenFirmware platforms"
depends on MMC_SDHCI && PPC_OF
@@ -440,3 +432,12 @@ config MMC_SH_MMCIF
  This selects the MMC Host Interface controler (MMCIF).
 
  This driver supports MMCIF in sh7724/sh7757/sh7372.
+
+config MMC_JZ4740
+   tristate "JZ4740 SD/Multimedia Card Interface support"
+   depends on MACH_JZ4740
+   help
+ This selects support for the SD/MMC controller on Ingenic JZ4740
+ SoCs.
+ If you have a board based on such a SoC and with a SD/MMC slot,
+ say Y or M here.
diff -puN drivers/mmc/host/jz4740_mmc.c~mmc-add-jz4740-mmc-driver-v6 
drivers/mmc/host/jz4740_mmc.c
--- a/drivers/mmc/host/jz4740_mmc.c~mmc-add-jz4740-mmc-driver-v6
+++ a/drivers/mmc/host/jz4740_mmc.c
@@ -22,7 +22,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -30,6 +29,7 @@
 #include 
 #include 
 
+#include 
 
 #define JZ_REG_MMC_STRPCL  0x00
 #define JZ_REG_MMC_STATUS  0x04
@@ -103,7 +103,12 @@
 
 #define JZ_MMC_CLK_RATE 2400
 
-#define JZ4740_MMC_MAX_TIMEOUT 1000
+enum jz4740_mmc_state {
+   JZ4740_MMC_STATE_READ_RESPONSE,
+   JZ4740_MMC_STATE_TRANSFER_DATA,
+   JZ4740_MMC_STATE_SEND_STOP,
+   JZ4740_MMC_STATE_DONE,
+};
 
 struct jz4740_mmc_host {
struct mmc_host *mmc;
@@ -121,7 +126,6 @@ struct jz4740_mmc_host {
 
unsigned long waiting;
 
-   int max_clock;
uint32_t cmdat;
 
uint16_t irq_mask;
@@ -129,6 +133,8 @@ struct jz4740_mmc_host {
spinlock_t lock;
 
struct timer_list timeout_timer;
+   struct sg_mapping_iter miter;
+   enum jz4740_mmc_state state;
 };
 
 static void jz4740_mmc_set_irq_enabled(struct jz4740_mmc_host *host,
@@ -160,22 +166,24 @@ static void jz4740_mmc_clock_enable(stru
 static void jz4740_mmc_clock_disable(struct jz4740_mmc_host *host)
 {
uint32_t status;
+   unsigned int timeout = 1000;
 
writew(JZ_MMC_STRPCL_CLOCK_STOP, host->base + JZ_REG_MMC_STRPCL);
do {
status = readl(host->base + JZ_REG_MMC_STATUS);
-   } while (status & JZ_MMC_STATUS_CLK_EN);
+   } while (status & JZ_MMC_STATUS_CLK_EN && --timeout);
 }
 
 static void jz4740_mmc_reset(struct jz4740_mmc_host *host)
 {
uint32_t status;
+   unsigned int timeout = 1000;
 
writew(JZ_MMC_STRPCL_RESET, host->base + JZ_REG_MMC_STRPCL);
udelay(10);
do {
status = readl(host->base + JZ_REG_MMC_STATUS);
-   } while (status & JZ_MMC_STATUS_IS_RESETTING);
+   } while (status &a

+ block-add-secure-discard.patch added to -mm tree

2010-07-15 Thread akpm

The patch titled
 block: add secure discard
has been added to the -mm tree.  Its filename is
 block-add-secure-discard.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: block: add secure discard
From: Adrian Hunter 

Secure discard is the same as discard except that all copies of the
discarded sectors (perhaps created by garbage collection) must also be
erased.

Signed-off-by: Adrian Hunter 
Cc: Jens Axboe 
Cc: Kyungmin Park 
Cc: Madhusudhan Chikkature 
Cc: Christoph Hellwig 
Cc: Ben Gardiner 
Cc: 
Signed-off-by: Andrew Morton 
---

 block/blk-core.c|5 -
 block/blk-lib.c |6 ++
 block/compat_ioctl.c|1 +
 block/elevator.c|6 ++
 block/ioctl.c   |   15 ++-
 include/linux/bio.h |2 ++
 include/linux/blkdev.h  |7 ++-
 include/linux/fs.h  |2 ++
 kernel/trace/blktrace.c |8 
 9 files changed, 45 insertions(+), 7 deletions(-)

diff -puN block/blk-core.c~block-add-secure-discard block/blk-core.c
--- a/block/blk-core.c~block-add-secure-discard
+++ a/block/blk-core.c
@@ -1514,7 +1514,10 @@ static inline void __generic_make_reques
if (bio_check_eod(bio, nr_sectors))
goto end_io;
 
-   if ((bio->bi_rw & REQ_DISCARD) && !blk_queue_discard(q)) {
+   if ((bio->bi_rw & REQ_DISCARD) &&
+   (!blk_queue_discard(q) ||
+((bio->bi_rw & REQ_SECURE) &&
+ !blk_queue_secdiscard(q {
err = -EOPNOTSUPP;
goto end_io;
}
diff -puN block/blk-lib.c~block-add-secure-discard block/blk-lib.c
--- a/block/blk-lib.c~block-add-secure-discard
+++ a/block/blk-lib.c
@@ -50,6 +50,12 @@ int blkdev_issue_discard(struct block_de
if (!blk_queue_discard(q))
return -EOPNOTSUPP;
 
+   if (flags & BLKDEV_IFL_SECURE) {
+   if (!blk_queue_secdiscard(q))
+   return -EOPNOTSUPP;
+   type |= DISCARD_SECURE;
+   }
+
while (nr_sects && !ret) {
unsigned int max_discard_sectors =
min(q->limits.max_discard_sectors, UINT_MAX >> 9);
diff -puN block/compat_ioctl.c~block-add-secure-discard block/compat_ioctl.c
--- a/block/compat_ioctl.c~block-add-secure-discard
+++ a/block/compat_ioctl.c
@@ -703,6 +703,7 @@ long compat_blkdev_ioctl(struct file *fi
case BLKFLSBUF:
case BLKROSET:
case BLKDISCARD:
+   case BLKSECDISCARD:
/*
 * the ones below are implemented in blkdev_locked_ioctl,
 * but we call blkdev_ioctl, which gets the lock for us
diff -puN block/elevator.c~block-add-secure-discard block/elevator.c
--- a/block/elevator.c~block-add-secure-discard
+++ a/block/elevator.c
@@ -83,6 +83,12 @@ int elv_rq_merge_ok(struct request *rq, 
return 0;
 
/*
+* Don't merge discard requests and secure discard requests
+*/
+   if ((bio->bi_rw & REQ_SECURE) != (rq->bio->bi_rw & REQ_SECURE))
+   return 0;
+
+   /*
 * different data direction or already started, don't merge
 */
if (bio_data_dir(bio) != rq_data_dir(rq))
diff -puN block/ioctl.c~block-add-secure-discard block/ioctl.c
--- a/block/ioctl.c~block-add-secure-discard
+++ a/block/ioctl.c
@@ -114,8 +114,10 @@ static int blkdev_reread_part(struct blo
 }
 
 static int blk_ioctl_discard(struct block_device *bdev, uint64_t start,
-uint64_t len)
+uint64_t len, int secure)
 {
+   unsigned long flags = BLKDEV_IFL_WAIT;
+
if (start & 511)
return -EINVAL;
if (len & 511)
@@ -125,8 +127,9 @@ static int blk_ioctl_discard(struct bloc
 
if (start + len > (bdev->bd_inode->i_size >> 9))
return -EINVAL;
-   return blkdev_issue_discard(bdev, start, len, GFP_KERNEL,
-   BLKDEV_IFL_WAIT);
+   if (secure)
+   flags |= BLKDEV_IFL_SECURE;
+   return blkdev_issue_discard(bdev, start, len, GFP_KERNEL, flags);
 }
 
 static int put_ushort(unsigned long arg, unsigned short val)
@@ -213,7 +216,8 @@ int blkdev_ioctl(struct block_device *bd
set_device_ro(bdev, n);
  

+ omap_hsmmc-add-erase-capability.patch added to -mm tree

2010-07-15 Thread akpm

The patch titled
 omap_hsmmc: add erase capability
has been added to the -mm tree.  Its filename is
 omap_hsmmc-add-erase-capability.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: omap_hsmmc: add erase capability
From: Adrian Hunter 

Disable the data (busy) timeout for erases and set the MMC_CAP_ERASE
capability.

Signed-off-by: Adrian Hunter 
Cc: Jens Axboe 
Cc: Kyungmin Park 
Cc: Madhusudhan Chikkature 
Cc: Christoph Hellwig 
Cc: Ben Gardiner 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/host/omap_hsmmc.c |   13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff -puN drivers/mmc/host/omap_hsmmc.c~omap_hsmmc-add-erase-capability 
drivers/mmc/host/omap_hsmmc.c
--- a/drivers/mmc/host/omap_hsmmc.c~omap_hsmmc-add-erase-capability
+++ a/drivers/mmc/host/omap_hsmmc.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -78,6 +79,7 @@
 #define INT_EN_MASK0x307F0033
 #define BWR_ENABLE (1 << 4)
 #define BRR_ENABLE (1 << 5)
+#define DTO_ENABLE (1 << 20)
 #define INIT_STREAM(1 << 1)
 #define DP_SELECT  (1 << 21)
 #define DDIR   (1 << 4)
@@ -523,7 +525,8 @@ static void omap_hsmmc_stop_clock(struct
dev_dbg(mmc_dev(host->mmc), "MMC Clock is not stoped\n");
 }
 
-static void omap_hsmmc_enable_irq(struct omap_hsmmc_host *host)
+static void omap_hsmmc_enable_irq(struct omap_hsmmc_host *host,
+ struct mmc_command *cmd)
 {
unsigned int irq_mask;
 
@@ -532,6 +535,10 @@ static void omap_hsmmc_enable_irq(struct
else
irq_mask = INT_EN_MASK;
 
+   /* Disable timeout for erases */
+   if (cmd->opcode == MMC_ERASE)
+   irq_mask &= ~DTO_ENABLE;
+
OMAP_HSMMC_WRITE(host->base, STAT, STAT_CLEAR);
OMAP_HSMMC_WRITE(host->base, ISE, irq_mask);
OMAP_HSMMC_WRITE(host->base, IE, irq_mask);
@@ -782,7 +789,7 @@ omap_hsmmc_start_command(struct omap_hsm
mmc_hostname(host->mmc), cmd->opcode, cmd->arg);
host->cmd = cmd;
 
-   omap_hsmmc_enable_irq(host);
+   omap_hsmmc_enable_irq(host, cmd);
 
host->response_busy = 0;
if (cmd->flags & MMC_RSP_PRESENT) {
@@ -2104,7 +2111,7 @@ static int __init omap_hsmmc_probe(struc
mmc->max_seg_size = mmc->max_req_size;
 
mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
-MMC_CAP_WAIT_WHILE_BUSY;
+MMC_CAP_WAIT_WHILE_BUSY | MMC_CAP_ERASE;
 
switch (mmc_slot(host).wires) {
case 8:
_

Patches currently in -mm which might be from adrian.hun...@nokia.com are

linux-next.patch
mmc-recognize-csd-structure.patch
mmc-recognize-csd-structure-fix.patch
mmc-split-mmc_sd_init_card.patch
mmc-implement-sd-combo-iomem-support.patch
mmc-omap-fix-for-bus-width-which-improves-sd-cards-peformance.patch
sdio-allow-non-standard-sdio-cards.patch
omap_hsmmc-add-init_card-pass-through-callback.patch
omap-pandora-pass-wl1251-information-to-sdio-core.patch
mmc-add-erase-secure-erase-trim-and-secure-trim-operations.patch
mmc_block-add-discard-support.patch
omap_hsmmc-add-erase-capability.patch
block-add-secure-discard.patch
mmc_block-add-support-for-secure-discard.patch

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


+ mmc-add-erase-secure-erase-trim-and-secure-trim-operations.patch added to -mm tree

2010-07-15 Thread akpm

The patch titled
 mmc: add erase, secure erase, trim and secure trim operations
has been added to the -mm tree.  Its filename is
 mmc-add-erase-secure-erase-trim-and-secure-trim-operations.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc: add erase, secure erase, trim and secure trim operations
From: Adrian Hunter 

SD/MMC cards tend to support an erase operation.  In addition, eMMC v4.4
cards can support secure erase, trim and secure trim operations that are
all variants of the basic erase command.

SD/MMC device attributes "erase_size" and "preferred_erase_size" have been
added.

"erase_size" is the minimum size, in bytes, of an erase operation.  For
MMC, "erase_size" is the erase group size reported by the card.  Note that
"erase_size" does not apply to trim or secure trim operations where the
minimum size is always one 512 byte sector.  For SD, "erase_size" is 512
if the card is block-addressed, 0 otherwise.

SD/MMC cards can erase an arbitrarily large area up to and
including the whole card.  When erasing a large area it may
be desirable to do it in smaller chunks for three reasons:

1. A single erase command will make all other I/O on the card
   wait.  This is not a problem if the whole card is being erased, but
   erasing one partition will make I/O for another partition on the
   same card wait for the duration of the erase - which could be a
   several minutes.

2. To be able to inform the user of erase progress.

3. The erase timeout becomes too large to be very useful. 
   Because the erase timeout contains a margin which is multiplied by
   the size of the erase area, the value can end up being several
   minutes for large areas.

"erase_size" is not the most efficient unit to erase (especially for SD
where it is just one sector), hence "preferred_erase_size" provides a good
chunk size for erasing large areas.

For MMC, "preferred_erase_size" is the high-capacity erase size if a card
specifies one, otherwise it is based on the capacity of the card.

For SD, "preferred_erase_size" is the allocation unit size specified by
the card.

"preferred_erase_size" is in bytes.

Signed-off-by: Adrian Hunter 
Cc: Jens Axboe 
Cc: Kyungmin Park 
Cc: Madhusudhan Chikkature 
Cc: Christoph Hellwig 
Cc: Ben Gardiner 
Cc: 
Signed-off-by: Andrew Morton 
---

 Documentation/00-INDEX  |2 
 Documentation/mmc/00-INDEX  |4 
 Documentation/mmc/mmc-dev-attrs.txt |   56 
 drivers/mmc/core/core.c |  346 ++
 drivers/mmc/core/core.h |2 
 drivers/mmc/core/mmc.c  |   47 +++
 drivers/mmc/core/sd.c   |   82 ++
 drivers/mmc/core/sd_ops.c   |   48 +++
 drivers/mmc/core/sd_ops.h   |1 
 include/linux/mmc/card.h|   20 +
 include/linux/mmc/core.h|   19 +
 include/linux/mmc/host.h|1 
 include/linux/mmc/mmc.h |   26 +
 include/linux/mmc/sd.h  |5 
 14 files changed, 651 insertions(+), 8 deletions(-)

diff -puN 
Documentation/00-INDEX~mmc-add-erase-secure-erase-trim-and-secure-trim-operations
 Documentation/00-INDEX
--- 
a/Documentation/00-INDEX~mmc-add-erase-secure-erase-trim-and-secure-trim-operations
+++ a/Documentation/00-INDEX
@@ -232,6 +232,8 @@ memory.txt
- info on typical Linux memory problems.
 mips/
- directory with info about Linux on MIPS architecture.
+mmc/
+   - directory with info about the MMC subsystem
 mono.txt
- how to execute Mono-based .NET binaries with the help of BINFMT_MISC.
 mutex-design.txt
diff -puN /dev/null Documentation/mmc/00-INDEX
--- /dev/null
+++ a/Documentation/mmc/00-INDEX
@@ -0,0 +1,4 @@
+00-INDEX
+- this file
+mmc-dev-attrs.txt
+- info on SD and MMC device attributes
diff -puN /dev/null Documentation/mmc/mmc-dev-attrs.txt
--- /dev/null
+++ a/Documentation/mmc/mmc-dev-attrs.txt
@@ -0,0 +1,56 @@
+SD and MMC Device Attributes
+
+
+All attributes are read-only.
+
+   cid Card Identifaction Register
+   csd Card Specific Data Register
+   scr SD Card Configuration Register (SD only)
+   dateManufacturing Date (from CID Register)
+   f

+ mmc_block-add-support-for-secure-discard.patch added to -mm tree

2010-07-15 Thread akpm

The patch titled
 mmc_block: add support for secure discard
has been added to the -mm tree.  Its filename is
 mmc_block-add-support-for-secure-discard.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
  reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

--
Subject: mmc_block: add support for secure discard
From: Adrian Hunter 

Secure discard is implemented by Secure Trim if the discard is unaligned
or Secure Erase otherwise.

Signed-off-by: Adrian Hunter 
Cc: Jens Axboe 
Cc: Kyungmin Park 
Cc: Madhusudhan Chikkature 
Cc: Christoph Hellwig 
Cc: Ben Gardiner 
Cc: 
Signed-off-by: Andrew Morton 
---

 drivers/mmc/card/block.c |   46 ++---
 drivers/mmc/card/queue.c |3 ++
 2 files changed, 46 insertions(+), 3 deletions(-)

diff -puN drivers/mmc/card/block.c~mmc_block-add-support-for-secure-discard 
drivers/mmc/card/block.c
--- a/drivers/mmc/card/block.c~mmc_block-add-support-for-secure-discard
+++ a/drivers/mmc/card/block.c
@@ -280,6 +280,42 @@ out:
return err ? 0 : 1;
 }
 
+static int mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq,
+  struct request *req)
+{
+   struct mmc_blk_data *md = mq->data;
+   struct mmc_card *card = md->queue.card;
+   unsigned int from, nr, arg;
+   int err = 0;
+
+   mmc_claim_host(card->host);
+
+   if (!mmc_can_secure_erase_trim(card)) {
+   err = -EOPNOTSUPP;
+   goto out;
+   }
+
+   from = blk_rq_pos(req);
+   nr = blk_rq_sectors(req);
+
+   if (mmc_can_trim(card) && !mmc_erase_group_aligned(card, from, nr))
+   arg = MMC_SECURE_TRIM1_ARG;
+   else
+   arg = MMC_SECURE_ERASE_ARG;
+
+   err = mmc_erase(card, from, nr, arg);
+   if (!err && arg == MMC_SECURE_TRIM1_ARG)
+   err = mmc_erase(card, from, nr, MMC_SECURE_TRIM2_ARG);
+out:
+   spin_lock_irq(&md->lock);
+   __blk_end_request(req, err, blk_rq_bytes(req));
+   spin_unlock_irq(&md->lock);
+
+   mmc_release_host(card->host);
+
+   return err ? 0 : 1;
+}
+
 static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *req)
 {
struct mmc_blk_data *md = mq->data;
@@ -510,10 +546,14 @@ static int mmc_blk_issue_rw_rq(struct mm
 
 static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
 {
-   if (req->cmd_flags & REQ_DISCARD)
-   return mmc_blk_issue_discard_rq(mq, req);
-   else
+   if (req->cmd_flags & REQ_DISCARD) {
+   if (req->cmd_flags & REQ_SECURE)
+   return mmc_blk_issue_secdiscard_rq(mq, req);
+   else
+   return mmc_blk_issue_discard_rq(mq, req);
+   } else {
return mmc_blk_issue_rw_rq(mq, req);
+   }
 }
 
 static inline int mmc_blk_readonly(struct mmc_card *card)
diff -puN drivers/mmc/card/queue.c~mmc_block-add-support-for-secure-discard 
drivers/mmc/card/queue.c
--- a/drivers/mmc/card/queue.c~mmc_block-add-support-for-secure-discard
+++ a/drivers/mmc/card/queue.c
@@ -141,6 +141,9 @@ int mmc_init_queue(struct mmc_queue *mq,
mq->queue->limits.discard_alignment =
card->erase_size << 9;
}
+   if (mmc_can_secure_erase_trim(card))
+   queue_flag_set_unlocked(QUEUE_FLAG_SECDISCARD,
+   mq->queue);
}
 
 #ifdef CONFIG_MMC_BLOCK_BOUNCE
_

Patches currently in -mm which might be from adrian.hun...@nokia.com are

linux-next.patch
mmc-recognize-csd-structure.patch
mmc-recognize-csd-structure-fix.patch
mmc-split-mmc_sd_init_card.patch
mmc-implement-sd-combo-iomem-support.patch
mmc-omap-fix-for-bus-width-which-improves-sd-cards-peformance.patch
sdio-allow-non-standard-sdio-cards.patch
omap_hsmmc-add-init_card-pass-through-callback.patch
omap-pandora-pass-wl1251-information-to-sdio-core.patch
mmc-add-erase-secure-erase-trim-and-secure-trim-operations.patch
mmc_block-add-discard-support.patch
omap_hsmmc-add-erase-capability.patch
block-add-secure-discard.patch
mmc_block-add-support-for-secure-discard.patch

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


  1   2   3   4   5   6   >