From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.181 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796077873; b=IS8sXUPLkdDmOHOrMFvKWZWClOOkyDeLnyBhWSRfwMlbUs+qTrFzhPVVUXepPeHj0wdl oviRcJSi757BckfGB2L/CwbPwNs53ZjTywB0ZHUAwXzuiLh0U6J4chj0+4rb6YicWgQrS qpJ43hSQ02GOBPzFNFcOKmw7ENCGPEnJdqdZI1OHej4BOdBYaPR6p44XNBmH8LtcDnRSn FvQI/4AQxG6NO9d1nVf5JAj/0fBd/V4axc0/dAaMcao0sWuF20gawRxJ0x1yweMM4RUZb WjFU36Xtg3TTffcGfG+UJPir9WX+ehnJGsPUjPtVyMgs3VvqOaj6e3Nkb5h1glMx4nQ== 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-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=Hmu4PtvjUCrA9kC3FAEUzx4KXm4Agpb1+sJmVonv2x8TYDY8a88OVmqY+eyxA8iyK5oS h2Q8MY1KQzz6hs+LVh3imeQ5+ZhG5qsja54k7aAd0M/EeQc0hcnMp0mlhgKuN+Mga5+Mt 5/26h4scpaHvLClpYECWRGWa14vZR18HK1C0BvA0j9u8IYh6mqbBr/AwjquxXGP3NlC3e 84V8j9yMBL0XzV732YsGcRjzp5yHb2w5iARpHLHHrOrMuDP1QneRZIjv833cjsAlhqt4D k2Rb6U4Bg7FDewRIGySSMx8FKvub+AnyT3x+Q9hi9rUtRZZ84M0fkCQX+dem1/gUa/g== 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="aGBj/y8E"; arc=none smtp.remote-ip=74.125.82.181 Received: from mail-dy1-f181.google.com (mail-dy1-f181.google.com [74.125.82.181]) (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 D2BD4606A325 for ; Mon, 30 Nov 2026 22:31:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D2BD4606A325 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) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=aGBj/y8E Received: by mail-dy1-f181.google.com with SMTP id 5a478bee46e88-3863db981d4so15350196eec.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=vger.kernel.org; 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=aGBj/y8E5dhbxuyXTZiQ9EqdMSkbIuDT67c6wdXzpXyoeMdhclKCzDwoXbcMiacmV8 +WrJsG+/QGt+bE0dZq0tqs5l4K9rR3TLGUmkEnrKxuUpbSqA2cO3C9fAORc/2tqOxhYf KQbqtRo/rVLti3nCVi1Ha/C+hFza+AsUL9xm0= 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=YUaDulLH8doafgfZZVm71qycKmLbVNmTzU8AnuSrfmEU2v8hWD2YeWpGVM3EKVC6DB tKxdYpgZsAMDN84UmEL28PLO3/+TLhJo9dJp5qTScFCbzFSceMJvpWHUpIh5XQt8rOY+ sPhKq+y8cdPZ1KMv3FURGBQM9uTUeRfwqgv1H2tMqcmIzO4E9xbxO4GBDVDpZMCYwDgj oUS7AWhsoRviXwZE2ELHBKhYkzaFBqY8vEYyjJL8qzWYm3KxIn8b4zQVtY8mJXPO4ef/ YpvrZPtF5Fd8aDTNWhmASbVSeFDa/Q62h9u474W+UG5PJys6E5eg8abTUauSMo27dZW3 1GjA== X-Gm-Message-State: APuU4Z8htdzvMNBZfkiScG0JfVprAd8wmyikZY5QNYYW1I/l5bqRN2U8 ofTD23bFdVgLARcfYRKnyTFks55xI9+EZpgfPTZvY91ZMM0OGAeUIzDC8gzLX9Z0pw== X-Gm-Gg: AZFdTZdq1JGqHA9J6mVQ2+3Rp9QAnZXDdxCHn3l8KHVgeU0nHE1376g/ge6oVC3mc+O scU5bL+PHp7Im9bKeEjRosqbfQmrn23/NkHY+cWd4VGniMG8TwmJ/cLG3/7TuRzt8XzFlPm8HK0 s8aBpuh7h1A/2kp4GEtHr4kMkCRSciSgECv+5hZV9qNHWKLz9qgVV23ibk6/KDT82LmYx8mHQSq dFeWIU53JvJaCqz8DJMB9IyKrvsw0W6qFlzCdx6NlB6Jkc1VQqVAQPAxp0CA+rgfgwz7lELfZjc 5n04lxcAcZd1LXRvcf9bsAgDpKWsBoBr+2RF0lEZlGKt5jTWdlY7WsJbA8e1JxlqqThWJDl2aPC kaYVA48L6m7LGyLIvOHDQyiFzVwR3ZkvOt2yCMWJU47Q6FqyCk+JPddRwE8P9K/sP7RjU2m/RMh QnXRxoZGaAcT+Ck265QOmol6SMr+u0UXq+2sTF/lE9gSuOOLNs8DnVTPrBvDXS6zg51hz65hxnu JsG9cNXHVlkiCsGGp0aYTEs0nQB/B5uB7gmkpx79RbRi55a91wC3b5oISXEkZPUrxb61V1L8Vh1 u5/g1/tCGez1vKkKXbV93WF3E2sYokuCgzeqolhhGc7Z+1SO58fN/12I/iiE8gOq1PQc 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: linux-pm@vger.kernel.org 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