mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1 V3] MMC: core - fix the use of hard coded timeout value.
@ 2008-07-09 23:41 Tomas Winkler
  2008-07-10 19:55 ` Pierre Ossman
  0 siblings, 1 reply; 2+ messages in thread
From: Tomas Winkler @ 2008-07-09 23:41 UTC (permalink / raw)
  To: drzeus-list; +Cc: linux-kernel, Benzi Zbit

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   |    6 ++++++
 drivers/mmc/core/sdio_io.c    |    6 +-----
 include/linux/mmc/sdio_func.h |    2 ++
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/core/sdio_cis.c b/drivers/mmc/core/sdio_cis.c
index d5e51b1..956bd76 100644
--- a/drivers/mmc/core/sdio_cis.c
+++ b/drivers/mmc/core/sdio_cis.c
@@ -129,6 +129,12 @@ 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, present in ver 1.1 and above */
+	if (vsn > SDIO_SDIO_REV_1_00)
+		func->enable_timeout = (buf[28] | (buf[29] << 8)) * 10;
+	else
+		func->enable_timeout = jiffies_to_msecs(HZ);
+
 	return 0;
 }
 
diff --git a/drivers/mmc/core/sdio_io.c b/drivers/mmc/core/sdio_io.c
index 3ccf691..0888df6 100755
--- a/drivers/mmc/core/sdio_io.c
+++ b/drivers/mmc/core/sdio_io.c
@@ -76,11 +76,7 @@ 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;
+	timeout = jiffies + msecs_to_jiffies(func->enable_timeout);
 
 	while (1) {
 		ret = mmc_io_rw_direct(func->card, 0, 0, SDIO_CCCR_IORx, 0, &reg);
diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h
index 28fb0a3..07bee4a 100755
--- a/include/linux/mmc/sdio_func.h
+++ b/include/linux/mmc/sdio_func.h
@@ -46,6 +46,8 @@ struct sdio_func {
 	unsigned		max_blksize;	/* maximum block size */
 	unsigned		cur_blksize;	/* current block size */
 
+	unsigned		enable_timeout;	/* max enable timeout in msec */
+
 	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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1 V3] MMC: core - fix the use of hard coded timeout value.
  2008-07-09 23:41 [PATCH 1/1 V3] MMC: core - fix the use of hard coded timeout value Tomas Winkler
@ 2008-07-10 19:55 ` Pierre Ossman
  0 siblings, 0 replies; 2+ messages in thread
From: Pierre Ossman @ 2008-07-10 19:55 UTC (permalink / raw)
  To: Tomas Winkler; +Cc: linux-kernel, Benzi Zbit

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

On Thu, 10 Jul 2008 02:41:43 +0300
Tomas Winkler <tomas.winkler@intel.com> wrote:

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

Looks ok. Applied.

-- 
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  rdesktop, core developer          http://www.rdesktop.org

  WARNING: This correspondence is being monitored by the
  Swedish government. Make sure your server uses encryption
  for SMTP traffic and consider using PGP for end-to-end
  encryption.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-07-10 19:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-09 23:41 [PATCH 1/1 V3] MMC: core - fix the use of hard coded timeout value Tomas Winkler
2008-07-10 19:55 ` Pierre Ossman

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®