From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.182 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796077873; b=ZT6t6zBBlpX/A/HLY4jhu27AI0UIipPxVYSeugfF/rbkfG2XItSKpdPxboLI8UTA9DhO EEwLkQaw3KWlM8rzyih/Uwxruqfzj0xY8az8BaACinPK9gcTbg0PycmyQO6t1vfQ9BCjv ZlOzlvBxRydwliomecAlDDEh7rah4xvnNGGzzR/yntHn1bBbyelzB+qZBkaJt4rKp+BDU 4eH//8lkXkwynIOIm2CZZjlhTLI7v1IztWvUT6/+7r2RPBPbevtOaHGyvSzCrPZcLYd6C 6mcBjAGgSasMBodadqOD3nzfos1hf3HghXFTpdkzcIKYeC6BcGsbSk3BCPTUvcwQEgg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796077873; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=r5ohaZENYMpXwEOHL8E55qSxs2D3NJLxQLD9r7SeCPM=; b=h/ZU7oQhnjkT89Cow/IhZh0IpPGMeJWuWO93GmvBTR/pdsOONn5Z586i5plGEYosuPMS fm1TbyKvK0fFbVXSBcblAhOIHXFomhZsM0d0aSLxMsCISHDNHElEVkckoKqBNxkDWm36l K1ZL6b02U2PLiidHfZUZ4gJIVlRUhfDADtpOOlWH/ulIYa7XTZKlmarCBsaFw4ixfVMX2 DAf596xdW+SfIOK6IvP9uFMdV6+Q1GPdT2l0dIiIXj/I0Uhc38hPgjF7BsENfTcY+QRdK u1teHlH96GRgS9T2XU+7Y30CgQ8qO3xiVqKmrT0kpzmvQdD3vIzIPQ5ifp9y1JHjWSQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b="MKll+g/J"; arc=none smtp.remote-ip=74.125.82.182 Received: from mail-dy1-f182.google.com (mail-dy1-f182.google.com [74.125.82.182]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC5C7606A320 for ; Mon, 30 Nov 2026 22:31:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CC5C7606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=MKll+g/J Received: by mail-dy1-f182.google.com with SMTP id 5a478bee46e88-3863db981d4so15350195eec.0 for ; Mon, 30 Nov 2026 14:31:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1796077872; x=1796682672; darn=lists.linux.dev; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=r5ohaZENYMpXwEOHL8E55qSxs2D3NJLxQLD9r7SeCPM=; b=MKll+g/JFteFi/59BfqbT7vPJRKN/EG7P2gOmPxrVr5LcCjG6wM6ThnHMQlk/0t9Mb h4bcIek5uYir1sRh4OTDNyRooWzPVSRa+mpFZn+oW5kZ0Auuimhb20Y08Y115SaPNIS+ nc9EQdCGYeMUg99YwTAeCd+MPLGw9Vma5GASc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796077872; x=1796682672; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=r5ohaZENYMpXwEOHL8E55qSxs2D3NJLxQLD9r7SeCPM=; b=IvJ3ds2+n6GdLCkzNArmQh8EIkjikfiv65GGGi+JMAXmZO+G+IpANfsAlHcWcEopVa mp0Ivg9DuMeboOUdhPz+dfYKmnTtZd+/e7KMeAZXZzOehoVr3FG9Ua4A2ZHPs97G7LRR 1w8txzgFoIDBylNDKxAXrXUW47shc6+QQIzs4m1NXcyR/4nEQQ0FmbGdh/7PiZnW5tmj HpGFua4PKOD1VcmGnRTvcEg3Pui2LEdPZ4UczkWmlor8FiEkCPrfbmvaJfMNSZ+cJLUY 6jQLOzsSGtGVfWW5i+zGNwx99luvjQHQCjsVJFbtWAX4w8Sn76XyVuGPmWrRMbPwWpPZ OTqw== X-Forwarded-Encrypted: i=1; AL+hErH69DS0FAe+dYI9UDvxIaNGla3US0XwH12IImZ1LwT4jt5cZX51jiFyXi/TGNOLiNwNjBJn6q+/YpGujA==@lists.linux.dev X-Gm-Message-State: APuU4Z85QfGCD0UHqEP552CtnZxXbWwawci+wmnYMcSAKxgSuBR0i8vy vLxlELNqAsgOZq9IqCsdXiIk1xfOUfksaM3wsyDXLMoGxu3BtayiMEhTvAMWVK7PUg== X-Gm-Gg: AZFdTZfLxTJ4ueF9l0VJrFE+pwibwjih5J9g/1ulx1XNbQ6or864KHe4ZSV1YMAkodH +ELMcggIHcJVj8tIEX8NItlzIO2nFkBHdp4WU4UtgAgHvMiDfVJ3OC65JTkHyq7jsimR7tGgNoQ 9N1opHQZNn6wvkt4TDlLjDGEce0SsCvGvHG9viP37y5pw17pLxXs9VX9WodtOC2oESz6sop7Bif BNUPiPTJUykU7m+gFwy2/s184T/K+jOWr6jDl/xQTl/UpbdEvuysbkWitrrdakTiEN1nLPVAVMY LLivo4tgAOoh6gPGEOBv/hzC56N0+ZB/AolOJTrfohveTaf4oB0O8TGDYU7JGqR4k/pHQjuswf3 ARFIg22mjQz3ATDJ4F3wnk8lXDeaTe6U1YQ+RoiUjc6JE4RTn4QS+xcd/8Qzu5+t0wuwe2+z2bN ni2ZiydUMhJxQYx86s0APtwSesEYhhc1BIcSnD/aMr3/2ZrN1LITUtjK+pj9A0RbvWuRcioieXT YG5nDbIc6Nwhos8Md6M3gwnQ3ezRNsViJY1aQFSdXzfZQ02K+XLooWrcBe2NpH7lmP1UBW17cfm vwrRpo4HJPt3xowtwDCuADAsU7RyGaNydsybaERdd7wyXwM1AOUN76FXlB7iIuCn5SMG X-Received: by 2002:a05:7300:a506:b0:386:c960:278 with SMTP id 5a478bee46e88-386c9600557mr25907319eec.17.1796077871910; Mon, 30 Nov 2026 14:31:11 -0800 (PST) Received: from localhost ([2a00:79e0:2e7c:8:d64c:d468:46b8:64da]) by smtp.gmail.com with UTF8SMTPSA id 5a478bee46e88-386b9bdafb5sm69908199eec.9.2026.11.30.14.31.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2026 14:31:11 -0800 (PST) Date: Mon, 30 Nov 2026 14:31:09 -0800 From: Brian Norris To: "Rafael J. Wysocki" Cc: Linux PM , Alan Stern , Sakari Ailus , Ulf Hansson , Linux Driver Core Development Subject: Re: [PATCH v2 3/4] PM: runtime: Update last_busy in all rpm_idle() paths Message-ID: References: <4779892.LvFx2qVVIh@rafael.j.wysocki> <2373315.iZASKD2KPV@rafael.j.wysocki> X-Mailing-List: driver-core@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2373315.iZASKD2KPV@rafael.j.wysocki> On Tue, Nov 24, 2026 at 04:37:51PM +0100, Rafael J. Wysocki wrote: > From: "Rafael J. Wysocki" > > The changelog of commit 26236a3e8803 ("PM: runtime: Update last_busy > before calling rpm_suspend() in rpm_idle()") stated that rpm_idle() only > needed to update last_busy when it was about to call rpm_suspend(), but > that is incorrect. There are still cases in which a device may be > autosuspended earlier than expected. > > Namely, when rpm_idle() returns without calling rpm_suspend(), for example > because the callback has returned a transient error, while an autosuspend > timer is running, the timer may suspend the device without respecting the > autosuspend delay. Moreover, an autosuspend timer may fire while the > callback is running in rpm_idle() and it will not see the new last_busy > value in that case. > > To address these cases, add one more pm_runtime_mark_last_busy() call to > rpm_idle(), before the first retval check, and add a comment next to it > to explain the rationale for updating last_busy at that point. > > Fixes: 26236a3e8803 ("PM: runtime: Update last_busy before calling rpm_suspend() in rpm_idle()") > Signed-off-by: Rafael J. Wysocki > --- > > v1 -> v2: > * Address only one case addressed by the v1 (out of two) > * Add a new last_busy update instead of moving the existing one in case the > runtime idle callback waits for the device to become idle or similar I think there's a lot of noise in here about potentially-redundant last_busy updates, but I suppose that's a better problem to have than inconsistent/missing updates. I think we'd be in a happier world once rpm_idle() is gone. Reviewed-by: Brian Norris