sdio: fix the use of hard coded timeout value.
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> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
This commit is contained in:
parent
c71f65129a
commit
62a7573ee9
@ -129,6 +129,12 @@ static int cistpl_funce_func(struct sdio_func *func,
|
|||||||
/* TPLFE_MAX_BLK_SIZE */
|
/* TPLFE_MAX_BLK_SIZE */
|
||||||
func->max_blksize = buf[12] | (buf[13] << 8);
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,11 +76,7 @@ int sdio_enable_func(struct sdio_func *func)
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
/*
|
timeout = jiffies + msecs_to_jiffies(func->enable_timeout);
|
||||||
* FIXME: This should timeout based on information in the CIS,
|
|
||||||
* but we don't have card to parse that yet.
|
|
||||||
*/
|
|
||||||
timeout = jiffies + HZ;
|
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
ret = mmc_io_rw_direct(func->card, 0, 0, SDIO_CCCR_IORx, 0, ®);
|
ret = mmc_io_rw_direct(func->card, 0, 0, SDIO_CCCR_IORx, 0, ®);
|
||||||
|
@ -46,6 +46,8 @@ struct sdio_func {
|
|||||||
unsigned max_blksize; /* maximum block size */
|
unsigned max_blksize; /* maximum block size */
|
||||||
unsigned cur_blksize; /* current block size */
|
unsigned cur_blksize; /* current block size */
|
||||||
|
|
||||||
|
unsigned enable_timeout; /* max enable timeout in msec */
|
||||||
|
|
||||||
unsigned int state; /* function state */
|
unsigned int state; /* function state */
|
||||||
#define SDIO_STATE_PRESENT (1<<0) /* present in sysfs */
|
#define SDIO_STATE_PRESENT (1<<0) /* present in sysfs */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user