regmap: Fix regmap_bulk_write single-rw mutex deadlock
authorAnthony Olech <anthony.olech.opensource@diasemi.com>
Wed, 9 Oct 2013 16:44:38 +0000 (17:44 +0100)
committerMark Brown <broonie@linaro.org>
Wed, 9 Oct 2013 17:47:27 +0000 (18:47 +0100)
commit4174a7a4f763ed51809a4dbca06de054d31c1d38
tree4a9c3bf3ff7390545e13851bcece13b1f2ea7429
parentd0e639c9e06d44e713170031fe05fb60ebe680af
regmap: Fix regmap_bulk_write single-rw mutex deadlock

When regmap_bulk_write() is called with the map->use_single_rw flag set
an immediate mutex deadlock happens because regmap_raw_write() is called
after obtaining the mutex and regmap_raw_write() itself then tries to
obtain the mutex as well.

It is obvious that no one other than myself tried it with a real device.
I did, but only for the purposes of an experiment and demonstration.

But even if this situation will never ever happen with a real device, it
is a bug and therefore should be fixed.

Signed-off-by: Anthony Olech <anthony.olech.opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/base/regmap/regmap.c