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:Hannes Reinecke <hare@suse.de> Tested-by:
Enzo Matsumiya <ematsumiya@suse.de> Tested-by:
Daniel Wagner <dwagner@suse.de> Signed-off-by:
Christoph Hellwig <hch@lst.de> Stable-dep-of: c94b7f9b ("nvme-hwmon: kmalloc the NVME SMART log buffer") Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Lipeng Sang <sanglipeng1@jd.com>
Loading
Please sign in to comment