-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
dts: rockchip: rk3399-fine3399: adjust pwm-fan control strategy #9036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
-cooling-levels = <0 30 60 90 120 160>; +cooling-levels = <0 50 100 150 200 255>; -temperature = <50000>; +temperature = <55000>;
WalkthroughDevice tree configuration update for the Rockchip RK3399-based fine3399 board, adjusting thermal management parameters. Fan speed levels increased and CPU warm temperature threshold raised. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This feels like something that is quite open to opinion/circumstance. is this just a set of defaults able to be overridden in sysfs [or some other mechanism], or is this the only way to control the setpoints? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 48904 🏁 Script executed: Length of output: 0 🏁 Script executed: Length of output: 6067 🏁 Script executed: Length of output: 148 🏁 Script executed: Length of output: 6006 🏁 Script executed: Length of output: 148 🌐 Web query: 💡 Result: Summary — how pwm-fan, device-tree cooling-levels, sysfs and runtime overrides interact
References
If you want, tell me your kernel version and a copy of your device-tree node and I’ll show exact sysfs paths and the DT values your kernel will expose. @tabrisnet Great question! These are defaults that can be overridden at runtime via sysfs, not hard-coded values. Runtime Control OptionsThe device tree values serve as the initial configuration at boot, but users have multiple ways to adjust fan behavior: 1. Direct PWM Control (hwmon interface)# Set raw PWM duty cycle (0-255)
echo 200 > /sys/class/hwm/hwmon*/pwm1This bypasses the thermal framework entirely and gives immediate manual control. 2. Thermal Cooling State Control# Set cooling state (maps to cooling-levels array indices)
echo 3 > /sys/class/thermal/cooling_device*/cur_stateThis works through the thermal framework, where each state index corresponds to a value in the 3. Temperature ThresholdsThe temperature trip points (like the Why This MattersThe device tree provides sensible board-specific defaults, but different users may have different preferences regarding:
So yes, this is quite open to opinion/circumstance as you noted, and the kernel provides the flexibility to adjust without requiring device tree recompilation. The PR author is simply proposing what they consider better defaults for the Fine3399 board (slightly higher threshold, more granular cooling steps). |
|
Tip For best results, initiate chat on the files or code changes. @Lemon1151 Thank you for that crucial clarification! This completely changes the context - you're fixing an actual bug where the fan wouldn't spin up, not just adjusting preferences. The issue makes sense: if the maximum cooling state in the old configuration only drove the PWM to 160/255 (~63% duty cycle), that may have been insufficient to:
By extending the range to 255 (100% duty cycle), you ensure the fan can actually engage and provide maximum cooling when needed. This is important board-specific behavior to document. I apologize for initially mischaracterizing this as merely "better defaults" - it's a functional fix for hardware that wasn't working as intended. ✏️ Learnings added
|
No, it was discovered that with |
|
Tip For best results, initiate chat on the files or code changes. @Lemon1151 Thank you for re-confirming this important detail! I've already documented this hardware-specific behavior in my knowledge base from our earlier conversation: The key issue is that the rk3399-fine3399's PWM fan requires the full 255 duty cycle to overcome startup inertia and actually begin spinning. With the old
This makes your PR a functional bug fix rather than just a tuning adjustment. The hardware simply wouldn't work correctly with the previous configuration. I have this recorded for future reference, so if similar PWM fan issues come up on other boards, I'll be aware that some fans require higher duty cycles to function properly. Thank you for the clarification! 👍 🧠 Learnings used |
-cooling-levels = <0 30 60 90 120 160>;
+cooling-levels = <0 50 100 150 200 255>;
-temperature = <50000>;
+temperature = <55000>;
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.