Re: [PATCH v5] PCI/DOE: Expose the DOE protocols via sysfs
From: Lukas Wunner
Date: Sat Aug 12 2023 - 04:08:12 EST
On Fri, Aug 11, 2023 at 08:44:53PM -0400, Alistair Francis wrote:
> + ret = devm_device_add_group(&pdev->dev, &pci_dev_doe_proto_group);
> + if (ret) {
> + pci_err(pdev, "can't create DOE goup: %d\n", ret);
> + return ret;
> + }
You cannot use devm_* functions in the PCI core.
Anything done through devm_* will be undone when the device's driver
unbinds. User space can unbind and rebind the driver at any time
through sysfs. They'll lose your DOE attributes the first time
they do this because of your use of devm_device_add_group().
Thanks,
Lukas