From nobody Mon Oct 06 22:02:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cgYDG6Kpkz6Bfcg; Mon, 06 Oct 2025 22:02:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cgYDG5KTZz3Z8f; Mon, 06 Oct 2025 22:02:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759788174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Ibc/geYUiUOjKIQ58ePzUMJlGND+Ru+wg7pclmYR6/Q=; b=veMVIE9R+HGWPHRfRkF/27FRsvnTpTbB3y2GknUik/Ahwa3W7voKCczt9t1de1UBNifTog II19sKDllwKWHoFShSlHl8Q99TnqldWyxTLOWMDeVVlLD9J5RAw7ws1ynz3KrUA5zE5qx7 oQTwRR7brTG5nLSvaKepNjCLVo990CZL4UBXDcq67yFmyAGxqs1Bi8rfoSWWo1Exx/o8SN 5eqQ4bDJg27r9N0RLU8zDZbUz6Myu003oULOTyfSSkgPsmzJpV4qC36VF1345Z0IU/gjQo sP7pH+G9cXYq3SHVQVkWa2ta7lLPWNqPCARnlDWoZDBGF3H2Rli9YS6yjT5JSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759788174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Ibc/geYUiUOjKIQ58ePzUMJlGND+Ru+wg7pclmYR6/Q=; b=ptqs1/353Byyl/NNP1Gmc6mqO4axMYWpG4YHb3nSeDhJ27cCx7411ZEoScNHbLaJqDCRt0 +Sgla7Db0U3Xpojgqj6aiYqmdrhpezwwcApbYr+68rChCegEa26U3ooWB2vpZYNBVwP+BB +hExltnxKyUjNg0y12c8WK14VI4c+rbV9fHcANQZQ+8x0a6OWMJHgTMw2HZ3uPcSaLjCOs CVP2UcwogSYbnTDL6ifI9lnOwGOgRcI3/0/VJCJW+Ii9zDPDqmhYm4uju7mK3VAIxMnZIP AfK9/F0iU0WkiqFo4EznlUosKHB8cYK2t4Mlch2dImghlNmxHoPooU+PDOWfIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759788174; a=rsa-sha256; cv=none; b=qNtZSIibDm9pKcAOIVOMalj+JrGqkVK9cTeKuU1GngqNii6K4+N3vuc7w0zIcfQNqAKkgS Bn2/MnXnIg1SszOEABZwU35vmlv3S0JfespRucOE2G5/c5xlwF+WVPpjL/vEH9xTtCmL9C VEx7a0xbV2MKoTZA+4B9MTPTkE1hLNK8UHPahjxI9YgmsHUQMJT6bRvxikGzhQGmnN0Vuv FlzmcTj0vNoSvnq7+ASJukeEt5Y1BwYlBmcDOpa9L4yZ1u3QUNLA02vl0ex4E6r5SC2Wmx WLkEzfeNmRhaTbWZkQyabvT1wCGd62qFp6J9oSvvCWwMhFc/igzEUoh0rsVHKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E6" (verified OK)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4cgYDG47rLz10dW; Mon, 06 Oct 2025 22:02:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id D3A24A64808; Mon, 06 Oct 2025 22:02:42 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id C82242D029E7; Mon, 6 Oct 2025 22:02:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id 2LuSTh7y1eJp; Mon, 6 Oct 2025 22:02:51 +0000 (UTC) Received: from nv.t4-02.sbone.de (nv.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:22]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 423462D029D8; Mon, 6 Oct 2025 22:02:51 +0000 (UTC) Date: Mon, 6 Oct 2025 22:02:51 +0000 (UTC) From: "Bjoern A. Zeeb" To: Aymeric Wibo cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a25cfcab9a9d - main - linuxkpi: Support s2idle in `pm_suspend_target_state` In-Reply-To: <202510062150.596LoDYv072197@gitrepo.freebsd.org> Message-ID: References: <202510062150.596LoDYv072197@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Mon, 6 Oct 2025, Aymeric Wibo wrote: > The branch main has been updated by obiwac: > > URL: https://cgit.FreeBSD.org/src/commit/?id=a25cfcab9a9d2c7d733b85bf04b504369623de1c > > commit a25cfcab9a9d2c7d733b85bf04b504369623de1c > Author: Aymeric Wibo > AuthorDate: 2025-10-06 21:38:58 +0000 > Commit: Aymeric Wibo > CommitDate: 2025-10-06 21:49:54 +0000 > > linuxkpi: Support s2idle in `pm_suspend_target_state` > > When going to s2idle, set Linux' pm_suspend_target_state to > PM_SUSPEND_TO_IDLE instead of setting PM_SUSPEND_MEM (for S3) in all > cases. > > This is necessary because more recent versions of the amdgpu DRM drivers > have different paths for when entering s2idle & S0ix is supported than > S3. > > Reviewed by: bz > Approved by: bz I cannot apporve them; I am neither a mentor, srcmgr, re, or other entity in this case. But thank you for splitting them up into two logical chunks (with the only bit that adding the enum here should have been part of the other half so each of them would have compiled independently). > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D51591 > --- > sys/compat/linuxkpi/common/src/linux_acpi.c | 30 +++++++++++++++++++---------- > 1 file changed, 20 insertions(+), 10 deletions(-) > > diff --git a/sys/compat/linuxkpi/common/src/linux_acpi.c b/sys/compat/linuxkpi/common/src/linux_acpi.c > index 60e14cfc98c5..c7d62c745c7e 100644 > --- a/sys/compat/linuxkpi/common/src/linux_acpi.c > +++ b/sys/compat/linuxkpi/common/src/linux_acpi.c > @@ -119,17 +119,27 @@ acpi_evaluate_dsm(ACPI_HANDLE ObjHandle, const guid_t *guid, > } > > static void > -linux_handle_power_suspend_event(void *arg __unused, > - enum power_stype stype __unused) > +linux_handle_power_suspend_event(void *arg __unused, enum power_stype stype) > { > - /* > - * Only support S3 for now. > - * acpi_sleep_event isn't always called so we use power_suspend_early > - * instead which means we don't know what state we're switching to. > - * TODO: Make acpi_sleep_event consistent > - */ > - linux_acpi_target_sleep_state = ACPI_STATE_S3; > - pm_suspend_target_state = PM_SUSPEND_MEM; > + switch (stype) { > + case POWER_STYPE_SUSPEND_TO_IDLE: > + /* > + * XXX: obiwac Not 100% sure this is correct, but > + * acpi_target_sleep_state does seem to be set to > + * ACPI_STATE_S3 during s2idle on Linux. > + */ > + linux_acpi_target_sleep_state = ACPI_STATE_S3; > + pm_suspend_target_state = PM_SUSPEND_TO_IDLE; > + break; > + case POWER_STYPE_SUSPEND_TO_MEM: > + linux_acpi_target_sleep_state = ACPI_STATE_S3; > + pm_suspend_target_state = PM_SUSPEND_MEM; > + break; > + default: > + printf("%s: sleep type %d not yet supported\n", > + __func__, stype); > + break; > + } > } > > static void > -- Bjoern A. Zeeb r15:7