diff mbox series

PCI: endpoint: Fix clearing start entry in configfs

Message ID 1568282211-24713-1-git-send-email-hayashi.kunihiko@socionext.com
State Superseded
Headers show
Series PCI: endpoint: Fix clearing start entry in configfs | expand

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
ignored.

-- 
2.7.4

Comments

Kunihiko Hayashi Dec. 11, 2019, 3:26 a.m. UTC | #1
Hi,

Is there any comments about this?
I think this fix needs to stop and restart endpoint controller
using configfs 'logically' at least.

Thank you,

On Thu, 12 Sep 2019 18:56:51 +0900 <hayashi.kunihiko@socionext.com> wrote:

> 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

> ignored.

> 

> 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


---
Best Regards,
Kunihiko Hayashi
diff mbox series

Patch

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;
 	}