Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] rtl2832: regmap is aware of lockdep, drop local locking hack

Tested-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>

authored by

Peter Rosin and committed by
Wolfram Sang
3f30e40b e01fc42d

-31
-30
drivers/media/dvb-frontends/rtl2832.c
··· 890 890 return false; 891 891 } 892 892 893 - /* 894 - * FIXME: Hack. Implement own regmap locking in order to silence lockdep 895 - * recursive lock warning. That happens when regmap I2C client calls I2C mux 896 - * adapter, which leads demod I2C repeater enable via demod regmap. Operation 897 - * takes two regmap locks recursively - but those are different regmap instances 898 - * in a two different I2C drivers, so it is not deadlock. Proper fix is to make 899 - * regmap aware of lockdep. 900 - */ 901 - static void rtl2832_regmap_lock(void *__dev) 902 - { 903 - struct rtl2832_dev *dev = __dev; 904 - struct i2c_client *client = dev->client; 905 - 906 - dev_dbg(&client->dev, "\n"); 907 - mutex_lock(&dev->regmap_mutex); 908 - } 909 - 910 - static void rtl2832_regmap_unlock(void *__dev) 911 - { 912 - struct rtl2832_dev *dev = __dev; 913 - struct i2c_client *client = dev->client; 914 - 915 - dev_dbg(&client->dev, "\n"); 916 - mutex_unlock(&dev->regmap_mutex); 917 - } 918 - 919 893 static struct dvb_frontend *rtl2832_get_dvb_frontend(struct i2c_client *client) 920 894 { 921 895 struct rtl2832_dev *dev = i2c_get_clientdata(client); ··· 1056 1082 dev->sleeping = true; 1057 1083 INIT_DELAYED_WORK(&dev->i2c_gate_work, rtl2832_i2c_gate_work); 1058 1084 /* create regmap */ 1059 - mutex_init(&dev->regmap_mutex); 1060 1085 dev->regmap_config.reg_bits = 8, 1061 1086 dev->regmap_config.val_bits = 8, 1062 - dev->regmap_config.lock = rtl2832_regmap_lock, 1063 - dev->regmap_config.unlock = rtl2832_regmap_unlock, 1064 - dev->regmap_config.lock_arg = dev, 1065 1087 dev->regmap_config.volatile_reg = rtl2832_volatile_reg, 1066 1088 dev->regmap_config.max_register = 5 * 0x100, 1067 1089 dev->regmap_config.ranges = regmap_range_cfg,
-1
drivers/media/dvb-frontends/rtl2832_priv.h
··· 33 33 struct rtl2832_dev { 34 34 struct rtl2832_platform_data *pdata; 35 35 struct i2c_client *client; 36 - struct mutex regmap_mutex; 37 36 struct regmap_config regmap_config; 38 37 struct regmap *regmap; 39 38 struct i2c_mux_core *muxc;