pwm: rp1: use pwmchip_get_drvdata() instead of container_of()#6972
Merged
pelwell merged 1 commit intoraspberrypi:rpi-6.12.yfrom Jul 24, 2025
Merged
pwm: rp1: use pwmchip_get_drvdata() instead of container_of()#6972pelwell merged 1 commit intoraspberrypi:rpi-6.12.yfrom
pelwell merged 1 commit intoraspberrypi:rpi-6.12.yfrom
Conversation
Contributor
Author
|
Probably broken since the very beginning of 6.12.y |
Contributor
|
Tested and LGTM. You could lose the |
The PWM framework may not embed struct pwm_chip within the driver’s private data. Using container_of() can result in accessing invalid memory or NULL pointers, especially after recent kernel changes. Switch to pwmchip_get_drvdata() to reliably access the driver data. This resolves kernel warnings and probe failures seen after updating from kernel 6.12.28 to 6.12.34 [1] While at it remove the now obsolete `struct pwm_chip chip` member from `struct pwm_pio_rp1`. [1] raspberrypi#6971 Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
ec51394 to
44630a4
Compare
Contributor
Author
|
Thanks. I've updated the PR |
popcornmix
added a commit
to raspberrypi/firmware
that referenced
this pull request
Aug 1, 2025
kernel: drm/v3d: Address race-condition between per-fd GPU stats and fd release See: raspberrypi/linux#6973 kernel: pwm: rp1: use pwmchip_get_drvdata() instead of container_of() See: raspberrypi/linux#6972
popcornmix
added a commit
to raspberrypi/rpi-firmware
that referenced
this pull request
Aug 1, 2025
kernel: drm/v3d: Address race-condition between per-fd GPU stats and fd release See: raspberrypi/linux#6973 kernel: pwm: rp1: use pwmchip_get_drvdata() instead of container_of() See: raspberrypi/linux#6972
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.
The PWM framework may not embed struct pwm_chip within the driver’s private data. Using container_of() can result in accessing invalid memory or NULL pointers, especially after recent kernel changes.
Switch to pwmchip_get_drvdata() to reliably access the driver data. This resolves kernel warnings and probe failures seen after updating from kernel 6.12.28 to 6.12.34 [1]
[1] #6971