Commit 42f7d489 authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Lipeng Sang
Browse files

nvme-hwmon: rework to avoid devm allocation

stable inclusion
from stable-v5.10.152
commit bc17f727b005921fc3b8651daefa053200c57cf0
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I73HJ0

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bc17f727b005921fc3b8651daefa053200c57cf0



--------------------------------

[ Upstream commit ed7770f6 ]

The original design to use device-managed resource allocation
doesn't really work as the NVMe controller has a vastly different
lifetime than the hwmon sysfs attributes, causing warning about
duplicate sysfs entries upon reconnection.
This patch reworks the hwmon allocation to avoid device-managed
resource allocation, and uses the NVMe controller as parent for
the sysfs attributes.

Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Tested-by: default avatarEnzo Matsumiya <ematsumiya@suse.de>
Tested-by: default avatarDaniel Wagner <dwagner@suse.de>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Stable-dep-of: c94b7f9b ("nvme-hwmon: kmalloc the NVME SMART log buffer")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarLipeng Sang <sanglipeng1@jd.com>
parent 73ee9c60
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment