From nobody Tue Apr 12 21:59:23 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9973C1AFBA79; Tue, 12 Apr 2022 21:59:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KdKPl3tzCz4hft; Tue, 12 Apr 2022 21:59:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649800764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qgp5U/OV8fyv74MPWVqi7lJ5VyQ6ddFaWtrPAJ1Q4JQ=; b=aZ468FRkCe3gKlF6DFtdEPlD/Ug7kqtCGudbCS+NNW/W0qEkt8zdHL5btTZfYI5z0JAJPX ACxI1Bw+RWSwE0AGNsXiu6EHlLSlpORaBQ1pHREzYBpa+s8fEtuXXzcRCmW/jTBh7e4Fwh MybF119eyny5KCidhvTkZbEyaTlXsUe/QHAHpn5y0i2PiN/nXjhgoEtrvQ/JG4MXj7pKXt WX3+63upuuF6CduOpuAVIzd3AGDhB1yNNqXvIWC9lBnMtTeQprF/wZ25U1xQY5dijH2OCO McmVncR6xnAdMeZz4ip+qNVVdK5yDidSuH6o0iadz39yZLlpHm6GIsQbmyun2w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BD951F640; Tue, 12 Apr 2022 21:59:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 23CLxNe5035453; Tue, 12 Apr 2022 21:59:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23CLxNUp035452; Tue, 12 Apr 2022 21:59:23 GMT (envelope-from git) Date: Tue, 12 Apr 2022 21:59:23 GMT Message-Id: <202204122159.23CLxNUp035452@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 5f2995aa950f - main - powerpc pmu: Don't use garbage battery info. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f2995aa950f99ca124a450e4e57c9966fba802a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649800764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qgp5U/OV8fyv74MPWVqi7lJ5VyQ6ddFaWtrPAJ1Q4JQ=; b=Gz87hLNYWvaunRQlRZfdoDEQGPDfeeuFgkP2A4Z4Zbt+StT4gmVdoP3mmyQQowQu/Ga+2x FYNiXz0sbD1wPMYQr48sc76R3Pbg5ptMTEoAW9e6qx63GcAlU5E/rGO4QSU0kNtBOz/iL6 L9QijzTVVoAJZUvp1xqLQFB/OHsvdGglAO4gqkS2Pcd1aG9Uhzfje4Dp4xWwXY6qdIYF3B 1GQ3D1nLA2V9kWHf5hYcVuQzXwOxWj1p1zBNSKPF9Jfw6LWAfMuNwfDdWoZoFk/0/gggmg Wyscmj9mNvKckxuEE996jN7SoPqT5Eo3a25ZGPjZqzddLmwwuuPHAaJngfJIjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649800764; a=rsa-sha256; cv=none; b=uIivu7MmDrBDmc8Ysx8w7ZIvwp6vYo9TA0Gt2yrS9A/tAYl0KiYO8eDvu3TxRUn63bnH5z hvL890mDBoZlnFOLZnNGNOCO15Mi4+ovpBFnv8llCPIkZ5HPL7z8gTMAIFble3B1OTsy3H 0lT4yjGEpW79tXPiXYrXNYuIZU1GgUp8f1Yi31keNvJQYrnfWcQmTopPXOqLI28OoT8qab 05fyXnbBecCyUe06EbP0XnEuMbBQOnzjvMraNCIjsBvjHxYYK37uz4tsayahjs8TIXs/Gp GxQ06VbCtMusmJa74BR17/s+24D7y6ol4a+JtC3F9DiL4XAm4UUXkT8y4+RH0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5f2995aa950f99ca124a450e4e57c9966fba802a commit 5f2995aa950f99ca124a450e4e57c9966fba802a Author: John Baldwin AuthorDate: 2022-04-12 21:58:58 +0000 Commit: John Baldwin CommitDate: 2022-04-12 21:58:58 +0000 powerpc pmu: Don't use garbage battery info. If pmu_query_battery fails, don't notify a change in battery status. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D34889 --- sys/powerpc/powermac/pmu.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/powerpc/powermac/pmu.c b/sys/powerpc/powermac/pmu.c index 97865174cc2f..ae01b9251b11 100644 --- a/sys/powerpc/powermac/pmu.c +++ b/sys/powerpc/powermac/pmu.c @@ -964,7 +964,7 @@ pmu_battery_notify(struct pmu_battstate *batt, struct pmu_battstate *old) } static void -pmu_battquery_proc() +pmu_battquery_proc(void) { struct pmu_softc *sc; struct pmu_battstate batt; @@ -977,8 +977,10 @@ pmu_battquery_proc() while (1) { kproc_suspend_check(curproc); error = pmu_query_battery(sc, 0, &batt); - pmu_battery_notify(&batt, &cur_batt); - cur_batt = batt; + if (error == 0) { + pmu_battery_notify(&batt, &cur_batt); + cur_batt = batt; + } pause("pmu_batt", hz); } }