From 24ef8b27d729da319a00d7047c583489859c2756 Mon Sep 17 00:00:00 2001 From: Benzi Zbit Date: Thu, 10 Jul 2008 02:41:43 +0300 Subject: [PATCH] --- yaml --- r: 102215 b: refs/heads/master c: 62a7573ee9f31d4fdb330b3e68ebf6efaba1d57c h: refs/heads/master i: 102213: aee50777d3783de3c71867e33ae65fb69de3e356 102211: dcbd43b370730b21e98f4b740706599595707a51 102207: 388455551041bdf8d79e9db7076fc39cb9acdfdc v: v3 --- [refs] | 2 +- trunk/drivers/mmc/core/sdio_cis.c | 6 ++++++ trunk/drivers/mmc/core/sdio_io.c | 6 +----- trunk/include/linux/mmc/sdio_func.h | 2 ++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index cb55676e4bd7..90d5f1f077bd 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c71f65129a1fb67bc6b9b8d03b493675b5c9302b +refs/heads/master: 62a7573ee9f31d4fdb330b3e68ebf6efaba1d57c diff --git a/trunk/drivers/mmc/core/sdio_cis.c b/trunk/drivers/mmc/core/sdio_cis.c index d5e51b1c7b3f..956bd7677502 100644 --- a/trunk/drivers/mmc/core/sdio_cis.c +++ b/trunk/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/trunk/drivers/mmc/core/sdio_io.c b/trunk/drivers/mmc/core/sdio_io.c index 3ccf6919877c..0888df64581f 100755 --- a/trunk/drivers/mmc/core/sdio_io.c +++ b/trunk/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, ®); diff --git a/trunk/include/linux/mmc/sdio_func.h b/trunk/include/linux/mmc/sdio_func.h index 28fb0a33acf8..07bee4a0d457 100755 --- a/trunk/include/linux/mmc/sdio_func.h +++ b/trunk/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 */