michaelroland / wdnas-hwdaemon

Hardware Controller for Western Digital My Cloud NAS Systems
GNU General Public License v3.0
13 stars 10 forks source link

PRx100 compatibility #4

Closed stefaang closed 2 years ago

stefaang commented 6 years ago

On the PR2100/PR4100, coretemp is at /sys/class/hwmon/hwmon1 instead of /sys/class/hwmon/hwmon0.

The memory temperature sensor is located on address 0x4c on bus 5.

stefaan@debian ~ % sudo modprobe i2c-dev
stefaan@debian ~ % sudo i2cdetect -y 5       
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- 08 -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: 30 31 -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- 4c -- -- -- 
50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
stefaan@debian ~ % sudo i2cget -y 5 0x4c 0x00
0x25
stefaan@debian ~ % sudo i2cget -y 5 0x4c 0x01
0x28

It would be helpful if these parameters could be set via the config file.

The PMC is available at /dev/ttyS2 when the kernel is compiled with CONFIG_SERIAL_8250_LPSS enabled. This option is already available.

michaelroland commented 6 years ago

I've followed the discussion at https://community.wd.com/t/guide-how-to-install-debian-linux-on-the-my-cloud-pr4100-nas/217141 and I'm already working on some of the issues mentioned there. However, I don't have a PR2100/PR4100 to debug on.

Could you provide some more information from your device? Specifically:

stefaang commented 6 years ago

Here's the info you requested.

stefaan@ptr-eiwxtdwig27a15tzjnm ~ % ls -l /sys/class/hwmon/hwmon*/
/sys/class/hwmon/hwmon0/:
total 0
-r--r--r-- 1 root root 4096 Jul 10 00:24 name
drwxr-xr-x 2 root root    0 Jul 30 11:58 power
lrwxrwxrwx 1 root root    0 Jul 10 00:23 subsystem -> ../../../../class/hwmon
-r--r--r-- 1 root root 4096 Jul 10 00:24 temp1_crit
-r--r--r-- 1 root root 4096 Jul 10 00:24 temp1_input
-rw-r--r-- 1 root root 4096 Jul 30 11:58 uevent

/sys/class/hwmon/hwmon1/:
total 0
lrwxrwxrwx 1 root root    0 Jul 10 00:24 device -> ../../../coretemp.0
-r--r--r-- 1 root root 4096 Jul 10 00:24 name
drwxr-xr-x 2 root root    0 Jul 30 11:58 power
lrwxrwxrwx 1 root root    0 Jul 10 00:23 subsystem -> ../../../../../class/hwmon
-r--r--r-- 1 root root 4096 Jul 10 00:24 temp2_crit
-r--r--r-- 1 root root 4096 Jul 10 00:24 temp2_crit_alarm
-r--r--r-- 1 root root 4096 Jul 10 00:24 temp2_input
-r--r--r-- 1 root root 4096 Jul 10 00:24 temp2_label
-r--r--r-- 1 root root 4096 Jul 10 00:24 temp2_max
-r--r--r-- 1 root root 4096 Jul 10 00:24 temp3_crit
-r--r--r-- 1 root root 4096 Jul 10 00:24 temp3_crit_alarm
-r--r--r-- 1 root root 4096 Jul 10 00:24 temp3_input
-r--r--r-- 1 root root 4096 Jul 10 00:24 temp3_label
-r--r--r-- 1 root root 4096 Jul 10 00:24 temp3_max
-r--r--r-- 1 root root 4096 Jul 10 00:24 temp4_crit
-r--r--r-- 1 root root 4096 Jul 10 00:24 temp4_crit_alarm
-r--r--r-- 1 root root 4096 Jul 10 00:24 temp4_input
-r--r--r-- 1 root root 4096 Jul 10 00:24 temp4_label
-r--r--r-- 1 root root 4096 Jul 10 00:24 temp4_max
-r--r--r-- 1 root root 4096 Jul 10 00:24 temp5_crit
-r--r--r-- 1 root root 4096 Jul 10 00:24 temp5_crit_alarm
-r--r--r-- 1 root root 4096 Jul 10 00:24 temp5_input
-r--r--r-- 1 root root 4096 Jul 10 00:24 temp5_label
-r--r--r-- 1 root root 4096 Jul 10 00:24 temp5_max
-rw-r--r-- 1 root root 4096 Jul 10 00:23 uevent

stefaan@ptr-eiwxtdwig27a15tzjnm ~ % tail -n +1 /sys/class/hwmon/hwmon*/name
==> /sys/class/hwmon/hwmon0/name <==
acpitz

==> /sys/class/hwmon/hwmon1/name <==
coretemp

stefaan@ptr-eiwxtdwig27a15tzjnm ~ % tail -n +1 /sys/class/hwmon/hwmon*/temp*_label

==> /sys/class/hwmon/hwmon1/temp2_label <==
Core 0

==> /sys/class/hwmon/hwmon1/temp3_label <==
Core 1

==> /sys/class/hwmon/hwmon1/temp4_label <==
Core 2

==> /sys/class/hwmon/hwmon1/temp5_label <==
Core 3

stefaan@ptr-eiwxtdwig27a15tzjnm ~ % ls -l /sys/class/i2c-dev

total 0
lrwxrwxrwx 1 root root 0 Aug  3 13:45 i2c-0 -> ../../devices/pci0000:00/0000:00:18.2/i2c-0/i2c-dev/i2c-0
lrwxrwxrwx 1 root root 0 Aug  3 13:45 i2c-1 -> ../../devices/pci0000:00/0000:00:18.3/i2c-1/i2c-dev/i2c-1
lrwxrwxrwx 1 root root 0 Aug  3 13:45 i2c-2 -> ../../devices/pci0000:00/0000:00:18.4/i2c-2/i2c-dev/i2c-2
lrwxrwxrwx 1 root root 0 Aug  3 13:45 i2c-3 -> ../../devices/pci0000:00/0000:00:18.6/i2c-3/i2c-dev/i2c-3
lrwxrwxrwx 1 root root 0 Aug  3 13:45 i2c-4 -> ../../devices/pci0000:00/0000:00:18.7/i2c-4/i2c-dev/i2c-4
lrwxrwxrwx 1 root root 0 Aug  3 13:45 i2c-5 -> ../../devices/pci0000:00/0000:00:1f.3/i2c-5/i2c-dev/i2c-5

stefaan@ptr-eiwxtdwig27a15tzjnm ~ % tail -n +1 /sys/class/i2c-dev/*/name

==> /sys/class/i2c-dev/i2c-0/name <==
Synopsys DesignWare I2C adapter

==> /sys/class/i2c-dev/i2c-1/name <==
Synopsys DesignWare I2C adapter

==> /sys/class/i2c-dev/i2c-2/name <==
Synopsys DesignWare I2C adapter

==> /sys/class/i2c-dev/i2c-3/name <==
Synopsys DesignWare I2C adapter

==> /sys/class/i2c-dev/i2c-4/name <==
Synopsys DesignWare I2C adapter

==> /sys/class/i2c-dev/i2c-5/name <==
SMBus I801 adapter at f040

stefaan@ptr-eiwxtdwig27a15tzjnm ~ % tail -n +1 /sys/class/i2c-dev/*/device/device/vendor

==> /sys/class/i2c-dev/i2c-0/device/device/vendor <==
0x8086

==> /sys/class/i2c-dev/i2c-1/device/device/vendor <==
0x8086

==> /sys/class/i2c-dev/i2c-2/device/device/vendor <==
0x8086

==> /sys/class/i2c-dev/i2c-3/device/device/vendor <==
0x8086

==> /sys/class/i2c-dev/i2c-4/device/device/vendor <==
0x8086

==> /sys/class/i2c-dev/i2c-5/device/device/vendor <==
0x8086

stefaan@ptr-eiwxtdwig27a15tzjnm ~ % tail -n +1 /sys/class/i2c-dev/*/device/device/device

==> /sys/class/i2c-dev/i2c-0/device/device/device <==
0x22c2

==> /sys/class/i2c-dev/i2c-1/device/device/device <==
0x22c3

==> /sys/class/i2c-dev/i2c-2/device/device/device <==
0x22c4

==> /sys/class/i2c-dev/i2c-3/device/device/device <==
0x22c6

==> /sys/class/i2c-dev/i2c-4/device/device/device <==
0x22c7

==> /sys/class/i2c-dev/i2c-5/device/device/device <==
0x2292

stefaan@ptr-eiwxtdwig27a15tzjnm ~ % tail -n +1 /sys/class/block/sd*/vendor

zsh: no matches found: /sys/class/block/sd*/vendor

stefaan@ptr-eiwxtdwig27a15tzjnm /sys/class/block % ll
total 0
lrwxrwxrwx 1 root root 0 Jul 10 00:23 md127 -> ../../devices/virtual/block/md127
lrwxrwxrwx 1 root root 0 Jul 10 00:23 mmcblk0 -> ../../devices/pci0000:00/0000:00:10.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0
lrwxrwxrwx 1 root root 0 Jul 10 00:23 mmcblk0boot0 -> ../../devices/pci0000:00/0000:00:10.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0boot0
lrwxrwxrwx 1 root root 0 Jul 10 00:23 mmcblk0boot1 -> ../../devices/pci0000:00/0000:00:10.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0boot1
lrwxrwxrwx 1 root root 0 Jul 10 00:23 mmcblk0p1 -> ../../devices/pci0000:00/0000:00:10.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p1
lrwxrwxrwx 1 root root 0 Jul 10 00:23 mmcblk0p2 -> ../../devices/pci0000:00/0000:00:10.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p2
lrwxrwxrwx 1 root root 0 Jul 10 00:23 mmcblk0p3 -> ../../devices/pci0000:00/0000:00:10.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p3
lrwxrwxrwx 1 root root 0 Jul 10 00:23 mmcblk0p4 -> ../../devices/pci0000:00/0000:00:10.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p4
lrwxrwxrwx 1 root root 0 Jul 10 00:23 mmcblk0p5 -> ../../devices/pci0000:00/0000:00:10.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p5
lrwxrwxrwx 1 root root 0 Jul 10 00:23 mmcblk0p6 -> ../../devices/pci0000:00/0000:00:10.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p6
lrwxrwxrwx 1 root root 0 Jul 10 00:23 mmcblk0p7 -> ../../devices/pci0000:00/0000:00:10.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p7
lrwxrwxrwx 1 root root 0 Jul 10 00:23 mmcblk0p8 -> ../../devices/pci0000:00/0000:00:10.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p8
lrwxrwxrwx 1 root root 0 Jul 10 00:23 mmcblk0p9 -> ../../devices/pci0000:00/0000:00:10.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0p9
lrwxrwxrwx 1 root root 0 Jul 10 00:23 mmcblk0rpmb -> ../../devices/pci0000:00/0000:00:10.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/mmcblk0rpmb
lrwxrwxrwx 1 root root 0 Jul 10 00:23 sda -> ../../devices/pci0000:00/0000:00:13.0/ata1/host0/target0:0:0/0:0:0:0/block/sda
lrwxrwxrwx 1 root root 0 Jul 10 00:23 sda1 -> ../../devices/pci0000:00/0000:00:13.0/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda1
lrwxrwxrwx 1 root root 0 Jul 10 00:23 sda2 -> ../../devices/pci0000:00/0000:00:13.0/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda2
lrwxrwxrwx 1 root root 0 Jul 10 00:23 sdb -> ../../devices/pci0000:00/0000:00:13.0/ata2/host1/target1:0:0/1:0:0:0/block/sdb
lrwxrwxrwx 1 root root 0 Jul 10 00:23 sdb1 -> ../../devices/pci0000:00/0000:00:13.0/ata2/host1/target1:0:0/1:0:0:0/block/sdb/sdb1
lrwxrwxrwx 1 root root 0 Jul 10 00:23 sdb2 -> ../../devices/pci0000:00/0000:00:13.0/ata2/host1/target1:0:0/1:0:0:0/block/sdb/sdb2
lrwxrwxrwx 1 root root 0 Jul 10 00:23 sdc -> ../../devices/pci0000:00/0000:00:1c.2/0000:03:00.0/ata3/host2/target2:0:0/2:0:0:0/block/sdc
lrwxrwxrwx 1 root root 0 Jul 10 00:23 sdc1 -> ../../devices/pci0000:00/0000:00:1c.2/0000:03:00.0/ata3/host2/target2:0:0/2:0:0:0/block/sdc/sdc1
lrwxrwxrwx 1 root root 0 Jul 10 00:23 sdc2 -> ../../devices/pci0000:00/0000:00:1c.2/0000:03:00.0/ata3/host2/target2:0:0/2:0:0:0/block/sdc/sdc2
lrwxrwxrwx 1 root root 0 Jul 10 00:23 sdd -> ../../devices/pci0000:00/0000:00:1c.3/0000:04:00.0/ata5/host4/target4:0:0/4:0:0:0/block/sdd
lrwxrwxrwx 1 root root 0 Jul 10 00:23 sdd1 -> ../../devices/pci0000:00/0000:00:1c.3/0000:04:00.0/ata5/host4/target4:0:0/4:0:0:0/block/sdd/sdd1
lrwxrwxrwx 1 root root 0 Jul 10 00:23 sdd2 -> ../../devices/pci0000:00/0000:00:1c.3/0000:04:00.0/ata5/host4/target4:0:0/4:0:0:0/block/sdd/sdd2
lrwxrwxrwx 1 root root 0 Jul 10 00:23 sde -> ../../devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.0/host6/target6:0:0/6:0:0:0/block/sde
lrwxrwxrwx 1 root root 0 Jul 10 00:23 sde1 -> ../../devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.0/host6/target6:0:0/6:0:0:0/block/sde/sde1
lrwxrwxrwx 1 root root 0 Jul 10 00:23 sde2 -> ../../devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.0/host6/target6:0:0/6:0:0:0/block/sde/sde2
lrwxrwxrwx 1 root root 0 Jul 10 00:23 sde3 -> ../../devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.0/host6/target6:0:0/6:0:0:0/block/sde/sde3

stefaan@ptr-eiwxtdwig27a15tzjnm /sys/class/block % cat /proc/cpuinfo 
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 76
model name  : Intel(R) Pentium(R) CPU  N3710  @ 1.60GHz
stepping    : 4
microcode   : 0x403
cpu MHz     : 694.140
cache size  : 1024 KB
physical id : 0
siblings    : 4
core id     : 0
cpu cores   : 4
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes rdrand lahf_lm 3dnowprefetch epb kaiser tpr_shadow vnmi flexpriority ept vpid tsc_adjust smep erms dtherm ida arat
bugs        : cpu_meltdown spectre_v1 spectre_v2
bogomips    : 3200.00
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor   : 1
vendor_id   : GenuineIntel
cpu family  : 6
model       : 76
model name  : Intel(R) Pentium(R) CPU  N3710  @ 1.60GHz
stepping    : 4
microcode   : 0x403
cpu MHz     : 870.605
cache size  : 1024 KB
physical id : 0
siblings    : 4
core id     : 1
cpu cores   : 4
apicid      : 2
initial apicid  : 2
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes rdrand lahf_lm 3dnowprefetch epb kaiser tpr_shadow vnmi flexpriority ept vpid tsc_adjust smep erms dtherm ida arat
bugs        : cpu_meltdown spectre_v1 spectre_v2
bogomips    : 3200.00
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor   : 2
vendor_id   : GenuineIntel
cpu family  : 6
model       : 76
model name  : Intel(R) Pentium(R) CPU  N3710  @ 1.60GHz
stepping    : 4
microcode   : 0x403
cpu MHz     : 883.789
cache size  : 1024 KB
physical id : 0
siblings    : 4
core id     : 2
cpu cores   : 4
apicid      : 4
initial apicid  : 4
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes rdrand lahf_lm 3dnowprefetch epb kaiser tpr_shadow vnmi flexpriority ept vpid tsc_adjust smep erms dtherm ida arat
bugs        : cpu_meltdown spectre_v1 spectre_v2
bogomips    : 3200.00
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor   : 3
vendor_id   : GenuineIntel
cpu family  : 6
model       : 76
model name  : Intel(R) Pentium(R) CPU  N3710  @ 1.60GHz
stepping    : 4
microcode   : 0x403
cpu MHz     : 1013.378
cache size  : 1024 KB
physical id : 0
siblings    : 4
core id     : 3
cpu cores   : 4
apicid      : 6
initial apicid  : 6
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes rdrand lahf_lm 3dnowprefetch epb kaiser tpr_shadow vnmi flexpriority ept vpid tsc_adjust smep erms dtherm ida arat
bugs        : cpu_meltdown spectre_v1 spectre_v2
bogomips    : 3200.00
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:
stefaang commented 6 years ago

EDIT: nvm... I was curious why my fan started spinning so often but it's clearly related to processor load.

stefaang commented 6 years ago

FYI, I made a fork of this project: https://github.com/WDCommunity/wdnas-hwtools It's more targeted towards the PRx100 as the DLx100 is no longer available in the official channels. I intend to maintain support for the DLx100 though.

michaelroland commented 2 years ago

Works for me now.