Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PDDF kernel modules with 5.10 kernel and fix some compilation … #9582

Merged
merged 3 commits into from
Jan 3, 2022

Conversation

FuzailBrcm
Copy link
Contributor

…warnings

Why I did it

There were compilation errors and warnings like,

  1. /usr/src/linux-headers-5.10.0-8-2-common/scripts/Makefile.build:69: You cannot use subdir-y/m to visit a module Makefile. Use obj-y/m instead.

  2. fatal error: linux/platform_data/pca954x.h: No such file or directory

  3. hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().

  4. If PDDF kernel module compilation fails, the PDDF debian package was not detecting the break.

How I did it

  • Modified the code with new kernel 5.10 APIs.
  • Modified the Makefiles to use 'obj-m' instead of 'subdir-y'

How to verify it

  • PDDF is supported on Accton platform. Load the build on AS7326 setup and check the 'dmesg'

Some logs are here,

root@sonic:/home/admin# show ver

SONiC Software Version: SONiC.master.59273-dirty-20211215.190411
Distribution: Debian 11.1
Kernel: 5.10.0-8-2-amd64
Build commit: d05afb5db
Build date: Wed Dec 15 19:11:16 UTC 2021
Built by: AzDevOps@sonic-build-workers-000ZI8

Platform: x86_64-accton_as7326_56x-r0
HwSKU: Accton-AS7326-56X
ASIC: broadcom
..
root@sonic:/home/admin#
root@sonic:/home/admin# systemctl status pddf-platform-init.service
● pddf-platform-init.service - PDDF module and device initialization service
     Loaded: loaded (/lib/systemd/system/pddf-platform-init.service; enabled; vendor preset: enabled)
     Active: active (exited) since Fri 2021-12-17 04:54:12 UTC; 20s ago
    Process: 792 ExecStart=/usr/local/bin/pddf_util.py install (code=exited, status=0/SUCCESS)
   Main PID: 792 (code=exited, status=0/SUCCESS)

Dec 17 04:54:03 sonic systemd[1]: Starting PDDF module and device initialization service...
Dec 17 04:54:12 sonic pddf_util.py[792]: Checking system....
Dec 17 04:54:12 sonic pddf_util.py[792]: PDDF has no PDDF driver installed....
Dec 17 04:54:12 sonic pddf_util.py[792]: Installing ...
Dec 17 04:54:12 sonic pddf_util.py[792]: Failed :pip3 show sonic-platform > /dev/null 2>&1
Dec 17 04:54:12 sonic pddf_util.py[792]: Attemting to install the PDDF sonic_platform wheel package ...
Dec 17 04:54:12 sonic pddf_util.py[792]: Successfully installed /usr/share/sonic/device/x86_64-accton_as7326_56x-r0/sonic_platform-1.0-py3-none-any.whl package
Dec 17 04:54:12 sonic pddf_util.py[792]: Creating devices ...
Dec 17 04:54:12 sonic systemd[1]: Finished PDDF module and device initialization service.
root@sonic:/home/admin# 
root@sonic:/home/admin# systemctl status as7326-56x-pddf-platform-monitor.service
● as7326-56x-pddf-platform-monitor.service - Accton AS7326-56X Platform Monitoring service
     Loaded: loaded (/lib/systemd/system/as7326-56x-pddf-platform-monitor.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2021-12-17 07:08:46 UTC; 1h 56min ago
   Main PID: 4759 (python3)
      Tasks: 1 (limit: 19049)
     Memory: 18.2M
     CGroup: /system.slice/as7326-56x-pddf-platform-monitor.service
             └─4759 python3 /usr/local/bin/accton_as7326_pddf_monitor.py

Dec 17 07:08:46 sonic systemd[1]: Started Accton AS7326-56X Platform Monitoring service.
root@sonic:/home/admin#

root@sonic:/var/log/pddf#
root@sonic:/var/log/pddf# pddf_psuutil mfrinfo
PSU    Status    Manufacturer ID    Model     Serial              Fan Airflow Direction
-----  --------  -----------------  --------  ------------------  -----------------------
PSU1   NOT OK
PSU2   OK        3Y POWER           YM-2651Y  SA070V581836002372  EXHAUST
root@sonic:/var/log/pddf# pddf_psuutil seninfo
PSU    Status      Output Voltage (V)    Output Current (A)    Output Power (W)    Temperature1 (C)    Fan1 Speed (RPM)
-----  --------  --------------------  --------------------  ------------------  ------------------  ------------------
PSU1   NOT OK                    0.00                  0.00                0.00                0.00                   0
PSU2   OK                       12.02                  8.11               97.00               24.00                6400
root@sonic:/var/log/pddf# pddf_fanutil direction
FAN         Direction
----------  -----------
Fantray1_1  Exhaust
Fantray1_2  Exhaust
Fantray2_1  Exhaust
Fantray2_2  Exhaust
Fantray3_1  Exhaust
Fantray3_2  Exhaust
Fantray4_1  Exhaust
Fantray4_2  Exhaust
Fantray5_1  Exhaust
Fantray5_2  Exhaust
Fantray6_1  Exhaust
Fantray6_2  Exhaust
root@sonic:/var/log/pddf# pddf_fanutil getspeed
FAN           SPEED (RPM)
----------  -------------
Fantray1_1          10800
Fantray1_2           9700
Fantray2_1          10800
Fantray2_2           9800
Fantray3_1          10800
Fantray3_2           9800
Fantray4_1          11000
Fantray4_2          10000
Fantray5_1          10900
Fantray5_2           9900
Fantray6_1          10800
Fantray6_2           9800
root@sonic:/var/log/pddf#

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

@FuzailBrcm FuzailBrcm requested a review from lguohan as a code owner December 17, 2021 09:07
@FuzailBrcm
Copy link
Contributor Author

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 9582 in repo Azure/sonic-buildimage

@FuzailBrcm
Copy link
Contributor Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list.

jostar-yang
jostar-yang previously approved these changes Dec 21, 2021
Copy link
Contributor

@jostar-yang jostar-yang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes are ok to me.

@FuzailBrcm
Copy link
Contributor Author

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 9582 in repo Azure/sonic-buildimage

@geans-pin
Copy link
Contributor

/azpw run

geans-pin
geans-pin previously approved these changes Dec 21, 2021
@FuzailBrcm FuzailBrcm dismissed stale reviews from geans-pin and jostar-yang via f6c136c December 21, 2021 08:37
geans-pin
geans-pin previously approved these changes Dec 22, 2021
Copy link
Contributor

@jostar-yang jostar-yang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Th changes are fine to me.

jostar-yang
jostar-yang previously approved these changes Dec 22, 2021
Copy link
Contributor

@jostar-yang jostar-yang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is fine to me.

Copy link
Collaborator

@lguohan lguohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@lguohan lguohan merged commit 93247a6 into sonic-net:master Jan 3, 2022
seanwu-ec pushed a commit to seanwu-ec/sonic-buildimage that referenced this pull request Jan 13, 2022
…ilation (sonic-net#9582)

- Why I did it
There were compilation errors and warnings like,

/usr/src/linux-headers-5.10.0-8-2-common/scripts/Makefile.build:69: You cannot use subdir-y/m to visit a module Makefile. Use obj-y/m instead.

fatal error: linux/platform_data/pca954x.h: No such file or directory

hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().

If PDDF kernel module compilation fails, the PDDF debian package was not detecting the break.

- How I did it
Modified the code with new kernel 5.10 APIs.
Modified the Makefiles to use 'obj-m' instead of 'subdir-y'

- How to verify it
PDDF is supported on Accton platform. Load the build on AS7326 setup and check the 'dmesg'
@FuzailBrcm
Copy link
Contributor Author

@prgeor @vdahiya12
Please include this PR in 202111 branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants