mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Matt Fleming" <mattjfleming@googlemail.com>
To: "Pierre Ossman" <drzeus-mmc@drzeus.cx>
Cc: linux-kernel@vger.kernel.org, dbrownell@users.sourceforge.net
Subject: Re: [RFC][PATCH] MMC: Use write timeout value as read from CSR
Date: Tue, 9 Sep 2008 10:07:41 +0100	[thread overview]
Message-ID: <5ff4a1e50809090207o5846f5udf709eeda81653eb@mail.gmail.com> (raw)
In-Reply-To: <20080909105513.5b8ceaaf@mjolnir.drzeus.cx>

[-- Attachment #1: Type: text/plain, Size: 1428 bytes --]

2008/9/9 Pierre Ossman <drzeus-mmc@drzeus.cx>:
> On Tue, 9 Sep 2008 08:59:11 +0100
> "Matt Fleming" <mattjfleming@googlemail.com> wrote:
>
>>
>> OK, just to be clear, where are those fields not used? They are used
>> in the new mmc_get_timeout() function.
>>
>
> Sorry, you're right. I just noticed the !host->mmc->card part and
> assumed you had your own logic in there.
>

No worries.

> Why do you have that part though? What case have you found where you
> need the timeouts and do not have properly set timeout fields?
>

This check was put in place because the function was being called
before the card structure was setup properly. I didn't actually work
out the call path but it stopped the kmmcd thread oopsing :)

How does this patch look for the SDIO case?


diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 044d84e..5ebfe35 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -249,8 +249,10 @@ void mmc_set_data_timeout(struct mmc_data *data,
const struct mmc_card *card)
         * SDIO cards only define an upper 1 s limit on access.
         */
        if (mmc_card_sdio(card)) {
-               data->timeout_ns = 1000000000;
-               data->timeout_clks = 0;
+               if (data->timeout_ns > 1000000000) {
+                       data->timeout_ns = 1000000000;
+                       data->timeout_clks = 0;
+               }
                return;
        }

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: mmc-sdio-use-csr-timeout.patch --]
[-- Type: text/x-diff; name=mmc-sdio-use-csr-timeout.patch, Size: 531 bytes --]

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 044d84e..5ebfe35 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -249,8 +249,10 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card)
 	 * SDIO cards only define an upper 1 s limit on access.
 	 */
 	if (mmc_card_sdio(card)) {
-		data->timeout_ns = 1000000000;
-		data->timeout_clks = 0;
+		if (data->timeout_ns > 1000000000) {
+			data->timeout_ns = 1000000000;
+			data->timeout_clks = 0;
+		}
 		return;
 	}
 

  reply	other threads:[~2008-09-09  9:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-01 15:12 Matt Fleming
2008-09-07 10:38 ` Pierre Ossman
2008-09-08 13:28   ` Matt Fleming
2008-09-08 19:18     ` David Brownell
2008-09-09  7:22     ` Pierre Ossman
2008-09-09  7:34       ` Matt Fleming
2008-09-09  7:44         ` Pierre Ossman
2008-09-09  7:59           ` Matt Fleming
2008-09-09  8:55             ` Pierre Ossman
2008-09-09  9:07               ` Matt Fleming [this message]
2008-09-09  9:42                 ` Matt Fleming
2008-09-14 13:48                   ` Pierre Ossman
     [not found]                     ` <5ff4a1e50809150103v1e250e0x4192e2fe901750a6@mail.gmail.com>
     [not found]                       ` <20080915103821.2b618bba@mjolnir.drzeus.cx>
2008-09-15  9:24                         ` Matt Fleming
2008-09-20 11:06                           ` Pierre Ossman
2008-09-24 11:16                             ` Matt Fleming
2008-10-02  8:26                               ` Pierre Ossman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5ff4a1e50809090207o5846f5udf709eeda81653eb@mail.gmail.com \
    --to=mattjfleming@googlemail.com \
    --cc=dbrownell@users.sourceforge.net \
    --cc=drzeus-mmc@drzeus.cx \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®