Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp203199lqb; Tue, 28 May 2024 12:58:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU8NaLOnM0SFqg6S7huz5DAWLXF5iZJcKTRYYysPXZqx8CDhsS1VkDb8Md3HmCNBaMED6WPT6n0WndVZPVDF3v5n3JeeTt6YYyefqtvXA== X-Google-Smtp-Source: AGHT+IFLWUCs2eysekBovTZtMWldTa/Z6hAHDLXaNTq4Jlx9JYWRoebaUzy25cdF43u0Tg5guIvG X-Received: by 2002:a50:8719:0:b0:579:c4e8:42bf with SMTP id 4fb4d7f45d1cf-57a03f86e73mr78443a12.12.1716926333727; Tue, 28 May 2024 12:58:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716926333; cv=pass; d=google.com; s=arc-20160816; b=dBdrTSMrqR5Ewni82HkH/huddo7m6ILKSbJ/K37uCwPtsMMv2jcqdBVxPw13dCUC2l RBhitMHVu/Bry2DUafA8KpvxHdMuTrm68ZM5i0XyHfmE1vDZWrINnUf6G4ZTi3lhvLqC NT2zKy3LNAMwnyEo8QpAPRTzc3f0TCD7F+6w5P28qSPVZnkYHfrnvy99vRMBYPFQQOS7 RcO1Fniclv6bquQrKCSKtJG7OsY8ybATLTZI7fyhF3rLSuxVZ80Fkaf4EdHV4e3PuDiA dDk0aDnK7pDnWRfvtKPwr1BOXOYPvjp3gkRzQtMO59B22NNgmj8mc+P7q3lNBtbE7bXS 7ViQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=6yOuPpkMHBfTpniiiUr5Ay5mAukYPAynWHmQ3sZKSxs=; fh=B9NFXxBwzl0IW/WcNqi2wmzEBQTmix8TS22LaDjdVvg=; b=itEkDFio9uY/JxriEEugEVI4O2uxjx+xY8wH2Bh5wmZAPl28vy7tTnOE79gTxDwIbB WGTt/cnbS3zaC2lR8BOm1mcbyB0XxsznFV+fgTHFWW+tgxaf3EbLoWJnX67xqWPKbLLS GNl7kt0asD4fp1YF7C9x3H8a64wGLS36PzAlKr1jD5Tu2cdTY4KlCZags7OQJ5frwMER lrdubU+I1vBf0qPaEg1TqseeU9kll5UsUpDLT3XWRua8WyrG39efIMhkh2Wdtbn4UQju f97yuS7GwOkW0sEP/6y3duABTLpq8//iX9x3oxbFxMqXVgprUlYNR2ZxYXh4QvEsIg50 Uj3g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=W+OAbSM0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-192990-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192990-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a016f7d4asi166843a12.216.2024.05.28.12.58.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 12:58:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192990-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=W+OAbSM0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-192990-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192990-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9B6A31F22621 for ; Tue, 28 May 2024 19:58:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A5F4C178391; Tue, 28 May 2024 19:58:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="W+OAbSM0" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C640D178372; Tue, 28 May 2024 19:58:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716926283; cv=none; b=qJv4HWFguycOCsXUaV1t7PVRtwh3/cZKK8hZ+My0hZMl0Res1w8LmGh2BVYnSFgoNNX9a6bBzvfSOrCUziJ9pUfQuFIgLIt4SrRyojV7xez4WHYBTltPYqnwg5Fkjw3HET+/4jBXpJ+po0x1UO0sNTc/Atva81Eseokd93x+3uo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716926283; c=relaxed/simple; bh=BZlSwuttDPw9S9+xlwtc5/DNO6T6WU/rzwVlBiGJZJY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ShGq6ZyUExZAmVeO0226HWEYf8pMOsu9f2l2Yu3V4QZ15hqrQawre/e1tCURGVcYIs6qsh/wNSVeui8e6lFCVCSIyHz5O9aVynU39VWiW19y0ZK1d3Ldau8UoafartWBG4fAac3fTMj52eEeSINlUDaTkovzDspDkf6gtmGeILs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=W+OAbSM0; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CC8AC32786; Tue, 28 May 2024 19:58:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716926283; bh=BZlSwuttDPw9S9+xlwtc5/DNO6T6WU/rzwVlBiGJZJY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=W+OAbSM0A/BaV3StQPVI1WdF2UWFKuReytJe3cR/rVYbeVX5pTYv1sUodh8WAjSac VTqwOu7uYLtO/MfClEvTFskJoPIZWxbetOMyVaV9aZ/gQOttZJ6Hc0k59F6nsUwNc3 bfRwG4N/8+4N1AHKKlTkXOEKZ5IpCvf3AKDXnVeyA0zRLv00PByTXustEVm7s7X8Nv 3uLtEyBEd4SSk85AMKQDjw7ulj6cBfOi9lDyWqH69TFFBrjnmQmirO+EQpCUYnigrz z9BDbe5PFQ8XaxFA8dE6Dd3JtVOrNtjYouQCWxF34HR6JbIByX5bh4FsCJ7IR64Y5G USw2t+bDMboaQ== Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-24ffb6ee0f4so33807fac.0; Tue, 28 May 2024 12:58:03 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCVkTXyWD3+MX679GIohMb62YdYTiD7XsG9nBVRsjMx9rXcd+5kNLySG/V6kLOCdP23PD2zINRkPAkmQr/BahixKqkaOA9kyx85xNyc8Nbejhqbj9vxNwP4hxbYWDkA9QBB+npU98KdOMGu3EMEZF44fgrcHw+UzvWqZwgpzSm/jy822 X-Gm-Message-State: AOJu0YyTv2qRgPGm/j2bbOYNB5+bV7IXlpTPwwE1CJ5KTYIwaaxOczhA fgFo5dLIBNp6hT6lCj0dbH16D5zcyviU3YKbwlghs8OullzyGgpj5++WMIA19DImRlrA61z/09W a1RfUPm8cfE04ZY9HiIS7OV3TGo8= X-Received: by 2002:a05:6870:d888:b0:24c:b2d0:bfff with SMTP id 586e51a60fabf-24cb2d0c0camr12861111fac.2.1716926282655; Tue, 28 May 2024 12:58:02 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240526-acpi-ac-changed-v1-1-f4b5997753bb@weissschuh.net> In-Reply-To: From: "Rafael J. Wysocki" Date: Tue, 28 May 2024 21:57:51 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] ACPI: AC: Properly notify powermanagement core about changes To: Sebastian Reichel , =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= Cc: "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Rajas Paranjpe Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, May 27, 2024 at 11:43=E2=80=AFPM Sebastian Reichel wrote: > > Hi, > > On Sun, May 26, 2024 at 11:40:01PM +0200, Thomas Wei=C3=9Fschuh wrote: > > The powermanagement core does various actions when a power-supply chang= es. > > It calls into notifiers, LED triggers, other power supplies and emits a= n uevent. > > > > To make sure that all these actions happen properly call power_supply_c= hanged(). > > > > Reported-by: Rajas Paranjpe > > Closes: https://github.com/MrChromebox/firmware/issues/420#issuecomment= -2132251318 > > Signed-off-by: Thomas Wei=C3=9Fschuh > > --- > > Reviewed-by: Sebastian Reichel > > -- Sebastian > > > drivers/acpi/ac.c | 4 ++-- > > drivers/acpi/sbs.c | 4 ++-- > > 2 files changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c > > index 2d4a35e6dd18..09a87fa222c7 100644 > > --- a/drivers/acpi/ac.c > > +++ b/drivers/acpi/ac.c > > @@ -145,7 +145,7 @@ static void acpi_ac_notify(acpi_handle handle, u32 = event, void *data) > > dev_name(&adev->dev), e= vent, > > (u32) ac->state); > > acpi_notifier_call_chain(adev, event, (u32) ac->state); > > - kobject_uevent(&ac->charger->dev.kobj, KOBJ_CHANGE); > > + power_supply_changed(ac->charger); > > } > > } > > > > @@ -268,7 +268,7 @@ static int acpi_ac_resume(struct device *dev) > > if (acpi_ac_get_state(ac)) > > return 0; > > if (old_state !=3D ac->state) > > - kobject_uevent(&ac->charger->dev.kobj, KOBJ_CHANGE); > > + power_supply_changed(ac->charger); > > > > return 0; > > } > > diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c > > index 94e3c000df2e..dc8164b182dc 100644 > > --- a/drivers/acpi/sbs.c > > +++ b/drivers/acpi/sbs.c > > @@ -610,7 +610,7 @@ static void acpi_sbs_callback(void *context) > > if (sbs->charger_exists) { > > acpi_ac_get_present(sbs); > > if (sbs->charger_present !=3D saved_charger_state) > > - kobject_uevent(&sbs->charger->dev.kobj, KOBJ_CHAN= GE); > > + power_supply_changed(sbs->charger); > > } > > > > if (sbs->manager_present) { > > @@ -622,7 +622,7 @@ static void acpi_sbs_callback(void *context) > > acpi_battery_read(bat); > > if (saved_battery_state =3D=3D bat->present) > > continue; > > - kobject_uevent(&bat->bat->dev.kobj, KOBJ_CHANGE); > > + power_supply_changed(bat->bat); > > } > > } > > } > > > > --- Applied as 6.10-rc material, thanks!