lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8760zwx521.fsf@eliezer.anholt.net>
Date:	Thu, 17 Dec 2015 11:12:38 -0800
From:	Eric Anholt <eric@...olt.net>
To:	"Rafael J. Wysocki" <rjw@...ysocki.net>
Cc:	Sudip Mukherjee <sudipm.mukherjee@...il.com>,
	Pavel Machek <pavel@....cz>, Len Brown <len.brown@...el.com>,
	linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org
Subject: Re: [PATCH] PM / sleep: define inline functions

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

> On Wednesday, December 16, 2015 04:41:37 PM Eric Anholt wrote:
>> 
>> --=-=-=
>> Content-Type: text/plain
>> 
>> Sudip Mukherjee <sudipm.mukherjee@...il.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@...olt.net>
>> > Signed-off-by: Sudip Mukherjee <sudip@...torindia.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.

Download attachment "signature.asc" of type "application/pgp-signature" (819 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ