Re: mc13xxx-core: kernel hangs after 'regmap_read'

From: Shawn Guo
Date: Fri May 25 2012 - 04:37:12 EST


On Thu, May 24, 2012 at 07:08:37PM +1000, Marc Reilly wrote:
> > diff --git a/drivers/mfd/mc13xxx-spi.c b/drivers/mfd/mc13xxx-spi.c
> > index 3fcdab3..5d1969f 100644
> > --- a/drivers/mfd/mc13xxx-spi.c
> > +++ b/drivers/mfd/mc13xxx-spi.c
> > @@ -49,6 +49,7 @@ static struct regmap_config mc13xxx_regmap_spi_config = {
> > .reg_bits = 7,
> > .pad_bits = 1,
> > .val_bits = 24,
> > + .write_flag_mask = 0x80,
>
> Should probably have .read_flag_mask = 0x00, here too. If either are non zero,
> both are set.
>
Since mc13xxx_regmap_spi_config is a static variable, .read_flag_mask
is initialized as 0 already.

> I guess this is the problem, regmap's default read_flag_mask for the spi bus
> is 0x80, and the write mask defaults to 0. The mc13xxx works the opposite way
> though! aarg. My bad for not noticing. So setting the write_flag_mask to 0x80
> also sets the read mask to 0 correctly also.

--
Regards,
Shawn

--
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/