All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] PWMconfig problem with Asus P5B Deluxe / Winbond
Date: Sun, 18 Nov 2007 16:34:01 +0000	[thread overview]
Message-ID: <20071118173401.393c00dc@hyperion.delvare> (raw)
In-Reply-To: <4dfa50520711142226r2e6d1c3fy229e05d4ca43d032@mail.gmail.com>

On Sun, 18 Nov 2007 16:57:22 +0100, Alexander Kiel wrote:
> Hi Jean,
> 
> > > Ok the problem with pwmconfig is the following:
> > > 
> > > echo 0 > $ENABLE 2> /dev/null outputs actually 0. This is the 0 from the
> > > echo. echo 3 > $ENABLE 2> /dev/null would output 3. I have no clue why
> > > this is the case.
> > 
> > How did you try that, on the command line? $ENABLE is a variable in the
> > pwmconfig script, on the command line it's undefined, so that can't
> > work. Your original report doesn't show any "0" printed on the screen.
> 
> Yes I did this on the command line (bash). Of course, I replaced the
> $ENABLE variable through pwm1_enable. Try the following command
> in /sys/class/hwmon/hwmon0/device as root:
> 
> echo 255 > pwm1; echo 0 > pwm1_enable 2>/dev/null; echo 1 > pwm1_enable
> 2>/dev/null; echo 255 > pwm1; cat pwm1
> 
> This gives me a 0 on the stdout. But this:
> 
> echo 255 > pwm1; echo 0 > pwm1_enable >/dev/null 2>/dev/null; echo 1 >
> pwm1_enable 2>/dev/null; echo 255 > pwm1; cat pwm1
> 
> gives me 255 on stdout. 

May I ask what shell (and version) you're using? Both sequences above
return 255 here.

> 
> PWM1 has no fan attached in my configuration. It may be the CPU fan
> controller, but I don't have a CPU fan, I have water cooling. I don't
> know if this makes a difference. Currently I have pwm4 working by BIOS
> (ASUS Q-fan control). 

PWM1 has no fan attached on my system either.

> 
> > > This 0 causes the line echo $MAX > $1 to set pwm1 to 0 instead of 255.
> > 
> > I very much doubt it. Both statements are separate, I fail to see how
> > whatever the first one does could have any influence on the second.
> 
> I don't have much experience in shell programming. But is it possible
> that the 0 at stdout stays there until the next command? And than the
> cat 255 > pwm1 would be a echo 0 255 > pwm1.

It would take a broken shell to do what you describe, if that's
possible at all. The following command should answer your question:

echo 0 > /sys/class/hwmon/hwmon0/device/pwm1_enable ; echo 255 > /tmp/pwm1 ; cat /tmp/pwm1

Here, it prints the expected error message, then 255.

> 
> > > If I add a > /dev/null to the line echo 0 > $ENABLE 2> /dev/null it
> > > works as it should.
> > > 
> > > So the diff is:
> > > ----------------------------------------------------------------------
> > > 127c127
> > > <               echo 0 > $ENABLE > /dev/null 2> /dev/null
> > > ---
> > > >               echo 0 > $ENABLE 2> /dev/null
> > > ----------------------------------------------------------------------
> > > 
> > > Can you submit this patch? I don't have a reasonable access to the
> > > lm-sensors community.
> > 
> > This patch is not correct, it breaks pwmconfig more than it fixes it.
> 
> I have pwmconfig v0.8. Maybe the line numbers are not correct in your
> version. I think you will find the right position per hand. a additional
> > /dev/null should not hurt.

I meant that the patch is functionally incorrect, not that I was not
able to apply it (although it is, indeed, technically incorrect, for
it's reverted and not in unified format.)

An additional > /dev/null can certainly hurt, as it overwrites the
previous > $ENABLE, meaning that you do NOT write the value to the
sysfs file at all. It doesn't make a difference for you because writing
0 to pwm1_enable doesn't actually work with the w83627ehf driver, but
your change breaks drivers for which it works.

> 
> > As explained above, the problem you have is not with setting
> > pwm1_enable to 1 (that works) but presumably with setting pwm1 to 255.
> > So you're trying to fix the wrong line of the script.
> 
> Yes the problem is setting pwm1 to 255. But it is set to 0 by pwmconfig
> v0.8. And after my investigation I find out that the 0 comes from this
> echo 0 statement. I than fixed pwmconfig with this additional
> > /dev/null and it worked for me. It worked completely. It found my fan
> attached to pwm4 and all this stuff.

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

  parent reply	other threads:[~2007-11-18 16:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-15  6:26 [lm-sensors] PWMconfig problem with Asus P5B Deluxe / Winbond David Hubbard
2007-11-15 11:08 ` Alexander Kiel
2007-11-15 19:41 ` David Hubbard
2007-11-15 23:15 ` Alexander Kiel
2007-11-16  0:24 ` David Hubbard
2007-11-16  0:41 ` Alexander Kiel
2007-11-16  0:59 ` David Hubbard
2007-11-18 15:14 ` Jean Delvare
2007-11-18 15:57 ` Alexander Kiel
2007-11-18 16:34 ` Jean Delvare [this message]
2007-11-18 17:10 ` Alexander Kiel
2007-11-18 20:09 ` Jean Delvare
2007-11-19  6:32 ` David Hubbard
2007-11-21 22:16 ` Jean Delvare

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071118173401.393c00dc@hyperion.delvare \
    --to=khali@linux-fr.org \
    --cc=lm-sensors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.