Git Product home page Git Product logo

Comments (5)

Vladimir-NTCT avatar Vladimir-NTCT commented on August 18, 2024

Some hints for Accton developers
Our AS5812-54X chassis has AC power supplies. Power supplies info is in a file system as expected:

cd /sys/bus/i2c/devices/57-0050

ls -al

total 0
drwxr-xr-x 3 root root 0 Nov 19 20:40 .
drwxr-xr-x 7 root root 0 Nov 19 20:40 ..
lrwxrwxrwx 1 root root 0 Nov 19 20:40 driver -> ../../../../../../bus/i2c/drivers/as5812_54x_psu
drwxr-xr-x 3 root root 0 Nov 19 20:40 hwmon
-r--r--r-- 1 root root 4096 Nov 19 21:16 modalias
-r--r--r-- 1 root root 4096 Nov 19 21:16 name
-r--r--r-- 1 root root 4096 Nov 19 21:16 psu_index
-r--r--r-- 1 root root 4096 Nov 19 21:16 psu_model_name
-r--r--r-- 1 root root 4096 Nov 19 21:16 psu_power_good
-r--r--r-- 1 root root 4096 Nov 19 21:16 psu_present
lrwxrwxrwx 1 root root 0 Nov 19 20:40 subsystem -> ../../../../../../bus/i2c
-rw-r--r-- 1 root root 4096 Nov 19 20:40 uevent

cd /sys/bus/i2c/devices/58-0053

ls -al

total 0
drwxr-xr-x 3 root root 0 Nov 19 20:40 .
drwxr-xr-x 7 root root 0 Nov 19 20:40 ..
lrwxrwxrwx 1 root root 0 Nov 19 20:40 driver -> ../../../../../../bus/i2c/drivers/as5812_54x_psu
drwxr-xr-x 3 root root 0 Nov 19 20:40 hwmon
-r--r--r-- 1 root root 4096 Nov 19 21:18 modalias
-r--r--r-- 1 root root 4096 Nov 19 21:18 name
-r--r--r-- 1 root root 4096 Nov 19 21:18 psu_index
-r--r--r-- 1 root root 4096 Nov 19 20:58 psu_model_name
-r--r--r-- 1 root root 4096 Nov 19 21:18 psu_power_good
-r--r--r-- 1 root root 4096 Nov 19 21:18 psu_present
lrwxrwxrwx 1 root root 0 Nov 19 20:40 subsystem -> ../../../../../../bus/i2c
-rw-r--r-- 1 root root 4096 Nov 19 20:40 uevent

Looks like ONLP library is looking for info in a wrong place where CD power supplies info is supposed to be but is not present. Library header file platform_lib.h had wrong definitions for PSU1_AC_EEPROM_PREFIX, PSU1_DC_EEPROM_PREFIX, PSU2_AC_EEPROM_PREFIX and PSU2_DC_EEPROM_PREFIX. "AC" and "DC" are reversed.

from opennetworklinux.

roylee123 avatar roylee123 commented on August 18, 2024

Hi, could you show the output of "onlpdump"?
This model support 2 kinds of PSUs, you can find corresponding devices on 57-0050/58-0053 and 57-0038/58-003B.
But your unit is supposed to equip with PSUx_AC_EEPROM_PREFIX.
That's why psu_status_info_get() is always called with is_ac=1.

from opennetworklinux.

Vladimir-NTCT avatar Vladimir-NTCT commented on August 18, 2024

I have no onlpdump:

onlpdump

-sh: onlpdump: not found

which onlpdump

pwd

/sys/bus/i2c/devices/57-0038

ls -al

total 0
drwxr-xr-x 2 root root 0 Nov 19 20:40 .
drwxr-xr-x 7 root root 0 Nov 19 20:40 ..
-r--r--r-- 1 root root 4096 Nov 19 21:16 modalias
-r--r--r-- 1 root root 4096 Nov 19 21:16 name
lrwxrwxrwx 1 root root 0 Nov 19 20:40 subsystem -> ../../../../../../bus/i2c
-rw-r--r-- 1 root root 4096 Nov 19 20:40 uevent

cd ../58-003b

ls -al

total 0
drwxr-xr-x 2 root root 0 Nov 19 20:40 .
drwxr-xr-x 7 root root 0 Nov 19 20:40 ..
-r--r--r-- 1 root root 4096 Nov 26 17:40 modalias
-r--r--r-- 1 root root 4096 Nov 26 17:40 name
lrwxrwxrwx 1 root root 0 Nov 19 20:40 subsystem -> ../../../../../../bus/i2c
-rw-r--r-- 1 root root 4096 Nov 19 20:40 uevent

My power supplies are both AC, information is taken by the driver and placed to the file system under
/sys/bus/i2c/devices/57-0050 and /sys/bus/i2c/devices/58-0053

ONLP library function onlp_psu_info_get() is looking into /sys/bus/i2c/devices/57-0038 and /sys/bus/i2c/devices/58-003b instead and obviously is not finding file "psu_present".

If you look into OpenNetworkLinux/packages/platforms/accton/x86-64/x86-64-accton-as5812-54x/onlp/builds/src/module/src/platform_lib.h
you can find:

#define PSU1_AC_EEPROM_PREFIX "/sys/bus/i2c/devices/57-0038/"
#define PSU1_DC_EEPROM_PREFIX "/sys/bus/i2c/devices/57-0050/"
#define PSU2_AC_EEPROM_PREFIX "/sys/bus/i2c/devices/58-003b/"
#define PSU2_DC_EEPROM_PREFIX "/sys/bus/i2c/devices/58-0053/"

which is incorrect: AC and DC paths are reversed. It should be:

#define PSU1_DC_EEPROM_PREFIX "/sys/bus/i2c/devices/57-0038/"
#define PSU1_AC_EEPROM_PREFIX "/sys/bus/i2c/devices/57-0050/"
#define PSU2_DC_EEPROM_PREFIX "/sys/bus/i2c/devices/58-003b/"
#define PSU2_AC_EEPROM_PREFIX "/sys/bus/i2c/devices/58-0053/"

from opennetworklinux.

roylee123 avatar roylee123 commented on August 18, 2024

Hi,
I can read psu_present at 4 locations you mentioned.
All of them are working.
It supposed you created device with wrong names.
Please check your scripts with

https://github.com/opencomputeproject/OpenNetworkLinux/blob/master/packages/platforms/accton/x86-64/x86-64-accton-as5812-54t/platform-config/r0/src/python/x86_64_accton_as5812_54t_r0/__init__.py

from opennetworklinux.

Vladimir-NTCT avatar Vladimir-NTCT commented on August 18, 2024

Changing I2C devices creation from
echo as5812_54x_psu 0x38 > /sys/bus/i2c/devices/i2c-57/new_device
echo as5812_54x_psu 0x3b > /sys/bus/i2c/devices/i2c-58/new_device
to
echo as5812_54x_psu1 0x38 > /sys/bus/i2c/devices/i2c-57/new_device
echo as5812_54x_psu2 0x3b > /sys/bus/i2c/devices/i2c-58/new_device
in a start-up script resolves this issue.

from opennetworklinux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.