Repository navigation
Apple platform: small independent fixes (DART page tables, SMC, PWM, LEDs, SPMI, tipd, AVD, ALSA, tas2764) - #368
Merged
RyanTheTide merged 17 commits intoOct 23, 2026
Conversation
dart_map_pages() checks only that the first physical address fits the output address size. A multi-page request that starts below the limit and runs past it is accepted, and the pages beyond the limit get truncated output addresses in their PTEs. Check the whole range: refuse the request with -ERANGE when pgcount pages from paddr do not fit below 1 << oas. Signed-off-by: Jonathan Goyvaerts <[email protected]> Assisted-by: LLM
apple_smc_write_atomic() is used with interrupts off (power-off and reboot through macsmc-reboot) and polled RTKit until the reply came, with no limit: an SMC that never answers hung the CPU in the reboot path for good. Poll with read_poll_timeout_atomic() for at most SMC_TIMEOUT_MS and return -ETIMEDOUT after that. A timed-out command is not cancelled and still owns the shared-memory buffer, so leave atomic_pending set and refuse further atomic writes with -EBUSY instead of reusing the buffer. A reply with the wrong sequence number does not tell whether the command finished either; treat it the same way. Signed-off-by: Jonathan Goyvaerts <[email protected]> Assisted-by: LLM
apple_pwm_probe() only checked the clock rate against NSEC_PER_SEC. A clock that reports 0 Hz passed and every later period and duty cycle computation divided by it. Refuse it at probe time as well. Signed-off-by: Jonathan Goyvaerts <[email protected]> Assisted-by: LLM
The LED class turns an LED off only when it is unregistered, which does not happen at power-off or reboot, so a PWM LED keeps its last duty cycle while the machine goes down. On the Apple laptops the keyboard backlight stays lit after the screen has gone dark. Add a shutdown hook that disables sysfs writes (under led_access, as led_sysfs_disable() requires), drains the brightness work and applies zero duty once. Signed-off-by: Jonathan Goyvaerts <[email protected]> Assisted-by: LLM
The charge control end threshold getter ignored the result of the SMC read and reported whatever was in the buffer when the read failed. Return the error instead. Writes outside 0..100 to the start or end threshold were passed on to the key-specific code, which clamps some of them silently. Refuse them with -EINVAL. Signed-off-by: Jonathan Goyvaerts <[email protected]> Assisted-by: LLM
The wakeup source was initialised after the SMC notifier was registered and was never torn down. Initialise it with devm_device_init_wakeup() before the notifier, so that on removal the notifier is unregistered (and its running callbacks drained) while the input device and the wakeup source still exist. Signed-off-by: Jonathan Goyvaerts <[email protected]> Assisted-by: LLM
devm_platform_ioremap_resource_byname() returns an error pointer, never NULL. A PMGR node without the "fabric-ps" or "dcs-ps" register range, which both are optional, therefore had its error pointer dereferenced by the following readl_relaxed(). Signed-off-by: Jonathan Goyvaerts <[email protected]> Assisted-by: LLM
Coprocessor firmware on newer SoCs sends oslog message types this driver does not handle. Nothing acts on them and they are harmless, but each one logs a warning. Log them at debug level, like the oslog notifications already are. Signed-off-by: Jonathan Goyvaerts <[email protected]> Assisted-by: LLM
magicmouse_open() returned without hid_hw_close() when the multitouch request or the dimensions request failed, and published geometry from a dimensions report without checking it. Check the report ID, require a positive span on both axes and a nonzero size and resolution before setting any axis, and close the device on every error path. Signed-off-by: Jonathan Goyvaerts <[email protected]> Assisted-by: LLM
tps6598x_connect() left an ERR_PTR in tps->partner when typec_register_partner() failed. Its "already connected" check then treated the port as connected, so no later connect could register the partner. Clear it, as the cd321x path does. tps6598x_dr_set() ignored the result of tps6598x_set_data_role(), so a role switch that failed was reported to the Type-C class as done. Signed-off-by: Jonathan Goyvaerts <[email protected]> Assisted-by: LLM
The AVD firmware reports a VP's error interrupt as a bare slot number. The IRQ handler only logged it and left the job to the watchdog, so every decode error (seen with VP9 streams from a web browser) stalled the decoder for the whole watchdog timeout. The VP that reported the error has stopped, and the PP is only started on a VP done, so the job cannot complete. Run the watchdog at once: it resets the AVD and fails only that frame, and it ignores a job the hardware does not own. Signed-off-by: Jonathan Goyvaerts <[email protected]> Assisted-by: LLM
v4l2_m2m_release() freed the m2m device while its job_work could still be queued or running, for example when a driver is unbound right after a job was scheduled. The worker then runs on freed memory. Cancel it first. Signed-off-by: Jonathan Goyvaerts <[email protected]> Assisted-by: LLM
snd_dmaengine_pcm_pointer() handles DMA_IN_PROGRESS and DMA_PAUSED and treats every other status as position 0. A channel that reports DMA_ERROR has stopped moving data, but the PCM core keeps seeing a valid position at the start of the buffer, so the stream neither advances nor ends: playback stalls silently until the application gives up. Return SNDRV_PCM_POS_XRUN for DMA_ERROR, so the core stops the stream with an XRUN and user space can recover by preparing it again. Signed-off-by: Jonathan Goyvaerts <[email protected]> Assisted-by: LLM
The IRQ handler reads the six interrupt latch registers with snd_soc_component_read() into a u8 array. On a failed read that function returns the negative errno, which truncates to a byte with most bits set: the handler then logs over-temperature, over-current and most other faults that never happened, and the context bytes are garbage. Read the latches with regmap_read() and return IRQ_NONE, with a rate-limited error, when one of them cannot be read. Fixes: dae191f ("ASoC: tas2764: Add IRQ handling") Signed-off-by: Jonathan Goyvaerts <[email protected]> Assisted-by: LLM
The reply word carries the opcode and the target ID of the command it answers. When they do not match the command just sent, the FIFO is out of step with the commands, and the data that follows belongs to another transaction. Fail the command with -EIO and mark the controller as failed, as after a timeout, instead of returning that data to the caller. Signed-off-by: Jonathan Goyvaerts <[email protected]> Assisted-by: LLM
tipd_init() defers until the connector's USB role switch (the dwc3) is registered, but only after it has woken the chip, switched it to S0 and set its interrupt mask, and the deferral then puts the chip back to sleep. With both drivers loaded by udev at boot that cycle could repeat several times. Look the role switch up in sn201202x_probe() and defer there instead, before the chip is touched. A connector without a role switch, or one whose remote node is disabled, gives NULL and the probe continues as before. Signed-off-by: Jonathan Goyvaerts <[email protected]> Assisted-by: LLM
This reverts commit d5a8234. integration/aurora now has the same check in ce32dd5 ("soc: apple: pmgr-misc: sleep under PMP only while it runs, quieter probe"), which also returns the error instead of false. Without this revert the branch conflicts with it. Signed-off-by: Jonathan Goyvaerts <[email protected]> Assisted-by: LLM
Contributor
Author
This was referenced Oct 23, 2026
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sixteen small fixes found while bringing up the MacBook Pro J616s (M4 Pro). None needs T6040 support; each is
independent and can be taken or dropped on its own.
cycles the chip through S0).
Hardware tested on: Apple MacBook Pro (16-inch, M4 Pro, 2024), J616s / T6040, macOS 26.x firmware, booted by our own loader (not aurora's m1n1) with our private T6040 device tree.
How tested: Each fix runs in our daily kernel on the J616s (aurora-wip 7.1.12 base plus our series). Seen on hardware:
the keyboard backlight now goes dark at power-off; the VP9 decode-error reset (browser VP9 streams); the sn201202x
deferral (no repeated wake cycles at boot); the tas2764 latch read on the speaker amps. The others are code-review fixes
that never fired on this machine.
Not tested / limits: The DART output-size check, SMC atomic timeout, zero PWM clock, magicmouse dimension checks, SPMI reply
mismatch, tipd partner failure and v4l2-mem2mem cancel paths were found by review and never triggered. No other Mac
was tested.
Base:
integration/aurora(44d5afc). Built and checked there (aurora's defconfig, W=1 on every touched object, checkpatch --strict). Hardware testing was done on our daily tree, which is based on aurora-wip (Linux 7.1.12) and runs this code.🤖 Generated with Claude Code
https://claude.ai/code/session_01K4TC3f2CpzFxhnEziL9wcg