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] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 3 Feb 2013 09:56:09 +0100
From:	Jesse Barnes <jbarnes@...tuousgeek.org>
To:	"Rafael J. Wysocki" <rjw@...k.pl>
Cc:	linux-kernel@...r.kernel.org, intel-gfx@...ts.freedesktop.org,
	Linux PM list <linux-pm@...r.kernel.org>
Subject: Re: [PATCH] PM: make VT switching to the suspend console optional
 v2

On Sat, 02 Feb 2013 21:50:35 +0100
"Rafael J. Wysocki" <rjw@...k.pl> wrote:
> > > + * Drivers can indicate support for switchless suspend/resume, which can
> > > + * save time and flicker, by using this routine and passing 'false' as
> > > + * the argument.  If any loaded driver needs VT switching, or the
> > > + * no_console_suspend argument has been passed on the command line, VT
> > > + * switches will occur.
> > > + */
> > 
> > It seems to me that we'll need a separate counter for the number of registered
> > drivers and do the switch if that number is equal to the number of drivers that
> > have passed false to this thing.
> > 
> > In which case we can simplify this slightly and introduce
> > pm_vt_swtich_not_required(void)
> 
> Sorry, that won't be sufficient.  Rather something like pm_vt_switch_get()
> (indicating "I'll do the switch, thanks") and pm_vt_switch_put() (indicating
> "now you need to do the switch yourself").

I thought of both of your approaches before posting this one, but each
have other problems.  And I found a bug in mine last night.

So I think I need a separate count of drivers that need the switch, and
ones that don't.  Then if either no driver has registered or if the
need_switch count is nonzero, we'll do the switch.  Otherwise, if the
dont_need_switch is nonzero, we can avoid the switch.  I think that'll
handle all the cases I outlined.

My code as posted will fail if one driver needs a switch but then two
switch free drivers register.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ