Date: Tue, 12 Jul 2011 23:34:40 +0300 From: Vitaly Magerya <vmagerya@gmail.com> To: Andriy Gapon <avg@freebsd.org> Cc: freebsd-acpi@freebsd.org Subject: Re: (Missing) power states of an Atom N455-based netbook Message-ID: <CAL409KwV0MYBv-Ju_2p_rx23P7TER6C3D%2BdVyvbfeg%2B3bYFQwg@mail.gmail.com> In-Reply-To: <4E1C6626.7030108@FreeBSD.org> References: <BANLkTim%2B1UwquMJ32WP8wZBGkYxPv78MLA@mail.gmail.com> <4E05EB91.9090509@FreeBSD.org> <BANLkTi=dyNx=TjyEqYMhSkRtddjVA4nAtw@mail.gmail.com> <4E0862A0.7060405@FreeBSD.org> <BANLkTikmVUtLyANBSqYb%2BL-xkwQ4Zo51Eg@mail.gmail.com> <4E09BADF.7050702@FreeBSD.org> <BANLkTin_%2BZH%2Bo7rdR9ijHMtrXcSdH9ZSdQ@mail.gmail.com> <4E0A41C8.3000904@FreeBSD.org> <BANLkTikwgy%2BKuA5E5zXQKGT-eyV35YAVag@mail.gmail.com> <4E0CE158.6030804@FreeBSD.org> <BANLkTinRY-h%2BkpXtwWJ_L86qVRdoynFSdg@mail.gmail.com> <4E0DB58F.4070906@FreeBSD.org> <CAL409Kw=rUnm9D56KvYiFWiU-bp59KqKnPcUXL38rZsW_Qh8AQ@mail.gmail.com> <4E130154.9080809@FreeBSD.org> <CAL409KyX0jDd9U=7GExvyPR1cDxPwsMHm2b%2B1Tvmijhpg0iWDQ@mail.gmail.com> <4E146FDB.2020602@FreeBSD.org> <CAL409KxL8S%2BzMOmSXghAQHLJRCS19ft%2BLiCKMPPm1dgEyMV%2BSQ@mail.gmail.com> <4E16F61E.80201@FreeBSD.org> <CAL409KzZFHfrEcABv%2B6ZzYUxmLKCbPOR_3sWALrqvmwCD8dxVQ@mail.gmail.com> <4E1C6626.7030108@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Andriy Gapon <avg@freebsd.org> wrote: > on 11/07/2011 19:07 Vitaly Magerya said the following: >> Can you elaborate? From my reading, the only place cpu_cx_lowest >> is used is in acpi_cpu_notify, where sc->cpu_cx_lowest is optionally >> increased to min(cpu_cx_lowest, sc->cpu_cx_count - 1), which should >> be safe in any situation. > > This is exactly the place that I am concerned about. > Probably my mind is clouded but I can not understand why > acpi_cpu_set_cx_lowest() > call is under the condition: > if (sc->cpu_cx_lowest < cpu_cx_lowest) > acpi_cpu_set_cx_lowest(sc, min(cpu_cx_lowest, sc->cpu_cx_count - 1)); > > If you or someone else can explain to me why that condition is there... Now that I think about it, yes it does look like a bug. Here's how to trigger it: 1. Kill devd. 2. Make sure you've got C3, set hw.acpi.cpu.cx_lowest to C3. 3. Plug the power cord in (only C2 is now reported). 4. Look at dev.cpu.N.cx_lowest: it's still C3, even though dev.cpu.N.cx_supported only has C1 and C2. This happens because normally sc->cpu_cx_lowest == cpu_cx_lowest, so the update isn't executed, and sc->cpu_cx_lowest remains as before. In short, that update should probably be executed unconditionally.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAL409KwV0MYBv-Ju_2p_rx23P7TER6C3D%2BdVyvbfeg%2B3bYFQwg>