[systemd-devel] [PATCH] logind: allow suspending if there are no displays

Benjamin Podszun dar at darklajid.de
Mon Apr 28 14:34:19 PDT 2014


Lennart Poettering <lennart <at> poettering.net> writes:
> 
> On Mon, 28.04.14 00:44, Mantas Mikulėnas (grawity <at> gmail.com) wrote:
> 
> > With proprietary graphics drivers, there won't be any 'drm' devices in
> > sysfs, so logind will never suspend the system upon closing the lid,
> > even if only one (internal) display is connected. This has been reported
> > by multiple users so far.
> > 
> > IMHO, it's better to suspend the system in this case for safety reasons,
> > to avoid having nvidia blob users' laptops overheat, for the same reason
> > that sleep inhibitors are overridden (LidSwitchIgnoreInhibited=yes).

(Apologies if this messes up the thread - replying via gmane.org, since I
wasn't subscribed and wanted to reply in-thread easily.)

I was (probably) the last person on IRC to report the problem, the final
reason for this thread. grawity/Mantas was extremely helpful and tracked
down my problem remotely: Close the laptop, move elsewhere, laptop is
extremely hot and smells like warm plastic when I open it again. Happened
about half a dozen times and every time I unpacked that thing I expected it
to be dead for good, due to the temperature.

> Isn't the right approach to ask nivida to just support the normal kernel
> APIs for this? I mean, we can tape over things, and we can shift arounds
> so that things keep breaking for other people, but how about just asking
> them to fix their stuff?

Frankly? No. I'm a fan of your work and I happily run systemd. But if you
think that "Let's just make nvidia fix their drivers" is the right attitude,
I think that's a little extreme.. There's another guy that tried that
already - it would be just like giving Linus' middle finger again.

As a user:

- everything worked until recently (i.e. one of the recent systemd releases
broke what worked before - for this particular setup that behavior is a
regression)

- I didn't want the nvidia card (corporate laptop, not my choice) but need
3d acceleration at times. I have to keep the blob for now.

- I'd at least expect a workaround. If that's the way systemd/logind is
playing this out, there should be a way to say 'Okay, okay. I understand
that nvidia should cave in, but please suspend anyway'. As far as I know
there's none right now, other than running a (forever?) patched systemd from
source (with grawity/Mantas' patch).

- I first and foremost expect that the software I'm running isn't so
idealistic that it might cause damage to my hardware


Please reconsider this patch or document that limitation prominently. I'm
really trying to follow interesting/special news about all things systemd
and this change is totally unexpected (heck, logind isn't even logging
anything about it unless you learn the magic 'enable debug' incantation and
understand that it thinks that you have no display attached) and the
solutions present at the moment are all coming with major limitations

- Never close the lid w/o turning off the machine first

- Go back to a free driver and stop using everything 3d

- Stop using the upstream systemd packages and fork to fix the issues above

- Move to a different system / away from systemd

All of these suck. I hope you (both the team and you personally) think about
this some more and fix it in the single one possible place - where it was
introduced just a short while ago, here in logind.

As stated in the original patch notes: People that actually want to supress
suspend on lid close already have a way to do that and can still do that,
with that patch applied. The inverse - please, please do suspend whatever
displays you think I have - doesn't seem to exist.

Regards,
Ben
 
> > ---
> >  src/login/logind-action.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/login/logind-action.c b/src/login/logind-action.c
> > index 1928f43..c488f04 100644
> > --- a/src/login/logind-action.c
> > +++ b/src/login/logind-action.c
> >  <at>  <at>  -86,7 +86,7  <at>  <at>  int manager_handle_action(
> >                  n = manager_count_displays(m);
> >                  if (n < 0)
> >                          log_warning("Display counting failed: %s",
strerror(-n));
> > -                else if (n != 1) {
> > +                else if (n > 1) {
> >                          log_debug("Ignoring lid switch request, %i
displays connected.", n);
> >                          return 0;
> >                  }
> 
> Lennart
> 






More information about the systemd-devel mailing list