From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796385384; b=jDv8IuMjXEGLkuobsewWvGA6QaEXoPsGcFNIvpePoNA6e2hMJ58XU6P/IbKmYCo7ppNa YMjNJ1G8RvEU3w3Y0lnBedxHa5q809/jUfA9L+bQHzQyUb/WKzPgO3F/K3Y/Q0u3kzuKh Zo2/kLD0G9LAuZ0Jv3H1QIsMUf62KFa+82xzX00AhTf4L6QHUQYoge7pS3YqCP3H28rQO O6WAelYYMl67R6knbqhSWb4itE2CACavfqYzZOkZHe6g1Ni2zNxhV93UyS38Aml+ATo56 fNov1KqM8+nsW58nPV1FZ6TqXUJmME/uyKLjcYUUBLRSSG53u5Kb6FgeQ0Im72PAfrA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385384; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=L09Kp9JVOg+zng/N4JSoUUG+oPJ3oAqvs8bW7jWJOvI=; b=X6vAuGwjqQj5sDsRwyj0yWI37Z/n4Y16iDfZBKq5ihHA/X8CZWTsOaP2LREaXSpp9K7/ s7FWL0eSZ4mygADYfOv7Tz+J5QfG+YJu/8NHuGFMhtEr5tUWqGN1iXD8yp9mwCkcdr7pl y5b/AnDchDfxYsQt5w6ryXAOpiV+guKNsT4VOSOg3c7JH8fAutdeTz1Ok0Erc/qrhfCA7 ynRTQ3RT9HLWlvQPuQSF2rrsUEyxbhmOIGNXdbBKM5k/U4eiP97TBoS/TRVtnp7jSkN96 j2pkcKeIhEZCTr9+OLs4ItfI1BsO0EGRRgx8r7gxeLByULnz7NSWIBMzpbu+ujzCXAA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Y6+GGEKO; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E255B606A322; Fri, 4 Dec 2026 11:56:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Y6+GGEKO Received: by smtp.kernel.org (Postfix) with ESMTPSA id 416601F000C2; Fri, 4 Dec 2026 11:56:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385383; bh=L09Kp9JVOg+zng/N4JSoUUG+oPJ3oAqvs8bW7jWJOvI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Y6+GGEKOVG4UuOCRWLFGtLdY32rtm9kSn3I2YqQ2YabNu+5WYRUPkR7UMP6wyv+Tc bjR8VivXmoMrkdtfueq5LIvBbM0GgjSiA1OdnC/fsND00aAy9XfwmFZzOMfPgO75Cv e569HvfNFExS5n/XZNDD9aNYvY03v3G5ETlS9gfU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Brian Norris , "Rafael J. Wysocki" , Alan Stern Subject: [PATCH 6.6 0533/1167] PM: runtime: Update last_busy in rpm_resume() for active devices Date: Fri, 4 Dec 2026 18:59:20 +0900 Message-ID: <20261204100715.936310236@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Rafael J. Wysocki commit 55b2b8af704f845e01fa2f31ee259b07641ce3a9 upstream. Setting an autosuspend delay for a device can be expected to cause a runtime suspend of the device after calling, say, pm_runtime_put() to be deferred, so the time between the last successful attempt to resume the device and its subsequent suspend is at least equal to the autosuspend delay. However, that expectation is only met after the device has been actually resumed in rpm_resume() by invoking its runtime resume callback. If the runtime PM status of the device is already "active" when rpm_resume() runs for it, the device's last_busy timestamp is not updated which may allow a subsequent pm_runtime_put() invocation (or similar) to suspend it right away. This is arguably inconsistent and confusing, so make rpm_resume() also update the device's last_busy timestamp when it finds that the device is already "active" and it is about to return 1 early. Fixes: 56f487c78015 ("PM / Runtime: Update last_busy in rpm_resume") Link: https://lore.kernel.org/linux-pm/CAJZ5v0jTX1FgeS9FCV=+V4uacSgLQBVsSPnU27ybgUGg57GUOA@mail.gmail.com/ Reported-by: Brian Norris Cc: All applicable Signed-off-by: Rafael J. Wysocki Acked-by: Alan Stern Reviewed-by: Brian Norris Tested-by: Brian Norris Link: https://patch.msgid.link/13032301.O9o76ZdvQC@rafael.j.wysocki Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/base/power/runtime.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -795,6 +795,12 @@ static int rpm_resume(struct device *dev pm_runtime_deactivate_timer(dev); if (dev->power.runtime_status == RPM_ACTIVE) { + /* + * The attempt to resume the device means that it is needed for + * something, so update its last_busy timestamp as in the case + * in which it actually resumes below. + */ + pm_runtime_mark_last_busy(dev); retval = 1; goto out; }