Date: Mon, 6 Mar 2023 07:51:42 +0100 From: Tomek CEDRO <tomek@cedro.info> To: Kyle Evans <kevans@freebsd.org> Cc: Warner Losh <imp@bsdimp.com>, FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Re: acpi_cmbat with charge-limited battery Message-ID: <CAFYkXjnf-P6tCWQ7fqCmuykbx5_mTQKJTnhstEhxx51ohcnkUg@mail.gmail.com> In-Reply-To: <CACNAnaHHUoxBpoyynUXtLWnghLTV9S5CNjSiURb%2BDiJDF7WjFw@mail.gmail.com> References: <CACNAnaG=vk0jnk4zhvmuW7cRTMFdCuiMJp7mBOMx_rKy7umuoQ@mail.gmail.com> <CANCZdfp4JZCsuaQhbSuMYrYseu5n%2BHmASdEiCb0QM-2hr5Ja4g@mail.gmail.com> <CACNAnaHHUoxBpoyynUXtLWnghLTV9S5CNjSiURb%2BDiJDF7WjFw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Mar 6, 2023 at 7:39=E2=80=AFAM Kyle Evans <kevans@freebsd.org> wrot= e: > On Sun, Mar 5, 2023 at 9:33=E2=80=AFPM Warner Losh <imp@bsdimp.com> wrote= : > > On Sun, Mar 5, 2023 at 7:20=E2=80=AFPM Kyle Evans <kevans@freebsd.org> = wrote: > >> > >> Hello! > >> > >> I've dealt with this mainly over the weekend, but my solution was to > >> just disable acpi_cmbat entirely, which is maybe not the best solution > >> but I can't tell if this should be considered a firmware bug or if > >> it's something we could find a way to workaround in the kernel. > >> > >> Basically, I've set the firmware on my frame.work laptop to limit the > >> battery charge to 80%. When it hits 80% while plugged in, things get a > >> little funky- I assume it's because the firmware's trying to carefully > >> maintain the limit, but I end up getting (at least) one acpi > >> notification per second, alternating between BST_CHANGE/BIX_CHANGE, > >> which in turn drives up CPU usage as we tap it out to devd and upowerd > >> picks it up. upowerd ends up pegging a core consistently. > >> > >> Should we be rate-limiting these devd notifications? Is this even > >> reasonable behavior for the firmware? I'm not really sure how other OS > >> behave here, but I haven't really seen any complaints from other > >> framework'ers. > > > > Seems like this is crappy firmware behavior and we should rate > > limit in the driver... It's not useful information to be sharing once > > a second... > > The more I think about it (and with your generally confirmatory > response), the more I think approaching both problems independently is > probably good. I added a quick sysctl to acpi_cmbat to allow an > interval for folks with broken firmware like myself; I'll probably > throw that up for review tomorrow-ish. I'll also reach out to > frame.work folks and see if they can improve this in some way, but I > suspect any action there will take a while. Maybe some sort of PID function would help separate data and control? :-) https://en.wikipedia.org/wiki/PID_controller --=20 CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFYkXjnf-P6tCWQ7fqCmuykbx5_mTQKJTnhstEhxx51ohcnkUg>