Date: Mon, 6 Oct 2025 23:17:35 +0100 From: Jessica Clarke <jrtc27@freebsd.org> To: "Bjoern A. Zeeb" <bz@freebsd.org> Cc: Aymeric Wibo <obiwac@FreeBSD.org>, "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org> Subject: Re: git: a25cfcab9a9d - main - linuxkpi: Support s2idle in `pm_suspend_target_state` Message-ID: <579A2FBE-5EBD-41D4-97D4-14638A6120D4@freebsd.org> In-Reply-To: <p215n6qs-8321-89r-84oq-25q8n783p080@mnoonqbm.arg> References: <202510062150.596LoDYv072197@gitrepo.freebsd.org> <p215n6qs-8321-89r-84oq-25q8n783p080@mnoonqbm.arg>
next in thread | previous in thread | raw e-mail | index | archive | help
On 6 Oct 2025, at 23:02, Bjoern A. Zeeb <bz@freebsd.org> wrote: >=20 > On Mon, 6 Oct 2025, Aymeric Wibo wrote: >=20 >> The branch main has been updated by obiwac: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Da25cfcab9a9d2c7d733b85bf04b50436= 9623de1c >>=20 >> commit a25cfcab9a9d2c7d733b85bf04b504369623de1c >> Author: Aymeric Wibo <obiwac@FreeBSD.org> >> AuthorDate: 2025-10-06 21:38:58 +0000 >> Commit: Aymeric Wibo <obiwac@FreeBSD.org> >> CommitDate: 2025-10-06 21:49:54 +0000 >>=20 >> linuxkpi: Support s2idle in `pm_suspend_target_state` >>=20 >> 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. >>=20 >> This is necessary because more recent versions of the amdgpu DRM = drivers >> have different paths for when entering s2idle & S0ix is supported = than >> S3. >>=20 >> Reviewed by: bz >> Approved by: bz >=20 > I cannot apporve them; I am neither a mentor, srcmgr, re, or other = entity in this case. Having a src commit bit not under mentorship is enough. Jessica > 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). >=20 >=20 >> 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(-) >>=20 >> 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, >> } >>=20 >> 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 =3D ACPI_STATE_S3; >> - pm_suspend_target_state =3D 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 =3D ACPI_STATE_S3; >> + pm_suspend_target_state =3D PM_SUSPEND_TO_IDLE; >> + break; >> + case POWER_STYPE_SUSPEND_TO_MEM: >> + linux_acpi_target_sleep_state =3D ACPI_STATE_S3; >> + pm_suspend_target_state =3D PM_SUSPEND_MEM; >> + break; >> + default: >> + printf("%s: sleep type %d not yet supported\n", >> + __func__, stype); >> + break; >> + } >> } >>=20 >> static void >>=20 >=20 > --=20 > Bjoern A. Zeeb = r15:7
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?579A2FBE-5EBD-41D4-97D4-14638A6120D4>