From nobody Wed Aug 14 19:00:16 2024 X-Original-To: freebsd-acpi@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 4Wkcyk4wx5z5SfVZ for ; Wed, 14 Aug 2024 19:00:30 +0000 (UTC) (envelope-from megamansec@gmail.com) Received: from mail-vk1-xa31.google.com (mail-vk1-xa31.google.com [IPv6:2607:f8b0:4864:20::a31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wkcyj2YWHz446B for ; Wed, 14 Aug 2024 19:00:29 +0000 (UTC) (envelope-from megamansec@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=Vpz0g8K4; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of megamansec@gmail.com designates 2607:f8b0:4864:20::a31 as permitted sender) smtp.mailfrom=megamansec@gmail.com Received: by mail-vk1-xa31.google.com with SMTP id 71dfb90a1353d-4f527c0c959so80608e0c.1 for ; Wed, 14 Aug 2024 12:00:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723662028; x=1724266828; darn=freebsd.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=d73nn3nZsXDjPaMKoRmocVwhq5Keew1AoZgoMTIZlsg=; b=Vpz0g8K4Gm1pDzTYLWJ3/7V3zS+d3W+5I2I5f0VRyYLUk1UDZpeoGuVCDVH0W3YdHB 60jPdBHHZjVX2gCdVwKf1J7IzvKMQdIK1xmALfc9WRbEdWtc0f+8FG73FstezL1HQ+28 +rlvT5NJIt+FTmTMntmIEkUEMpryOR96FkcS96ocZYGVzSnqarg1ujm3/OPxRzuAvspS mSjKtsystT3zvrqPThZukrC5r9CL9NYGvZAJos0UksCFByJXw30DYVEAZVQkWUvndFO6 TOug+hW3IeV+YIwF2CyP1ninLjvFMEUIwNSINfChpGrV3/bXstzzFkQooSYd3TYk8eYR pnbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723662028; x=1724266828; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=d73nn3nZsXDjPaMKoRmocVwhq5Keew1AoZgoMTIZlsg=; b=QBexP1vsaMiZOGdqIwP/+DzfzKKs5g8QqMhHYfKshlhFqDMae0/BoOmBhaPE48Im6F zZNynr6WXiiuxSjCRuGZ6SzXszAz5eBzL4/1M6t8pypUd3H7vvGk70tTpquJsKhPIM2+ WRxtns6A4rfP6L422doYIntYg10O9+zTqTjsawn6hptqHyoYxLFlHAHWokzX8k78YK42 58eO1f4NfHd7zh7A5NhCScfCMk8Cg3qJ8ZiC88XRCMnZpTz6azf/XzkLSYmU5qou009q uk31OuNsGCBHPlehlo7tgRyLMn0Pw2za3PsEI9krKpusIvwwTWzjdZoUW3MMC6V6Ormj wwGQ== X-Gm-Message-State: AOJu0Yyor2Uz0uW93WlKqe3vwowRptzNqpKRduAZIX6RSnky9keR/uHv 50aRfNs7Zwe06y5519wosGQg6DzmtL0DU9rmgqgr6HUC6a8waDwnSmogh+aNos4JpZ3w5X2EewV zvDCqgIwZDjbqjA+bCxQ/DxohbfSpHvAE X-Google-Smtp-Source: AGHT+IHP38yiYGU5zKCPjYcFrOz1Sct33eSVk2tVvKHQSJoJj/cKBDJxQIJOb13R74/CO9NJxuWcOme7iTcpKUOy2GU= X-Received: by 2002:a05:6122:3c8b:b0:4ec:f8e4:e0bf with SMTP id 71dfb90a1353d-4fad1b0ef62mr5182502e0c.2.1723662027431; Wed, 14 Aug 2024 12:00:27 -0700 (PDT) List-Id: ACPI and power management development List-Archive: https://lists.freebsd.org/archives/freebsd-acpi List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-acpi@FreeBSD.org MIME-Version: 1.0 References: In-Reply-To: From: Joshua Rogers Date: Wed, 14 Aug 2024 21:00:16 +0200 Message-ID: Subject: Re: suspend/resume on MacbookPro11.4 without X To: freebsd-acpi@freebsd.org Content-Type: multipart/alternative; boundary="000000000000dba6fe061fa95685" X-Spamd-Bar: --- X-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCPT_COUNT_ONE(0.00)[1]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FREEMAIL_FROM(0.00)[gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; PREVIOUSLY_DELIVERED(0.00)[freebsd-acpi@freebsd.org]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MISSING_XM_UA(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MLMMJ_DEST(0.00)[freebsd-acpi@freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::a31:from] X-Rspamd-Queue-Id: 4Wkcyj2YWHz446B --000000000000dba6fe061fa95685 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ah, I see this is specifically mentioned at https://docs.freebsd.org/en/books/handbook/config/index.html#acpi-overview: " In order for the suspend/resume functionality to work correctly the graphics drivers must be loaded on the system." So, I need to ensure that X is loaded before the system is ever suspended (like the lid being closed). Is there any way to ensure that X is loaded before hw.acpi.power_button_state or hw.acpi.lid_switch_state cause a suspension? On Wed, Aug 7, 2024 at 8:53=E2=80=AFPM Joshua Rogers = wrote: > Hi all, > > I'm currently battling with a Macbook Pro 11.4, attempting to get all of > its hardware supported on FreeBSD. At the moment, I'm investigating wheth= er > it is possible to get suspend/resume working at on 13.3-RELEASE-p4. > > I've exhibited a few different behaviors: > > Using the inbuilt SSD/NVMe ("SM951 AHCI"), I exhibit the following > behaviour: > > 1A. No X, Using debug.acpi.suspend_bounce=3D1: > Successfully resumes, but the disk becomes unreadable/unwritable. The > keyboard is responsive but the mouse is not. I can continue some actions, > but clearly only what is cached in memory. I don't know whether this is > expected: I'm using ZFS with full disk encryption. > > 1B. No X, using debug.acpi.suspend_bounce=3D0: > The screen does not turn back on: but everything else seems to work like > beep, drive read/writing, keyboard, etc (I'm basically just typing in the > blind). > > > 2A. Using X and suspend_bounce=3D1: > The screen resumes but the disk becomes unreadable writable. The keyboard > is responsive but the mouse is not. The same as without X > > 2B. Using X and debug.acpi.suspend_bounce=3D0: > Everything works as well as expected. Keyboard and mouse work. Writing to > the disk works. > > --- > > For the non-X use cases, I've built the kernel with the following minimal > configuration [config.txt]. A more minimal version may work, but I didn't > bother to trim it down any further. The behavior exhibited by the > suspension is the same as when built normally. > > At the moment, case 2B is fine: I use X most of the time, and I don't use > suspend_bounce. But I would like to fiz the 1B case at least (no X). Are > there any suggestions of how to debug this? > > FYI: It looks like the Linux kernel went through an issue with this > version of the Macbook too: > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit= /?id=3D13cfc732160f > / https://bugzilla.kernel.org/show_bug.cgi?id=3D103211. I've attempted t= o > recreate the patch and it loads, but does not seem to do anything > [asmc-patch.c.patch]. I have no idea if it is relevant or not. > > An initial HW_PROBE can be found here: > https://bsd-hardware.info/?probe=3D6bade1eaf8 > > Cheers, > Joshua. > --000000000000dba6fe061fa95685 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
"=C2=A0=C2=A0 In order for the suspend/resume func= tionality to work correctly the graphics drivers must be loaded on the syst= em."

So, I need to ensure that X is loaded be= fore the system is ever suspended (like the lid being closed). Is there any= way to ensure that X is loaded before hw.acpi.power_button_state or hw.acp= i.lid_switch_state cause a suspension?

On Wed, Aug 7, 2024 at 8:53= =E2=80=AFPM Joshua Rogers <megam= ansec@gmail.com> wrote:
Hi all,

I'm currentl= y battling with a Macbook Pro 11.4, attempting to get all of its hardware s= upported on FreeBSD. At the moment, I'm investigating whether it is pos= sible to get suspend/resume working at on 13.3-RELEASE-p4.

I've exhibited a few different behaviors:

=
Using the inbuilt SSD/NVMe ("SM951 AHCI"), I exhibit the fol= lowing behaviour:

1A. No X, Using=C2=A0debug.acpi.= suspend_bounce=3D1:
Successfully resumes, but the disk becomes un= readable/unwritable. The keyboard is responsive but the mouse is not. I can= continue some actions, but clearly only what is cached in memory. I don= 9;t know whether this is expected: I'm using ZFS with full disk encrypt= ion.=C2=A0

1B. No X, using debug.acpi.suspend_boun= ce=3D0:
The screen does not turn back on: but everything else see= ms to work like beep, drive read/writing, keyboard, etc (I'm basically = just typing in the blind).=C2=A0


2A= . Using X and suspend_bounce=3D1:
The screen resumes but the disk= becomes unreadable writable. The keyboard is responsive but the mouse is n= ot. The same as without X

2B. Using X and debug.ac= pi.suspend_bounce=3D0:
Everything works as well as expected. Keyb= oard and mouse work. Writing to the disk works.=C2=A0

<= div>---

For the non-X use cases, I've built th= e kernel with the following minimal configuration [config.txt]. A more mini= mal version may work, but I didn't bother to trim it down any further. = The behavior exhibited by the suspension is the same as when built normally= .

At the moment, case 2B is fine: I use X most of = the time, and I don't use suspend_bounce. But I would like to fiz the 1= B case at least (no X). Are there any suggestions of how to debug this?

FYI: It looks like the Linux kernel went through an i= ssue with this version of the Macbook too:=C2=A0https://git.kernel.org/pub/scm/linux/kernel/git/torval= ds/linux.git/commit/?id=3D13cfc732160f=C2=A0/=C2=A0https://bugz= illa.kernel.org/show_bug.cgi?id=3D103211. I've attempted to recreat= e the patch and it loads, but does not seem to do anything [asmc-patch.c.pa= tch]. I have no idea if it is relevant or not.

An = initial HW_PROBE can be found here:=C2=A0https://bsd-hardware.info/?probe= =3D6bade1eaf8

Cheers,
Joshua.
<= /div>
--000000000000dba6fe061fa95685--