PCI: endpoint: Fix clearing start entry in configfs
diff mbox series

Message ID 1568282211-24713-1-git-send-email-hayashi.kunihiko@socionext.com
State New
Delegated to: Lorenzo Pieralisi
Headers show
  • PCI: endpoint: Fix clearing start entry in configfs
Related show

Commit Message

Kunihiko Hayashi Sept. 12, 2019, 9:56 a.m. UTC
The value of 'start' entry is no change whenever writing 0 to configfs.
So the endpoint that stopped once can't restart.

Fixes: d74679911610 ("PCI: endpoint: Introduce configfs entry for configuring EP functions")
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
 drivers/pci/endpoint/pci-ep-cfs.c | 1 +
 1 file changed, 1 insertion(+)

Since the possibility of restarting endpoint is up to each controller,
if restart is prohibited on purpose for some reason, this patch can be

diff mbox series

diff --git a/drivers/pci/endpoint/pci-ep-cfs.c b/drivers/pci/endpoint/pci-ep-cfs.c
index d1288a0..4fead88 100644
--- a/drivers/pci/endpoint/pci-ep-cfs.c
+++ b/drivers/pci/endpoint/pci-ep-cfs.c
@@ -58,6 +58,7 @@  static ssize_t pci_epc_start_store(struct config_item *item, const char *page,
 	if (!start) {
+		epc_group->start = 0;
 		return len;