Skip to content

Fix/atcphy pipehandler - #503

Open
milijan wants to merge 4407 commits into
AsahiLinux:asahifrom
milijan:fix/atcphy-pipehandler
Open

milijan wants to merge 4407 commits into
AsahiLinux:asahifrom
milijan:fix/atcphy-pipehandler

Conversation

@milijan

@milijan milijan commented May 28, 2026

Copy link
Copy Markdown

Two fixes observed on J313 (M1 MacBook Air) with a USB-C multiport hub:

  • Retry pipehandler lock with backoff: Replace the single poll with up to 10 retries at 5–10 ms intervals (~100 ms total). Avoids having to hard cycle the usb-c connection.

  • Fix teardown race and spurious WARN on USB3_DP. Scope the WARN to the failure case only.

Tested on Fedora Asahi Remix 44, kernel 6.19.

vanyuan599 and others added 30 commits April 22, 2026 13:30
[ Upstream commit 7a57354 ]

Add missing error handling for mcp251x_power_enable() calls in both
mcp251x_open() and mcp251x_can_resume() functions.

In mcp251x_open(), if power enable fails, jump to error path to close
candev without attempting to disable power again.

In mcp251x_can_resume(), properly check return values of power enable calls
for both power and transceiver regulators. If any fails, return the error
code to the PM framework and log the failure.

This ensures the driver properly handles power control failures and
maintains correct device state.

Signed-off-by: Wenyuan Li <2063309626@qq.com>
Link: https://patch.msgid.link/tencent_F3EFC5D7738AC548857B91657715E2D3AA06@qq.com
[mkl: fix patch description]
[mkl: mcp251x_can_resume(): replace goto by return]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit 2594196 ]

Add a DMI quirk entry for ASUS HN7306EA in the ACP SoundWire legacy
machine driver.

Set driver_data to ASOC_SDW_ACP_DMIC for this board so the
platform-specific DMIC quirk path is selected.

Signed-off-by: Hasun Park <hasunpark@gmail.com>
Link: https://patch.msgid.link/20260319163321.30326-1-hasunpark@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit b8bee48 ]

The build can fail with:

ERROR: modpost: "__auxiliary_driver_register"
[sound/usb/qcom/snd-usb-audio-qmi.ko] undefined!
ERROR: modpost: "auxiliary_driver_unregister"
[sound/usb/qcom/snd-usb-audio-qmi.ko] undefined!

Select AUXILIARY_BUS when SND_USB_AUDIO_QMI is enabled.

Signed-off-by: Frank Zhang <rmxpzlb@gmail.com>
Link: https://patch.msgid.link/20260317102527.556248-1-rmxpzlb@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
…302EAC

[ Upstream commit 0198d27 ]

The ASUS ROG Flow Z13-KJP GZ302EAC model uses sys_vendor name ASUS
rather than ASUSTeK COMPUTER INC., but it needs the same folio quirk as
the other ROG Flow Z13. To keep things simple, just match on sys_vendor
ASUS since it covers both.

Signed-off-by: Matthew Schwartz <matthew.schwartz@linux.dev>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Reviewed-by: Denis Benato <denis.benato@linux.dev>
Link: https://patch.msgid.link/20260312212246.1608080-1-matthew.schwartz@linux.dev
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit 5254d41 ]

When logging that an inode exists, as part of logging a new name or
logging new dir entries for a directory, we always set the generation of
the logged inode item to 0. This is to signal during log replay (in
overwrite_item()), that we should not set the i_size since we only logged
that an inode exists, so the i_size of the inode in the subvolume tree
must be preserved (as when we log new names or that an inode exists, we
don't log extents).

This works fine except when we have already logged an inode in full mode
or it's the first time we are logging an inode created in a past
transaction, that inode has a new i_size of 0 and then we log a new name
for the inode (due to a new hardlink or a rename), in which case we log
an i_size of 0 for the inode and a generation of 0, which causes the log
replay code to not update the inode's i_size to 0 (in overwrite_item()).

An example scenario:

  mkdir /mnt/dir
  xfs_io -f -c "pwrite 0 64K" /mnt/dir/foo

  sync

  xfs_io -c "truncate 0" -c "fsync" /mnt/dir/foo

  ln /mnt/dir/foo /mnt/dir/bar

  xfs_io -c "fsync" /mnt/dir

  <power fail>

After log replay the file remains with a size of 64K. This is because when
we first log the inode, when we fsync file foo, we log its current i_size
of 0, and then when we create a hard link we log again the inode in exists
mode (LOG_INODE_EXISTS) but we set a generation of 0 for the inode item we
add to the log tree, so during log replay overwrite_item() sees that the
generation is 0 and i_size is 0 so we skip updating the inode's i_size
from 64K to 0.

Fix this by making sure at fill_inode_item() we always log the real
generation of the inode if it was logged in the current transaction with
the i_size we logged before. Also if an inode created in a previous
transaction is logged in exists mode only, make sure we log the i_size
stored in the inode item located from the commit root, so that if we log
multiple times that the inode exists we get the correct i_size.

A test case for fstests will follow soon.

Reported-by: Vyacheslav Kovalevsky <slava.kovalevskiy.2014@gmail.com>
Link: https://lore.kernel.org/linux-btrfs/af8c15fa-4e41-4bb2-885c-0bc4e97532a6@gmail.com/
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit 84d29bf ]

The HP Omen 16-wf1xxx (board ID: 8C76) has the same WMI interface as
other Victus S boards, but requires quirks for correctly switching
thermal profile (similar to board 8C78).

Add the DMI board name to victus_s_thermal_profile_boards[] table and
map it to omen_v1_thermal_params.

Testing on board 8C76 confirmed that platform profile is registered
successfully and fan RPMs are readable and controllable.

Tested-by: WJ Enderlava <jie7172585@gmail.com>
Reported-by: WJ Enderlava <jie7172585@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221149
Signed-off-by: Krishna Chomal <krishna.chomal108@gmail.com>
Link: https://patch.msgid.link/20260227154106.226809-1-krishna.chomal108@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
…_sync_file()

[ Upstream commit a85b46d ]

If overlay is used on top of btrfs, dentry->d_sb translates to overlay's
super block and fsid assignment will lead to a crash.

Use file_inode(file)->i_sb to always get btrfs_sb.

Reviewed-by: Boris Burkov <boris@bur.io>
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit 2f388b4 ]

The HP Pavilion 15-eg0xxx with subsystem ID 0x103c87cb uses a Realtek
ALC287 codec with a mute LED wired to GPIO pin 4 (mask 0x10). The
existing ALC287_FIXUP_HP_GPIO_LED fixup already handles this correctly,
but the subsystem ID was missing from the quirk table.

GPIO pin confirmed via manual hda-verb testing:
  hda-verb SET_GPIO_MASK 0x10
  hda-verb SET_GPIO_DIRECTION 0x10
  hda-verb SET_GPIO_DATA 0x10

Signed-off-by: César Montoya <sprit152009@gmail.com>
Link: https://patch.msgid.link/20260321153603.12771-1-sprit152009@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit bffcaad ]

Holding reference on the expectation is not sufficient, the master
conntrack object can just go away, making exp->master invalid.

To access exp->master safely:

- Grab the nf_conntrack_expect_lock, this gets serialized with
  clean_from_lists() which also holds this lock when the master
  conntrack goes away.

- Hold reference on master conntrack via nf_conntrack_find_get().
  Not so easy since the master tuple to look up for the master conntrack
  is not available in the existing problematic paths.

This patch goes for extending the nf_conntrack_expect_lock section
to address this issue for simplicity, in the cases that are described
below this is just slightly extending the lock section.

The add expectation command already holds a reference to the master
conntrack from ctnetlink_create_expect().

However, the delete expectation command needs to grab the spinlock
before looking up for the expectation. Expand the existing spinlock
section to address this to cover the expectation lookup. Note that,
the nf_ct_expect_iterate_net() calls already grabs the spinlock while
iterating over the expectation table, which is correct.

The get expectation command needs to grab the spinlock to ensure master
conntrack does not go away. This also expands the existing spinlock
section to cover the expectation lookup too. I needed to move the
netlink skb allocation out of the spinlock to keep it GFP_KERNEL.

For the expectation events, the IPEXP_DESTROY event is already delivered
under the spinlock, just move the delivery of IPEXP_NEW under the
spinlock too because the master conntrack event cache is reached through
exp->master.

While at it, add lockdep notations to help identify what codepaths need
to grab the spinlock.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit 4e9597f ]

During a GPU page fault, the driver restores the SVM range and then maps it
into the GPU page tables. The current implementation passes a GPU-page-size
(4K-based) PFN to svm_range_restore_pages() to restore the range.

SVM ranges are tracked using system-page-size PFNs. On systems where the
system page size is larger than 4K, using GPU-page-size PFNs to restore the
range causes two problems:

Range lookup fails:
Because the restore function receives PFNs in GPU (4K) units, the SVM
range lookup does not find the existing range. This will result in a
duplicate SVM range being created.

VMA lookup failure:
The restore function also tries to locate the VMA for the faulting address.
It converts the GPU-page-size PFN into an address using the system page
size, which results in an incorrect address on non-4K page-size systems.
As a result, the VMA lookup fails with the message: "address 0xxxx VMA is
removed".

This patch passes the system-page-size PFN to svm_range_restore_pages() so
that the SVM range is restored correctly on non-4K page systems.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Donet Tom <donettom@linux.ibm.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 074fe39)
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit a6fc88b ]

Tiny SRCU's srcu_gp_start_if_needed() directly calls schedule_work(),
which acquires the workqueue pool->lock.

This causes a lockdep splat when call_srcu() is called with a scheduler
lock held, due to:

  call_srcu() [holding pi_lock]
    srcu_gp_start_if_needed()
      schedule_work() -> pool->lock

  workqueue_init() / create_worker() [holding pool->lock]
    wake_up_process() -> try_to_wake_up() -> pi_lock

Also add irq_work_sync() to cleanup_srcu_struct() to prevent a
use-after-free if a queued irq_work fires after cleanup begins.

Tested with rcutorture SRCU-T and no lockdep warnings.

[ Thanks to Boqun for similar fix in patch "rcu: Use an intermediate irq_work
to start process_srcu()" ]

Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Boqun Feng <boqun@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit faceb5c ]

HP Laptop 15-fd0xxx with ALC236 codec does not handle the toggling of
the mute LED.
This patch adds a quirk entry for subsystem ID 0x8dd7 using
ALC236_FIXUP_HP_MUTE_LED_COEFBIT2 fixup, enabling correct mute LED
behavior.

Signed-off-by: Kshamendra Kumar Mishra <kshamendrakumarmishra@gmail.com>
Link: https://patch.msgid.link/DHAB51ISUM96.2K9SZIABIDEQ0@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
…piry

[ Upstream commit d3c0037 ]

New test case fails unexpectedly when avx2 matching functions are used.

The test first loads a ranomly generated pipapo set
with 'ipv4 . port' key, i.e.  nft -f foo.

This works.  Then, it reloads the set after a flush:
(echo flush set t s; cat foo) | nft -f -

This is expected to work, because its the same set after all and it was
already loaded once.

But with avx2, this fails: nft reports a clashing element.

The reported clash is of following form:

    We successfully re-inserted
      a . b
      c . d

Then we try to insert a . d

avx2 finds the already existing a . d, which (due to 'flush set') is marked
as invalid in the new generation.  It skips the element and moves to next.

Due to incorrect masking, the skip-step finds the next matching
element *only considering the first field*,

i.e. we return the already reinserted "a . b", even though the
last field is different and the entry should not have been matched.

No such error is reported for the generic c implementation (no avx2) or when
the last field has to use the 'nft_pipapo_avx2_lookup_slow' fallback.

Bisection points to
7711f4b ("netfilter: nft_set_pipapo: fix range overlap detection")
but that fix merely uncovers this bug.

Before this commit, the wrong element is returned, but erronously
reported as a full, identical duplicate.

The root-cause is too early return in the avx2 match functions.
When we process the last field, we should continue to process data
until the entire input size has been consumed to make sure no stale
bits remain in the map.

Link: https://lore.kernel.org/netfilter-devel/20260321152506.037f68c0@elisabeth/
Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
…form

[ Upstream commit d3be95e ]

On the HP EliteBoard G1a platform (models without a headphone jack).
the speaker mute LED failed to function. The Sysfs ctl-led info showed
empty values because the standard LED registration couldn't correctly
bind to the master switch.
Adding this patch will fix and enable the speaker mute LED feature.

Tested-by: Chris Chiu <chris.chiu@canonical.com>
Signed-off-by: Kailang Yang <kailang@realtek.com>
Link: https://lore.kernel.org/279e929e884849df84687dbd67f20037@realtek.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit bac1e57 ]

Similar to commit 7b50991 ("ALSA hda/realtek: Add quirk for
Framework F111:000C") and previous quirks for Framework systems with
Realtek codecs.

000F is another new platform with an ALC285 which needs the same quirk.

Signed-off-by: Dustin L. Howett <dustin@howett.net>
Link: https://patch.msgid.link/20260327-framework-alsa-000f-v1-1-74013aba1c00@howett.net
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit 0fd56fa ]

wl1251_tx_packet_cb() uses the firmware completion ID directly to index
the fixed 16-entry wl->tx_frames[] array. The ID is a raw u8 from the
completion block, and the callback does not currently verify that it
fits the array before dereferencing it.

Reject completion IDs that fall outside wl->tx_frames[] and keep the
existing NULL check in the same guard. This keeps the fix local to the
trust boundary and avoids touching the rest of the completion flow.

Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260323080845.40033-1-pengpeng@iscas.ac.cn
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit b9eff97 ]

Component has "card_aux_list" which is added/deled in bind/unbind aux dev
function (A), and used in for_each_card_auxs() loop (B).

	static void soc_unbind_aux_dev(...)
	{
		...
		for_each_card_auxs_safe(...) {
			...
(A)			list_del(&component->card_aux_list);
		}			     ^^^^^^^^^^^^^
	}

	static int soc_bind_aux_dev(...)
	{
		...
		for_each_card_pre_auxs(...) {
			...
(A)			list_add(&component->card_aux_list, ...);
		}			     ^^^^^^^^^^^^^
		...
	}

	#define for_each_card_auxs(card, component)	\
(B)		list_for_each_entry(component, ..., card_aux_list)
						    ^^^^^^^^^^^^^

But it has been used without calling INIT_LIST_HEAD().

	> git grep card_aux_list sound/soc
	sound/soc/soc-core.c:           list_del(&component->card_aux_list);
	sound/soc/soc-core.c:           list_add(&component->card_aux_list, ...);

call missing INIT_LIST_HEAD() for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87341mxa8l.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit ea31be8 ]

There is another Book2 Pro model (NP950QED) that seems equipped with
the same speaker module as the non-360 model, which requires
ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS quirk.

Reported-by: Throw <zakkabj@gmail.com>
Link: https://patch.msgid.link/20260330162249.147665-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit bc5b4e5 ]

The NeuralDSP Quad Cortex does not support DSD playback. We need
this product-specific entry with zero quirks because otherwise it
falls through to the vendor-specific entry which marks it as
supporting DSD playback.

Cc: Yue Wang <yuleopen@gmail.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Signed-off-by: Phil Willoughby <willerz@gmail.com>
Link: https://patch.msgid.link/20260328080921.3310-1-willerz@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit e6c8882 ]

The Pin Complex 0x17 (bass/woofer speakers) is incorrectly reported as
unconnected in the BIOS (pin default 0x411111f0 = N/A). This causes the
kernel to configure speaker_outs=0, meaning only the tweeters (pin 0x14)
are used. The result is very low, tinny audio with no bass.

The existing quirk ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN (already present
in patch_realtek.c for SSID 0x17aa3801) fixes the issue completely.

Reported-by: Garcicasti <andresgarciacastilla@gmail.com>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=221298
Signed-off-by: songxiebing <songxiebing@kylinos.cn>
Link: https://patch.msgid.link/20260331033650.285601-1-songxiebing@kylinos.cn
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
…l stack size to GPU page size

[ Upstream commit 78746a4 ]

The control stack size is calculated based on the number of CUs and
waves, and is then aligned to PAGE_SIZE. When the resulting control
stack size is aligned to 64 KB, GPU hangs and queue preemption
failures are observed while running RCCL unit tests on systems with
more than two GPUs.

amdgpu 0048:0f:00.0: amdgpu: Queue preemption failed for queue with
doorbell_id: 80030008
amdgpu 0048:0f:00.0: amdgpu: Failed to evict process queues
amdgpu 0048:0f:00.0: amdgpu: GPU reset begin!. Source: 4
amdgpu 0048:0f:00.0: amdgpu: Queue preemption failed for queue with
doorbell_id: 80030008
amdgpu 0048:0f:00.0: amdgpu: Failed to evict process queues
amdgpu 0048:0f:00.0: amdgpu: Failed to restore process queues

This issue is observed on both 4 KB and 64 KB system page-size
configurations.

This patch fixes the issue by aligning the control stack size to
AMDGPU_GPU_PAGE_SIZE instead of PAGE_SIZE, so the control stack size
will not be 64 KB on systems with a 64 KB page size and queue
preemption works correctly.

Additionally, In the current code, wg_data_size is aligned to PAGE_SIZE,
which can waste memory if the system page size is large. In this patch,
wg_data_size is aligned to AMDGPU_GPU_PAGE_SIZE. The cwsr_size, calculated
from wg_data_size and the control stack size, is aligned to PAGE_SIZE.

Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Donet Tom <donettom@linux.ibm.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit a3e1443)
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit 78ec5bf ]

When cifs_sanitize_prepath is called with an empty string or a string
containing only delimiters (e.g., "/"), the current logic attempts to
check *(cursor2 - 1) before cursor2 has advanced. This results in an
out-of-bounds read.

This patch adds an early exit check after stripping prepended
delimiters. If no path content remains, the function returns NULL.

The bug was identified via manual audit and verified using a
standalone test case compiled with AddressSanitizer, which
triggered a SEGV on affected inputs.

Signed-off-by: Fredric Cover <FredTheDude@proton.me>
Reviewed-by: Henrique Carvalho <[2]henrique.carvalho@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit 8ec017c ]

The HP Laptop 15-fc0xxx (subsystem ID 0x103c8dc9) has an internal
DMIC connected to the AMD ACP6x audio coprocessor. Add a DMI quirk
entry so the internal microphone is properly detected on this model.

Tested on HP Laptop 15-fc0237ns with Fedora 43 (kernel 6.19.9).

Signed-off-by: Gilson Marquato Júnior <gilsonmandalogo@hotmail.com>
Link: https://patch.msgid.link/20260330-hp-15-fc0xxx-dmic-v2-v1-1-6dd6f53a1917@hotmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit 217d5bc ]

The Lenovo Yoga Pro 7 14IMH9 (DMI: 83E2) shares PCI SSID 17aa:3847
with the Legion 7 16ACHG6, but has a different codec subsystem ID
(17aa:38cf). The existing SND_PCI_QUIRK for 17aa:3847 applies
ALC287_FIXUP_LEGION_16ACHG6, which attempts to initialize an external
I2C amplifier (CLSA0100) that is not present on the Yoga Pro 7 14IMH9.

As a result, pin 0x17 (bass speakers) is connected to DAC 0x06 which
has no volume control, making hardware volume adjustment completely
non-functional. Audio is either silent or at maximum volume regardless
of the slider position.

Add a HDA_CODEC_QUIRK entry using the codec subsystem ID (17aa:38cf)
to correctly identify the Yoga Pro 7 14IMH9 and apply
ALC287_FIXUP_YOGA9_14IMH9_BASS_SPK_PIN, which redirects pin 0x17 to
DAC 0x02 and restores proper volume control. The existing Legion entry
is preserved unchanged.

This follows the same pattern used for 17aa:386e, where Legion Y9000X
and Yoga Pro 7 14ARP8 share a PCI SSID but are distinguished via
HDA_CODEC_QUIRK.

Link: https://github.com/nomad4tech/lenovo-yoga-pro-7-linux
Tested-by: Alexander Savenko <alex.sav4387@gmail.com>
Signed-off-by: Alexander Savenko <alex.sav4387@gmail.com>
Link: https://patch.msgid.link/20260331082929.44890-1-alex.sav4387@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
…ncer)

[ Upstream commit a4337a2 ]

The 1kOhm pull down and hardware debouncer are features of the revision 0.92
of the Chassis specification. Fix that in the code accordingly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit 1a9452c ]

This platform is a similar vintage of platforms that had a BIOS bug
leading to a 10s delay at resume from s0i3.

Add a quirk for it.

Reported-by: Imrane <ihalim.me@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221273
Tested-by: Imrane <ihalim.me@gmail.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/20260324211647.357924-1-mario.limonciello@amd.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit 48e91af ]

Add Nova Lake THC QuickSPI device IDs to support list.

Signed-off-by: Even Xu <even.xu@intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit 5327439 ]

According to a mailing list report [1], this controller's predecessor
has the same issue. However, it uses the xpad driver instead of HID, so
this quirk wouldn't apply.

[1]: https://lore.kernel.org/linux-input/unufo3$det$1@ciao.gmane.io/

Signed-off-by: leo vriska <leo@60228.dev>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit f0541ed ]

The bass speakers are not working, and add the following entry
in /etc/modprobe.d/snd.conf:
options snd-sof-intel-hda-generic hda_model=alc287-yoga9-bass-spk-pin
Fixes the bass speakers.

So add the quick ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN here.

Reported-by: Fernando Garcia Corona <fgarcor@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221317
Signed-off-by: songxiebing <songxiebing@kylinos.cn>
Link: https://patch.msgid.link/20260405012651.133838-1-songxiebing@kylinos.cn
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit d802d84 ]

roccat_report_event() iterates over the device->readers list without
holding the readers_lock. This allows a concurrent roccat_release() to
remove and free a reader while it's still being accessed, leading to a
use-after-free.

Protect the readers list traversal with the readers_lock mutex.

Signed-off-by: Benoît Sevens <bsevens@google.com>
Reviewed-by: Silvan Jegen <s.jegen@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
@doug445

doug445 commented Oct 9, 2026

Copy link
Copy Markdown

Tested on t6000 (MacBook Pro 16" M1 Pro, MacBookPro18,1 / J316s): this fixes the
pipehandler errors, but boot enumeration still fails here.

Setup

  • Fedora Asahi Remix 44, kernel 7.1.13-402.asahi.fc44.aarch64+16k
  • 87a2ad1c3428 applied on top of the Fedora kernel source (linux-7.1.13 +
    patch-7.1-redhat.patch, which itself touches ~400 lines of atc.c). All 8 hunks
    applied with offsets only, no fuzz.
  • Built phy-apple-atc out-of-tree against kernel-16k-devel and installed as a
    /lib/modules/<kver>/updates override, initramfs rebuilt.

What improved

Before the patch, unbinding tps6598x reliably produced:

WARNING: drivers/phy/apple/atc.c:2328 at atcphy_mux_set+0x138/0x230 [phy_apple_atc]
  typec_mux_set / typec_set_mode / tps6598x_disconnect / tipd_remove
phy-apple-atc b03000000.phy: Pipehandler lock not acked.
phy-apple-atc b03000000.phy: Failed to lock pipehandler

With the patch applied, none of these appear in any of my attempts. The lock retry does
what it claims.

What did not change

A device attached at power-on still does not enumerate. Booting with a USB2 hub in
port0:

xhci-hcd xhci-hcd.3.auto: new USB bus registered, assigned bus number 1
hub 1-0:1.0: USB hub found
   ... nothing further

At that point /sys/class/typec/port0 shows a partner attached with data_role
[host], the xHCI is registered, the deferred-probe list is empty, and no PHY errors
are logged — there are simply zero devices behind the root hub. Unplug/replug
enumerates it immediately. This is identical to stock behaviour.

One possibly relevant difference

The device that fails here is USB2-only: 214b:7260 (a USB 2.0 hub), which comes up at
480M on the USB2 root hub while the USB3 root hub stays empty. Your commit message is
framed around USB3 bring-up, and item 5 — the host-mode BIST leaving an RXDETECT
override that suppresses xhci link detection — is the one I'd have expected to cover my
case. If that path is USB3-only, it may never reach a high-speed-only device.

t6000 topology note, in case it matters

All four phy@ nodes here are "apple,t6000-atcphy", "apple,t8103-atcphy" and all four
bind phy-apple-atc — including phy@1303000000, which is the DCP's dp-phy. With
phy_apple_atc absent, dcp reports Failed to get dp-phy: -517 alongside three
dwc3-apple: Failed to get reset control deferrals. If J313 keeps the DP PHY separate,
the blast radius of an atcphy failure differs between the two SoCs.

Happy to test revisions or gather more detail.

hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 2, 2026
Six coprocessor CPUs' power gates (DISP_CPU, ANE_CPU, DISPEXT0..3_CPU on
t6031) hold a retention: with it on, the core keeps its state through the
gating auto-PM does while its firmware naps. macOS turns it off before the
domain powers off and on once it is on (ApplePMGR::_setPSLevel ->
_setPwrGateRetention, rda KC_PMGR 0xfffffe0009bd507c): the flip-flop
groups' bits cleared in the gate's word, then the memory groups' 2-bit
fields at +0x24 set to 1; off sets the bits and clears the fields.

apple,pwrgate names the gate (a syscon, its word's offset, the counts of
its flip-flop and memory groups). The domain sets it on at probe when on,
after each power-on and off before each power-off. A bad or missing gate
leaves the domain as before, with a warning.

Without it the DCP's nap loses the next doorbell: on AsahiLinux#503, with Linux's
keep-awake dropped at runtime and the retention off, the first swap_start
after the nap was sent and never answered (flip_done timed out, then
"unexpected busy command channel"); the runtime nap that passed (r174) had
turned the retention on by hand (tools/probe/pgret.c).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 2, 2026
The DCP's RTKit takes a keep-awake reference at boot (apple,rtkit-keep-awake):
without one its firmware hibernates at its first idle and loses the doorbells
that follow. Held for good, it keeps the firmware from napping. macOS holds
its DCP for 60 s after boot (AppleDCPExpert's _bootCompleteTimeoutGated),
then lets it nap whenever idle.

Drop the reference nap_after_s (default 60, 0 keeps it) after dcp_start, and
take it again before the unbind's shutdown, so that runs as before. The
debugfs keep_awake knob shares the toggle and its lock (now per DCP).

It needs DISP_CPU's floor at 0 and its power-gate retention on (the PMGR's
apple,pwrgate): with the retention off, the first call after the drop was
sent and never answered (AsahiLinux#503: swap_start with no reply, flip_done timed
out, "unexpected busy command channel", the display lost until a reboot).
With it on, the napping firmware leaves DISP_CPU power-gated 98-100 % of
each idle window and answers every call (r174, six alternated pairs at
runtime; AsahiLinux#504, napcheck.sh: after the boot's nap 20 backlight steps, 10 DPMS
cycles, a session restart and 10 s2idle cycles with no DCP error, DISP_CPU
gated 99.2-99.8 % at the idle desktop).
@jannau
jannau force-pushed the asahi branch 2 times, most recently from 414e55d to c8ec9be Compare November 3, 2026 22:37
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 5, 2026
Six coprocessor CPUs' power gates (DISP_CPU, ANE_CPU, DISPEXT0..3_CPU on
t6031) hold a retention: with it on, the core keeps its state through the
gating auto-PM does while its firmware naps. macOS turns it off before the
domain powers off and on once it is on (ApplePMGR::_setPSLevel ->
_setPwrGateRetention, rda KC_PMGR 0xfffffe0009bd507c): the flip-flop
groups' bits cleared in the gate's word, then the memory groups' 2-bit
fields at +0x24 set to 1; off sets the bits and clears the fields.

apple,pwrgate names the gate (a syscon, its word's offset, the counts of
its flip-flop and memory groups). The domain sets it on at probe when on,
after each power-on and off before each power-off. A bad or missing gate
leaves the domain as before, with a warning.

Without it the DCP's nap loses the next doorbell: on AsahiLinux#503, with Linux's
keep-awake dropped at runtime and the retention off, the first swap_start
after the nap was sent and never answered (flip_done timed out, then
"unexpected busy command channel"); the runtime nap that passed (r174) had
turned the retention on by hand (tools/probe/pgret.c).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 5, 2026
The DCP's RTKit takes a keep-awake reference at boot (apple,rtkit-keep-awake):
without one its firmware hibernates at its first idle and loses the doorbells
that follow. Held for good, it keeps the firmware from napping. macOS holds
its DCP for 60 s after boot (AppleDCPExpert's _bootCompleteTimeoutGated),
then lets it nap whenever idle.

Drop the reference nap_after_s (default 60, 0 keeps it) after dcp_start, and
take it again before the unbind's shutdown, so that runs as before. The
debugfs keep_awake knob shares the toggle and its lock (now per DCP).

It needs DISP_CPU's floor at 0 and its power-gate retention on (the PMGR's
apple,pwrgate): with the retention off, the first call after the drop was
sent and never answered (AsahiLinux#503: swap_start with no reply, flip_done timed
out, "unexpected busy command channel", the display lost until a reboot).
With it on, the napping firmware leaves DISP_CPU power-gated 98-100 % of
each idle window and answers every call (r174, six alternated pairs at
runtime; AsahiLinux#504, napcheck.sh: after the boot's nap 20 backlight steps, 10 DPMS
cycles, a session restart and 10 s2idle cycles with no DCP error, DISP_CPU
gated 99.2-99.8 % at the idle desktop).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 5, 2026
Six coprocessor CPUs' power gates (DISP_CPU, ANE_CPU, DISPEXT0..3_CPU on
t6031) hold a retention: with it on, the core keeps its state through the
gating auto-PM does while its firmware naps. macOS turns it off before the
domain powers off and on once it is on (ApplePMGR::_setPSLevel ->
_setPwrGateRetention, rda KC_PMGR 0xfffffe0009bd507c): the flip-flop
groups' bits cleared in the gate's word, then the memory groups' 2-bit
fields at +0x24 set to 1; off sets the bits and clears the fields.

apple,pwrgate names the gate (a syscon, its word's offset, the counts of
its flip-flop and memory groups). The domain sets it on at probe when on,
after each power-on and off before each power-off. A bad or missing gate
leaves the domain as before, with a warning.

Without it the DCP's nap loses the next doorbell: on AsahiLinux#503, with Linux's
keep-awake dropped at runtime and the retention off, the first swap_start
after the nap was sent and never answered (flip_done timed out, then
"unexpected busy command channel"); the runtime nap that passed (r174) had
turned the retention on by hand (tools/probe/pgret.c).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 5, 2026
The DCP's RTKit takes a keep-awake reference at boot (apple,rtkit-keep-awake):
without one its firmware hibernates at its first idle and loses the doorbells
that follow. Held for good, it keeps the firmware from napping. macOS holds
its DCP for 60 s after boot (AppleDCPExpert's _bootCompleteTimeoutGated),
then lets it nap whenever idle.

Drop the reference nap_after_s (default 60, 0 keeps it) after dcp_start, and
take it again before the unbind's shutdown, so that runs as before. The
debugfs keep_awake knob shares the toggle and its lock (now per DCP).

It needs DISP_CPU's floor at 0 and its power-gate retention on (the PMGR's
apple,pwrgate): with the retention off, the first call after the drop was
sent and never answered (AsahiLinux#503: swap_start with no reply, flip_done timed
out, "unexpected busy command channel", the display lost until a reboot).
With it on, the napping firmware leaves DISP_CPU power-gated 98-100 % of
each idle window and answers every call (r174, six alternated pairs at
runtime; AsahiLinux#504, napcheck.sh: after the boot's nap 20 backlight steps, 10 DPMS
cycles, a session restart and 10 s2idle cycles with no DCP error, DISP_CPU
gated 99.2-99.8 % at the idle desktop).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 7, 2026
Six coprocessor CPUs' power gates (DISP_CPU, ANE_CPU, DISPEXT0..3_CPU on
t6031) hold a retention: with it on, the core keeps its state through the
gating auto-PM does while its firmware naps. macOS turns it off before the
domain powers off and on once it is on (ApplePMGR::_setPSLevel ->
_setPwrGateRetention, rda KC_PMGR 0xfffffe0009bd507c): the flip-flop
groups' bits cleared in the gate's word, then the memory groups' 2-bit
fields at +0x24 set to 1; off sets the bits and clears the fields.

apple,pwrgate names the gate (a syscon, its word's offset, the counts of
its flip-flop and memory groups). The domain sets it on at probe when on,
after each power-on and off before each power-off. A bad or missing gate
leaves the domain as before, with a warning.

Without it the DCP's nap loses the next doorbell: on AsahiLinux#503, with Linux's
keep-awake dropped at runtime and the retention off, the first swap_start
after the nap was sent and never answered (flip_done timed out, then
"unexpected busy command channel"); the runtime nap that passed (r174) had
turned the retention on by hand (tools/probe/pgret.c).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 7, 2026
The DCP's RTKit takes a keep-awake reference at boot (apple,rtkit-keep-awake):
without one its firmware hibernates at its first idle and loses the doorbells
that follow. Held for good, it keeps the firmware from napping. macOS holds
its DCP for 60 s after boot (AppleDCPExpert's _bootCompleteTimeoutGated),
then lets it nap whenever idle.

Drop the reference nap_after_s (default 60, 0 keeps it) after dcp_start, and
take it again before the unbind's shutdown, so that runs as before. The
debugfs keep_awake knob shares the toggle and its lock (now per DCP).

It needs DISP_CPU's floor at 0 and its power-gate retention on (the PMGR's
apple,pwrgate): with the retention off, the first call after the drop was
sent and never answered (AsahiLinux#503: swap_start with no reply, flip_done timed
out, "unexpected busy command channel", the display lost until a reboot).
With it on, the napping firmware leaves DISP_CPU power-gated 98-100 % of
each idle window and answers every call (r174, six alternated pairs at
runtime; AsahiLinux#504, napcheck.sh: after the boot's nap 20 backlight steps, 10 DPMS
cycles, a session restart and 10 s2idle cycles with no DCP error, DISP_CPU
gated 99.2-99.8 % at the idle desktop).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 8, 2026
Six coprocessor CPUs' power gates (DISP_CPU, ANE_CPU, DISPEXT0..3_CPU on
t6031) hold a retention: with it on, the core keeps its state through the
gating auto-PM does while its firmware naps. macOS turns it off before the
domain powers off and on once it is on (ApplePMGR::_setPSLevel ->
_setPwrGateRetention, rda KC_PMGR 0xfffffe0009bd507c): the flip-flop
groups' bits cleared in the gate's word, then the memory groups' 2-bit
fields at +0x24 set to 1; off sets the bits and clears the fields.

apple,pwrgate names the gate (a syscon, its word's offset, the counts of
its flip-flop and memory groups). The domain sets it on at probe when on,
after each power-on and off before each power-off. A bad or missing gate
leaves the domain as before, with a warning.

Without it the DCP's nap loses the next doorbell: on AsahiLinux#503, with Linux's
keep-awake dropped at runtime and the retention off, the first swap_start
after the nap was sent and never answered (flip_done timed out, then
"unexpected busy command channel"); the runtime nap that passed (r174) had
turned the retention on by hand (tools/probe/pgret.c).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 8, 2026
The DCP's RTKit takes a keep-awake reference at boot (apple,rtkit-keep-awake):
without one its firmware hibernates at its first idle and loses the doorbells
that follow. Held for good, it keeps the firmware from napping. macOS holds
its DCP for 60 s after boot (AppleDCPExpert's _bootCompleteTimeoutGated),
then lets it nap whenever idle.

Drop the reference nap_after_s (default 60, 0 keeps it) after dcp_start, and
take it again before the unbind's shutdown, so that runs as before. The
debugfs keep_awake knob shares the toggle and its lock (now per DCP).

It needs DISP_CPU's floor at 0 and its power-gate retention on (the PMGR's
apple,pwrgate): with the retention off, the first call after the drop was
sent and never answered (AsahiLinux#503: swap_start with no reply, flip_done timed
out, "unexpected busy command channel", the display lost until a reboot).
With it on, the napping firmware leaves DISP_CPU power-gated 98-100 % of
each idle window and answers every call (r174, six alternated pairs at
runtime; AsahiLinux#504, napcheck.sh: after the boot's nap 20 backlight steps, 10 DPMS
cycles, a session restart and 10 s2idle cycles with no DCP error, DISP_CPU
gated 99.2-99.8 % at the idle desktop).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 8, 2026
Six coprocessor CPUs' power gates (DISP_CPU, ANE_CPU, DISPEXT0..3_CPU on
t6031) hold a retention: with it on, the core keeps its state through the
gating auto-PM does while its firmware naps. macOS turns it off before the
domain powers off and on once it is on (ApplePMGR::_setPSLevel ->
_setPwrGateRetention, rda KC_PMGR 0xfffffe0009bd507c): the flip-flop
groups' bits cleared in the gate's word, then the memory groups' 2-bit
fields at +0x24 set to 1; off sets the bits and clears the fields.

apple,pwrgate names the gate (a syscon, its word's offset, the counts of
its flip-flop and memory groups). The domain sets it on at probe when on,
after each power-on and off before each power-off. A bad or missing gate
leaves the domain as before, with a warning.

Without it the DCP's nap loses the next doorbell: on AsahiLinux#503, with Linux's
keep-awake dropped at runtime and the retention off, the first swap_start
after the nap was sent and never answered (flip_done timed out, then
"unexpected busy command channel"); the runtime nap that passed (r174) had
turned the retention on by hand (tools/probe/pgret.c).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 8, 2026
The DCP's RTKit takes a keep-awake reference at boot (apple,rtkit-keep-awake):
without one its firmware hibernates at its first idle and loses the doorbells
that follow. Held for good, it keeps the firmware from napping. macOS holds
its DCP for 60 s after boot (AppleDCPExpert's _bootCompleteTimeoutGated),
then lets it nap whenever idle.

Drop the reference nap_after_s (default 60, 0 keeps it) after dcp_start, and
take it again before the unbind's shutdown, so that runs as before. The
debugfs keep_awake knob shares the toggle and its lock (now per DCP).

It needs DISP_CPU's floor at 0 and its power-gate retention on (the PMGR's
apple,pwrgate): with the retention off, the first call after the drop was
sent and never answered (AsahiLinux#503: swap_start with no reply, flip_done timed
out, "unexpected busy command channel", the display lost until a reboot).
With it on, the napping firmware leaves DISP_CPU power-gated 98-100 % of
each idle window and answers every call (r174, six alternated pairs at
runtime; AsahiLinux#504, napcheck.sh: after the boot's nap 20 backlight steps, 10 DPMS
cycles, a session restart and 10 s2idle cycles with no DCP error, DISP_CPU
gated 99.2-99.8 % at the idle desktop).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 11, 2026
Six coprocessor CPUs' power gates (DISP_CPU, ANE_CPU, DISPEXT0..3_CPU on
t6031) hold a retention: with it on, the core keeps its state through the
gating auto-PM does while its firmware naps. macOS turns it off before the
domain powers off and on once it is on (ApplePMGR::_setPSLevel ->
_setPwrGateRetention, rda KC_PMGR 0xfffffe0009bd507c): the flip-flop
groups' bits cleared in the gate's word, then the memory groups' 2-bit
fields at +0x24 set to 1; off sets the bits and clears the fields.

apple,pwrgate names the gate (a syscon, its word's offset, the counts of
its flip-flop and memory groups). The domain sets it on at probe when on,
after each power-on and off before each power-off. A bad or missing gate
leaves the domain as before, with a warning.

Without it the DCP's nap loses the next doorbell: on AsahiLinux#503, with Linux's
keep-awake dropped at runtime and the retention off, the first swap_start
after the nap was sent and never answered (flip_done timed out, then
"unexpected busy command channel"); the runtime nap that passed (r174) had
turned the retention on by hand (tools/probe/pgret.c).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 11, 2026
The DCP's RTKit takes a keep-awake reference at boot (apple,rtkit-keep-awake):
without one its firmware hibernates at its first idle and loses the doorbells
that follow. Held for good, it keeps the firmware from napping. macOS holds
its DCP for 60 s after boot (AppleDCPExpert's _bootCompleteTimeoutGated),
then lets it nap whenever idle.

Drop the reference nap_after_s (default 60, 0 keeps it) after dcp_start, and
take it again before the unbind's shutdown, so that runs as before. The
debugfs keep_awake knob shares the toggle and its lock (now per DCP).

It needs DISP_CPU's floor at 0 and its power-gate retention on (the PMGR's
apple,pwrgate): with the retention off, the first call after the drop was
sent and never answered (AsahiLinux#503: swap_start with no reply, flip_done timed
out, "unexpected busy command channel", the display lost until a reboot).
With it on, the napping firmware leaves DISP_CPU power-gated 98-100 % of
each idle window and answers every call (r174, six alternated pairs at
runtime; AsahiLinux#504, napcheck.sh: after the boot's nap 20 backlight steps, 10 DPMS
cycles, a session restart and 10 s2idle cycles with no DCP error, DISP_CPU
gated 99.2-99.8 % at the idle desktop).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 19, 2026
Six coprocessor CPUs' power gates (DISP_CPU, ANE_CPU, DISPEXT0..3_CPU on
t6031) hold a retention: with it on, the core keeps its state through the
gating auto-PM does while its firmware naps. macOS turns it off before the
domain powers off and on once it is on (ApplePMGR::_setPSLevel ->
_setPwrGateRetention, rda KC_PMGR 0xfffffe0009bd507c): the flip-flop
groups' bits cleared in the gate's word, then the memory groups' 2-bit
fields at +0x24 set to 1; off sets the bits and clears the fields.

apple,pwrgate names the gate (a syscon, its word's offset, the counts of
its flip-flop and memory groups). The domain sets it on at probe when on,
after each power-on and off before each power-off. A bad or missing gate
leaves the domain as before, with a warning.

Without it the DCP's nap loses the next doorbell: on AsahiLinux#503, with Linux's
keep-awake dropped at runtime and the retention off, the first swap_start
after the nap was sent and never answered (flip_done timed out, then
"unexpected busy command channel"); the runtime nap that passed (r174) had
turned the retention on by hand (tools/probe/pgret.c).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 19, 2026
The DCP's RTKit takes a keep-awake reference at boot (apple,rtkit-keep-awake):
without one its firmware hibernates at its first idle and loses the doorbells
that follow. Held for good, it keeps the firmware from napping. macOS holds
its DCP for 60 s after boot (AppleDCPExpert's _bootCompleteTimeoutGated),
then lets it nap whenever idle.

Drop the reference nap_after_s (default 60, 0 keeps it) after dcp_start, and
take it again before the unbind's shutdown, so that runs as before. The
debugfs keep_awake knob shares the toggle and its lock (now per DCP).

It needs DISP_CPU's floor at 0 and its power-gate retention on (the PMGR's
apple,pwrgate): with the retention off, the first call after the drop was
sent and never answered (AsahiLinux#503: swap_start with no reply, flip_done timed
out, "unexpected busy command channel", the display lost until a reboot).
With it on, the napping firmware leaves DISP_CPU power-gated 98-100 % of
each idle window and answers every call (r174, six alternated pairs at
runtime; AsahiLinux#504, napcheck.sh: after the boot's nap 20 backlight steps, 10 DPMS
cycles, a session restart and 10 s2idle cycles with no DCP error, DISP_CPU
gated 99.2-99.8 % at the idle desktop).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 20, 2026
Six coprocessor CPUs' power gates (DISP_CPU, ANE_CPU, DISPEXT0..3_CPU on
t6031) hold a retention: with it on, the core keeps its state through the
gating auto-PM does while its firmware naps. macOS turns it off before the
domain powers off and on once it is on (ApplePMGR::_setPSLevel ->
_setPwrGateRetention, rda KC_PMGR 0xfffffe0009bd507c): the flip-flop
groups' bits cleared in the gate's word, then the memory groups' 2-bit
fields at +0x24 set to 1; off sets the bits and clears the fields.

apple,pwrgate names the gate (a syscon, its word's offset, the counts of
its flip-flop and memory groups). The domain sets it on at probe when on,
after each power-on and off before each power-off. A bad or missing gate
leaves the domain as before, with a warning.

Without it the DCP's nap loses the next doorbell: on AsahiLinux#503, with Linux's
keep-awake dropped at runtime and the retention off, the first swap_start
after the nap was sent and never answered (flip_done timed out, then
"unexpected busy command channel"); the runtime nap that passed (r174) had
turned the retention on by hand (tools/probe/pgret.c).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 20, 2026
The DCP's RTKit takes a keep-awake reference at boot (apple,rtkit-keep-awake):
without one its firmware hibernates at its first idle and loses the doorbells
that follow. Held for good, it keeps the firmware from napping. macOS holds
its DCP for 60 s after boot (AppleDCPExpert's _bootCompleteTimeoutGated),
then lets it nap whenever idle.

Drop the reference nap_after_s (default 60, 0 keeps it) after dcp_start, and
take it again before the unbind's shutdown, so that runs as before. The
debugfs keep_awake knob shares the toggle and its lock (now per DCP).

It needs DISP_CPU's floor at 0 and its power-gate retention on (the PMGR's
apple,pwrgate): with the retention off, the first call after the drop was
sent and never answered (AsahiLinux#503: swap_start with no reply, flip_done timed
out, "unexpected busy command channel", the display lost until a reboot).
With it on, the napping firmware leaves DISP_CPU power-gated 98-100 % of
each idle window and answers every call (r174, six alternated pairs at
runtime; AsahiLinux#504, napcheck.sh: after the boot's nap 20 backlight steps, 10 DPMS
cycles, a session restart and 10 s2idle cycles with no DCP error, DISP_CPU
gated 99.2-99.8 % at the idle desktop).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 20, 2026
Six coprocessor CPUs' power gates (DISP_CPU, ANE_CPU, DISPEXT0..3_CPU on
t6031) hold a retention: with it on, the core keeps its state through the
gating auto-PM does while its firmware naps. macOS turns it off before the
domain powers off and on once it is on (ApplePMGR::_setPSLevel ->
_setPwrGateRetention, rda KC_PMGR 0xfffffe0009bd507c): the flip-flop
groups' bits cleared in the gate's word, then the memory groups' 2-bit
fields at +0x24 set to 1; off sets the bits and clears the fields.

apple,pwrgate names the gate (a syscon, its word's offset, the counts of
its flip-flop and memory groups). The domain sets it on at probe when on,
after each power-on and off before each power-off. A bad or missing gate
leaves the domain as before, with a warning.

Without it the DCP's nap loses the next doorbell: on AsahiLinux#503, with Linux's
keep-awake dropped at runtime and the retention off, the first swap_start
after the nap was sent and never answered (flip_done timed out, then
"unexpected busy command channel"); the runtime nap that passed (r174) had
turned the retention on by hand (tools/probe/pgret.c).
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 20, 2026
The DCP's RTKit takes a keep-awake reference at boot (apple,rtkit-keep-awake):
without one its firmware hibernates at its first idle and loses the doorbells
that follow. Held for good, it keeps the firmware from napping. macOS holds
its DCP for 60 s after boot (AppleDCPExpert's _bootCompleteTimeoutGated),
then lets it nap whenever idle.

Drop the reference nap_after_s (default 60, 0 keeps it) after dcp_start, and
take it again before the unbind's shutdown, so that runs as before. The
debugfs keep_awake knob shares the toggle and its lock (now per DCP).

It needs DISP_CPU's floor at 0 and its power-gate retention on (the PMGR's
apple,pwrgate): with the retention off, the first call after the drop was
sent and never answered (AsahiLinux#503: swap_start with no reply, flip_done timed
out, "unexpected busy command channel", the display lost until a reboot).
With it on, the napping firmware leaves DISP_CPU power-gated 98-100 % of
each idle window and answers every call (r174, six alternated pairs at
runtime; AsahiLinux#504, napcheck.sh: after the boot's nap 20 backlight steps, 10 DPMS
cycles, a session restart and 10 s2idle cycles with no DCP error, DISP_CPU
gated 99.2-99.8 % at the idle desktop).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.