PWM values randomly interpreted invertedly

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
2
down vote

favorite














Ubuntu 18.04 LTS
Linux 4.15.0


Mainboard: Gigabyte z97x Gaming 7 (kernel module: it87)



I am using the endpoints at /sys/class/hwmon/hwmon2 to set my case fans PWM values.



Sample script to set my fan speed via script (using argv):



#!/bin/bash
echo 1 > /sys/class/hwmon/hwmon2/pwm3_enable
echo 1 > /sys/class/hwmon/hwmon2/pwm4_enable
echo 1 > /sys/class/hwmon/hwmon2/pwm5_enable

echo $1 > /sys/class/hwmon/hwmon2/pwm3
echo $2 > /sys/class/hwmon/hwmon2/pwm4
echo $3 > /sys/class/hwmon/hwmon2/pwm5


This script works about 70% of times while the other 30% of times the value for pwm4 and pwm5 are interpreted in an inverted way:



pwm(255) = 0 rpm
pwm( 0 ) = max rpm


The behavior is random and varies through reboots.



What causes PWM values being interpreted in an inverted way? Is there any way I can permanently set the way the PWM values are interpreted?







share|improve this question






















  • have you tried using 1 instead of 0? 1 is so small that most fan won't even run with such a low value. I have seen pwm controlled fans that completely stop at a low pwm value and restart spinning at zero, this is probably a security feature (system crashed -> let spin the fan).
    – pim
    May 29 at 9:43










  • my script is being run on boot and sets all pwm values to 82. This is the value that I found out to be slow, nearly silent but still effective. The issue is that in 30% of all cases inputting 82 results in my fans actually getting 173 (255-82) due to the invert bug.
    – Flatron
    May 29 at 11:30










  • OK, reading your post I assumed only zero was a problem... What is your kernel version? it seems that this patch is related to your problem : patchwork.kernel.org/patch/9615835, should be fixed in 4.10.2 and later
    – pim
    May 29 at 11:40











  • And your kernel is far after that, nothing more to say...
    – pim
    May 29 at 11:55






  • 1




    Seems clearly a bug, the maintainer is Jean Delvare <jdelvare@suse.com>, and the report should go to the linux-hwmon@vger.kernel.org mailing list.
    – pim
    May 30 at 4:40














up vote
2
down vote

favorite














Ubuntu 18.04 LTS
Linux 4.15.0


Mainboard: Gigabyte z97x Gaming 7 (kernel module: it87)



I am using the endpoints at /sys/class/hwmon/hwmon2 to set my case fans PWM values.



Sample script to set my fan speed via script (using argv):



#!/bin/bash
echo 1 > /sys/class/hwmon/hwmon2/pwm3_enable
echo 1 > /sys/class/hwmon/hwmon2/pwm4_enable
echo 1 > /sys/class/hwmon/hwmon2/pwm5_enable

echo $1 > /sys/class/hwmon/hwmon2/pwm3
echo $2 > /sys/class/hwmon/hwmon2/pwm4
echo $3 > /sys/class/hwmon/hwmon2/pwm5


This script works about 70% of times while the other 30% of times the value for pwm4 and pwm5 are interpreted in an inverted way:



pwm(255) = 0 rpm
pwm( 0 ) = max rpm


The behavior is random and varies through reboots.



What causes PWM values being interpreted in an inverted way? Is there any way I can permanently set the way the PWM values are interpreted?







share|improve this question






















  • have you tried using 1 instead of 0? 1 is so small that most fan won't even run with such a low value. I have seen pwm controlled fans that completely stop at a low pwm value and restart spinning at zero, this is probably a security feature (system crashed -> let spin the fan).
    – pim
    May 29 at 9:43










  • my script is being run on boot and sets all pwm values to 82. This is the value that I found out to be slow, nearly silent but still effective. The issue is that in 30% of all cases inputting 82 results in my fans actually getting 173 (255-82) due to the invert bug.
    – Flatron
    May 29 at 11:30










  • OK, reading your post I assumed only zero was a problem... What is your kernel version? it seems that this patch is related to your problem : patchwork.kernel.org/patch/9615835, should be fixed in 4.10.2 and later
    – pim
    May 29 at 11:40











  • And your kernel is far after that, nothing more to say...
    – pim
    May 29 at 11:55






  • 1




    Seems clearly a bug, the maintainer is Jean Delvare <jdelvare@suse.com>, and the report should go to the linux-hwmon@vger.kernel.org mailing list.
    – pim
    May 30 at 4:40












up vote
2
down vote

favorite









up vote
2
down vote

favorite













Ubuntu 18.04 LTS
Linux 4.15.0


Mainboard: Gigabyte z97x Gaming 7 (kernel module: it87)



I am using the endpoints at /sys/class/hwmon/hwmon2 to set my case fans PWM values.



Sample script to set my fan speed via script (using argv):



#!/bin/bash
echo 1 > /sys/class/hwmon/hwmon2/pwm3_enable
echo 1 > /sys/class/hwmon/hwmon2/pwm4_enable
echo 1 > /sys/class/hwmon/hwmon2/pwm5_enable

echo $1 > /sys/class/hwmon/hwmon2/pwm3
echo $2 > /sys/class/hwmon/hwmon2/pwm4
echo $3 > /sys/class/hwmon/hwmon2/pwm5


This script works about 70% of times while the other 30% of times the value for pwm4 and pwm5 are interpreted in an inverted way:



pwm(255) = 0 rpm
pwm( 0 ) = max rpm


The behavior is random and varies through reboots.



What causes PWM values being interpreted in an inverted way? Is there any way I can permanently set the way the PWM values are interpreted?







share|improve this question
















Ubuntu 18.04 LTS
Linux 4.15.0


Mainboard: Gigabyte z97x Gaming 7 (kernel module: it87)



I am using the endpoints at /sys/class/hwmon/hwmon2 to set my case fans PWM values.



Sample script to set my fan speed via script (using argv):



#!/bin/bash
echo 1 > /sys/class/hwmon/hwmon2/pwm3_enable
echo 1 > /sys/class/hwmon/hwmon2/pwm4_enable
echo 1 > /sys/class/hwmon/hwmon2/pwm5_enable

echo $1 > /sys/class/hwmon/hwmon2/pwm3
echo $2 > /sys/class/hwmon/hwmon2/pwm4
echo $3 > /sys/class/hwmon/hwmon2/pwm5


This script works about 70% of times while the other 30% of times the value for pwm4 and pwm5 are interpreted in an inverted way:



pwm(255) = 0 rpm
pwm( 0 ) = max rpm


The behavior is random and varies through reboots.



What causes PWM values being interpreted in an inverted way? Is there any way I can permanently set the way the PWM values are interpreted?









share|improve this question













share|improve this question




share|improve this question








edited May 29 at 9:56









muru

128k19270460




128k19270460










asked May 29 at 9:18









Flatron

607619




607619











  • have you tried using 1 instead of 0? 1 is so small that most fan won't even run with such a low value. I have seen pwm controlled fans that completely stop at a low pwm value and restart spinning at zero, this is probably a security feature (system crashed -> let spin the fan).
    – pim
    May 29 at 9:43










  • my script is being run on boot and sets all pwm values to 82. This is the value that I found out to be slow, nearly silent but still effective. The issue is that in 30% of all cases inputting 82 results in my fans actually getting 173 (255-82) due to the invert bug.
    – Flatron
    May 29 at 11:30










  • OK, reading your post I assumed only zero was a problem... What is your kernel version? it seems that this patch is related to your problem : patchwork.kernel.org/patch/9615835, should be fixed in 4.10.2 and later
    – pim
    May 29 at 11:40











  • And your kernel is far after that, nothing more to say...
    – pim
    May 29 at 11:55






  • 1




    Seems clearly a bug, the maintainer is Jean Delvare <jdelvare@suse.com>, and the report should go to the linux-hwmon@vger.kernel.org mailing list.
    – pim
    May 30 at 4:40
















  • have you tried using 1 instead of 0? 1 is so small that most fan won't even run with such a low value. I have seen pwm controlled fans that completely stop at a low pwm value and restart spinning at zero, this is probably a security feature (system crashed -> let spin the fan).
    – pim
    May 29 at 9:43










  • my script is being run on boot and sets all pwm values to 82. This is the value that I found out to be slow, nearly silent but still effective. The issue is that in 30% of all cases inputting 82 results in my fans actually getting 173 (255-82) due to the invert bug.
    – Flatron
    May 29 at 11:30










  • OK, reading your post I assumed only zero was a problem... What is your kernel version? it seems that this patch is related to your problem : patchwork.kernel.org/patch/9615835, should be fixed in 4.10.2 and later
    – pim
    May 29 at 11:40











  • And your kernel is far after that, nothing more to say...
    – pim
    May 29 at 11:55






  • 1




    Seems clearly a bug, the maintainer is Jean Delvare <jdelvare@suse.com>, and the report should go to the linux-hwmon@vger.kernel.org mailing list.
    – pim
    May 30 at 4:40















have you tried using 1 instead of 0? 1 is so small that most fan won't even run with such a low value. I have seen pwm controlled fans that completely stop at a low pwm value and restart spinning at zero, this is probably a security feature (system crashed -> let spin the fan).
– pim
May 29 at 9:43




have you tried using 1 instead of 0? 1 is so small that most fan won't even run with such a low value. I have seen pwm controlled fans that completely stop at a low pwm value and restart spinning at zero, this is probably a security feature (system crashed -> let spin the fan).
– pim
May 29 at 9:43












my script is being run on boot and sets all pwm values to 82. This is the value that I found out to be slow, nearly silent but still effective. The issue is that in 30% of all cases inputting 82 results in my fans actually getting 173 (255-82) due to the invert bug.
– Flatron
May 29 at 11:30




my script is being run on boot and sets all pwm values to 82. This is the value that I found out to be slow, nearly silent but still effective. The issue is that in 30% of all cases inputting 82 results in my fans actually getting 173 (255-82) due to the invert bug.
– Flatron
May 29 at 11:30












OK, reading your post I assumed only zero was a problem... What is your kernel version? it seems that this patch is related to your problem : patchwork.kernel.org/patch/9615835, should be fixed in 4.10.2 and later
– pim
May 29 at 11:40





OK, reading your post I assumed only zero was a problem... What is your kernel version? it seems that this patch is related to your problem : patchwork.kernel.org/patch/9615835, should be fixed in 4.10.2 and later
– pim
May 29 at 11:40













And your kernel is far after that, nothing more to say...
– pim
May 29 at 11:55




And your kernel is far after that, nothing more to say...
– pim
May 29 at 11:55




1




1




Seems clearly a bug, the maintainer is Jean Delvare <jdelvare@suse.com>, and the report should go to the linux-hwmon@vger.kernel.org mailing list.
– pim
May 30 at 4:40




Seems clearly a bug, the maintainer is Jean Delvare <jdelvare@suse.com>, and the report should go to the linux-hwmon@vger.kernel.org mailing list.
– pim
May 30 at 4:40















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1041506%2fpwm-values-randomly-interpreted-invertedly%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1041506%2fpwm-values-randomly-interpreted-invertedly%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

Trouble downloading packages list due to a “Hash sum mismatch” error

How do I move numbers in filenames, in a batch renaming operation?