Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1658437

Re: [PATCH v3 00/19] Report power supply from hid-logitech-hidpp

From Benjamin Tissoires <benjamin.tissoires@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 00/19] Report power supply from hid-logitech-hidpp
Date 2017-06-06 09:30 +0200
Message-ID <tPh6a-5ES-15@gated-at.bofh.it> (permalink)
References (1 earlier) <tNCHL-61B-13@gated-at.bofh.it> <tNE6T-6SI-25@gated-at.bofh.it> <tNPbY-6hW-17@gated-at.bofh.it> <tNVAK-2ht-5@gated-at.bofh.it> <tOVfk-kl-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Sorry for the delay, public holiday yesterday and I wasn't home]

On Jun 05 2017 or thereabouts, Jiri Kosina wrote:
> On Fri, 2 Jun 2017, Dave Hansen wrote:
> 
> > >>>> This will allow upower to not handle those devices anymore and to
> > >>>> have more
> > >>>> immediate reportng of the device to the system.
> > >>> FWIW, I'm on Ubuntu 14.04, and upower *is* reporting my mouse battery
> > >>> as
> > >>> if it were a laptop battery.  It's mostly garbage, and always reports
> > >>> 0%, which makes upower always tell me my laptop is 2/3 charged (I
> > >>> have 2
> > >>> real batteries).
> > > Well, the exported battery might be sending levels instead of
> > > pourcentages. And upower needs to be upgraded to handle those :(
> > 
> > It sounds like there are a number of things here where newer kernels are
> > breaking older userspace.  It's also causing some very end-user visible
> > effects, like having folks' systems auto shut down because upower thinks
> > their batteries are dead.
> > 
> > Old versions of upower are obviously confused here.  It would be really
> > nice to ensure that newer kernels don't break it like this.
> > 
> > IOW, it would be really nice if this were treated like a regression,
> > because it's tantalizingly close.

Believe me, I really try to avoid any regression. However, in this
situation, it's a user space bug and the only solution to not hit the
user space bug from the kernel is to not export the extra device, or
teach your upower daemon to ignore this particular device through a
udev rule (if that's possible, I'll check that today).


> 
> I agree with Dave. If there is no solution found in time for -rc5, 
> reverting to previous state would be the proper way to go.
>

Well, as Bastien said, the issue is that old user space is buggy, and
even if we postpone the switch to 4.13, there will always be someone who
did not updated upower and who will complain.

As soon as I started the development of this series, Bastien upgraded
upower with the required changes, and usually the development cycle of
the kernel gives plenty of time for users to upgrade their user space
tools before the kernel hits mainline.

[...after a little bit of digging...]

I tried today with a Fedora 25 and the shipped upower that doesn't have
the bits Bastien worked on last March.

I couldn't expose the bug as reported here. The reason being what
Bastien said, there is a "scope" property exported by the kernel device
which is set to "Device" telling upower to ignore the device completely
in this version.

A git blame game gives me 28c8653ed8d43 being the original addition of
the "scope" handling and this commit is dated "Wed Apr 18 16:46:41 2012
+0100". It was shipped in UPOWER_0_9_16, and there has been 7 minor
releases of upower since, and there has been the final 1.0 branch since
too.

So, no, I don't think this is a regression if you are running a 5 year
old user space that doesn't handle properties introduced in kernel v3.4.
Any HID keyboard you plug in that exports a battery will show the very
same upower bug, and there has been countless since 2012.

Cheers,
Benjamin

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v3 00/19] Report power supply from hid-logitech-hidpp Dave Hansen <dave.hansen@intel.com> - 2017-06-01 20:10 +0200
  Re: [PATCH v3 00/19] Report power supply from hid-logitech-hidpp Bastien Nocera <hadess@hadess.net> - 2017-06-01 21:40 +0200
    Re: [PATCH v3 00/19] Report power supply from hid-logitech-hidpp Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2017-06-02 09:30 +0200
      Re: [PATCH v3 00/19] Report power supply from hid-logitech-hidpp Bastien Nocera <hadess@hadess.net> - 2017-06-02 15:00 +0200
        Re: [PATCH v3 00/19] Report power supply from hid-logitech-hidpp Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2017-06-02 15:50 +0200
      Re: [PATCH v3 00/19] Report power supply from hid-logitech-hidpp Dave Hansen <dave.hansen@intel.com> - 2017-06-02 16:20 +0200
        Re: [PATCH v3 00/19] Report power supply from hid-logitech-hidpp Jiri Kosina <jikos@kernel.org> - 2017-06-05 10:10 +0200
          Re: [PATCH v3 00/19] Report power supply from hid-logitech-hidpp Bastien Nocera <hadess@hadess.net> - 2017-06-05 15:10 +0200
            Re: [PATCH v3 00/19] Report power supply from hid-logitech-hidpp Dave Hansen <dave.hansen@intel.com> - 2017-06-05 17:00 +0200
              Re: [PATCH v3 00/19] Report power supply from hid-logitech-hidpp Bastien Nocera <hadess@hadess.net> - 2017-06-05 19:20 +0200
          Re: [PATCH v3 00/19] Report power supply from hid-logitech-hidpp Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2017-06-06 09:30 +0200
            Re: [PATCH v3 00/19] Report power supply from hid-logitech-hidpp Bastien Nocera <hadess@hadess.net> - 2017-06-06 09:50 +0200

csiph-web