[PATCHv2 2/2] rtl2832: use custom lock class key for regmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There was nested locking error shown by lockdep validator when both
demod and tuner drivers were using regmap. That is false positive
coming from the reason lockdep groups mutexes to 'classes'. That
leads situation both tuner driver and demod driver regmap mutex is
seen as a same mutex, even those are different ones in a real life.
Lockdep uses keys to separate these clock classes. Use custom class
key to demod regmap in order to separate it from mutex used by tuner
regmap, thus seen it as a different lock also from lockdep point of
view.

Cc: Lars-Peter Clausen <lars@xxxxxxxxxx>
Cc: Mark Brown <broonie@xxxxxxxxxx>
Signed-off-by: Antti Palosaari <crope@xxxxxx>
---
 drivers/media/dvb-frontends/rtl2832.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/dvb-frontends/rtl2832.c b/drivers/media/dvb-frontends/rtl2832.c
index f44dc50..6cfe5b6 100644
--- a/drivers/media/dvb-frontends/rtl2832.c
+++ b/drivers/media/dvb-frontends/rtl2832.c
@@ -1186,6 +1186,7 @@ static int rtl2832_probe(struct i2c_client *client,
 			.range_max        = 5 * 0x100,
 		},
 	};
+	static struct lock_class_key key;
 	static const struct regmap_config regmap_config = {
 		.reg_bits    =  8,
 		.val_bits    =  8,
@@ -1194,6 +1195,7 @@ static int rtl2832_probe(struct i2c_client *client,
 		.ranges = regmap_range_cfg,
 		.num_ranges = ARRAY_SIZE(regmap_range_cfg),
 		.cache_type = REGCACHE_RBTREE,
+		.lockdep_lock_class_key = &key,
 	};
 
 	dev_dbg(&client->dev, "\n");
-- 
http://palosaari.fi/

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux