linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] PCI: endpoint: Fix clearing start entry in configfs
@ 2019-12-20 12:24 Kunihiko Hayashi
  2020-02-21 14:15 ` Lorenzo Pieralisi
  0 siblings, 1 reply; 6+ messages in thread
From: Kunihiko Hayashi @ 2019-12-20 12:24 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Lorenzo Pieralisi
  Cc: linux-pci, linux-kernel, Kunihiko Hayashi

The value of 'start' entry is no change whenever writing 0 to configfs.
So the endpoint that stopped once can't restart.

The following command lines are an example restarting endpoint and
reprogramming configurations after receiving bus-reset.

    echo 0 > controllers/66000000.pcie-ep/start
    rm controllers/66000000.pcie-ep/func1
    ln -s functions/pci_epf_test/func1 controllers/66000000.pcie-ep/
    echo 1 > controllers/66000000.pcie-ep/start

However, the first 'echo' can't set 0 to 'start', so the last 'echo' can't
restart endpoint.

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(+)

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) {
 		pci_epc_stop(epc);
+		epc_group->start = 0;
 		return len;
 	}
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-02-26  1:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-20 12:24 [PATCH RESEND] PCI: endpoint: Fix clearing start entry in configfs Kunihiko Hayashi
2020-02-21 14:15 ` Lorenzo Pieralisi
2020-02-25 10:05   ` Kunihiko Hayashi
2020-02-25 10:18     ` Lorenzo Pieralisi
2020-02-25 11:12       ` Kishon Vijay Abraham I
2020-02-26  1:20         ` Kunihiko Hayashi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).