linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] PCI: pci-epf-test: Register notifier if only core_init_notifier is enabled
@ 2022-08-25  9:01 Kunihiko Hayashi
  2022-10-27 14:02 ` Lorenzo Pieralisi
  2022-10-28 17:06 ` Bjorn Helgaas
  0 siblings, 2 replies; 6+ messages in thread
From: Kunihiko Hayashi @ 2022-08-25  9:01 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Bjorn Helgaas
  Cc: Om Prakash Singh, Vidya Sagar, linux-pci, linux-kernel, Kunihiko Hayashi

Need to register pci_epf_test_notifier function event if only
core_init_notifier is enabled.

Fixes: 5e50ee27d4a5 ("PCI: pci-epf-test: Add support to defer core initialization")
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Acked-by: Om Prakash Singh <omp@nvidia.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

This patch is a part of series "PCI: endpoint: Fix core_init_notifier feature".
The rest of the patches have been withdrawn.

Changes since v2:
- Add Acked-by lines

Changes since v1:
- Add Acked-by lines

diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
index 36b1801a061b..55283d2379a6 100644
--- a/drivers/pci/endpoint/functions/pci-epf-test.c
+++ b/drivers/pci/endpoint/functions/pci-epf-test.c
@@ -979,7 +979,7 @@ static int pci_epf_test_bind(struct pci_epf *epf)
 	if (ret)
 		epf_test->dma_supported = false;
 
-	if (linkup_notifier) {
+	if (linkup_notifier || core_init_notifier) {
 		epf->nb.notifier_call = pci_epf_test_notifier;
 		pci_epc_register_notifier(epc, &epf->nb);
 	} else {
-- 
2.17.1


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

* Re: [PATCH v3] PCI: pci-epf-test: Register notifier if only core_init_notifier is enabled
  2022-08-25  9:01 [PATCH v3] PCI: pci-epf-test: Register notifier if only core_init_notifier is enabled Kunihiko Hayashi
@ 2022-10-27 14:02 ` Lorenzo Pieralisi
  2022-10-28 17:06 ` Bjorn Helgaas
  1 sibling, 0 replies; 6+ messages in thread
From: Lorenzo Pieralisi @ 2022-10-27 14:02 UTC (permalink / raw)
  To: Kunihiko Hayashi, Lorenzo Pieralisi, Krzysztof Wilczyński,
	Bjorn Helgaas, Kishon Vijay Abraham I
  Cc: linux-pci, linux-kernel, Vidya Sagar, Om Prakash Singh

On Thu, 25 Aug 2022 18:01:01 +0900, Kunihiko Hayashi wrote:
> Need to register pci_epf_test_notifier function event if only
> core_init_notifier is enabled.
> 
> 

Applied to pci/misc, thanks!

[1/1] PCI: pci-epf-test: Register notifier if only core_init_notifier is enabled
      https://git.kernel.org/lpieralisi/pci/c/6acd25cc98ce

Thanks,
Lorenzo

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

* Re: [PATCH v3] PCI: pci-epf-test: Register notifier if only core_init_notifier is enabled
  2022-08-25  9:01 [PATCH v3] PCI: pci-epf-test: Register notifier if only core_init_notifier is enabled Kunihiko Hayashi
  2022-10-27 14:02 ` Lorenzo Pieralisi
@ 2022-10-28 17:06 ` Bjorn Helgaas
  2022-11-01  9:31   ` Kunihiko Hayashi
  1 sibling, 1 reply; 6+ messages in thread
From: Bjorn Helgaas @ 2022-10-28 17:06 UTC (permalink / raw)
  To: Kunihiko Hayashi
  Cc: Kishon Vijay Abraham I, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Bjorn Helgaas, Om Prakash Singh,
	Vidya Sagar, linux-pci, linux-kernel

On Thu, Aug 25, 2022 at 06:01:01PM +0900, Kunihiko Hayashi wrote:
> Need to register pci_epf_test_notifier function event if only
> core_init_notifier is enabled.
> 
> Fixes: 5e50ee27d4a5 ("PCI: pci-epf-test: Add support to defer core initialization")
> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> Acked-by: Om Prakash Singh <omp@nvidia.com>
> Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
> ---
>  drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> This patch is a part of series "PCI: endpoint: Fix core_init_notifier feature".
> The rest of the patches have been withdrawn.
> 
> Changes since v2:
> - Add Acked-by lines
> 
> Changes since v1:
> - Add Acked-by lines
> 
> diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
> index 36b1801a061b..55283d2379a6 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-test.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-test.c
> @@ -979,7 +979,7 @@ static int pci_epf_test_bind(struct pci_epf *epf)
>  	if (ret)
>  		epf_test->dma_supported = false;
>  
> -	if (linkup_notifier) {
> +	if (linkup_notifier || core_init_notifier) {
>  		epf->nb.notifier_call = pci_epf_test_notifier;
>  		pci_epc_register_notifier(epc, &epf->nb);

Why does pci_epc_register_notifier() even exist?  It's not used at all
except for this test code.

It would be better if infrastructure like this were connected with
some user of it.

>  	} else {
> -- 
> 2.17.1
> 

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

* Re: [PATCH v3] PCI: pci-epf-test: Register notifier if only core_init_notifier is enabled
  2022-10-28 17:06 ` Bjorn Helgaas
@ 2022-11-01  9:31   ` Kunihiko Hayashi
  2022-11-02 23:09     ` Bjorn Helgaas
  0 siblings, 1 reply; 6+ messages in thread
From: Kunihiko Hayashi @ 2022-11-01  9:31 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Kishon Vijay Abraham I, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Bjorn Helgaas, Om Prakash Singh,
	Vidya Sagar, linux-pci, linux-kernel

Hi Bjorn,

On 2022/10/29 2:06, Bjorn Helgaas wrote:
> On Thu, Aug 25, 2022 at 06:01:01PM +0900, Kunihiko Hayashi wrote:
>> Need to register pci_epf_test_notifier function event if only
>> core_init_notifier is enabled.
>>
>> Fixes: 5e50ee27d4a5 ("PCI: pci-epf-test: Add support to defer core
> initialization")
>> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
>> Acked-by: Om Prakash Singh <omp@nvidia.com>
>> Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
>> ---
>>   drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> This patch is a part of series "PCI: endpoint: Fix core_init_notifier
> feature".
>> The rest of the patches have been withdrawn.
>>
>> Changes since v2:
>> - Add Acked-by lines
>>
>> Changes since v1:
>> - Add Acked-by lines
>>
>> diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c
> b/drivers/pci/endpoint/functions/pci-epf-test.c
>> index 36b1801a061b..55283d2379a6 100644
>> --- a/drivers/pci/endpoint/functions/pci-epf-test.c
>> +++ b/drivers/pci/endpoint/functions/pci-epf-test.c
>> @@ -979,7 +979,7 @@ static int pci_epf_test_bind(struct pci_epf *epf)
>>   	if (ret)
>>   		epf_test->dma_supported = false;
>>   
>> -	if (linkup_notifier) {
>> +	if (linkup_notifier || core_init_notifier) {
>>   		epf->nb.notifier_call = pci_epf_test_notifier;
>>   		pci_epc_register_notifier(epc, &epf->nb);
> 
> Why does pci_epc_register_notifier() even exist?  It's not used at all
> except for this test code.
> 
> It would be better if infrastructure like this were connected with
> some user of it.
This call was added by the commit 5779dd0a7dbd
("PCI: endpoint: Use notification chain mechanism to notify EPC events to EPF").

I haven't followed the discussion, however, this commit say:
"This will also enable to add more events (in addition to linkup) in the future."

Thank you,

---
Best Regards
Kunihiko Hayashi

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

* Re: [PATCH v3] PCI: pci-epf-test: Register notifier if only core_init_notifier is enabled
  2022-11-01  9:31   ` Kunihiko Hayashi
@ 2022-11-02 23:09     ` Bjorn Helgaas
  2022-11-08 12:17       ` Manivannan Sadhasivam
  0 siblings, 1 reply; 6+ messages in thread
From: Bjorn Helgaas @ 2022-11-02 23:09 UTC (permalink / raw)
  To: Kunihiko Hayashi
  Cc: Kishon Vijay Abraham I, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Bjorn Helgaas, Om Prakash Singh,
	Vidya Sagar, linux-pci, linux-kernel

On Tue, Nov 01, 2022 at 06:31:07PM +0900, Kunihiko Hayashi wrote:
> Hi Bjorn,
> 
> On 2022/10/29 2:06, Bjorn Helgaas wrote:
> > On Thu, Aug 25, 2022 at 06:01:01PM +0900, Kunihiko Hayashi wrote:
> > > Need to register pci_epf_test_notifier function event if only
> > > core_init_notifier is enabled.
> > > 
> > > Fixes: 5e50ee27d4a5 ("PCI: pci-epf-test: Add support to defer core
> > initialization")
> > > Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> > > Acked-by: Om Prakash Singh <omp@nvidia.com>
> > > Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
> > > ---
> > >   drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > This patch is a part of series "PCI: endpoint: Fix core_init_notifier
> > feature".
> > > The rest of the patches have been withdrawn.
> > > 
> > > Changes since v2:
> > > - Add Acked-by lines
> > > 
> > > Changes since v1:
> > > - Add Acked-by lines
> > > 
> > > diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c
> > b/drivers/pci/endpoint/functions/pci-epf-test.c
> > > index 36b1801a061b..55283d2379a6 100644
> > > --- a/drivers/pci/endpoint/functions/pci-epf-test.c
> > > +++ b/drivers/pci/endpoint/functions/pci-epf-test.c
> > > @@ -979,7 +979,7 @@ static int pci_epf_test_bind(struct pci_epf *epf)
> > >   	if (ret)
> > >   		epf_test->dma_supported = false;
> > > -	if (linkup_notifier) {
> > > +	if (linkup_notifier || core_init_notifier) {
> > >   		epf->nb.notifier_call = pci_epf_test_notifier;
> > >   		pci_epc_register_notifier(epc, &epf->nb);
> > 
> > Why does pci_epc_register_notifier() even exist?  It's not used at all
> > except for this test code.
> > 
> > It would be better if infrastructure like this were connected with
> > some user of it.
>
> This call was added by the commit 5779dd0a7dbd
> ("PCI: endpoint: Use notification chain mechanism to notify EPC events to EPF").
> 
> I haven't followed the discussion, however, this commit say: "This
> will also enable to add more events (in addition to linkup) in the
> future."

5779dd0a7dbd was 2.5 years ago.  It was probably a mistake to merge it
then.  Usually we add infrastructure when we have a user for it,
either in the very same patch or at least in a subsequent patch of the
series.  

But Lorenzo has already merged this, so I guess this is moot.

He probably wouldn't object to a second patch that removes the fixed
infrastructure if nobody uses it.  We can easily resurrect it if a
need arises, and if that happens, we'll be glad that it has been
fixed!

Bjorn

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

* Re: [PATCH v3] PCI: pci-epf-test: Register notifier if only core_init_notifier is enabled
  2022-11-02 23:09     ` Bjorn Helgaas
@ 2022-11-08 12:17       ` Manivannan Sadhasivam
  0 siblings, 0 replies; 6+ messages in thread
From: Manivannan Sadhasivam @ 2022-11-08 12:17 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Kunihiko Hayashi, Kishon Vijay Abraham I, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Bjorn Helgaas, Om Prakash Singh,
	Vidya Sagar, linux-pci, linux-kernel

On Wed, Nov 02, 2022 at 06:09:02PM -0500, Bjorn Helgaas wrote:
> On Tue, Nov 01, 2022 at 06:31:07PM +0900, Kunihiko Hayashi wrote:
> > Hi Bjorn,
> > 
> > On 2022/10/29 2:06, Bjorn Helgaas wrote:
> > > On Thu, Aug 25, 2022 at 06:01:01PM +0900, Kunihiko Hayashi wrote:
> > > > Need to register pci_epf_test_notifier function event if only
> > > > core_init_notifier is enabled.
> > > > 
> > > > Fixes: 5e50ee27d4a5 ("PCI: pci-epf-test: Add support to defer core
> > > initialization")
> > > > Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> > > > Acked-by: Om Prakash Singh <omp@nvidia.com>
> > > > Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
> > > > ---
> > > >   drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
> > > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > > 
> > > > This patch is a part of series "PCI: endpoint: Fix core_init_notifier
> > > feature".
> > > > The rest of the patches have been withdrawn.
> > > > 
> > > > Changes since v2:
> > > > - Add Acked-by lines
> > > > 
> > > > Changes since v1:
> > > > - Add Acked-by lines
> > > > 
> > > > diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c
> > > b/drivers/pci/endpoint/functions/pci-epf-test.c
> > > > index 36b1801a061b..55283d2379a6 100644
> > > > --- a/drivers/pci/endpoint/functions/pci-epf-test.c
> > > > +++ b/drivers/pci/endpoint/functions/pci-epf-test.c
> > > > @@ -979,7 +979,7 @@ static int pci_epf_test_bind(struct pci_epf *epf)
> > > >   	if (ret)
> > > >   		epf_test->dma_supported = false;
> > > > -	if (linkup_notifier) {
> > > > +	if (linkup_notifier || core_init_notifier) {
> > > >   		epf->nb.notifier_call = pci_epf_test_notifier;
> > > >   		pci_epc_register_notifier(epc, &epf->nb);
> > > 
> > > Why does pci_epc_register_notifier() even exist?  It's not used at all
> > > except for this test code.
> > > 
> > > It would be better if infrastructure like this were connected with
> > > some user of it.
> >
> > This call was added by the commit 5779dd0a7dbd
> > ("PCI: endpoint: Use notification chain mechanism to notify EPC events to EPF").
> > 
> > I haven't followed the discussion, however, this commit say: "This
> > will also enable to add more events (in addition to linkup) in the
> > future."
> 
> 5779dd0a7dbd was 2.5 years ago.  It was probably a mistake to merge it
> then.  Usually we add infrastructure when we have a user for it,
> either in the very same patch or at least in a subsequent patch of the
> series.  
> 
> But Lorenzo has already merged this, so I guess this is moot.
> 
> He probably wouldn't object to a second patch that removes the fixed
> infrastructure if nobody uses it.  We can easily resurrect it if a
> need arises, and if that happens, we'll be glad that it has been
> fixed!
> 

I'm planning to submit a new EPF driver that makes use of this infrastructure
(although the callback mechanism).

Thanks,
Mani

> Bjorn

-- 
மணிவண்ணன் சதாசிவம்

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

end of thread, other threads:[~2022-11-08 12:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-25  9:01 [PATCH v3] PCI: pci-epf-test: Register notifier if only core_init_notifier is enabled Kunihiko Hayashi
2022-10-27 14:02 ` Lorenzo Pieralisi
2022-10-28 17:06 ` Bjorn Helgaas
2022-11-01  9:31   ` Kunihiko Hayashi
2022-11-02 23:09     ` Bjorn Helgaas
2022-11-08 12:17       ` Manivannan Sadhasivam

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