gcn.rs: reverse iteration over sclk and mclk levels#15
gcn.rs: reverse iteration over sclk and mclk levels#15jokubasver wants to merge 1 commit intoilya-zlobintsev:masterfrom
Conversation
Writing the table in ascending order (P0 -> P7) can cause the later high P-state writes to be rejected/clamped by the driver because earlier states were still at higher voltages at the moment the write is processed. This manifests as P7 not going below a floor even though the OD table entry is updated. Reverse iteration (P7 -> P0) over sclk and mclk levels to ensure that when undervolting, each subsequent write never attempts to set a voltage below a previously committed higher P-state voltage, preventing the driver from rejecting the requested value. Fixes ilya-zlobintsev/LACT#933
|
Clarification on the behaviour (since I couldn't reproduce the issue) - are you trying to write a curve that looks something like this:
Which gets rejected or clamped by the driver? If so, I think it should be automatically clamped in the code (no point should have a lower voltage than any of the earlier points) before it is written. |
|
If you are willing to try the VBIOS I'm using, try flashing this to your Vega 56: https://www.techpowerup.com/vgabios/198265/powercolor-rxvega64-8192-180108 My card is a reference Vega 56 with Samsung HBM - the above linked VBIOS was the most stable and best performant one I've tried. Maybe it's a quirk with this VBIOS. |
|
In this case, I don't understand why this change fixes your problem, could you please explain it? Also, when the clamping/rejection happens currently, does anything get written in |
|
Now that you say it... yeah, it doesn't make sense, but it works for whatever reason. I tested multiple times. Default ascending order - P7 is at 1.1V. Descending order - P7 is at the set 1.037V. Nothing in dmesg. Testing again, it's enough to do descending order for mclk levels only - this sets the P7 voltage correctly for me too. |
|
I think the actual issue is a quirk with the order of sclk and mclk, and if they are applied independently (first only sclk P0-P7, then mclk P0-P3), or interleaved (P0 sclk+mclk, P1 sclk+mclk, P2 sclk+mclk, P3 sclk+mclk, P4 sclk, P5 sclk, etc etc). The reverse order of mclk application was probably just a fluke and it worked-around my issue just by chance. Sorry for the confusion. As an experiment, I've tried an interleaved approach (set P0 for BOTH sclk and mclk, then P1 for both sclk and mclk, etc etc) - this way I can confirm that P7 does get applied correctly for me to my set value of 1037mv. Let me know what you think. |
|
That also seems weird, but theoretically shouldn't break things? I can test if that works fine on my card. |
|
Please do. If it works fine for you, I will close this PR and open a new one. |
|
I've tested the approach, and it works fine on my card. Unfortunately I don't have a Polaris card to test this on, as that would be another generation this change affects, but hopefully it's fine. Change in #16 |

Writing the table in ascending order (P0 -> P7) can cause the later high P-state writes to be rejected/clamped by the driver because earlier states were still at higher voltages at the moment the write is processed. This manifests as P7 not going below a floor even though the OD table entry is updated.
Reverse iteration (P7 -> P0) over sclk and mclk levels to ensure that when undervolting, each subsequent write never attempts to set a voltage below a previously committed higher P-state voltage, preventing the driver from rejecting the requested value.
Fixes ilya-zlobintsev/LACT#933