From: Tomas Winkler <tomas.winkler@intel.com>
To: drzeus-list@drzeus.cx
Cc: marcel@holtmann.org, linux-kernel@vger.kernel.org,
Benzi Zbit <Benzi.Zbit@intel.com>
Subject: [PATCH 1/5 V2] MMC: core - fix the use of hard coded timeout value.
Date: Tue, 1 Jul 2008 02:53:00 +0300 [thread overview]
Message-ID: <1214869984-20115-1-git-send-email-tomas.winkler@intel.com> (raw)
From: Benzi Zbit <Benzi.Zbit@intel.com>
This adds reading and using of enable_timeout from the CIS
Signed-off-by: Benzi Zbit <Benzi.Zbit@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
drivers/mmc/core/sdio_cis.c | 2 ++
drivers/mmc/core/sdio_io.c | 7 ++-----
include/linux/mmc/sdio_func.h | 1 +
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/mmc/core/sdio_cis.c b/drivers/mmc/core/sdio_cis.c
index d5e51b1..e3a9797 100644
--- a/drivers/mmc/core/sdio_cis.c
+++ b/drivers/mmc/core/sdio_cis.c
@@ -129,6 +129,8 @@ static int cistpl_funce_func(struct sdio_func *func,
/* TPLFE_MAX_BLK_SIZE */
func->max_blksize = buf[12] | (buf[13] << 8);
+ /* TPLFE_ENABLE_TIMEOUT_VAL */
+ func->enable_timeout = buf[28] | (buf[29] << 8);
return 0;
}
diff --git a/drivers/mmc/core/sdio_io.c b/drivers/mmc/core/sdio_io.c
index 625b92c..252c4fd 100644
--- a/drivers/mmc/core/sdio_io.c
+++ b/drivers/mmc/core/sdio_io.c
@@ -76,11 +76,8 @@ int sdio_enable_func(struct sdio_func *func)
if (ret)
goto err;
- /*
- * FIXME: This should timeout based on information in the CIS,
- * but we don't have card to parse that yet.
- */
- timeout = jiffies + HZ;
+ /* max enable timeout is in units of 10mS */
+ timeout = jiffies + msecs_to_jiffies(func->enable_timeout * 10);
while (1) {
ret = mmc_io_rw_direct(func->card, 0, 0, SDIO_CCCR_IORx, 0, ®);
diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h
index b050f4d..8de40f1 100644
--- a/include/linux/mmc/sdio_func.h
+++ b/include/linux/mmc/sdio_func.h
@@ -46,6 +46,7 @@ struct sdio_func {
unsigned max_blksize; /* maximum block size */
unsigned cur_blksize; /* current block size */
+ unsigned enable_timeout; /* max enable timeout in units of 10mS steps */
unsigned int state; /* function state */
#define SDIO_STATE_PRESENT (1<<0) /* present in sysfs */
--
1.5.4.1
---------------------------------------------------------------------
Intel Israel (74) Limited
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
next reply other threads:[~2008-06-30 23:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-30 23:53 Tomas Winkler [this message]
2008-06-30 23:53 ` [PATCH 2/5 V2] MMC: wbsd.c fix shadowing of 'dma' variable Tomas Winkler
2008-06-30 23:53 ` [PATCH 3/5] MMC: fix sdio_io sparse errors Tomas Winkler
2008-06-30 23:53 ` [PATCH 4/5] MMC: fix spares errors of sdhci.c Tomas Winkler
2008-06-30 23:53 ` [PATCH 5/5] MMC: cleanup endianity conversions Tomas Winkler
2008-07-01 1:51 ` Marcel Holtmann
2008-07-01 1:47 ` [PATCH 4/5] MMC: fix spares errors of sdhci.c Marcel Holtmann
2008-07-01 1:54 ` [PATCH 3/5] MMC: fix sdio_io sparse errors Marcel Holtmann
2008-07-01 1:44 ` [PATCH 2/5 V2] MMC: wbsd.c fix shadowing of 'dma' variable Marcel Holtmann
2008-07-05 22:38 ` Pierre Ossman
2008-07-01 1:45 ` [PATCH 1/5 V2] MMC: core - fix the use of hard coded timeout value Marcel Holtmann
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=1214869984-20115-1-git-send-email-tomas.winkler@intel.com \
--to=tomas.winkler@intel.com \
--cc=Benzi.Zbit@intel.com \
--cc=drzeus-list@drzeus.cx \
--cc=linux-kernel@vger.kernel.org \
--cc=marcel@holtmann.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®