linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] i2c: Mark adapter devices with pm_runtime_no_callbacks
@ 2015-04-16 12:05 Charles Keepax
  2015-04-16 12:28 ` Beata Michalska
  2015-04-22  7:54 ` Wolfram Sang
  0 siblings, 2 replies; 4+ messages in thread
From: Charles Keepax @ 2015-04-16 12:05 UTC (permalink / raw)
  To: wsa-z923LK4zBo2bacvFa/9K2g
  Cc: kgene-DgEjT+Ai2ygdnm+yROfE0A,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, lars-Qo5EllUWu/uELgA04lAiVw

Commit 523c5b89640e ("i2c: Remove support for legacy PM") removed the PM
ops from the bus type, which causes the pm operations on the s3c2410
adapter device to fail (-ENOSUPP in rpm_callback). The adapter device
doesn't get bound to a driver and as such can't have its own pm_runtime
callbacks. Previously this was fine as the bus callbacks would have been
used, but now this can cause devices which use PM runtime and are
attached over I2C to fail to resume.

This commit fixes this issue by marking all adapter devices with
pm_runtime_no_callbacks, since they can't have any.

Signed-off-by: Charles Keepax <ckeepax-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
---

Changes since v1:
 - Simple mark all adapter devices with pm_runtime_no_callbacks in the i2c
   core

Thanks,
Charles

 drivers/i2c/i2c-core.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 1672e6b..eac3331 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1410,6 +1410,8 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
 
 	dev_dbg(&adap->dev, "adapter [%s] registered\n", adap->name);
 
+	pm_runtime_no_callbacks(&adap->dev);
+
 #ifdef CONFIG_I2C_COMPAT
 	res = class_compat_create_link(i2c_adapter_compat_class, &adap->dev,
 				       adap->dev.parent);
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] i2c: Mark adapter devices with pm_runtime_no_callbacks
  2015-04-16 12:05 [PATCH v2] i2c: Mark adapter devices with pm_runtime_no_callbacks Charles Keepax
@ 2015-04-16 12:28 ` Beata Michalska
  2015-04-22  7:55   ` Wolfram Sang
  2015-04-22  7:54 ` Wolfram Sang
  1 sibling, 1 reply; 4+ messages in thread
From: Beata Michalska @ 2015-04-16 12:28 UTC (permalink / raw)
  To: Charles Keepax; +Cc: wsa, kgene, linux-samsung-soc, linux-i2c, lars

On 04/16/2015 02:05 PM, Charles Keepax wrote:
> Commit 523c5b89640e ("i2c: Remove support for legacy PM") removed the PM
> ops from the bus type, which causes the pm operations on the s3c2410
> adapter device to fail (-ENOSUPP in rpm_callback). The adapter device
> doesn't get bound to a driver and as such can't have its own pm_runtime
> callbacks. Previously this was fine as the bus callbacks would have been
> used, but now this can cause devices which use PM runtime and are
> attached over I2C to fail to resume.
>
> This commit fixes this issue by marking all adapter devices with
> pm_runtime_no_callbacks, since they can't have any.
>
> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
> ---
>
> Changes since v1:
>  - Simple mark all adapter devices with pm_runtime_no_callbacks in the i2c
>    core
>
> Thanks,
> Charles
>
>  drivers/i2c/i2c-core.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index 1672e6b..eac3331 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -1410,6 +1410,8 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
>  
>  	dev_dbg(&adap->dev, "adapter [%s] registered\n", adap->name);
>  
> +	pm_runtime_no_callbacks(&adap->dev);
> +
>  #ifdef CONFIG_I2C_COMPAT
>  	res = class_compat_create_link(i2c_adapter_compat_class, &adap->dev,
>  				       adap->dev.parent);

Thereis at least one more casewhen an I2C device fails to resume due
to bus callbacks being dropped(like fimc-is-i2c driver for exynos4-is,
the same scenario),  so I'm glad to see  it's being handled in on place
-it saves the trouble.

BR
Beata

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] i2c: Mark adapter devices with pm_runtime_no_callbacks
  2015-04-16 12:05 [PATCH v2] i2c: Mark adapter devices with pm_runtime_no_callbacks Charles Keepax
  2015-04-16 12:28 ` Beata Michalska
@ 2015-04-22  7:54 ` Wolfram Sang
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2015-04-22  7:54 UTC (permalink / raw)
  To: Charles Keepax; +Cc: kgene, linux-samsung-soc, linux-i2c, lars

[-- Attachment #1: Type: text/plain, Size: 925 bytes --]

On Thu, Apr 16, 2015 at 01:05:19PM +0100, Charles Keepax wrote:
> Commit 523c5b89640e ("i2c: Remove support for legacy PM") removed the PM
> ops from the bus type, which causes the pm operations on the s3c2410
> adapter device to fail (-ENOSUPP in rpm_callback). The adapter device
> doesn't get bound to a driver and as such can't have its own pm_runtime
> callbacks. Previously this was fine as the bus callbacks would have been
> used, but now this can cause devices which use PM runtime and are
> attached over I2C to fail to resume.
> 
> This commit fixes this issue by marking all adapter devices with
> pm_runtime_no_callbacks, since they can't have any.
> 
> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

Applied to for-current, thanks!

Will push out somewhat later today. Lars-Peter, if you'd like to donate
some ack/review tag until then, this would be much appreciated.


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] i2c: Mark adapter devices with pm_runtime_no_callbacks
  2015-04-16 12:28 ` Beata Michalska
@ 2015-04-22  7:55   ` Wolfram Sang
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2015-04-22  7:55 UTC (permalink / raw)
  To: Beata Michalska; +Cc: Charles Keepax, kgene, linux-samsung-soc, linux-i2c, lars

[-- Attachment #1: Type: text/plain, Size: 1233 bytes --]

On Thu, Apr 16, 2015 at 02:28:02PM +0200, Beata Michalska wrote:
> On 04/16/2015 02:05 PM, Charles Keepax wrote:
> > Commit 523c5b89640e ("i2c: Remove support for legacy PM") removed the PM
> > ops from the bus type, which causes the pm operations on the s3c2410
> > adapter device to fail (-ENOSUPP in rpm_callback). The adapter device
> > doesn't get bound to a driver and as such can't have its own pm_runtime
> > callbacks. Previously this was fine as the bus callbacks would have been
> > used, but now this can cause devices which use PM runtime and are
> > attached over I2C to fail to resume.
> >
> > This commit fixes this issue by marking all adapter devices with
> > pm_runtime_no_callbacks, since they can't have any.
> >
> > Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
> 
> Thereis at least one more casewhen an I2C device fails to resume due
> to bus callbacks being dropped(like fimc-is-i2c driver for exynos4-is,
> the same scenario),  so I'm glad to see  it's being handled in on place
> -it saves the trouble.

Thanks for the confirmation! If you could also add a formal 'Acked-by'
next time, this would help me because patchwork collects them for me
automatically.


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-22  7:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-16 12:05 [PATCH v2] i2c: Mark adapter devices with pm_runtime_no_callbacks Charles Keepax
2015-04-16 12:28 ` Beata Michalska
2015-04-22  7:55   ` Wolfram Sang
2015-04-22  7:54 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).