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] G760A not working korrekt on NAS dlink 323 HW C1
Date: Tue, 23 Mar 2010 12:43:01 +0000	[thread overview]
Message-ID: <20100323134301.30e109b8@hyperion.delvare> (raw)
In-Reply-To: <1269292447.6810.21.camel@kusanagi>

Hi Denny,

On Mon, 22 Mar 2010 22:14:07 +0100, Denny Schierz wrote:
> I have a NAS from D-Link called DNS-323ยน and it has a fan controller
> G760A. the hardware revision ist C1. My problem is, after starting the
> kernel (2.6.33.1 (* in .config, nit [M] ), the fan stops. I'm not able
> to activate him, with echo, like:
> 
> nas:~# cat /sys/class/hwmon/hwmon0/device/pwm1
> 18
> 
> echo 0 >  /sys/class/hwmon/hwmon0/device/pwm1
> nas:~# cat /sys/class/hwmon/hwmon0/device/pwm1
> 18
> 
> 
> echo 255 >  /sys/class/hwmon/hwmon0/device/pwm1
> nas:~# cat /sys/class/hwmon/hwmon0/device/pwm1
> 18
> 
> I do not know, what could be the problem, so I hope, anybody knows the
> problem:
> 
> nas:~# sensors
> g760a-i2c-0-3e
> Adapter: mv64xxx_i2c adapter
> fan1:       2073 RPM  ALARM

Does this value change over time? I guess not.

> 
> lm75-i2c-0-48
> Adapter: mv64xxx_i2c adapter
> temp1:       +48.5 C  (high = +80.0 C, hyst = +75.0 C)
> 
> ยน http://www.cyrius.com/debian/orion/d-link/dns-323/specs.html
> 
> The revision C1 seems to be a little different, but I don't know, how
> can I figure out this.
> 
> Any suggestions?

According to this page:
http://wiki.dns323.info/hardware:fan

fan speed control is different for the revision C1 hardware. This
suggests that the underlying hardware fan speed controller itself is
different. I would guess that you don't really have a G760A chip on
your board. The Linux kernel assumes it is there and instantiates such
a device, but in that case I would bet it is wrong.

The g760a driver lacks sanity checks when reading register values. It
doesn't catch errors reported by the underlying I2C adapter driver. I
bet that the 18 and 2073 values you get above are actually -ENODEV
being processed by the driver as if no error had occurred. -ENODEV is
-19, which is read as 255-19 = 237 if the error is ignored. The fan
speed computation formula in the driver is (clk*30)/(val*div) with
clk = 32768 and div = 2: (32768*30)/(237*2) = 2073, bingo.

For the time being, arch/arm/mach-orion5x/dns323-setup.c should
probably refrain from instantiating a g760a device on revision C1
boards. You'll have to discuss this with whoever is in charge of this
file.

Then you can try running i2cdetect on the I2C adapter, to see if a
mysterious device has been added. The I2C device map is supposed to be:

/*
 * On the DNS-323 the following devices are attached via I2C:
 *
 *  i2c addr | chip        | description
 *  0x3e     | GMT G760Af  | fan speed PWM controller
 *  0x48     | GMT G751-2f | temp. sensor and therm. watchdog (LM75 compatible)
 *  0x68     | ST M41T80   | RTC w/ alarm
 */

but I guess yours will be different.

-- 
Jean Delvare
http://khali.linux-fr.org/wishlist.html

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

  reply	other threads:[~2010-03-23 12:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-22 21:14 [lm-sensors] G760A not working korrekt on NAS dlink 323 HW C1 Denny Schierz
2010-03-23 12:43 ` Jean Delvare [this message]
2010-03-26  0:48 ` Denny Schierz
2010-03-29 15:25 ` 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=20100323134301.30e109b8@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.