From mboxrd@z Thu Jan 1 00:00:00 1970 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 D58C431353A for ; Mon, 20 Oct 2025 17:24:23 +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=1760981063; cv=none; b=GMjOnfGj0p/u75EdOtsCmdIjdgCJuZR8LlsTx1lqyYYNY+IIu4qo+vjji/nCvgEXe2pj/VQ0V+s1KlSrkGtCV+hTFRAaGoGnfBPXkgI1OG1WBBBOrMrCNQEjI/z+jXS2Q2HlPDBBXMt7z4cGU0trvsk3h9+mpCjwRB3u4mrXeVs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760981063; c=relaxed/simple; bh=uN4YzlNmTDyMTVbkr8hP6fCxIeShyG12ItAxTKnPx/U=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Dkv8UXEhwMibsOD0ZRxDY651FZrmddWiZPPRgN2KtBgQuytwPY/716dUIjtMf7SXZ/Q37vfXthC4bHtdyDcVRMkNZKE9RqNpkFdAiS5DQ69MteppnDEgj1JL046cKf/47r8Q9zHqyz5YBuMO22lyFMs1koc+5CYglZzphoD3jC8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cFac1jYc; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cFac1jYc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBF12C4CEF9; Mon, 20 Oct 2025 17:24:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1760981063; bh=uN4YzlNmTDyMTVbkr8hP6fCxIeShyG12ItAxTKnPx/U=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=cFac1jYc5I/mpLogrxJs+C1FSnV2hXbV3gLCdZCPseI5UTHbib0gaI8Bw7ULWpQRK /3yIC+HPGOrBZQrCrR/9ZHTVPQIlr+dHqzdvXocWj5RB89FAcpyaPYZtWDIaFf9ttH s458D7gJOxhlLDUeI7EcwRltwTNawyrHYamEDpgSKf7wyWVGjSZDtHU5HvA6IGCNaM jenI2DlyZ7AZ5vgD3amV/0/fmmetkdx+3pS5p7vQBfT9TRHuvadRfsd8+UpKjXmhmV mkKbzPz0qi7umxDfn/uTfqjzzrgG0pYTdz0wWLhQFfCeNLKH0PIa8bjc1pSCXPuvi2 mmYc2ddF7qVyw== Message-ID: Date: Mon, 20 Oct 2025 12:24:20 -0500 Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC 2/3] PM: Don't pass up device_resume() -EBUSY errors To: "Rafael J. Wysocki" Cc: mario.limonciello@amd.com, airlied@gmail.com, alexander.deucher@amd.com, christian.koenig@amd.com, dakr@kernel.org, gregkh@linuxfoundation.org, lenb@kernel.org, pavel@kernel.org, simona@ffwll.ch, Muhammad Usama Anjum , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-pm@vger.kernel.org References: <20251020165317.3992933-1-superm1@kernel.org> <20251020165317.3992933-3-superm1@kernel.org> Content-Language: en-US From: "Mario Limonciello (AMD) (kernel.org)" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 10/20/2025 12:18 PM, Rafael J. Wysocki wrote: > On Mon, Oct 20, 2025 at 6:53 PM Mario Limonciello (AMD) > wrote: >> >> From: Mario Limonciello >> >> If a device resume returns -EBUSY the device resume sequence has >> been skipped. > > Is this actually demonstrably true in all of the cases? > > And what about -EAGAIN? > I haven't audited codepaths of all drivers to guarantee it to be true for all cases. That's the main reason I wanted to make it RFC - to discuss the idea of a dedicated return code to indicate it was skipped. Another idea I had is that we could make it return a positive number, and PM core could recognize that as a skip. So would like your thoughts against the ideas currently presented: * -EAGAIN * -EBUSY * Some other return code * > 0 Whichever is decided the PM core documentation would need to be updated to match as well. >> Don't show errors for this or pass it up to async >> resume. If resume is run again in another stage the device should >> try again. >> >> Cc: Muhammad Usama Anjum >> Signed-off-by: Mario Limonciello (AMD) >> --- >> drivers/base/power/main.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c >> index bf9c3d79c455f..f6bc7ef9a8371 100644 >> --- a/drivers/base/power/main.c >> +++ b/drivers/base/power/main.c >> @@ -1112,7 +1112,9 @@ static void device_resume(struct device *dev, pm_message_t state, bool async) >> >> TRACE_RESUME(error); >> >> - if (error) { >> + if (error == -EBUSY) >> + pm_dev_dbg(dev, state, async ? " async" : ""); >> + else if (error) { >> WRITE_ONCE(async_error, error); >> dpm_save_failed_dev(dev_name(dev)); >> pm_dev_err(dev, state, async ? " async" : "", error); >> -- >> 2.43.0 >>