From nobody Fri May 13 22:54:52 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 B83281AD4A96; Fri, 13 May 2022 22:54:52 +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 4L0P9S2rjRz3nm8; Fri, 13 May 2022 22:54:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652482492; 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=j7wfK3ri9u3ZtjF/Y9GaGmQSqrdd0i+YCPtD0aCvUZc=; b=EAiDJvAmWu2RG7OiajiVcUoI2Y2oc5WyYDEOWMN5Aozmr8OE1L79tCjjQRHP6CUdTINFMH f/olM71QmLvetUCI+rQPPxe7lkkfYdr1VS3/c0RPYTKL/FE5YPnJDQqpDVXIZhPg46B1oW m1Am7KZ/KZvf62zMyZ0T/DU0GOxI5/9zvhYC8W12LH8DYwGt0r23FqOB5hP0cAbAzfAzzZ Uc+QxeaBmfSqDoSzG5UaEi0fCpYWmYTzwdHxEiQo2qEXwUl5KSrNcZGTqNFFFe2EvATKrb KG8K2pBdD2JEbZlA4CtkelTR8Q/HoTCAfbky2+u0IqT24p7yRL878HQDow6bMA== 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 255F93A8A; Fri, 13 May 2022 22:54:52 +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 24DMsq9L078339; Fri, 13 May 2022 22:54:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24DMsq0W078338; Fri, 13 May 2022 22:54:52 GMT (envelope-from git) Date: Fri, 13 May 2022 22:54:52 GMT Message-Id: <202205132254.24DMsq0W078338@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 24c581ffa917 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 24c581ffa9177cdc3770126d886a1def5d68fc06 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652482492; 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=j7wfK3ri9u3ZtjF/Y9GaGmQSqrdd0i+YCPtD0aCvUZc=; b=pSRercOVEXnlCGwIagl+LEorKeowvHjRVbQ6/QbN/iYrmR+P+pFjwIzJEgf/8atszK5Cp0 iPzXbguy8evpmTGN0MaIHHUU926lEd/qlH29W9G9HafCusqz8A1z9okjJJ7+Ub5mJtq2vN uIQJ3CoNp5hsNCYWfVjA/WiRI6nByFtYqVTNy7c7nrEvkgpoQWkmLwQ7w3DYAYXcNB1lIf hQ0R8p5jfmLkHhXHyHIdJhqUSt0JgwTSM1rbxrz1DiFruLSdDYUjIrvMefwtr0tPHuPkfO fm+MM3Kcb1TwP1gPlxHGj4Y1agBtk74L9TLJEe54gUdgQHK0nVI9KMaDnqRVww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652482492; a=rsa-sha256; cv=none; b=M9aTyLQ1/crmHaO4z5iVWoUwU9WJHifG0zY9dzVaHadBIghFYKaiq9m2gckAAfX0yciXDL nzdnfK1nKvPRzHTuah3E3jqydaa6f9mVz/zYd0CsJNEJ1zDGmSW/8Av+s29O3TGmnwNyNv EKRQaHB9ulkety0Xjx7HVqzStNhCFMbw0XJhd/J5sa89okEU+XkMCE3QzTGWdpJYn1jBSY CpVWosV7j0HhFZnAXbp9ryoJO1Sr6XbIhgXP7STMqjUXL1UrySLd1E+LjmEQWDmJCKyXUn OPLc5efoXmdYUnG+1Qq0I7DdMmvW/NTXPaNzLzrOjCqurLJ+GuyZ+bxVSb041g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=24c581ffa9177cdc3770126d886a1def5d68fc06 commit 24c581ffa9177cdc3770126d886a1def5d68fc06 Author: John Baldwin AuthorDate: 2022-04-12 21:58:58 +0000 Commit: John Baldwin CommitDate: 2022-05-13 20:13:43 +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 (cherry picked from commit 5f2995aa950f99ca124a450e4e57c9966fba802a) --- 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); } }