[AMD Official Use Only - Internal Distribution Only] Hi Alex, The speed is not 0 in the below scenario if the rpm is got from the metrics table on navi10. The possibility is that you were using an old firmware. The firmware on my system is 0x002a3e00 Can you remember the version when you saw the problem? Thanks. # echo 1 > devices/pci0000:00/0000:00:01.1/0000:02:00.0/0000:03:00.0/0000:04:00.0/hwmon/hwmon3/pwm1_enable # echo 125 > devices/pci0000:00/0000:00:01.1/0000:02:00.0/0000:03:00.0/0000:04:00.0/hwmon/hwmon3/pwm1 # cat devices/pci0000:00/0000:00:01.1/0000:02:00.0/0000:03:00.0/0000:04:00.0/hwmon/hwmon3/pwm1 109 -----Original Message----- From: Alex Deucher <alexdeucher@xxxxxxxxx> Sent: Thursday, October 22, 2020 11:28 AM To: Feng, Kenneth <Kenneth.Feng@xxxxxxx> Cc: amd-gfx list <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>; Gao, Likun <Likun.Gao@xxxxxxx> Subject: Re: [PATCH] drm/amd/pm: fix the wrong fan speed in fan1_input [CAUTION: External Email] On Wed, Oct 21, 2020 at 11:16 PM Feng, Kenneth <Kenneth.Feng@xxxxxxx> wrote: > > [AMD Official Use Only - Internal Distribution Only] > > Hi Alex, > After reboot, It is also not read back correctly as below. > # echo 1 > > devices/pci0000:00/0000:00:01.1/0000:02:00.0/0000:03:00.0/0000:04:00.0 > /hwmon/hwmon3/fan1_enable s# cat > devices/pci0000:00/0000:00:01.1/0000:02:00.0/0000:03:00.0/0000:04:00.0 > /hwmon/hwmon3/fan1_input > 183105 > # cat > devices/pci0000:00/0000:00:01.1/0000:02:00.0/0000:03:00.0/0000:04:00.0 > /hwmon/hwmon3/fan1_enable > 1 > What about if you manually set the speed. E.g., # echo 1 > devices/pci0000:00/0000:00:01.1/0000:02:00.0/0000:03:00.0/0000:04:00.0/hwmon/hwmon3/fan1_enable # echo 800 > devices/pci0000:00/0000:00:01.1/0000:02:00.0/0000:03:00.0/0000:04:00.0/hwmon/hwmon3/fan1_target # cat devices/pci0000:00/0000:00:01.1/0000:02:00.0/0000:03:00.0/0000:04:00.0/hwmon/hwmon3/fan1_input The problem I ran into on navi1x was setting the fan speed manually resulted in 0 for the fan speed in the metrics table. E.g., # echo 1 > devices/pci0000:00/0000:00:01.1/0000:02:00.0/0000:03:00.0/0000:04:00.0/hwmon/hwmon3/pwm1_enable # echo 125 > devices/pci0000:00/0000:00:01.1/0000:02:00.0/0000:03:00.0/0000:04:00.0/hwmon/hwmon3/pwm1 # cat devices/pci0000:00/0000:00:01.1/0000:02:00.0/0000:03:00.0/0000:04:00.0/hwmon/hwmon3/pwm See: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Famd%2F-%2Fissues%2F1164&data=04%7C01%7CKenneth.Feng%40amd.com%7Cfdef2561887a41322e2a08d8763a897b%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637389341097409110%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=M6EIZVH9vxUJw0d5eh%2B6VzYKQ0LEOwMRdAaEYzrU1d8%3D&reserved=0 Alex > > > -----Original Message----- > From: Alex Deucher <alexdeucher@xxxxxxxxx> > Sent: Thursday, October 22, 2020 10:18 AM > To: Feng, Kenneth <Kenneth.Feng@xxxxxxx> > Cc: amd-gfx list <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>; Gao, Likun > <Likun.Gao@xxxxxxx> > Subject: Re: [PATCH] drm/amd/pm: fix the wrong fan speed in fan1_input > > [CAUTION: External Email] > > On Wed, Oct 21, 2020 at 9:30 PM Feng, Kenneth <Kenneth.Feng@xxxxxxx> wrote: > > > > [AMD Official Use Only - Internal Distribution Only] > > > > Hi Alex, > > Navi10 also has this problem as below. > > # cat > > devices/pci0000:00/0000:00:01.1/0000:02:00.0/0000:03:00.0/0000:04:00 > > .0 > > /hwmon/hwmon3/fan1_input > > 1217 > > # cat > > devices/pci0000:00/0000:00:01.1/0000:02:00.0/0000:03:00.0/0000:04:00 > > .0 > > /hwmon/hwmon3/fan1_enable > > 0 > > # echo 1 > > > devices/pci0000:00/0000:00:01.1/0000:02:00.0/0000:03:00.0/0000:04:00 > > .0 > > /hwmon/hwmon3/fan1_enable # cat > > devices/pci0000:00/0000:00:01.1/0000:02:00.0/0000:03:00.0/0000:04:00 > > .0 > > /hwmon/hwmon3/fan1_enable > > 1 > > s# cat > > devices/pci0000:00/0000:00:01.1/0000:02:00.0/0000:03:00.0/0000:04:00 > > .0 > > /hwmon/hwmon3/fan1_input > > 183105 > > > > In AGM, the rpm is 1800. > > Does it read back correctly if you manually set the fan rpm first before reading it back? > > Alex > > > > > > > > > > -----Original Message----- > > From: Feng, Kenneth > > Sent: Thursday, October 22, 2020 9:11 AM > > To: Alex Deucher <alexdeucher@xxxxxxxxx> > > Cc: amd-gfx list <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>; Gao, Likun > > <Likun.Gao@xxxxxxx> > > Subject: RE: [PATCH] drm/amd/pm: fix the wrong fan speed in > > fan1_input > > > > [AMD Official Use Only - Internal Distribution Only] > > > > Hi Alex, > > Right, smu_v11_0_get_fan_speed_rpm() is not correct for sienna cichlid when it's in manual mode. > > An example is that in my system, the rpm is about 1800 in manual mode, confirmed with AGM and the internal smu fw scoreboard. > > But the fan1_input shows about 180000, which is way more than the real value. > > If you see the value from the metrics table is 0 on navi10, maybe it's the real rpm since we still have 0 rpm feature. > > I can double check the navi10. > > Thanks. > > > > > > -----Original Message----- > > From: Alex Deucher <alexdeucher@xxxxxxxxx> > > Sent: Thursday, October 22, 2020 2:47 AM > > To: Feng, Kenneth <Kenneth.Feng@xxxxxxx> > > Cc: amd-gfx list <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>; Gao, Likun > > <Likun.Gao@xxxxxxx> > > Subject: Re: [PATCH] drm/amd/pm: fix the wrong fan speed in > > fan1_input > > > > [CAUTION: External Email] > > > > On Wed, Oct 21, 2020 at 9:40 AM Alex Deucher <alexdeucher@xxxxxxxxx> wrote: > > > > > > On Wed, Oct 21, 2020 at 9:01 AM Alex Deucher <alexdeucher@xxxxxxxxx> wrote: > > > > > > > > On Wed, Oct 21, 2020 at 2:45 AM Kenneth Feng <kenneth.feng@xxxxxxx> wrote: > > > > > > > > > > fix the wrong fan speed in fan1_input when the fan control mode is manual. > > > > > the fan speed value is not correct when we set manual mode to fan1_enalbe - 1. > > > > > since the fan speed in the metrics table always reflects the > > > > > real fan speed,we can fetch the fan speed for both auto and manual mode. > > > > > > > > > > Signed-off-by: Kenneth Feng <kenneth.feng@xxxxxxx> > > > > > > > > NACK. At least on the navi boards I have, the metrics table fan > > > > speed reads back 0 when the fan is in manual mode. That's why I > > > > changed this in the first place. > > > > > > Nevermind, I was thinking about navi1x. If this is working > > > correctly on sienna cichlid, please ignore me. > > > > That said, I don't see why the current code should not work. Maybe a bug elsewhere? Is smu_v11_0_get_fan_speed_rpm() incorrect for sienna cichlid? > > > > Alex > > > > > > > > Alex > > > > > > > > > > > > > > Alex > > > > > > > > > > > > > --- > > > > > .../gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 11 +++-------- > > > > > 1 file changed, 3 insertions(+), 8 deletions(-) > > > > > > > > > > diff --git > > > > > a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c > > > > > b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c > > > > > index 496abc31b07e..27b6cade9ade 100644 > > > > > --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c > > > > > +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c > > > > > @@ -1171,14 +1171,9 @@ static int sienna_cichlid_get_fan_speed_rpm(struct smu_context *smu, > > > > > if (!speed) > > > > > return -EINVAL; > > > > > > > > > > - switch (smu_v11_0_get_fan_control_mode(smu)) { > > > > > - case AMD_FAN_CTRL_AUTO: > > > > > - return sienna_cichlid_get_smu_metrics_data(smu, > > > > > - METRICS_CURR_FANSPEED, > > > > > - speed); > > > > > - default: > > > > > - return smu_v11_0_get_fan_speed_rpm(smu, speed); > > > > > - } > > > > > + return sienna_cichlid_get_smu_metrics_data(smu, > > > > > + METRICS_CURR_FANSPEED, > > > > > + speed); > > > > > } > > > > > > > > > > static int sienna_cichlid_get_fan_parameters(struct > > > > > smu_context > > > > > *smu) > > > > > -- > > > > > 2.17.1 > > > > > > > > > > _______________________________________________ > > > > > amd-gfx mailing list > > > > > amd-gfx@xxxxxxxxxxxxxxxxxxxxx > > > > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2 > > > > > F%25 > > > > > 2F > > > > > lists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data= > > > > > 04 > > > > > %7 > > > > > C01%7Ckenneth.feng%40amd.com%7Cd8e969f4b63e4897a3df08d875f1b05 > > > > > 0% > > > > > 7C > > > > > 3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637389028190609906% > > > > > 7C > > > > > Un > > > > > known%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTi > > > > > I6 > > > > > Ik > > > > > 1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=KomP2H%2FadKJChDbNvNPQlT > > > > > ot > > > > > mE > > > > > WrhutsQCHfiRIjNUY%3D&reserved=0 _______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/amd-gfx