Skip to contentSkip to conversation

drm/imx/tve: take i2c adapter module reference

PATCH In review Johan Hovold 2 participants 5 messages Jul 16 – Nov 19

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/imx/tve: take i2c adapter module reference

The i2c subsystem currently blocks during adapter deregistration whenever there are consumers holding a reference.

Switch to using of_get_i2c_adapter_by_node() which also takes a reference to the adapter module so that an attempt to unload the module while in use fails gracefully instead of blocking uninterruptibly.

---
 drivers/gpu/drm/imx/ipuv3/imx-tve.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/imx/ipuv3/imx-tve.c +6 -6
index e861b8b9d8fa..389f45d54faa 100644
@@ -528,11 +528,11 @@ static const struct component_ops imx_tve_ops = {
 	.bind	= imx_tve_bind,
 };
 
-static void imx_tve_put_device(void *_dev)
+static void imx_tve_put_adapter(void *_adap)
 {
-	struct device *dev = _dev;
+	struct i2c_adapter *adap = _adap;
 
-	put_device(dev);
+	i2c_put_adapter(adap);
 }
 
 static int imx_tve_probe(struct platform_device *pdev)
@@ -554,11 +554,11 @@ static int imx_tve_probe(struct platform_device *pdev)
 
 	ddc_node = of_parse_phandle(np, "ddc-i2c-bus", 0);
 	if (ddc_node) {
-		tve->ddc = of_find_i2c_adapter_by_node(ddc_node);
+		tve->ddc = of_get_i2c_adapter_by_node(ddc_node);
 		of_node_put(ddc_node);
 		if (tve->ddc) {
-			ret = devm_add_action_or_reset(dev, imx_tve_put_device,
-						       &tve->ddc->dev);
+			ret = devm_add_action_or_reset(dev, imx_tve_put_adapter,
+						       tve->ddc);
 			if (ret)
 				return ret;
 		}
Signature · 1 line
2.54.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Johan Hovold

The i2c subsystem currently blocks during adapter deregistration whenever there are consumers holding a reference.

Switch to using of_get_i2c_adapter_by_node() which also takes a reference to the adapter module so that an attempt to unload the module while in use fails gracefully instead of blocking uninterruptibly.

regards
Philipp

#2 lore raw
In reply to Johan Hovold
Quoted 8 lines · Johan Hovold

The i2c subsystem currently blocks during adapter deregistration whenever there are consumers holding a reference.

Switch to using of_get_i2c_adapter_by_node() which also takes a reference to the adapter module so that an attempt to unload the module while in use fails gracefully instead of blocking uninterruptibly.

Can this one be picked up for 7.3-rc1?

Johan

#3 lore raw
Quoted 11 lines · Johan Hovold
Quoted 8 lines · Johan Hovold

The i2c subsystem currently blocks during adapter deregistration whenever there are consumers holding a reference.

Switch to using of_get_i2c_adapter_by_node() which also takes a reference to the adapter module so that an attempt to unload the module while in use fails gracefully instead of blocking uninterruptibly.

Can this one be picked up for 7.3-rc1?

Again, can someone please pick this one up?

Johan

#4 lore raw
Quoted 9 lines · Johan Hovold
Quoted 8 lines · Johan Hovold
Quoted 7 lines · Johan Hovold

The i2c subsystem currently blocks during adapter deregistration whenever there are consumers holding a reference.

Switch to using of_get_i2c_adapter_by_node() which also takes a reference to the adapter module so that an attempt to unload the module while in use fails gracefully instead of blocking uninterruptibly.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Can this one be picked up for 7.3-rc1?

Again, can someone please pick this one up?

It's been four months, can someone please pick this one up?

Johan