[lm-sensors] G760A not working korrekt on NAS dlink 323 HW C1 (2.6.33.1)

Jean Delvare khali at linux-fr.org
Tue Mar 23 13:43:01 CET 2010


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




More information about the lm-sensors mailing list