linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-next] arm64: PCI: Introduce pcibios_free_irq() helper function
@ 2021-08-25  7:16 Yajun Deng
  2021-08-25 10:05 ` Will Deacon
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yajun Deng @ 2021-08-25  7:16 UTC (permalink / raw)
  To: catalin.marinas, will; +Cc: linux-arm-kernel, linux-kernel, Yajun Deng

Introduce pcibios_free_irq() to free irq in pci_device_probe() and
pci_device_remove() that in drivers/pci/pci-driver.c.

Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
---
 arch/arm64/kernel/pci.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c
index 1006ed2d7c60..40da5aff4548 100644
--- a/arch/arm64/kernel/pci.c
+++ b/arch/arm64/kernel/pci.c
@@ -25,10 +25,18 @@
 int pcibios_alloc_irq(struct pci_dev *dev)
 {
 	if (!acpi_disabled)
-		acpi_pci_irq_enable(dev);
+		return acpi_pci_irq_enable(dev);
 
 	return 0;
 }
+
+void pcibios_free_irq(struct pci_dev *dev)
+{
+	if (!acpi_disabled)
+		acpi_pci_irq_disable(dev);
+
+}
+
 #endif
 
 /*
-- 
2.32.0


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

* Re: [PATCH linux-next] arm64: PCI: Introduce pcibios_free_irq() helper function
  2021-08-25  7:16 [PATCH linux-next] arm64: PCI: Introduce pcibios_free_irq() helper function Yajun Deng
@ 2021-08-25 10:05 ` Will Deacon
  2021-08-25 10:49 ` yajun.deng
  2021-08-25 13:30 ` Lorenzo Pieralisi
  2 siblings, 0 replies; 4+ messages in thread
From: Will Deacon @ 2021-08-25 10:05 UTC (permalink / raw)
  To: Yajun Deng
  Cc: catalin.marinas, linux-arm-kernel, linux-kernel, lorenzo.pieralisi

[+Lorenzo]

On Wed, Aug 25, 2021 at 03:16:12PM +0800, Yajun Deng wrote:
> Introduce pcibios_free_irq() to free irq in pci_device_probe() and
> pci_device_remove() that in drivers/pci/pci-driver.c.

Please can you describe the problem you're solving?

> Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
> ---
>  arch/arm64/kernel/pci.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c
> index 1006ed2d7c60..40da5aff4548 100644
> --- a/arch/arm64/kernel/pci.c
> +++ b/arch/arm64/kernel/pci.c
> @@ -25,10 +25,18 @@
>  int pcibios_alloc_irq(struct pci_dev *dev)
>  {
>  	if (!acpi_disabled)
> -		acpi_pci_irq_enable(dev);
> +		return acpi_pci_irq_enable(dev);

This means we'll now fail device probe if we can't enable the GSI. Is that a
problem?

Will

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

* Re: [PATCH linux-next] arm64: PCI: Introduce pcibios_free_irq() helper function
  2021-08-25  7:16 [PATCH linux-next] arm64: PCI: Introduce pcibios_free_irq() helper function Yajun Deng
  2021-08-25 10:05 ` Will Deacon
@ 2021-08-25 10:49 ` yajun.deng
  2021-08-25 13:30 ` Lorenzo Pieralisi
  2 siblings, 0 replies; 4+ messages in thread
From: yajun.deng @ 2021-08-25 10:49 UTC (permalink / raw)
  To: Will Deacon
  Cc: catalin.marinas, linux-arm-kernel, linux-kernel, lorenzo.pieralisi

August 25, 2021 6:05 PM, "Will Deacon" <will@kernel.org> wrote:

> [+Lorenzo]
> 
> On Wed, Aug 25, 2021 at 03:16:12PM +0800, Yajun Deng wrote:
> 
>> Introduce pcibios_free_irq() to free irq in pci_device_probe() and
>> pci_device_remove() that in drivers/pci/pci-driver.c.
> 
> Please can you describe the problem you're solving?
> 

pcibios_alloc_irq() will be called in pci_device_probe(), but there hasn't pcibios_free_irq()
in arm64 architecture correspond it. pcibios_free_irq() is an empty function in 
drivers/pci/pci-driver.c.So pcibios_alloc_irq() and pcibios_free_irq() don't correspond.

>> Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
>> ---
>> arch/arm64/kernel/pci.c | 10 +++++++++-
>> 1 file changed, 9 insertions(+), 1 deletion(-)
>> 
>> diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c
>> index 1006ed2d7c60..40da5aff4548 100644
>> --- a/arch/arm64/kernel/pci.c
>> +++ b/arch/arm64/kernel/pci.c
>> @@ -25,10 +25,18 @@
>> int pcibios_alloc_irq(struct pci_dev *dev)
>> {
>> if (!acpi_disabled)
>> - acpi_pci_irq_enable(dev);
>> + return acpi_pci_irq_enable(dev);
> 
> This means we'll now fail device probe if we can't enable the GSI. Is that a
> problem?
> 
Oh, It would be better that hasn't return.
> Will

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

* Re: [PATCH linux-next] arm64: PCI: Introduce pcibios_free_irq() helper function
  2021-08-25  7:16 [PATCH linux-next] arm64: PCI: Introduce pcibios_free_irq() helper function Yajun Deng
  2021-08-25 10:05 ` Will Deacon
  2021-08-25 10:49 ` yajun.deng
@ 2021-08-25 13:30 ` Lorenzo Pieralisi
  2 siblings, 0 replies; 4+ messages in thread
From: Lorenzo Pieralisi @ 2021-08-25 13:30 UTC (permalink / raw)
  To: Yajun Deng; +Cc: catalin.marinas, will, linux-arm-kernel, linux-kernel

On Wed, Aug 25, 2021 at 03:16:12PM +0800, Yajun Deng wrote:
> Introduce pcibios_free_irq() to free irq in pci_device_probe() and
> pci_device_remove() that in drivers/pci/pci-driver.c.

Add a rationale - it is just code inspection or you are fixing a bug ?

> Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
> ---
>  arch/arm64/kernel/pci.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c
> index 1006ed2d7c60..40da5aff4548 100644
> --- a/arch/arm64/kernel/pci.c
> +++ b/arch/arm64/kernel/pci.c
> @@ -25,10 +25,18 @@
>  int pcibios_alloc_irq(struct pci_dev *dev)
>  {
>  	if (!acpi_disabled)
> -		acpi_pci_irq_enable(dev);
> +		return acpi_pci_irq_enable(dev);

This is an unrelated change and it is potentially introducing
regressions. I need to page in the reasons why on arm64 we had to resort
to pcibios_alloc_irq() (probe ordering IIRC) - in the meanwhile
this function stays as it is.

>  	return 0;
>  }
> +
> +void pcibios_free_irq(struct pci_dev *dev)
> +{
> +	if (!acpi_disabled)
> +		acpi_pci_irq_disable(dev);
> +
> +}

Adding pcibios_free_irq() makes sense and I believe it is a genuine
"fix".

Please add any information in the commit log that explains the
run-time condition you are fixing.

Thanks,
Lorenzo

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

end of thread, other threads:[~2021-08-25 13:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-25  7:16 [PATCH linux-next] arm64: PCI: Introduce pcibios_free_irq() helper function Yajun Deng
2021-08-25 10:05 ` Will Deacon
2021-08-25 10:49 ` yajun.deng
2021-08-25 13:30 ` Lorenzo Pieralisi

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