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 <hein_tibo...@yahoo.es>

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 <hein_tibo...@yahoo.es>
Reviewed-and-Tested-by: Chris Ball <c...@laptop.org>
Cc: Matt Fleming <m...@console-pimps.org>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <a...@linux-foundation.org>
---

 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[] = { 400000, 300000, 200000, 100000 };
+       const unsigned freqs[] = { 400000, 300000, 200000, 100000 };
 
        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

Reply via email to