mmc_core: fix the use of hard coded timeout value.
Subsystems (2)
PATCH 1/3 mmc_core: fix the use of hard coded timeout value.
From: Benzi Zbit <[email protected]>
--- 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(-) mode change 100644 => 100755 drivers/mmc/core/sdio_cis.c mode change 100644 => 100755 drivers/mmc/core/sdio_io.c mode change 100644 => 100755 include/linux/mmc/sdio_func.h
drivers/mmc/core/sdio_cis.c +2 -0
@@ -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 ; }
drivers/mmc/core/sdio_io.c +2 -5
@@ -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 , ®);
include/linux/mmc/sdio_func.h +1 -0
@@ -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 */
Signature · 9 lines
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.
PATCH 2/3 mmc: wbsd.c fix shadowing of 'dma' variable
This patch fix warning :shadowing dma variable
--- drivers/mmc/host/wbsd.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)
drivers/mmc/host/wbsd.c +7 -7
@@ -75,9 +75,9 @@ static unsigned int nopnp = 0;#else static const unsigned int nopnp =1 ;#endif -static unsigned int io =0x248 ; -static unsigned int irq =6 ; -static int dma =2 ; +static unsigned int param_io =0x248 ; +static unsigned int param_irq =6 ; +static int param_dma =2 ;/* * Basic functions
@@ -1765,7 +1765,7 @@ static void __devexit wbsd_shutdown(struct device *dev, int pnp)static int __devinit wbsd_probe (struct platform_device *dev) {/* Use the module parameters for resources */ -return wbsd_init (&dev->dev, io, irq, dma,0 ); +return wbsd_init (&dev->dev, param_io, param_irq, param_dma,0 ); } static int __devexit wbsd_remove(struct platform_device *dev)
@@ -2031,9 +2031,9 @@ module_exit(wbsd_drv_exit);#ifdef CONFIG_PNP module_param (nopnp, uint,0444 );#endif -module_param (io, uint,0444 ); -module_param (irq, uint,0444 ); -module_param (dma, int,0444 ); +module_param (param_io, uint,0444 ); +module_param (param_irq, uint,0444 ); +module_param (param_dma, int,0444 );MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Pierre Ossman <[email protected]>" );
Signature · 9 lines
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.
PATCH 3/3 mmc: fix sdio_io sparse errors
This patch fixes sdio_io sparse errors.
This fix changes signature of API functions,
changing
unsigned char -> u8
unsigned short -> u16
unsigned long -> u32 - this was probably a bug in 64 bit platforms
--- drivers/mmc/core/sdio_io.c | 43 +++++++++++++++------------------------- include/linux/mmc/sdio_func.h | 33 ++++++++++++++----------------- 2 files changed, 31 insertions(+), 45 deletions(-)
drivers/mmc/core/sdio_io.c +16 -27
@@ -164,10 +164,8 @@ int sdio_set_block_size(struct sdio_func *func, unsigned blksz)return -EINVAL ;if (blksz ==0 ) { - blksz =min (min ( - func->max_blksize, - func->card->host->max_blk_size), -512u ); + blksz =min (func->max_blksize, func->card->host->max_blk_size); + blksz =min (blksz,512u ); } ret = mmc_io_rw_direct(func->card, 1, 0,
@@ -183,7 +181,6 @@ int sdio_set_block_size(struct sdio_func *func, unsigned blksz) func->cur_blksize = blksz;return 0 ; } -EXPORT_SYMBOL_GPL (sdio_set_block_size);/* Split an arbitrarily sized data transfer into several
@@ -200,10 +197,9 @@ static int sdio_io_rw_ext_helper(struct sdio_func *func, int write,/* Blocks per command is limited by host count, host transfer * size (we only use a single sg entry) and the maximum for * IO_RW_EXTENDED of 511 blocks. */ - max_blocks =min (min ( - func->card->host->max_blk_count, - func->card->host->max_seg_size / func->cur_blksize), -511u ); + max_blocks =min (func->card->host->max_blk_count, + func->card->host->max_seg_size / func->cur_blksize); + max_blocks =min (max_blocks,511u );while (remainder > func->cur_blksize) {unsigned blocks;
@@ -257,11 +253,10 @@ static int sdio_io_rw_ext_helper(struct sdio_func *func, int write,* function. If there is a problem reading the address, 0xff * is returned and @err_ret will contain the error code. */ -unsigned char sdio_readb (struct sdio_func *func,unsigned int addr, -int *err_ret) +u8 sdio_readb (struct sdio_func *func,unsigned int addr,int *err_ret) {int ret; -unsigned char val; +u8 val;BUG_ON (!func);
@@ -290,8 +285,7 @@ EXPORT_SYMBOL_GPL(sdio_readb);* function. @err_ret will contain the status of the actual * transfer. */ -void sdio_writeb (struct sdio_func *func,unsigned char b,unsigned int addr, -int *err_ret) +void sdio_writeb (struct sdio_func *func,u8 b,unsigned int addr,int *err_ret) {int ret;
@@ -352,7 +346,6 @@ int sdio_readsb(struct sdio_func *func, void *dst, unsigned int addr, {return sdio_io_rw_ext_helper (func,0 , addr,0 , dst, count); } -EXPORT_SYMBOL_GPL (sdio_readsb);/**
@@ -382,8 +375,7 @@ EXPORT_SYMBOL_GPL(sdio_writesb);* function. If there is a problem reading the address, 0xffff * is returned and @err_ret will contain the error code. */ -unsigned short sdio_readw (struct sdio_func *func,unsigned int addr, -int *err_ret) +u16 sdio_readw (struct sdio_func *func,unsigned int addr,int *err_ret) {int ret;
@@ -397,7 +389,7 @@ unsigned short sdio_readw(struct sdio_func *func, unsigned int addr,return 0xFFFF ; } -return le16_to_cpu (*(u16 *)func->tmpbuf); +return le16_to_cpup ((__le16 *)func->tmpbuf); }EXPORT_SYMBOL_GPL (sdio_readw);
@@ -412,12 +404,11 @@ EXPORT_SYMBOL_GPL(sdio_readw);* function. @err_ret will contain the status of the actual * transfer. */ -void sdio_writew (struct sdio_func *func,unsigned short b,unsigned int addr, -int *err_ret) +void sdio_writew (struct sdio_func *func,u16 b,unsigned int addr,int *err_ret) {int ret; - *(u16 *)func->tmpbuf =cpu_to_le16 (b); + *(__le16 *)func->tmpbuf =cpu_to_le16 (b); ret =sdio_memcpy_toio (func, addr, func->tmpbuf,2 );if (err_ret)
@@ -436,8 +427,7 @@ EXPORT_SYMBOL_GPL(sdio_writew);* 0xffffffff is returned and @err_ret will contain the error * code. */ -unsigned long sdio_readl (struct sdio_func *func,unsigned int addr, -int *err_ret) +u32 sdio_readl (struct sdio_func *func,unsigned int addr,int *err_ret) {int ret;
@@ -451,7 +441,7 @@ unsigned long sdio_readl(struct sdio_func *func, unsigned int addr,return 0xFFFFFFFF ; } -return le32_to_cpu (*(u32 *)func->tmpbuf); +return le32_to_cpup ((__le32 *)func->tmpbuf); }EXPORT_SYMBOL_GPL (sdio_readl);
@@ -466,12 +456,11 @@ EXPORT_SYMBOL_GPL(sdio_readl);* function. @err_ret will contain the status of the actual * transfer. */ -void sdio_writel (struct sdio_func *func,unsigned long b,unsigned int addr, -int *err_ret) +void sdio_writel (struct sdio_func *func,u32 b,unsigned int addr,int *err_ret) {int ret; - *(u32 *)func->tmpbuf =cpu_to_le32 (b); + *(__le32 *)func->tmpbuf =cpu_to_le32 (b); ret =sdio_memcpy_toio (func, addr, func->tmpbuf,4 );if (err_ret)
include/linux/mmc/sdio_func.h +15 -18
@@ -121,34 +121,31 @@ extern int sdio_set_block_size(struct sdio_func *func, unsigned blksz);extern int sdio_claim_irq (struct sdio_func *func,sdio_irq_handler_t *handler);extern int sdio_release_irq (struct sdio_func *func); -extern unsigned char sdio_readb (struct sdio_func *func, -unsigned int addr,int *err_ret); -extern unsigned short sdio_readw (struct sdio_func *func, -unsigned int addr,int *err_ret); -extern unsigned long sdio_readl (struct sdio_func *func, -unsigned int addr,int *err_ret); +extern u8 sdio_readb (struct sdio_func *func,unsigned int addr,int *err_ret); +extern u16 sdio_readw (struct sdio_func *func,unsigned int addr,int *err_ret); +extern u32 sdio_readl (struct sdio_func *func,unsigned int addr,int *err_ret);extern int sdio_memcpy_fromio (struct sdio_func *func,void *dst, -unsigned int addr,int count); +unsigned int addr,int count);extern int sdio_readsb (struct sdio_func *func,void *dst, -unsigned int addr,int count); +unsigned int addr,int count); -extern void sdio_writeb (struct sdio_func *func,unsigned char b, -unsigned int addr,int *err_ret); -extern void sdio_writew (struct sdio_func *func,unsigned short b, -unsigned int addr,int *err_ret); -extern void sdio_writel (struct sdio_func *func,unsigned long b, -unsigned int addr,int *err_ret); +extern void sdio_writeb (struct sdio_func *func,u8 b, +unsigned int addr,int *err_ret); +extern void sdio_writew (struct sdio_func *func,u16 b, +unsigned int addr,int *err_ret); +extern void sdio_writel (struct sdio_func *func,u32 b, +unsigned int addr,int *err_ret);extern int sdio_memcpy_toio (struct sdio_func *func,unsigned int addr, -void *src,int count); +void *src,int count);extern int sdio_writesb (struct sdio_func *func,unsigned int addr, -void *src,int count); +void *src,int count);extern unsigned char sdio_f0_readb (struct sdio_func *func, -unsigned int addr,int *err_ret); +unsigned int addr,int *err_ret);extern void sdio_f0_writeb (struct sdio_func *func,unsigned char b, -unsigned int addr,int *err_ret); +unsigned int addr,int *err_ret);#endif
Signature · 9 lines
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.
Re: [PATCH 3/3] mmc: fix sdio_io sparse errors
Hi Tomas,
Quoted 6 lines
This patch fixes
sdio_iosparse errors.
This fix changes signature of API functions,
changing
unsigned char -> u8
unsigned short -> u16
unsigned long -> u32 - this was probably a bug in 64 bit platforms
why are we not using the new get_unaligned_le* and put_unaligned_le* functions for the tmpbuf access?
Regards
Marcel
RE: [PATCH 3/3] mmc: fix sdio_io sparse errors
Quoted 18 lines
-----Original Message-----
From: Marcel Holtmann [mailto:[email protected]]
Sent: Monday, June 30, 2008 12:01 PM
To: Winkler, Tomas
Cc: [email protected]; [email protected]
Subject: Re: [PATCH 3/3] mmc: fixsdio_iosparse errorsHi Tomas,
Quoted 6 lines
This patch fixes
sdio_iosparse errors.
This fix changes signature of API functions,
changing
unsigned char -> u8
unsigned short -> u16
unsigned long -> u32 - this was probably a bug in 64 bit platforms
Quoted 3 lines
why are we not using the new get_unaligned_le* and put_unaligned_le* functions for the tmpbuf access?
It resides inside sido_func structure there is no reason it will be unaligned.
Tomas
---------------------------------------------------------------------
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.
Re: [PATCH 3/3] mmc: fix sdio_io sparse errors
In reply to Tomas WinklerQuoted 9 lines · On Mon, 30 Jun 2008 10:50:24 +0300 Tomas Winkler <[email protected]>…
This patch fixes
sdio_iosparse errors.
This fix changes signature of API functions,
changing
unsigned char -> u8
unsigned short -> u16
unsigned long -> u32 - this was probably a bug in 64 bit platformsSigned-off-by Tomas Winkler <[email protected]>---
I'm not entirely comfortable with this as the point was to use the same types as the "real" read*/write*. But as i386 and x86_64 use different types, I don't see much choice.
I've applied the patch.
Rgds
Signature · 9 lines
-- 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.
Re: [PATCH 2/3] mmc: wbsd.c fix shadowing of 'dma' variable
In reply to Tomas WinklerHi Tomas,
Quoted 1 line
This patch fix warning :shadowing dma variable
please use module_param_named() instead.
Regards
Marcel
Re: [PATCH 2/3] mmc: wbsd.c fix shadowing of 'dma' variable
In reply to Tomas WinklerQuoted 4 lines · On Mon, 30 Jun 2008 10:50:23 +0300 Tomas Winkler <[email protected]>…
This patch fix warning :shadowing dma variable
Signed-off-by Tomas Winkler <[email protected]>---
Looks ok. Applied.
Signature · 9 lines
-- 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.
Hi Tomas,
Quoted 7 lines
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(-) mode change 100644 => 100755 drivers/mmc/core/sdio_cis.c mode change 100644 => 100755 drivers/mmc/core/sdio_io.c mode change 100644 => 100755 include/linux/mmc/sdio_func.h
there is something wrong with your setup. Don't change the file modes and please resent the patch.
Regards
Marcel
Quoted 8 lines
-----Original Message-----
From: Marcel Holtmann [mailto:[email protected]]
Sent: Monday, June 30, 2008 11:58 AM
To: Winkler, Tomas
Cc: [email protected]; [email protected]; Zbit, Benzi
Subject: Re: [PATCH 1/3]mmc_core: fix the use of hard coded timeout
value.
Quoted 11 lines
Hi Tomas,
Quoted 7 lines
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(-) mode change 100644 => 100755 drivers/mmc/core/sdio_cis.c mode change 100644 => 100755 drivers/mmc/core/sdio_io.c mode change 100644 => 100755 include/linux/mmc/sdio_func.h
Quoted 2 lines
there is something wrong with your setup. Don't change the file modes and please resent the patch.
Oops, missed that.
Thanks
Tomas
---------------------------------------------------------------------
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.
Quoted 5 lines · On Mon, 30 Jun 2008 10:50:22 +0300 Tomas Winkler <[email protected]>…
From: Benzi Zbit <[email protected]>
Signed-off-by Benzi Zbit <[email protected]>Signed-off-by Tomas Winkler <[email protected]>---
A nice addition, but I'm afraid that field is not present on all cards (it was added in version 1.1). Could you make sure you have the proper guards and a fallback?
Rgds
Signature · 9 lines
-- 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.