kernel: (NULL device *): hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info()

Bug #1760273 reported by dino99
38
This bug affects 7 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

That error is logged since a while with all the supported kernels.
Please apply the patch on them:

https://github.com/torvalds/linux/blob/master/drivers/hwmon/hwmon.c

To get a maintained version of lm-sensors:
https://github.com/groeck/lm-sensors

ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: libsensors4 1:3.4.0-4
ProcVersionSignature: Ubuntu 4.13.0-36.40-generic 4.13.13
Uname: Linux 4.13.0-36-generic x86_64
ApportVersion: 2.20.7-0ubuntu3.7
Architecture: amd64
CurrentDesktop: GNOME
Date: Sat Mar 31 10:42:25 2018
Dependencies:
 gcc-7-base 7.2.0-8ubuntu3.2
 libc6 2.26-0ubuntu2.1
 libgcc1 1:7.2.0-8ubuntu3.2
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: lm-sensors
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
dino99 (9d9) wrote :
tags: added: bionic bot-stop-nagging
description: updated
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1760273

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
dino99 (9d9)
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Do you happen to know if this bug also exists in Bionic?

Changed in linux (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Triaged
Revision history for this message
dino99 (9d9) wrote :

Still exist in Bionic

Revision history for this message
dino99 (9d9) wrote :

Have tested the 4.16 vanilla kernel; and the hwmon warning is gone now.

tags: added: kernel-bug-fixed-upstream
dino99 (9d9)
no longer affects: lm-sensors (Ubuntu)
Revision history for this message
dino99 (9d9) wrote :

Test with 4.15.0-14-generic kernel

oem@ubuntu:~$ journalctl -b | grep hwmon_device_register
Apr 03 16:22:25 ubuntu kernel: (NULL device *): hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().

Revision history for this message
dino99 (9d9) wrote :

oem@ubuntu:/boot$ sudo grep hwmon_device_register abi-4.15.0-14-generic
EXPORT_SYMBOL_GPL vmlinux 0x00000000 devm_hwmon_device_register_with_groups
EXPORT_SYMBOL_GPL vmlinux 0x00000000 devm_hwmon_device_register_with_info
EXPORT_SYMBOL_GPL vmlinux 0x00000000 hwmon_device_register # <<<<<<<<<<<<<<<<<<<<<
EXPORT_SYMBOL_GPL vmlinux 0x00000000 hwmon_device_register_with_groups
EXPORT_SYMBOL_GPL vmlinux 0x00000000 hwmon_device_register_with_info

Revision history for this message
dino99 (9d9) wrote :

#5 comment addon

Greping like in #7 the vanilla 4.16 kernel also expose:

EXPORT_SYMBOL_GPL vmlinux 0x00000000 hwmon_device_register

but greping journalctl does not show that warning; maybe it is simply silenced.

Revision history for this message
dino99 (9d9) wrote :

kernel 4.15.0-15

kernel: (NULL device *): hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info()

Revision history for this message
Yovan (navoytak) wrote :

Is this bug harmless?

This bug still exists. My system ubuntu uname -a:

Linux vanoy 4.15.0-70-generic #79-Ubuntu SMP Tue Nov 12 10:36:11 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
You-Sheng Yang (vicamo) wrote :

Harmless. There are still 40+ drivers using this API in current mainline kernel v5.4.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
Download full text (25.6 KiB)

Yep, agreeing tho You-Sheng.
People are seeing this when e.g. using lm-sensores as it will trigger the hwmon interfaces which have plenty of these old calls.

Here an example list:
Documentation/hwmon/hwmon-kernel-api.rst:27: hwmon_device_register_with_groups(struct device *dev, const char *name,
Documentation/hwmon/hwmon-kernel-api.rst:32: devm_hwmon_device_register_with_groups(struct device *dev,
Documentation/hwmon/hwmon-kernel-api.rst:37: hwmon_device_register_with_info(struct device *dev,
Documentation/hwmon/hwmon-kernel-api.rst:43: devm_hwmon_device_register_with_info(struct device *dev,
Documentation/hwmon/hwmon-kernel-api.rst:53:hwmon_device_register_with_groups registers a hardware monitoring device.
Documentation/hwmon/hwmon-kernel-api.rst:58:hwmon_device_register_with_groups will attach this pointer to the newly
Documentation/hwmon/hwmon-kernel-api.rst:62:hwmon_device_register_with_groups creates the hwmon device with name attribute
Documentation/hwmon/hwmon-kernel-api.rst:67:devm_hwmon_device_register_with_groups is similar to
Documentation/hwmon/hwmon-kernel-api.rst:68:hwmon_device_register_with_groups. However, it is device managed, meaning the
Documentation/hwmon/hwmon-kernel-api.rst:71:hwmon_device_register_with_info is the most comprehensive and preferred means
Documentation/hwmon/hwmon-kernel-api.rst:78:devm_hwmon_device_register_with_info is similar to
Documentation/hwmon/hwmon-kernel-api.rst:79:hwmon_device_register_with_info. However, it is device managed, meaning the
Documentation/hwmon/hwmon-kernel-api.rst:86:hwmon_device_register_with_groups or hwmon_device_register_with_info.
Documentation/hwmon/hwmon-kernel-api.rst:90:the call to devm_hwmon_device_register_with_groups or
Documentation/hwmon/hwmon-kernel-api.rst:91:hwmon_device_register_with_info and if the automatic (device managed)
Documentation/hwmon/hwmon-kernel-api.rst:98:Using devm_hwmon_device_register_with_info()
Documentation/hwmon/hwmon-kernel-api.rst:101:hwmon_device_register_with_info() registers a hardware monitoring device.
Documentation/hwmon/hwmon-kernel-api.rst:339:hwmon_device_register_with_info or devm_hwmon_device_register_with_info,
Documentation/hwmon/submitting-patches.rst:127:* Use devm_hwmon_device_register_with_info() or, if your driver needs a remove
Documentation/hwmon/submitting-patches.rst:128: function, hwmon_device_register_with_info() to register your driver with the
Documentation/hwmon/submitting-patches.rst:130: possible. Do not use hwmon_device_register().
drivers/net/phy/nxp-tja11xx.c:349: devm_hwmon_device_register_with_info(dev, priv->hwmon_name,
drivers/net/phy/aquantia_hwmon.c:244: hwmon_dev = devm_hwmon_device_register_with_info(dev, hwmon_name,
drivers/net/phy/sfp.c:1173: sfp->hwmon_dev = hwmon_device_register_with_info(sfp->dev,
drivers/net/phy/marvell10g.c:191: priv->hwmon_dev = devm_hwmon_device_register_with_info(dev,
drivers/net/phy/marvell.c:2047: priv->hwmon_dev = devm_hwmon_device_register_with_info(
drivers/net/ethernet/sfc/mcdi_mon.c:505: hwmon->device = hwmon_device_register_with_groups(&efx->pci_dev->dev,
drivers/net/ethernet/emulex/benet/be_main.c:6014: ...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.