Re: [PATCH 1/3] drivers: base: add support for stmp-style devices

From: Fabio Estevam
Date: Wed Mar 07 2012 - 17:40:39 EST


On Wed, Mar 7, 2012 at 7:28 PM, Wolfram Sang <w.sang@xxxxxxxxxxxxxx> wrote:
...
> +static int stmp_clear_poll_bit(void __iomem *addr, u32 mask)
> +{
> + Â Â Â int timeout = 0x400;

Could you please add a proper timeout mechanism here?

Something like: http://patchwork.ozlabs.org/patch/137365/

,as you suggested in the first place ;-)

> +
> + Â Â Â writel(mask, addr + STMP_OFFSET_REG_CLR);
> + Â Â Â udelay(1);
> + Â Â Â while ((readl(addr) & mask) && --timeout)
> + Â Â Â Â Â Â Â /* nothing */;
> +
> + Â Â Â return !timeout;
> +}
> +
> +int stmp_reset_block(void __iomem *reset_addr)
> +{
> + Â Â Â int ret;
> + Â Â Â int timeout = 0x400;

Same here.

Regards,

Fabio Estevam
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/