linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: endpoint: Don't stop EP controller by EP function
@ 2022-06-22  4:09 Shunsuke Mie
  2022-06-22  5:10 ` Kishon Vijay Abraham I
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Shunsuke Mie @ 2022-06-22  4:09 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: Lorenzo Pieralisi, Krzysztof Wilczyński ,
	Bjorn Helgaas, Hou Zhiqiang, Li Chen, Shunsuke Mie, linux-pci,
	linux-kernel

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 <mie@igel.co.jp>
---
 drivers/pci/endpoint/functions/pci-epf-test.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
index 5b833f00e980..a5ed779b0a51 100644
--- a/drivers/pci/endpoint/functions/pci-epf-test.c
+++ b/drivers/pci/endpoint/functions/pci-epf-test.c
@@ -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];
 
-- 
2.17.1


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

* Re: [PATCH] PCI: endpoint: Don't stop EP controller by EP function
  2022-06-22  4:09 [PATCH] PCI: endpoint: Don't stop EP controller by EP function Shunsuke Mie
@ 2022-06-22  5:10 ` Kishon Vijay Abraham I
  2022-06-22  5:23   ` Shunsuke Mie
  2022-06-22 21:01 ` Bjorn Helgaas
  2022-07-05 22:40 ` Bjorn Helgaas
  2 siblings, 1 reply; 9+ messages in thread
From: Kishon Vijay Abraham I @ 2022-06-22  5:10 UTC (permalink / raw)
  To: Shunsuke Mie
  Cc: Lorenzo Pieralisi, Krzysztof Wilczyński, Bjorn Helgaas,
	Hou Zhiqiang, Li Chen, linux-pci, linux-kernel



On 22/06/22 09:39, Shunsuke Mie wrote:
> For multi-function endpoint device, an ep function shouldn't stop EP
> controller. Nomally the controller is stopped via configfs.

%s/Nomally/Normally/
> 
> Fixes: 349e7a85b25f ("PCI: endpoint: functions: Add an EP function to test PCI")
> Signed-off-by: Shunsuke Mie <mie@igel.co.jp>

Thank you for the fix!

Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
> ---
>  drivers/pci/endpoint/functions/pci-epf-test.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
> index 5b833f00e980..a5ed779b0a51 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-test.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-test.c
> @@ -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];
>  

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

* Re: [PATCH] PCI: endpoint: Don't stop EP controller by EP function
  2022-06-22  5:10 ` Kishon Vijay Abraham I
@ 2022-06-22  5:23   ` Shunsuke Mie
  0 siblings, 0 replies; 9+ messages in thread
From: Shunsuke Mie @ 2022-06-22  5:23 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: Lorenzo Pieralisi, Krzysztof Wilczyński, Bjorn Helgaas,
	Hou Zhiqiang, Li Chen, linux-pci, Linux Kernel Mailing List

Hi Kishon,

Thank you for your ack.

2022年6月22日(水) 14:10 Kishon Vijay Abraham I <kishon@ti.com>:
>
>
>
> On 22/06/22 09:39, Shunsuke Mie wrote:
> > 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?

> > Fixes: 349e7a85b25f ("PCI: endpoint: functions: Add an EP function to test PCI")
> > Signed-off-by: Shunsuke Mie <mie@igel.co.jp>
>
> Thank you for the fix!
>
> Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
> > ---
> >  drivers/pci/endpoint/functions/pci-epf-test.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
> > index 5b833f00e980..a5ed779b0a51 100644
> > --- a/drivers/pci/endpoint/functions/pci-epf-test.c
> > +++ b/drivers/pci/endpoint/functions/pci-epf-test.c
> > @@ -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];
> >

Thanks.
Shunsuke Mie

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

* Re: [PATCH] PCI: endpoint: Don't stop EP controller by EP function
  2022-06-22  4:09 [PATCH] PCI: endpoint: Don't stop EP controller by EP function Shunsuke Mie
  2022-06-22  5:10 ` Kishon Vijay Abraham I
@ 2022-06-22 21:01 ` Bjorn Helgaas
  2022-07-05 22:40 ` Bjorn Helgaas
  2 siblings, 0 replies; 9+ messages in thread
From: Bjorn Helgaas @ 2022-06-22 21:01 UTC (permalink / raw)
  To: Shunsuke Mie
  Cc: Kishon Vijay Abraham I, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Bjorn Helgaas, Hou Zhiqiang, Li Chen,
	linux-pci, linux-kernel

On Wed, Jun 22, 2022 at 01:09:24PM +0900, Shunsuke Mie wrote:
> 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 <mie@igel.co.jp>

Fixed typo and applied with Kishon's ack to pci/endpoint for v5.20, thanks!

> ---
>  drivers/pci/endpoint/functions/pci-epf-test.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
> index 5b833f00e980..a5ed779b0a51 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-test.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-test.c
> @@ -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];
>  
> -- 
> 2.17.1
> 

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

* Re: [PATCH] PCI: endpoint: Don't stop EP controller by EP function
  2022-06-22  4:09 [PATCH] PCI: endpoint: Don't stop EP controller by EP function Shunsuke Mie
  2022-06-22  5:10 ` Kishon Vijay Abraham I
  2022-06-22 21:01 ` Bjorn Helgaas
@ 2022-07-05 22:40 ` Bjorn Helgaas
  2022-07-06  2:37   ` Shunsuke Mie
  2 siblings, 1 reply; 9+ messages in thread
From: Bjorn Helgaas @ 2022-07-05 22:40 UTC (permalink / raw)
  To: Shunsuke Mie
  Cc: Kishon Vijay Abraham I, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Bjorn Helgaas, Hou Zhiqiang, Li Chen,
	linux-pci, linux-kernel

On Wed, Jun 22, 2022 at 01:09:24PM +0900, Shunsuke Mie wrote:
> 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?

> Fixes: 349e7a85b25f ("PCI: endpoint: functions: Add an EP function to test PCI")
> Signed-off-by: Shunsuke Mie <mie@igel.co.jp>
> ---
>  drivers/pci/endpoint/functions/pci-epf-test.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
> index 5b833f00e980..a5ed779b0a51 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-test.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-test.c
> @@ -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];
>  
> -- 
> 2.17.1
> 

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

* Re: [PATCH] PCI: endpoint: Don't stop EP controller by EP function
  2022-07-05 22:40 ` Bjorn Helgaas
@ 2022-07-06  2:37   ` Shunsuke Mie
  2022-07-06  3:08     ` Bjorn Helgaas
  0 siblings, 1 reply; 9+ messages in thread
From: Shunsuke Mie @ 2022-07-06  2:37 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Kishon Vijay Abraham I, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Bjorn Helgaas, Hou Zhiqiang, Li Chen,
	linux-pci, Linux Kernel Mailing List

2022年7月6日(水) 7:40 Bjorn Helgaas <helgaas@kernel.org>:

>
> On Wed, Jun 22, 2022 at 01:09:24PM +0900, Shunsuke Mie wrote:
> > 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?
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?

> > Fixes: 349e7a85b25f ("PCI: endpoint: functions: Add an EP function to test PCI")
> > Signed-off-by: Shunsuke Mie <mie@igel.co.jp>
> > ---
> >  drivers/pci/endpoint/functions/pci-epf-test.c | 1 -
> >  1 file changed, 1 deletion(-)
> >
> > diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
> > index 5b833f00e980..a5ed779b0a51 100644
> > --- a/drivers/pci/endpoint/functions/pci-epf-test.c
> > +++ b/drivers/pci/endpoint/functions/pci-epf-test.c
> > @@ -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];
> >
> > --
> > 2.17.1
> >

Thanks,
Shunsuke

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

* Re: [PATCH] PCI: endpoint: Don't stop EP controller by EP function
  2022-07-06  2:37   ` Shunsuke Mie
@ 2022-07-06  3:08     ` Bjorn Helgaas
  2022-07-06  3:15       ` Shunsuke Mie
  0 siblings, 1 reply; 9+ messages in thread
From: Bjorn Helgaas @ 2022-07-06  3:08 UTC (permalink / raw)
  To: Shunsuke Mie
  Cc: Kishon Vijay Abraham I, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Bjorn Helgaas, Hou Zhiqiang, Li Chen,
	linux-pci, Linux Kernel Mailing List

On Wed, Jul 06, 2022 at 11:37:29AM +0900, Shunsuke Mie wrote:
> 2022年7月6日(水) 7:40 Bjorn Helgaas <helgaas@kernel.org>:
> > On Wed, Jun 22, 2022 at 01:09:24PM +0900, Shunsuke Mie wrote:
> > > 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?
>
> 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.

> Kishon, could you please comment?
> 
> > > Fixes: 349e7a85b25f ("PCI: endpoint: functions: Add an EP function to test PCI")
> > > Signed-off-by: Shunsuke Mie <mie@igel.co.jp>
> > > ---
> > >  drivers/pci/endpoint/functions/pci-epf-test.c | 1 -
> > >  1 file changed, 1 deletion(-)
> > >
> > > diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
> > > index 5b833f00e980..a5ed779b0a51 100644
> > > --- a/drivers/pci/endpoint/functions/pci-epf-test.c
> > > +++ b/drivers/pci/endpoint/functions/pci-epf-test.c
> > > @@ -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];
> > >
> > > --
> > > 2.17.1
> > >
> 
> Thanks,
> Shunsuke

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

* Re: [PATCH] PCI: endpoint: Don't stop EP controller by EP function
  2022-07-06  3:08     ` Bjorn Helgaas
@ 2022-07-06  3:15       ` Shunsuke Mie
  2022-07-06 20:25         ` Bjorn Helgaas
  0 siblings, 1 reply; 9+ messages in thread
From: Shunsuke Mie @ 2022-07-06  3:15 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Kishon Vijay Abraham I, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Bjorn Helgaas, Hou Zhiqiang, Li Chen,
	linux-pci, Linux Kernel Mailing List

2022年7月6日(水) 12:08 Bjorn Helgaas <helgaas@kernel.org>:
>
> On Wed, Jul 06, 2022 at 11:37:29AM +0900, Shunsuke Mie wrote:
> > 2022年7月6日(水) 7:40 Bjorn Helgaas <helgaas@kernel.org>:
> > > On Wed, Jun 22, 2022 at 01:09:24PM +0900, Shunsuke Mie wrote:
> > > > 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?
> >
> > 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.

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

> But I don't know enough about EPF/EPC binding to know whether that
> makes sense either.
>
> > Kishon, could you please comment?
> >
> > > > Fixes: 349e7a85b25f ("PCI: endpoint: functions: Add an EP function to test PCI")
> > > > Signed-off-by: Shunsuke Mie <mie@igel.co.jp>
> > > > ---
> > > >  drivers/pci/endpoint/functions/pci-epf-test.c | 1 -
> > > >  1 file changed, 1 deletion(-)
> > > >
> > > > diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
> > > > index 5b833f00e980..a5ed779b0a51 100644
> > > > --- a/drivers/pci/endpoint/functions/pci-epf-test.c
> > > > +++ b/drivers/pci/endpoint/functions/pci-epf-test.c
> > > > @@ -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];
> > > >
> > > > --
> > > > 2.17.1
> > > >
> >
> > Thanks,
> > Shunsuke

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

* Re: [PATCH] PCI: endpoint: Don't stop EP controller by EP function
  2022-07-06  3:15       ` Shunsuke Mie
@ 2022-07-06 20:25         ` Bjorn Helgaas
  0 siblings, 0 replies; 9+ messages in thread
From: Bjorn Helgaas @ 2022-07-06 20:25 UTC (permalink / raw)
  To: Shunsuke Mie
  Cc: Kishon Vijay Abraham I, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Bjorn Helgaas, Hou Zhiqiang, Li Chen,
	linux-pci, Linux Kernel Mailing List

On Wed, Jul 06, 2022 at 12:15:38PM +0900, Shunsuke Mie wrote:
> 2022年7月6日(水) 12:08 Bjorn Helgaas <helgaas@kernel.org>:
> > On Wed, Jul 06, 2022 at 11:37:29AM +0900, Shunsuke Mie wrote:
> > > 2022年7月6日(水) 7:40 Bjorn Helgaas <helgaas@kernel.org>:
> > > > On Wed, Jun 22, 2022 at 01:09:24PM +0900, Shunsuke Mie wrote:
> > > > > 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?
> > >
> > > 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.
> 
> > 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.


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

end of thread, other threads:[~2022-07-06 20:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-22  4:09 [PATCH] PCI: endpoint: Don't stop EP controller by EP function Shunsuke Mie
2022-06-22  5:10 ` Kishon Vijay Abraham I
2022-06-22  5:23   ` Shunsuke Mie
2022-06-22 21:01 ` Bjorn Helgaas
2022-07-05 22:40 ` Bjorn Helgaas
2022-07-06  2:37   ` Shunsuke Mie
2022-07-06  3:08     ` Bjorn Helgaas
2022-07-06  3:15       ` Shunsuke Mie
2022-07-06 20:25         ` Bjorn Helgaas

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