Hi, back to this after a long context switch for some higher priority stuff.

So here I was able eventually to drop all this code and this change here https://cgit.freedesktop.org/~agrodzov/linux/commit/?h=amd-staging-drm-next-device-unplug&id=61852c8a59b4dd89d637693552c73175b9f2ccd6
was enough for me. Seems like while device_remove_file can handle the use case where the file and the parent directory already gone, sysfs_remove_group goes down in flames in that case
due to kobj->sd being unset on device removal.

Andrey

On 6/24/20 2:11 AM, Greg KH wrote:
But why are things being removed twice?
Not sure I understand what removed twice ? I remove only once per sysfs attribute.
This code path shows that the kernel is trying to remove a file that is
not present, so someone removed it already...

thanks,

gre k-h