Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1292918 > unrolled thread

[PATCH] PM / sleep: define inline functions

Started bySudip Mukherjee <sudipm.mukherjee@gmail.com>
First post2015-12-16 12:50 +0100
Last post2015-12-17 20:20 +0100
Articles 5 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] PM / sleep: define inline functions Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-12-16 12:50 +0100
    Re: [PATCH] PM / sleep: define inline functions Eric Anholt <eric@anholt.net> - 2015-12-17 01:50 +0100
      Re: [PATCH] PM / sleep: define inline functions "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-12-17 02:20 +0100
        Re: [PATCH] PM / sleep: define inline functions Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-12-17 09:00 +0100
        Re: [PATCH] PM / sleep: define inline functions Eric Anholt <eric@anholt.net> - 2015-12-17 20:20 +0100

#1292918 — [PATCH] PM / sleep: define inline functions

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2015-12-16 12:50 +0100
Subject[PATCH] PM / sleep: define inline functions
Message-ID<qGiKK-1es-23@gated-at.bofh.it>
If CONFIG_PM_SLEEP is not defined then the functions are defined as
NULL. And as a result we are getting build failure with
alpha allmodconfig with the error:

drivers/gpu/drm/vc4/vc4_v3d.c: In function 'vc4_v3d_set_power':
include/linux/stddef.h:7:14: error: called object is not a function or function pointer
 #define NULL ((void *)0)
              ^
include/linux/pm.h:776:30: note: in expansion of macro 'NULL'
 #define pm_generic_poweroff  NULL
                              ^
drivers/gpu/drm/vc4/vc4_v3d.c:157:10: note: in expansion of macro 'pm_generic_poweroff'
   return pm_generic_poweroff(&vc4->v3d->pdev->dev);
          ^
include/linux/stddef.h:7:14: error: called object is not a function or function pointer
 #define NULL ((void *)0)
              ^
include/linux/pm.h:764:28: note: in expansion of macro 'NULL'
 #define pm_generic_resume  NULL
                            ^
drivers/gpu/drm/vc4/vc4_v3d.c:159:10: note: in expansion of macro 'pm_generic_resume'
   return pm_generic_resume(&vc4->v3d->pdev->dev);
          ^

Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.")
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---

build log is at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/97149763

Also tested with x86_64 allmodconfig.

 include/linux/pm.h | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/include/linux/pm.h b/include/linux/pm.h
index 528be67..5fe5dbb 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -755,13 +755,22 @@ static inline void dpm_for_each_dev(void *data, void (*fn)(struct device *, void
 {
 }
 
+static inline int pm_generic_resume(struct device *dev)
+{
+	return 0;
+}
+
+static inline int pm_generic_poweroff(struct device *dev)
+{
+	return 0;
+}
+
 #define pm_generic_prepare		NULL
 #define pm_generic_suspend_late		NULL
 #define pm_generic_suspend_noirq	NULL
 #define pm_generic_suspend		NULL
 #define pm_generic_resume_early		NULL
 #define pm_generic_resume_noirq		NULL
-#define pm_generic_resume		NULL
 #define pm_generic_freeze_noirq		NULL
 #define pm_generic_freeze_late		NULL
 #define pm_generic_freeze		NULL
@@ -773,7 +782,6 @@ static inline void dpm_for_each_dev(void *data, void (*fn)(struct device *, void
 #define pm_generic_restore		NULL
 #define pm_generic_poweroff_noirq	NULL
 #define pm_generic_poweroff_late	NULL
-#define pm_generic_poweroff		NULL
 #define pm_generic_complete		NULL
 #endif /* !CONFIG_PM_SLEEP */
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1293444

FromEric Anholt <eric@anholt.net>
Date2015-12-17 01:50 +0100
Message-ID<qGuVB-Ae-39@gated-at.bofh.it>
In reply to#1292918

[Multipart message — attachments visible in raw view] — view raw

Sudip Mukherjee <sudipm.mukherjee@gmail.com> writes:

> If CONFIG_PM_SLEEP is not defined then the functions are defined as
> NULL. And as a result we are getting build failure with
> alpha allmodconfig with the error:
>
> drivers/gpu/drm/vc4/vc4_v3d.c: In function 'vc4_v3d_set_power':
> include/linux/stddef.h:7:14: error: called object is not a function or function pointer
>  #define NULL ((void *)0)
>               ^
> include/linux/pm.h:776:30: note: in expansion of macro 'NULL'
>  #define pm_generic_poweroff  NULL
>                               ^
> drivers/gpu/drm/vc4/vc4_v3d.c:157:10: note: in expansion of macro 'pm_generic_poweroff'
>    return pm_generic_poweroff(&vc4->v3d->pdev->dev);
>           ^
> include/linux/stddef.h:7:14: error: called object is not a function or function pointer
>  #define NULL ((void *)0)
>               ^
> include/linux/pm.h:764:28: note: in expansion of macro 'NULL'
>  #define pm_generic_resume  NULL
>                             ^
> drivers/gpu/drm/vc4/vc4_v3d.c:159:10: note: in expansion of macro 'pm_generic_resume'
>    return pm_generic_resume(&vc4->v3d->pdev->dev);
>           ^
>
> Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.")
> Cc: Eric Anholt <eric@anholt.net>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>

I'm happy with this solution, and would also be willing to just depend
on the config option as well.  Whatever people prefer.

[toc] | [prev] | [next] | [standalone]


#1293534

From"Rafael J. Wysocki" <rjw@rjwysocki.net>
Date2015-12-17 02:20 +0100
Message-ID<qGvoB-108-11@gated-at.bofh.it>
In reply to#1293444
On Wednesday, December 16, 2015 04:41:37 PM Eric Anholt wrote:
> 
> --=-=-=
> Content-Type: text/plain
> 
> Sudip Mukherjee <sudipm.mukherjee@gmail.com> writes:
> 
> > If CONFIG_PM_SLEEP is not defined then the functions are defined as
> > NULL. And as a result we are getting build failure with
> > alpha allmodconfig with the error:
> >
> > drivers/gpu/drm/vc4/vc4_v3d.c: In function 'vc4_v3d_set_power':
> > include/linux/stddef.h:7:14: error: called object is not a function or function pointer
> >  #define NULL ((void *)0)
> >               ^
> > include/linux/pm.h:776:30: note: in expansion of macro 'NULL'
> >  #define pm_generic_poweroff  NULL
> >                               ^
> > drivers/gpu/drm/vc4/vc4_v3d.c:157:10: note: in expansion of macro 'pm_generic_poweroff'
> >    return pm_generic_poweroff(&vc4->v3d->pdev->dev);
> >           ^
> > include/linux/stddef.h:7:14: error: called object is not a function or function pointer
> >  #define NULL ((void *)0)
> >               ^
> > include/linux/pm.h:764:28: note: in expansion of macro 'NULL'
> >  #define pm_generic_resume  NULL
> >                             ^
> > drivers/gpu/drm/vc4/vc4_v3d.c:159:10: note: in expansion of macro 'pm_generic_resume'
> >    return pm_generic_resume(&vc4->v3d->pdev->dev);
> >           ^
> >
> > Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.")
> > Cc: Eric Anholt <eric@anholt.net>
> > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> 
> I'm happy with this solution, and would also be willing to just depend
> on the config option as well.  Whatever people prefer.

These functions are intended to be used as PM callbacks rather than to be
called directly from code that doesn't depend on PM_SLEEP, so I'd prefer
all code calling them directly to depend on the config option.

Thanks,
Rafael

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1293661

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2015-12-17 09:00 +0100
Message-ID<qGBDH-4O5-5@gated-at.bofh.it>
In reply to#1293534
On Thu, Dec 17, 2015 at 02:43:38AM +0100, Rafael J. Wysocki wrote:
> On Wednesday, December 16, 2015 04:41:37 PM Eric Anholt wrote:
> > 
> > --=-=-=
> > Content-Type: text/plain
> > 
> > Sudip Mukherjee <sudipm.mukherjee@gmail.com> writes:
> > 
> > > If CONFIG_PM_SLEEP is not defined then the functions are defined as
> > > NULL. And as a result we are getting build failure with
> > > alpha allmodconfig with the error:
> > >
> > > drivers/gpu/drm/vc4/vc4_v3d.c: In function 'vc4_v3d_set_power':
> > > include/linux/stddef.h:7:14: error: called object is not a function or function pointer
> > >  #define NULL ((void *)0)
> > >               ^
> > > include/linux/pm.h:776:30: note: in expansion of macro 'NULL'
> > >  #define pm_generic_poweroff  NULL
> > >                               ^
> > > drivers/gpu/drm/vc4/vc4_v3d.c:157:10: note: in expansion of macro 'pm_generic_poweroff'
> > >    return pm_generic_poweroff(&vc4->v3d->pdev->dev);
> > >           ^
> > > include/linux/stddef.h:7:14: error: called object is not a function or function pointer
> > >  #define NULL ((void *)0)
> > >               ^
> > > include/linux/pm.h:764:28: note: in expansion of macro 'NULL'
> > >  #define pm_generic_resume  NULL
> > >                             ^
> > > drivers/gpu/drm/vc4/vc4_v3d.c:159:10: note: in expansion of macro 'pm_generic_resume'
> > >    return pm_generic_resume(&vc4->v3d->pdev->dev);
> > >           ^
> > >
> > > Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.")
> > > Cc: Eric Anholt <eric@anholt.net>
> > > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> > 
> > I'm happy with this solution, and would also be willing to just depend
> > on the config option as well.  Whatever people prefer.
> 
> These functions are intended to be used as PM callbacks rather than to be
> called directly from code that doesn't depend on PM_SLEEP, so I'd prefer
> all code calling them directly to depend on the config option.

Apart from alpha some other arch also failed on allmodconfig for
next-20151216.
next-20151217 is now getting compiled on travis. If it still shows the
build failure I will send v2 with config options.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1294161

FromEric Anholt <eric@anholt.net>
Date2015-12-17 20:20 +0100
Message-ID<qGMfN-3B1-39@gated-at.bofh.it>
In reply to#1293534

[Multipart message — attachments visible in raw view] — view raw

"Rafael J. Wysocki" <rjw@rjwysocki.net> writes:

> On Wednesday, December 16, 2015 04:41:37 PM Eric Anholt wrote:
>> 
>> --=-=-=
>> Content-Type: text/plain
>> 
>> Sudip Mukherjee <sudipm.mukherjee@gmail.com> writes:
>> 
>> > If CONFIG_PM_SLEEP is not defined then the functions are defined as
>> > NULL. And as a result we are getting build failure with
>> > alpha allmodconfig with the error:
>> >
>> > drivers/gpu/drm/vc4/vc4_v3d.c: In function 'vc4_v3d_set_power':
>> > include/linux/stddef.h:7:14: error: called object is not a function or function pointer
>> >  #define NULL ((void *)0)
>> >               ^
>> > include/linux/pm.h:776:30: note: in expansion of macro 'NULL'
>> >  #define pm_generic_poweroff  NULL
>> >                               ^
>> > drivers/gpu/drm/vc4/vc4_v3d.c:157:10: note: in expansion of macro 'pm_generic_poweroff'
>> >    return pm_generic_poweroff(&vc4->v3d->pdev->dev);
>> >           ^
>> > include/linux/stddef.h:7:14: error: called object is not a function or function pointer
>> >  #define NULL ((void *)0)
>> >               ^
>> > include/linux/pm.h:764:28: note: in expansion of macro 'NULL'
>> >  #define pm_generic_resume  NULL
>> >                             ^
>> > drivers/gpu/drm/vc4/vc4_v3d.c:159:10: note: in expansion of macro 'pm_generic_resume'
>> >    return pm_generic_resume(&vc4->v3d->pdev->dev);
>> >           ^
>> >
>> > Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.")
>> > Cc: Eric Anholt <eric@anholt.net>
>> > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
>> 
>> I'm happy with this solution, and would also be willing to just depend
>> on the config option as well.  Whatever people prefer.
>
> These functions are intended to be used as PM callbacks rather than to be
> called directly from code that doesn't depend on PM_SLEEP, so I'd prefer
> all code calling them directly to depend on the config option.

Actually, I should have probably checked what the right way to do this
is.

I'm using these functions for reset when the device gets wedged.  Before
swapping to using a generic power domain, I was just sending the command
through the firmware driver to turn the GPU off and back on.  The genpd
wraps my firmware driver's interface, so what is the best way to force
my domain (I assert I'm the only consumer of it) off and back on again?

If this is the best interface, then I do need to just depend on
CONFIG_PM_SLEEP in Kconfig.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web