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

Fabio Estevam festevam at gmail.com
Wed Mar 7 17:40:22 EST 2012


On Wed, Mar 7, 2012 at 7:28 PM, Wolfram Sang <w.sang at pengutronix.de> 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



More information about the linux-arm-kernel mailing list