Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2289173lqb; Mon, 27 May 2024 14:43:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXxMD1IQzbWm/a5kbKgxN8hIeNjNwxW3h+rSfFvmAlA5vqHu9qAafPLpnjgpWgBvtu6hdiZWaxooqjOXbMZ1nGMQUYUkKf84CGawZ7NvA== X-Google-Smtp-Source: AGHT+IHWEAjzbkDX2H8/n5M2SjEJ+EQU+LRHjYy6HD4uodBSKvOTRvt9jziNBgoU98op1hFsnk1f X-Received: by 2002:a05:6a20:d42f:b0:1b0:257b:a5b6 with SMTP id adf61e73a8af0-1b212e33e54mr13081133637.57.1716846233317; Mon, 27 May 2024 14:43:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716846233; cv=pass; d=google.com; s=arc-20160816; b=B4kPulA20pztTpQb4o98XJOWeIOe1Uoh/mCULmVhthJVleMw2KcAKXUpGxa0m0C6/n EGVHaS1hHL/Pd56TDXrqwWQ00RMDzSlBkIfsxaUr5jzO0u98DfrI7NByrhfRiapbwJh4 jVXiJC3i91lMsDC+fbBMI94XVnDSFInhAxEgyGzKVqT7Uek66/2rykO9Bv7+7xb1V1fH 6Q3c482KE5dWdLkO/ml54u5UIjlxbjxYG2U3DL9tdeYCkaL3nOGijkfoee7RsdQKBiVc 7FP4aXz6Vffg/wszf3A3QnGDV7MLSZA1OaMchcNMUnNw4mRNvOhcn/0eYqm3wT7nLVkO /dQg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=cpA/emeW2msjiWFCtCkNP0pOy+mKQcFfT4gmBDYEuNk=; fh=f2Vsq2kRHSBPzpqqBcXytZh8s+ONlXE3NbD4OdyRZCM=; b=ZhybsGaPEN/ZDjC23yVDvAUuFBh3RMi8Rx3ivPZYs3WE6A+WG7I1s9Mfp+vvORSDar n+X5BPpBZ9ouyOTpCzgWD6lvto7hV+7qk/P6ChFF/OCfmVhq6U0WirBm3+4acR3vI4iE Bg8LIGQ5yfIMU1YYO7QUeGD7FE1NuxatTWVRVcFORRwzGnZyCKailX4G0eWp5mp3Nqcw teRk7o1kVFBa7Mcgwqv4vYtB3w1t6xcU8O0oUpyUEzKHhHwUIBrbXtXa5WMR/s4Z/JtZ 5kyWXRuRNHZrofFTVXn7AbKCFrEEtTcz6ta1x0/JTCYC9lZ/A4RtaJp9uLsUMLSUaXb4 fJBw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ysFvJeHv; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-191466-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191466-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f8fc36e656si6794290b3a.104.2024.05.27.14.43.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:43:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191466-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=ysFvJeHv; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-191466-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191466-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id EAB0628307C for ; Mon, 27 May 2024 21:43:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1EF801649C8; Mon, 27 May 2024 21:43:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="ysFvJeHv" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (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 BCD3D1CAA9; Mon, 27 May 2024 21:43:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716846224; cv=none; b=e3J0gaqzXHQ7DAj/TLXKA8Dda8D/HJ1Yu/2mbiPNkCb0OTRnBamGVvkDCyl6l1773+HCnGRTHeDgeCdH2U29uuQkQF1YBp9YOzGl6W2F0CMt6tC8CzIehx1T4ZZrzV1ELEaEPjYzm6ZotGYOtNea0F6REQwpFATWi6FRF/zije4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716846224; c=relaxed/simple; bh=X+zXPmKQ0RClHtqVt1YiZe8llIi3tJ+EFNRQseL7MmE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BNsh9/MatG32yMFn5sKYhVhCGHUZO1zt16X0bSRqLxqZcEo2JbeZYt7ukT0A8bPsvXadGELgCntaprSQisxhJnCOacoZ/MIWjQ5XT6T88kNffbxPUY1zAP185jGxC7+FLyi1f/k/fbRXp1w0hqmv+wNfr6gsSZVf5mBf78gxxks= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=ysFvJeHv; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1716846219; bh=X+zXPmKQ0RClHtqVt1YiZe8llIi3tJ+EFNRQseL7MmE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ysFvJeHvEZUEL1zQ4L9o2KjHFi3RmNLQlApUFlI/HOghuGEqI+ypOz6xxndG3TiOW tT251UkuG0dR64KopDi+/s/WVJDddUR2zRXo0cJ9QERIL66PCg1Wwd6/IDpNYYKDhQ S46dHYuh+LC+F5b0CzrguELIrGgJC18IscGf+mLB9JQVyYU0wexxGd3/5FFhuwJRvZ kzPhdlX+ptKuGsknjf95Ss5KhWlFjENk2XBRZlTqFQFTkYr2K0ENTWm0KQezSC3E31 IAKwB+3Md9qyOTuOvWSiy/zt0fMTAdknqEmCtliOpopUBpqI65c0F7ty+Z4mW0DLES plWy2nelJDY6g== Received: from mercury (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: sre) by madrid.collaboradmins.com (Postfix) with ESMTPSA id A15E53780480; Mon, 27 May 2024 21:43:39 +0000 (UTC) Received: by mercury (Postfix, from userid 1000) id 13F0310612B3; Mon, 27 May 2024 23:43:39 +0200 (CEST) Date: Mon, 27 May 2024 23:43:39 +0200 From: Sebastian Reichel To: Thomas =?utf-8?Q?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 Subject: Re: [PATCH] ACPI: AC: Properly notify powermanagement core about changes Message-ID: References: <20240526-acpi-ac-changed-v1-1-f4b5997753bb@weissschuh.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ocxnujsdr2oxrri5" Content-Disposition: inline In-Reply-To: <20240526-acpi-ac-changed-v1-1-f4b5997753bb@weissschuh.net> --ocxnujsdr2oxrri5 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Sun, May 26, 2024 at 11:40:01PM +0200, Thomas Wei=DFschuh wrote: > The powermanagement core does various actions when a power-supply changes. > It calls into notifiers, LED triggers, other power supplies and emits an = uevent. >=20 > To make sure that all these actions happen properly call power_supply_cha= nged(). >=20 > Reported-by: Rajas Paranjpe > Closes: https://github.com/MrChromebox/firmware/issues/420#issuecomment-2= 132251318 > Signed-off-by: Thomas Wei=DFschuh > --- Reviewed-by: Sebastian Reichel -- Sebastian > drivers/acpi/ac.c | 4 ++-- > drivers/acpi/sbs.c | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) >=20 > 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 ev= ent, void *data) > dev_name(&adev->dev), event, > (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); > } > } > =20 > @@ -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); > =20 > 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_CHANGE); > + power_supply_changed(sbs->charger); > } > =20 > 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); > } > } > } >=20 > --- > base-commit: 6fbf71854e2ddea7c99397772fbbb3783bfe15b5 > change-id: 20240526-acpi-ac-changed-a08c6941ae51 >=20 > Best regards, > --=20 > Thomas Wei=DFschuh >=20 --ocxnujsdr2oxrri5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmZU/ooACgkQ2O7X88g7 +ppSEw//cGUjBMrRvbVbNEw4zn0y5P/uJwp8Gdhfa2WuF9iKNPAIAP4BuoQVSroi CfeN0uAe7VOXj6DHrAZLzRx2JyCRqfbA4xV0dOa1NMLwZBMBcAHhI/zE/Uyb/Ajh x9y/W36z/k34ciEHYGA7fHLhbFvSyQzDEgDE2ivByhMlMZMxSpRsovjc34eeUaty 2IB17/Vqmdu+LK0MYuTitnolNHKxxJBoAeGeIpuUCKUlmaKNj1RjpR10P1yoXHpH SYsYwbqUNCSPUL1zoYooQg+/w65Sm8vAdNN2rWSaM7F0Jw7jo/eqVWHOgI8Lk6bD LLjE2+DzMWmO2KwmE03seN2Hc6vhqC1PgSEw8rI18Cl40lk/IIFmf89uO1s5FIfk cbp6Qc8AknlhvTNw3+GSV/C1602N17hRJ/viL9xWtWZtGG0L34rc2fy9pOaIfwtM 5FoenJR0ZBGFbROrFgCZEork98KL8wERj973YnyQ0pb4QtUv20tRDc+s4cBSHuSe 1pPPk9MNCTnS5vdKzYGjOBKQKwOCXqQR415K5ltYca//MqZrrqq6+7rFAL2fYAR+ eYl7w0Ree1/TJmCaTi/IUZv7JpOHZBIP+21544X3FwKSYis3Uwaij9HNf3dNFEoD m5jZHKUv90AO3yKugzuUioTTvhBtd0XMzWWClJcYwTmOyQUvOdE= =6hnM -----END PGP SIGNATURE----- --ocxnujsdr2oxrri5--