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

From: Fabio Estevam
Date: Wed May 23 2012 - 10:18:12 EST


Mark,

On Wed, May 23, 2012 at 5:49 AM, Mark Brown
<broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

> You shouldn't be setting bits_per_word at all, that'll corrupt the data
> that regmap has formatted. ÂDoes removing that alone resolve the issue?

Removing only the line that sets bits_per_word:

--- a/drivers/mfd/mc13xxx-spi.c
+++ b/drivers/mfd/mc13xxx-spi.c
@@ -73,7 +73,6 @@ static int mc13xxx_spi_probe(struct spi_device *spi)

dev_set_drvdata(&spi->dev, mc13xxx);
spi->mode = SPI_MODE_0 | SPI_CS_HIGH;
- spi->bits_per_word = 32;

mc13xxx->dev = &spi->dev;
mutex_init(&mc13xxx->lock);


, does allow the kernel to boot, but the mx13xxx driver is not probed anymore:

spi_imx imx31-cspi.1: master is unqueued, this is deprecated
spi_imx imx31-cspi.1: probed
spi_imx imx31-cspi.0: master is unqueued, this is deprecated
l4f00242t03 spi0.0: l4f00242t03_probe: Unable to get the IO regulator
spi spi0.0: Driver l4f00242t03 requests probe deferral
spi_imx imx31-cspi.0: probed

Also, on the previous raw spi access version we had:

#define MC13XXX_REGOFFSET_SHIFT 25
int mc13xxx_reg_read(struct mc13xxx *mc13xxx, unsigned int offset, u32 *val)
{
struct spi_transfer t;
struct spi_message m;
int ret;

BUG_ON(!mutex_is_locked(&mc13xxx->lock));

if (offset > MC13XXX_NUMREGS)
return -EINVAL;

*val = offset << MC13XXX_REGOFFSET_SHIFT;
....

,would the spi regmap access take into account this
MC13XXX_REGOFFSET_SHIFT operation?

I haven't been able to see it in the regmap spi access.
--
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/