From 30f95ffef4b5bc097e949aee2069353fc88881cf Mon Sep 17 00:00:00 2001 From: Erik Bourget Date: Sun, 15 Nov 2026 22:59:54 -0500 Subject: [PATCH 1/3] mfd: macsmc: the T6050 saved-context path on the J716c The SMC's saved context for the T6050 firmware sleep was set up on the J714s only. The J716c has the same T6050 SMC: enable it there too, on a machine that is both apple,t6050 and apple,j716c. The J714s's wake reason table stays J714s only. Developed with Claude Code. Signed-off-by: Erik Bourget --- drivers/mfd/macsmc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/macsmc.c b/drivers/mfd/macsmc.c index 1a4f9c2da8cfc..72f8af4ef1a68 100644 --- a/drivers/mfd/macsmc.c +++ b/drivers/mfd/macsmc.c @@ -646,9 +646,11 @@ static int apple_smc_probe(struct platform_device *pdev) mutex_init(&smc->mutex); spin_lock_init(&smc->lock); smc->dev = &pdev->dev; - smc->saved_enabled = of_machine_is_compatible("apple,j714s") && + smc->saved_enabled = of_machine_is_compatible("apple,t6050") && + (of_machine_is_compatible("apple,j714s") || + of_machine_is_compatible("apple,j716c")) && of_device_is_compatible(dev->of_node, "apple,t6050-smc"); - if (smc->saved_enabled) + if (smc->saved_enabled && of_machine_is_compatible("apple,j714s")) smc->wake_reasons = apple_smc_j714s_wake_reasons; smc->sram_base = devm_platform_get_and_ioremap_resource(pdev, 1, &smc->sram); if (IS_ERR(smc->sram_base)) From b146b97cfab0125d115266804f2f9cdf02a9ae68 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 16 Nov 2026 23:54:40 +0000 Subject: [PATCH 2/3] mfd: macsmc: take an ordinary command's reply in before judging the saved lane at resume A wake by something the SMC itself reports, such as a Type-C port's unplug, brings a notification right behind the wake. Its handler's ordinary command can be in flight when the noirq resume runs: posted, with its reply waiting in the mailbox while the interrupt is still off. The resume took the pending flag for an unresolved saved command and refused with -EBUSY. The SMC then never got its AP ON notice, and ANS, waiting for its topology from the SMC, asserted 10 s into the wake: macsmc 28c600000.smc: PM: failed to resume noirq: error -16 nvme-apple 45dcc0000.nvme: RTKit: Message (id=1): assert failed: [21370]:timed out waiting for topology from SMC Poll the mailbox until the reply is in, bounded at 200 ms, before judging the lane. A recovery or a fault still refuses as before. Seen on the K116s: a USB stick pulled during a deep sleep. Signed-off-by: Jens Axboe (cherry picked from commit 2f579ba9fe5d28a17c4ea92c8b4dd5a4309c5132) --- drivers/mfd/macsmc.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/mfd/macsmc.c b/drivers/mfd/macsmc.c index 1a4f9c2da8cfc..765fb2469c729 100644 --- a/drivers/mfd/macsmc.c +++ b/drivers/mfd/macsmc.c @@ -1537,6 +1537,21 @@ static int apple_smc_suspend_noirq(struct device *dev) static int apple_smc_resume_noirq(struct device *dev) { struct apple_smc *smc = dev_get_drvdata(dev); + unsigned int i; + + /* + * A wake by something the SMC reports (a port's plug or unplug) brings a notification + * right behind it, and its handler's ordinary command can be in flight here: posted, its + * reply waiting in the mailbox with the interrupt still off. That is no unresolved saved + * command. Take the reply in by polling before judging the lane; refusing here left the + * SMC without its AP ON notice and ANS waiting for its topology ("timed out waiting for + * topology from SMC", ANS crashed 10 s into the wake). + */ + if (smc->saved_enabled && !smc->saved_recovery && !smc->saved_fault) + for (i = 0; i < 20000 && smp_load_acquire(&smc->saved_pending); i++) { + apple_rtkit_poll(smc->rtk); + udelay(10); + } if (smc->saved_enabled && (smc->saved_recovery || smc->saved_pending || smc->saved_fault)) From f1dea5f878b55f0d991dd26b193146dabdbb7fb8 Mon Sep 17 00:00:00 2001 From: DjDeveloperr Date: Tue, 17 Nov 2026 14:24:19 -0500 Subject: [PATCH 3/3] selftests: apple-dcp: include ext26 state in the cold-boot fixture Align the mocked DCP state and helpers with the production dcp_poweron() used by the fixture. This also covers its negative-control build paths. Signed-off-by: Diljit Singh --- tools/asahi/backlight-coldboot-tests.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/asahi/backlight-coldboot-tests.py b/tools/asahi/backlight-coldboot-tests.py index e08f7f3ce9cd3..75b72b186389b 100644 --- a/tools/asahi/backlight-coldboot-tests.py +++ b/tools/asahi/backlight-coldboot-tests.py @@ -71,12 +71,12 @@ def function(source, name): struct desktop *desktop; struct { struct dcp_backlight_state state; int lock; } backlight; struct { bool update; u32 maximum; } brightness; - bool panel,m4,v14,external,typec,pipe_enabled_h17p,crashed,quiescing; + bool panel,m4,v14,external,ext26,typec,pipe_enabled_h17p,crashed,quiescing; bool typec_crtc_off,typec_cable_connected,typec_follow_start,typec_poweron_hpd,hdmi_yielded; unsigned crtc_unplugs,typec_unplugs,typec_generation,typec_reconnect_tries,external_generation,external_crtc_generation; int external_lock,hpd_mutex,relink_lock,relink,typec_iomfb_hpd_ready; struct delayed_work typec_reconnect_wq,placeholder_edid_wq,external_stop_retry_wq,bl_fallback_wq; - struct work_struct external_stop_work; + struct work_struct external_stop_work,ext26_blank_work; void *dev,*hdmi_hpd,*avep; }; struct platform_device { struct apple_dcp *data; }; @@ -95,6 +95,9 @@ def function(source, name): static bool iomfb_v14_7_panel_nits(struct apple_dcp *p) { return p->v14; } static bool dcp_has_panel(struct apple_dcp *p) { return p->panel; } static bool dcp_is_external_h17p(struct apple_dcp *p) { return p->external; } +static bool dcp_is_ext26(struct apple_dcp *p) { return p->ext26; } +static bool dcp_is_retained_external(struct apple_dcp *p) { return p->external || p->ext26; } +static void flush_work(struct work_struct *p) { (void)p; } static bool dcp_is_typec_output(struct apple_dcp *p) { return p->typec; } static bool dcp_h17g_panel(struct apple_dcp *p) { return p->hw.iomfb_method_profile==DCP_IOMFB_METHODS_H17G; } static void dcp_backlight_kick(struct apple_dcp *p) { assert(p->backlight.state.ready);kicks++; }