Received: by 10.213.65.68 with SMTP id h4csp38140imn; Mon, 12 Mar 2018 16:40:21 -0700 (PDT) X-Google-Smtp-Source: AG47ELsmBpVdp55BXrXXSQ/r0R/2SYK3E3lhf/QyVPeYxnSV45T5nqo8aJHXzxP2D664vrT73UdH X-Received: by 2002:a17:902:b691:: with SMTP id c17-v6mr9890028pls.308.1520898020997; Mon, 12 Mar 2018 16:40:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520898020; cv=none; d=google.com; s=arc-20160816; b=znS9ZHhDpcySo3xY345QLqiTdHygjB8a+XGqqNZwrmz1YtAX/+TZV5CkL7pLs93nzY OU9Lxk6CMA5fy/Gnnf6Fr+5VBoNRI9vWcDa/QDFxjUVljpxGGyR71vrFQHwDM2mcZdUr 8Vf5W6RRYmf191aW5daVaejQg4FNxW1MIhSKW5uA1YScH4d/E3d84kla1ycUmg2ZFw2x fW26MM3TefawA8btSQUvmpJ09WHRcT42GOesGU8s1O3NMPndDsCBTNMsqJiF03SiUeea QwctR9UMZg4XvQTV8aRT5Es7TjqgjEvmosYNejBhBprtkCYtZls6wfHlBfyJbtvBNGGA +T3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=25XXSc2sC6/2E724ar7fW0xLXJ8r+HbLwvTPhHmfLfw=; b=Ri9j12HXGCLJtZ5mM4rke7h6CfJy/SiUjbR547hYLbGsKZmGSuIDcKnHNPSQgg3IFH xnQtSM99gMEodVBupnMJuTwkUMjZr+AfnjANFCsgIDRF0ulPxDe+nNKBEtqsowKKUaMl n94hT5WHx+2yjaEViYaC3I2V+o9Z53vSuYAFQkbzpGQcXIxRDDSofLrfcre4jbs4waBE niPK/0E1HbBYBXhml2W4PZQH2dpyXL140ZbArBHXIinxdEM10oi7fDnTJBY/ym0vVMvd icEbfR4TOVfR3penz/sOv1RijMkcC4+DyAW0mCuEXQunyQGiL/eYE99VvU/S8jLG8cWi QVSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=O63fbwqM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e125si5644848pgc.506.2018.03.12.16.40.05; Mon, 12 Mar 2018 16:40:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=O63fbwqM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932267AbeCLXjL (ORCPT + 99 others); Mon, 12 Mar 2018 19:39:11 -0400 Received: from mail-wr0-f182.google.com ([209.85.128.182]:36356 "EHLO mail-wr0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751333AbeCLXjK (ORCPT ); Mon, 12 Mar 2018 19:39:10 -0400 Received: by mail-wr0-f182.google.com with SMTP id d10so5086937wrf.3; Mon, 12 Mar 2018 16:39:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=25XXSc2sC6/2E724ar7fW0xLXJ8r+HbLwvTPhHmfLfw=; b=O63fbwqMyd2AqAHfwRdESErj5wEXzCVsYwTJdIP9KymPoeAnOWcNKk+tz1NHe+RjXQ 885eam6bp8QZhJ0qp8lUuKhGdIRtTucEeSZ+eEMkG4Q5+Q1uYlOpKoQEpONP37MKeW2h XaENY40yBVKGCKLs9L6eD0MjJiYCLMTaVqbQF5XUQMQgdW8MVvr+CxkefcATUgYB9aXH AouT/IndcWxSt7w/J4lyz7FzIafAT7F4pz5MeUiU6Gmakeny9+ddJ35DIhPDjHE5cUxb D90xXcfaouHTMfi7jIMprEWcy19hcusWGvKbyhTvH5fmolRR7wnY/s5wXvAwJ6tB/eXV 3TWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=25XXSc2sC6/2E724ar7fW0xLXJ8r+HbLwvTPhHmfLfw=; b=SlZC45kAUzsffG1WYfUfG4aBjAxtPCug1e+wQq+I7KXPX4VgRHW/XEPAUsQy2A4ZCD Sc6h8rae5DZyHEsA3iXieeSf95JxAbN2vX7EOA04Sq9cFn0996B71cNjZN2UV2Myqqto JONfB2rf8yNm3zWDUO/G9wEM2LoUIpu4eny7wIl3G1YF/1HyqzEG8Nx+ZBJM7qMrC1u9 IOcjWdjFFTbZMNUIMwW0/mHPrsxGrVYsIg9kIpopdbU2VSU/eYALCFb0IefLxf7ruRUD apVkg09iFiLa8DH14JKC4pjHLKsqcGIzee5c33Pxnn91nNAxH2dOjYOiQTSkchsJ8U3A nrRw== X-Gm-Message-State: AElRT7GKKSaTwZ7Eu/5jgOkgDHOyJhNipVn/80fX2D5rqi/BTg5bDeCs DJO14XS3dJBXil1np9n1Aig= X-Received: by 10.28.93.82 with SMTP id r79mr6539405wmb.73.1520897949047; Mon, 12 Mar 2018 16:39:09 -0700 (PDT) Received: from thinkpad (pppoe-46-239-9-93.teol.net. [46.239.9.93]) by smtp.googlemail.com with ESMTPSA id 140sm9139977wmi.34.2018.03.12.16.39.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Mar 2018 16:39:07 -0700 (PDT) Date: Tue, 13 Mar 2018 00:39:05 +0100 From: Ognjen =?utf-8?B?R2FsacSH?= To: Pavel Machek Cc: "Rafael J. Wysocki" , kernel list , ACPI mailing list , "Rafael J. Wysocki" , Sebastian Reichel Subject: Re: linux-next on thinkpad x60: full battery is indicated as battery error in mate Message-ID: <20180312233905.ulb4zrr7dphy2l3i@thinkpad> References: <20180312194715.GA3992@amd> <20180312194944.GA3979@amd> <20180312223521.vzccevf6z7ik5ysf@thinkpad> <20180312230407.GA7612@amd> <20180312231847.GB7612@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180312231847.GB7612@amd> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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