]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: endpoint: Fix clearing start entry in configfs
authorKunihiko Hayashi <hayashi.kunihiko@socionext.com>
Wed, 26 Feb 2020 05:52:23 +0000 (14:52 +0900)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tue, 31 Mar 2020 08:13:27 +0000 (09:13 +0100)
commit65ccdb3b6a998607e55a4de3d23e3c02355fc0de
tree476a5298a4b21cc79b0b0966a280ac44ef532a30
parentae0487c2a0afac01606e9aa1b8007c72399fc26a
PCI: endpoint: Fix clearing start entry in configfs

After an endpoint is started through configfs, if 0 is written to the
configfs entry 'start', the controller stops but the epc_group->start
value remains 1.

A subsequent unlinking of the function from the controller would trigger
a spurious WARN_ON_ONCE() in pci_epc_epf_unlink() despite right
behavior.

Fix it by setting epc_group->start = 0 when a controller is stopped
using configfs.

Fixes: c6907c51ad60 ("PCI: endpoint: Introduce configfs entry for configuring EP functions")
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
drivers/pci/endpoint/pci-ep-cfs.c