PCI: endpoint: Don't stop EP controller by EP function
Subsystems (2)
PATCH 1/1 PCI: endpoint: Don't stop EP controller by EP function
For multi-function endpoint device, an ep function shouldn't stop EP controller. Nomally the controller is stopped via configfs.
--- drivers/pci/endpoint/functions/pci-epf-test.c | 1 - 1 file changed, 1 deletion(-)
drivers/pci/endpoint/functions/pci-epf-test.c +0 -1
@@ -627,7 +627,6 @@ static void pci_epf_test_unbind(struct pci_epf *epf)cancel_delayed_work (&epf_test->cmd_handler);pci_epf_test_clean_dma_chan (epf_test); -pci_epc_stop (epc);for (bar =0 ; bar <PCI_STD_NUM_BARS ; bar++) { epf_bar = &epf->bar[bar];
Signature · 1 line
2.17.1
Quoted 2 lines · Shunsuke Mie
For multi-function endpoint device, an ep function shouldn't stop EP controller. Nomally the controller is stopped via configfs.
%s/Nomally/Normally/
Quoted 3 lines
Fixes 349e7a85b25f ("PCI: endpoint: functions: Add an EP function to test PCI")Signed-off-by Shunsuke Mie <[email protected]>
Thank you for the fix!
Quoted 16 lines
--- drivers/pci/endpoint/functions/pci-epf-test.c | 1 - 1 file changed, 1 deletion(-)drivers/pci/endpoint/functions/pci-epf-test.c +0
-1@@ -627,7 +627,6 @@ static void pci_epf_test_unbind(struct pci_epf *epf)cancel_delayed_work (&epf_test->cmd_handler);pci_epf_test_clean_dma_chan (epf_test); -pci_epc_stop (epc);for (bar =0 ; bar <PCI_STD_NUM_BARS ; bar++) { epf_bar = &epf->bar[bar];
Hi Kishon,
Thank you for your ack.
2022年6月22日(水) 14:10 Kishon Vijay Abraham I <[email protected]>:
Quoted 8 lines · Shunsuke Mie
Quoted 2 lines
For multi-function endpoint device, an ep function shouldn't stop EP controller. Nomally the controller is stopped via configfs.
%s/Nomally/Normally/
Oops, sorry. Should I resend this patch with fixing the typo?
Quoted 16 lines
Quoted 2 lines
Fixes 349e7a85b25f ("PCI: endpoint: functions: Add an EP function to test PCI")Signed-off-by Shunsuke Mie <[email protected]>Thank you for the fix!
Quoted 10 lines
--- drivers/pci/endpoint/functions/pci-epf-test.c | 1 - 1 file changed, 1 deletion(-)drivers/pci/endpoint/functions/pci-epf-test.c +0
-0@@ -627,7 +627,6 @@ static void pci_epf_test_unbind(struct pci_epf *epf)
Quoted 6 lines
drivers/pci/endpoint/functions/pci-epf-test.c static void pci_epf_test_unbind(struct pci_epf *epf) · line 632
Quoted 6 lines
drivers/pci/endpoint/functions/pci-epf-test.c +0
-1cancel_delayed_work (&epf_test->cmd_handler);pci_epf_test_clean_dma_chan (epf_test); -pci_epc_stop (epc);for (bar =0 ; bar <PCI_STD_NUM_BARS ; bar++) { epf_bar = &epf->bar[bar];
Thanks.
Shunsuke Mie
Quoted 5 lines · Shunsuke Mie
For multi-function endpoint device, an ep function shouldn't stop EP controller. Nomally the controller is stopped via configfs.
Fixes 349e7a85b25f ("PCI: endpoint: functions: Add an EP function to test PCI")Signed-off-by Shunsuke Mie <[email protected]>
Fixed typo and applied with Kishon's ack to pci/endpoint for v5.20, thanks!
Quoted 19 lines
--- drivers/pci/endpoint/functions/pci-epf-test.c | 1 - 1 file changed, 1 deletion(-)drivers/pci/endpoint/functions/pci-epf-test.c +0
-1@@ -627,7 +627,6 @@ static void pci_epf_test_unbind(struct pci_epf *epf)cancel_delayed_work (&epf_test->cmd_handler);pci_epf_test_clean_dma_chan (epf_test); -pci_epc_stop (epc);for (bar =0 ; bar <PCI_STD_NUM_BARS ; bar++) { epf_bar = &epf->bar[bar];Signature · 1 line
2.17.1
Quoted 2 lines · Shunsuke Mie
For multi-function endpoint device, an ep function shouldn't stop EP controller. Nomally the controller is stopped via configfs.
Can you please clarify this for me?
An endpoint function by itself wouldn't stop an endpoint controller.
I assume that some *operation* on an endpoint function currently stops the endpoint controller, but that operation should not stop the controller?
I guess the operation is an "unbind" that detaches an EPF device from an EPC device?
Quoted 21 lines
Fixes 349e7a85b25f ("PCI: endpoint: functions: Add an EP function to test PCI")Signed-off-by Shunsuke Mie <[email protected]>--- drivers/pci/endpoint/functions/pci-epf-test.c | 1 - 1 file changed, 1 deletion(-)drivers/pci/endpoint/functions/pci-epf-test.c +0
-1@@ -627,7 +627,6 @@ static void pci_epf_test_unbind(struct pci_epf *epf)cancel_delayed_work (&epf_test->cmd_handler);pci_epf_test_clean_dma_chan (epf_test); -pci_epc_stop (epc);for (bar =0 ; bar <PCI_STD_NUM_BARS ; bar++) { epf_bar = &epf->bar[bar];Signature · 1 line
2.17.1
2022年7月6日(水) 7:40 Bjorn Helgaas <[email protected]>:
Quoted 7 lines · Shunsuke Mie
Quoted 2 lines
For multi-function endpoint device, an ep function shouldn't stop EP controller. Nomally the controller is stopped via configfs.
Can you please clarify this for me?
Quoted 7 lines
An endpoint function by itself wouldn't stop an endpoint controller. I assume that some *operation* on an endpoint function currently stops the endpoint controller, but that operation should not stop the controller?
I guess the operation is an "unbind" that detaches an EPF device from an EPC device?
It is likely that after all of the endpoint functions are unbound, the controller can be stopped safely, but I'm not sure if it is desired behavior for endpoint framework.
Kishon, could you please comment?
Quoted 18 lines
Quoted 18 lines
Fixes 349e7a85b25f ("PCI: endpoint: functions: Add an EP function to test PCI")Signed-off-by Shunsuke Mie <[email protected]>--- drivers/pci/endpoint/functions/pci-epf-test.c | 1 - 1 file changed, 1 deletion(-)drivers/pci/endpoint/functions/pci-epf-test.c +0
-1@@ -627,7 +627,6 @@ static void pci_epf_test_unbind(struct pci_epf *epf)cancel_delayed_work (&epf_test->cmd_handler);pci_epf_test_clean_dma_chan (epf_test); -pci_epc_stop (epc);for (bar =0 ; bar <PCI_STD_NUM_BARS ; bar++) { epf_bar = &epf->bar[bar];
Quoted 3 lines
Quoted 3 lines
--
2.17.1
Thanks,
Shunsuke
Quoted 12 lines · Shunsuke Mie
2022年7月6日(水) 7:40 Bjorn Helgaas <[email protected]>:
Quoted 11 lines · Shunsuke Mie
Quoted 2 lines
For multi-function endpoint device, an ep function shouldn't stop EP controller. Nomally the controller is stopped via configfs.
Can you please clarify this for me?
An endpoint function by itself wouldn't stop an endpoint controller. I assume that some *operation* on an endpoint function currently stops the endpoint controller, but that operation should not stop the controller?
Quoted 6 lines
Quoted 2 lines
I guess the operation is an "unbind" that detaches an EPF device from an EPC device?
It is likely that after all of the endpoint functions are unbound, the controller can be stopped safely, but I'm not sure if it is desired behavior for endpoint framework.
I'm not asking about the patch itself. I'm asking about the commit log because "an EP function shouldn't stop EP controller" doesn't quite make sense in English.
I suspect it should say something like "unbinding one endpoint function of a multi-function device from the endpoint controller should not stop the controller."
But I don't know enough about EPF/EPC binding to know whether that makes sense either.
Quoted 26 lines
Kishon, could you please comment?
Quoted 18 lines
Quoted 18 lines
Fixes 349e7a85b25f ("PCI: endpoint: functions: Add an EP function to test PCI")Signed-off-by Shunsuke Mie <[email protected]>--- drivers/pci/endpoint/functions/pci-epf-test.c | 1 - 1 file changed, 1 deletion(-)drivers/pci/endpoint/functions/pci-epf-test.c +0
-1@@ -627,7 +627,6 @@ static void pci_epf_test_unbind(struct pci_epf *epf)cancel_delayed_work (&epf_test->cmd_handler);pci_epf_test_clean_dma_chan (epf_test); -pci_epc_stop (epc);for (bar =0 ; bar <PCI_STD_NUM_BARS ; bar++) { epf_bar = &epf->bar[bar];Quoted 3 lines
Quoted 3 lines
--
2.17.1Thanks,
Shunsuke
2022年7月6日(水) 12:08 Bjorn Helgaas <[email protected]>:
Quoted 17 lines · Shunsuke Mie
Quoted 15 lines
2022年7月6日(水) 7:40 Bjorn Helgaas <[email protected]>:
Quoted 13 lines · Shunsuke Mie
Quoted 2 lines
For multi-function endpoint device, an ep function shouldn't stop EP controller. Nomally the controller is stopped via configfs.
Can you please clarify this for me?
An endpoint function by itself wouldn't stop an endpoint controller. I assume that some *operation* on an endpoint function currently stops the endpoint controller, but that operation should not stop the controller?
I guess the operation is an "unbind" that detaches an EPF device from an EPC device?
Quoted 7 lines
Quoted 3 lines
It is likely that after all of the endpoint functions are unbound, the controller can be stopped safely, but I'm not sure if it is desired behavior for endpoint framework.
I'm not asking about the patch itself. I'm asking about the commit log because "an EP function shouldn't stop EP controller" doesn't quite make sense in English.
I'm sorry.
Quoted 3 lines
I suspect it should say something like "unbinding one endpoint function of a multi-function device from the endpoint controller should not stop the controller."
Yes, it is correct and represents the commit clearly.
Quoted 29 lines
But I don't know enough about EPF/EPC binding to know whether that makes sense either.
Quoted 26 lines
Kishon, could you please comment?
Quoted 18 lines
Quoted 18 lines
Fixes 349e7a85b25f ("PCI: endpoint: functions: Add an EP function to test PCI")Signed-off-by Shunsuke Mie <[email protected]>--- drivers/pci/endpoint/functions/pci-epf-test.c | 1 - 1 file changed, 1 deletion(-)drivers/pci/endpoint/functions/pci-epf-test.c +0
-1@@ -627,7 +627,6 @@ static void pci_epf_test_unbind(struct pci_epf *epf)cancel_delayed_work (&epf_test->cmd_handler);pci_epf_test_clean_dma_chan (epf_test); -pci_epc_stop (epc);for (bar =0 ; bar <PCI_STD_NUM_BARS ; bar++) { epf_bar = &epf->bar[bar];Quoted 3 lines
Quoted 3 lines
--
2.17.1Thanks,
Shunsuke
Quoted 24 lines · Shunsuke Mie
2022年7月6日(水) 12:08 Bjorn Helgaas <[email protected]>:
Quoted 16 lines · Shunsuke Mie
Quoted 15 lines
2022年7月6日(水) 7:40 Bjorn Helgaas <[email protected]>:
Quoted 13 lines · Shunsuke Mie
Quoted 2 lines
For multi-function endpoint device, an ep function shouldn't stop EP controller. Nomally the controller is stopped via configfs.
Can you please clarify this for me?
An endpoint function by itself wouldn't stop an endpoint controller. I assume that some *operation* on an endpoint function currently stops the endpoint controller, but that operation should not stop the controller?
I guess the operation is an "unbind" that detaches an EPF device from an EPC device?
Quoted 7 lines
Quoted 3 lines
It is likely that after all of the endpoint functions are unbound, the controller can be stopped safely, but I'm not sure if it is desired behavior for endpoint framework.
I'm not asking about the patch itself. I'm asking about the commit log because "an EP function shouldn't stop EP controller" doesn't quite make sense in English.
Quoted 6 lines
I'm sorry.
Quoted 3 lines
I suspect it should say something like "unbinding one endpoint function of a multi-function device from the endpoint controller should not stop the controller."
Yes, it is correct and represents the commit clearly.
Thanks! I updated the commit log to the following:
PCI: endpoint: Don't stop controller when unbinding endpoint function
Unbinding an endpoint function from the endpoint controller shouldn't stop the controller. This is especially a problem for multi-function endpoints where other endpoints may still be active.
Don't stop the controller when unbinding one of its endpoints. Normally the controller is stopped via configfs.