public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ognjen Galić" <smclt30p@gmail.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	kernel list <linux-kernel@vger.kernel.org>,
	ACPI mailing list <linux-acpi@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Sebastian Reichel <sre@kernel.org>
Subject: Re: linux-next on thinkpad x60: full battery is indicated as battery error in mate
Date: Tue, 13 Mar 2018 00:39:05 +0100	[thread overview]
Message-ID: <20180312233905.ulb4zrr7dphy2l3i@thinkpad> (raw)
In-Reply-To: <20180312231847.GB7612@amd>

On Tue, Mar 13, 2018 at 12:18:47AM +0100, Pavel Machek wrote:
> Hi!
> 
> > >> > >> Fully charged
> > >> > >> battery shows as empty battery with red "x" in Mate desktop. After
> > >> > >> reboot to recent mainline problem goes away. Tooltip says "battery
> > >> > >> waiting to charge".
> > >> > >>
> > >>
> > >> For the MATE bug see:
> > >> https://github.com/mate-desktop/mate-power-manager/pull/251
> > >>
> > >> The problem is in the new composite battery system in UPower, it
> > >> "merges" two external batteries into a single one for reporting. That
> > >> battery does not understand "Not Charging" inside the MATE Power
> > >> Manager. The above patch fixes that in MATE.
> > >
> > > Ok, so problem is 91eea70e5e5ce12eb1c7cd922e561fab43e201bd.
> > >
> > > And now, I see that MATE should be improved.
> > >
> > > But what I also see is that kernel is changing its interface in a way
> > > that (while making sense) breaks existing application. And we don't
> > > break existing applications.
> > >
> > > [Now... maybe if the fix for the application is available for long
> > > long time and noone is really looking and everyone already has new
> > > application version, maybe ... But pull request for MATE is 9 days
> > > old, and not even merged. So there is no way this is suitable for
> > > 4.17.]

It's not a bug in the kernel, it's a very subtle cosmetic bug in MATE.
If you can, please test that MATE patch and report back to Github
if it works, as I wrote that patch and they are waiting for someone with
a ThinkPad to test the patch. If it works, it will get merged and
everyone will be happy.

This is far from "breaking applications", it's just a cosmetic bug with
a single icon in a single application that has a simple fix.

The upstream underlying UPower system reports it properly, as
UP_DEVICE_STATE_PENDING_CHARGE, it's just that the MATE/GNOME developers did
not handle that scenario due to poor testing and use case analysis, even
when that state is in the UpDeviceState enumeration.

See:
https://upower.freedesktop.org/docs/UPower-up-types.html#UpDeviceState

UPower correctly returns UP_DEVICE_STATE_PENDING_CHARGE, its just that
the MATE Power Manager discards that and assumes
UP_DEVICE_STATE_UNKNOWN.

> > 
> > Right.
> > 
> > This basically means that we will have to defer the battery changes
> > until user space is ready and not just upstream, but also in distro
> > packages.
> 
> Yes please.

No. See below.

> 
> Note that only 91eea70e5e5ce12eb1c7cd922e561fab43e201bd should break
> anything, the others should be safe AFAICT?

Again, nothing is broken here, the kernel is *currently* broken as it
shows that the battery state is "Unknown" and MATE assumes a broken
kernel and returns a simple charging icon.

> 
> 								Pavel
> 
> -- 
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2018-03-12 23:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-12 19:47 linux-next on thinkpad x60: full battery is indicated as battery error in mate Pavel Machek
2018-03-12 19:49 ` Pavel Machek
2018-03-12 22:29   ` Rafael J. Wysocki
2018-03-12 22:35     ` Ognjen Galić
2018-03-12 23:04       ` Pavel Machek
2018-03-12 23:06         ` Rafael J. Wysocki
2018-03-12 23:18           ` Pavel Machek
2018-03-12 23:39             ` Ognjen Galić [this message]
2018-03-13  0:51             ` Ognjen Galić
2018-03-13  9:14               ` Rafael J. Wysocki
2018-03-13  9:15                 ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180312233905.ulb4zrr7dphy2l3i@thinkpad \
    --to=smclt30p@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rafael@kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox