OMAP: I2C: Fix the mismatch of pm_runtime enable and disable
Subsystems (4)
RFC PATCH 1/1 OMAP: I2C: Fix the mismatch of pm_runtime enable and disable
Currently the i2c driver calls the pm_runtime_enable and never the disable. This may cause a warning when pm_runtime_enable checks for the count match.Attempting to fix the same by calling pm_runtime_disable in the error and the remove path.
--- drivers/i2c/busses/i2c-omap.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/i2c/busses/i2c-omap.c +2 -0
@@ -1070,6 +1070,7 @@ err_unuse_clocks:omap_i2c_write_reg (dev,OMAP_I2C_CON_REG ,0 );pm_runtime_put (dev->dev);iounmap (dev->base); +pm_runtime_disable (&pdev->dev); err_free_mem:platform_set_drvdata (pdev,NULL );kfree (dev);
@@ -1085,6 +1086,7 @@ omap_i2c_remove(struct platform_device *pdev)struct omap_i2c_dev *dev =platform_get_drvdata (pdev);struct resource *mem; +pm_runtime_disable (&pdev->dev);platform_set_drvdata (pdev,NULL );free_irq (dev->irq, dev);
Signature · 1 line
1.7.1
RFC PATCH 1/1 OMAP: I2C: Fix the mismatch of pm_runtime enable and disable
Quoted 4 lines · Shubhrajyoti D
Currently the i2c driver calls the
pm_runtime_enableand never the disable. This may cause a warning whenpm_runtime_enablechecks for the count match.Attempting to fix the same by callingpm_runtime_disablein the error and the remove path.
I remember seeing Felipe doing the reverse to musb here:
http://marc.info/?l=linux-omap&m=132432610700952&w=2
so I'm confused here.
Quoted 35 lines
Cc Kevin Hilman <[email protected]>Cc Rajendra Nayak <[email protected]>Signed-off-by Shubhrajyoti D <[email protected]>---
?drivers/i2c/busses/i2c-omap.c | ? ?2 ++
?1 files changed, 2 insertions(+), 0 deletions(-)drivers/i2c/busses/i2c-omap.c +1
-0@@ -1070,6 +1070,7 @@ err_unuse_clocks: ? ? ? ?omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0); ? ? ? ?pm_runtime_put(dev->dev); ? ? ? ?iounmap(dev->base); + ? ? ? pm_runtime_disable(&pdev->dev);?err_free_mem:
? ? ? ?platform_set_drvdata(pdev, NULL);
? ? ? ?kfree(dev);drivers/i2c/busses/i2c-omap.c +1
-1@@ -1085,6 +1086,7 @@ omap_i2c_remove(struct platform_device *pdev) ? ? ? ?struct omap_i2c_dev ? ? *dev = platform_get_drvdata(pdev); ? ? ? ?struct resource ? ? ? ? *mem; + ? ? ? pm_runtime_disable(&pdev->dev); ? ? ? ?platform_set_drvdata(pdev, NULL); ? ? ? ?free_irq(dev->irq, dev); --1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo at vger.kernel.org
More majordomo info at ?http://vger.kernel.org/majordomo-info.html
Signature · 1 line
Gra?vydas
RFC PATCH 1/1 OMAP: I2C: Fix the mismatch of pm_runtime enable and disable
Quoted 8 lines · Grazvydas Ignotas
Quoted 4 lines · Shubhrajyoti D
Currently the i2c driver calls the
pm_runtime_enableand never the disable. This may cause a warning whenpm_runtime_enablechecks for the count match.Attempting to fix the same by callingpm_runtime_disablein the error and the remove path.I remember seeing Felipe doing the reverse to musb here:
http://marc.info/?l=linux-omap&m=132432610700952&w=2
so I'm confused here.
Strange however I see many drivers doing the same in the kernel on greping . Besides I expect a warn to come up.
Felipe could you explain the issue?
Quoted 34 lines
Quoted 34 lines
Cc Kevin Hilman <[email protected]>Cc Rajendra Nayak <[email protected]>Signed-off-by Shubhrajyoti D <[email protected]>--- drivers/i2c/busses/i2c-omap.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)drivers/i2c/busses/i2c-omap.c +2
-1@@ -1070,6 +1070,7 @@ err_unuse_clocks:omap_i2c_write_reg (dev,OMAP_I2C_CON_REG ,0 );pm_runtime_put (dev->dev);iounmap (dev->base); +pm_runtime_disable (&pdev->dev); err_free_mem:platform_set_drvdata (pdev,NULL );kfree (dev);@@ -1085,6 +1086,7 @@ omap_i2c_remove(struct platform_device *pdev)struct omap_i2c_dev *dev =platform_get_drvdata (pdev);struct resource *mem; +pm_runtime_disable (&pdev->dev);platform_set_drvdata (pdev,NULL );free_irq (dev->irq, dev); --1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
RFC PATCH 1/1 OMAP: I2C: Fix the mismatch of pm_runtime enable and disable
Quoted 6 lines · Shubhrajyoti
Quoted 5 lines · Grazvydas Ignotas
Quoted 4 lines · Shubhrajyoti D
Currently the i2c driver calls the
pm_runtime_enableand never the disable. This may cause a warning whenpm_runtime_enablechecks for the count match.Attempting to fix the same by callingpm_runtime_disablein the error and the remove path.
Quoted 7 lines
Quoted 3 lines
I remember seeing Felipe doing the reverse to musb here:
http://marc.info/?l=linux-omap&m=132432610700952&w=2
so I'm confused here.Strange however ?I see many drivers doing the same in the kernel on greping . Besides I expect a warn to come up.
Felipe could you explain the issue?
When do you see the warning? kfree(dev) should disable runtime pm, but without waking up the device.
Signature · 1 line
Felipe Contreras