arm64: PCI: Introduce pcibios_free_irq() helper function
PATCH v2 1/1 arm64: PCI: Introduce pcibios_free_irq() helper function
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 weak function in drivers/pci/pci-driver.c. So add pcibios_free_irq() for correspond it. This will be called in pci_device_remove().
====================
v2: remove the change in pcibios_alloc_irq(), and modify the commit log.
====================
--- arch/arm64/kernel/pci.c | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm64/kernel/pci.c +7 -0
@@ -29,6 +29,13 @@ int pcibios_alloc_irq(struct pci_dev *dev) return 0; } + +void pcibios_free_irq (struct pci_dev *dev) +{ +if (!acpi_disabled) +acpi_pci_irq_disable (dev); +} +#endif /*
Signature · 1 line
2.32.0
Catalin Marinas
maintainerQuoted 20 lines · Yajun Deng
pcibios_alloc_irq()will be called inpci_device_probe(), but there hasn'tpcibios_free_irq()in arm64 architecture correspond it.pcibios_free_irq()is an empty weak function indrivers/pci/pci-driver.c. So addpcibios_free_irq()for correspond it. This will be called inpci_device_remove().====================
v2: remove the change inpcibios_alloc_irq(), and modify the commit log.
====================Signed-off-by Yajun Deng <[email protected]>--- arch/arm64/kernel/pci.c | 7 +++++++ 1 file changed, 7 insertions(+)arch/arm64/kernel/pci.c +0
-0
arch/arm64/kernel/pci.c int pcibios_alloc_irq(struct pci_dev *dev) · line 37
Quoted 9 lines
arch/arm64/kernel/pci.c +6
-0@@ -29,6 +29,13 @@ int pcibios_alloc_irq(struct pci_dev *dev)return 0 ; } + +void pcibios_free_irq (struct pci_dev *dev) +{ +if (!acpi_disabled) +acpi_pci_irq_disable (dev); +}
For symmetry with the alloc path, this looks fine but I'd like Lorenzo to confirm.
The other questions, what does it fix and do we need a cc stable?
Thanks.
Signature · 1 line
Catalin
Quoted 3 lines · Yajun Deng
pcibios_alloc_irq()will be called inpci_device_probe(), but there hasn'tpcibios_free_irq()in arm64 architecture correspond it.pcibios_free_irq()is an empty weak function indrivers/pci/pci-driver.c.
"pcibios_alloc_irq() is a weak function called to allocate IRQs for a device in pci_device_probe(); arm64 implements it with ACPI specific code to enable IRQs for a device.
When a device is removed (pci_device_remove()) the pcibios_free_irq() counterpart is called.
Current arm64 code does not implement a pcibios_free_irq() function, and therefore, the weak empty stub is executed, which means that the IRQ for a device are not properly disabled when a device is removed.
Add an arm64 pcibios_free_irq() to undo the actions carried out in pcibios_alloc_irq()."
This is a stub commit log. Then you need to describe the bug you are fixing (if any, or it is just code inspection ?)
Quoted 6 lines
So add
pcibios_free_irq()for correspond it. This will be called inpci_device_remove().====================
v2: remove the change inpcibios_alloc_irq(), and modify the commit log.
====================
Don't add versioning in the commit log, it does not belong here.
I don't think we should send this to stable kernels straight away, it is best to make sure we are not triggering any regressions first.
Lorenzo
Quoted 26 lines
Signed-off-by Yajun Deng <[email protected]>--- arch/arm64/kernel/pci.c | 7 +++++++ 1 file changed, 7 insertions(+)arch/arm64/kernel/pci.c +7
-0@@ -29,6 +29,13 @@ int pcibios_alloc_irq(struct pci_dev *dev) return 0; } + +void pcibios_free_irq (struct pci_dev *dev) +{ +if (!acpi_disabled) +acpi_pci_irq_disable (dev); +} +#endif /* Signature · 1 line
2.32.0
Quoted 17 lines · Lorenzo Pieralisi
Quoted 3 lines · Yajun Deng
pcibios_alloc_irq()will be called inpci_device_probe(), but there hasn'tpcibios_free_irq()in arm64 architecture correspond it.pcibios_free_irq()is an empty weak function indrivers/pci/pci-driver.c."
pcibios_alloc_irq()is a weak function called to allocate IRQs for a device inpci_device_probe(); arm64 implements it with ACPI specific code to enable IRQs for a device.When a device is removed (
pci_device_remove()) thepcibios_free_irq()counterpart is called.Current arm64 code does not implement a
pcibios_free_irq()function, and therefore, the weak empty stub is executed, which means that the IRQ for a device are not properly disabled when a device is removed.
Quoted 6 lines
Add an arm64
pcibios_free_irq()to undo the actions carried out inpcibios_alloc_irq()."This is a stub commit log. Then you need to describe the bug you are fixing (if any, or it is just code inspection ?)
It is just code inspection.
Quoted 39 lines
Quoted 6 lines
So add
pcibios_free_irq()for correspond it. This will be called inpci_device_remove().====================
v2: remove the change inpcibios_alloc_irq(), and modify the commit log.
====================Don't add versioning in the commit log, it does not belong here.
I don't think we should send this to stable kernels straight away, it is best to make sure we are not triggering any regressions first.
Lorenzo
Quoted 25 lines
Signed-off-by Yajun Deng <[email protected]>---
arch/arm64/kernel/pci.c| 7 +++++++1 file changed, 7 insertions(+)arch/arm64/kernel/pci.c +7
-1@@ -29,6 +29,13 @@ int pcibios_alloc_irq(struct pci_dev *dev) return 0; } + +void pcibios_free_irq (struct pci_dev *dev) +{ +if (!acpi_disabled) +acpi_pci_irq_disable (dev); +} +#endif /* -- 2.32.0
Quoted 19 lines · On Wed, Sep 22, 2021 at 02:49:13AM +0000, [email protected] wrote:
Quoted 17 lines · Lorenzo Pieralisi
Quoted 3 lines · Yajun Deng
pcibios_alloc_irq()will be called inpci_device_probe(), but there hasn'tpcibios_free_irq()in arm64 architecture correspond it.pcibios_free_irq()is an empty weak function indrivers/pci/pci-driver.c."
pcibios_alloc_irq()is a weak function called to allocate IRQs for a device inpci_device_probe(); arm64 implements it with ACPI specific code to enable IRQs for a device.When a device is removed (
pci_device_remove()) thepcibios_free_irq()counterpart is called.Current arm64 code does not implement a
pcibios_free_irq()function, and therefore, the weak empty stub is executed, which means that the IRQ for a device are not properly disabled when a device is removed.
Quoted 7 lines
Quoted 6 lines
Add an arm64
pcibios_free_irq()to undo the actions carried out inpcibios_alloc_irq()."This is a stub commit log. Then you need to describe the bug you are fixing (if any, or it is just code inspection ?)
It is just code inspection.
Before merging it it must be tested, which would prove it is needed.
Lorenzo
Quoted 39 lines
Quoted 39 lines
Quoted 6 lines
So add
pcibios_free_irq()for correspond it. This will be called inpci_device_remove().====================
v2: remove the change inpcibios_alloc_irq(), and modify the commit log.
====================Don't add versioning in the commit log, it does not belong here.
I don't think we should send this to stable kernels straight away, it is best to make sure we are not triggering any regressions first.
Lorenzo
Quoted 25 lines
Signed-off-by Yajun Deng <[email protected]>---
arch/arm64/kernel/pci.c| 7 +++++++1 file changed, 7 insertions(+)arch/arm64/kernel/pci.c +7
-1@@ -29,6 +29,13 @@ int pcibios_alloc_irq(struct pci_dev *dev) return 0; } + +void pcibios_free_irq (struct pci_dev *dev) +{ +if (!acpi_disabled) +acpi_pci_irq_disable (dev); +} +#endif /* -- 2.32.0
Will Deacon
maintainerQuoted 23 lines · Lorenzo Pieralisi
Quoted 22 lines · On Wed, Sep 22, 2021 at 02:49:13AM +0000, [email protected] wrote:
Quoted 20 lines · Lorenzo Pieralisi
Quoted 3 lines · Yajun Deng
pcibios_alloc_irq()will be called inpci_device_probe(), but there hasn'tpcibios_free_irq()in arm64 architecture correspond it.pcibios_free_irq()is an empty weak function indrivers/pci/pci-driver.c."
pcibios_alloc_irq()is a weak function called to allocate IRQs for a device inpci_device_probe(); arm64 implements it with ACPI specific code to enable IRQs for a device.When a device is removed (
pci_device_remove()) thepcibios_free_irq()counterpart is called.Current arm64 code does not implement a
pcibios_free_irq()function, and therefore, the weak empty stub is executed, which means that the IRQ for a device are not properly disabled when a device is removed.Add an arm64
pcibios_free_irq()to undo the actions carried out inpcibios_alloc_irq()."
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
This is a stub commit log. Then you need to describe the bug you are fixing (if any, or it is just code inspection ?)
It is just code inspection.
Before merging it it must be tested, which would prove it is needed.
Ok, I'll ignore this patch for now then. Please yell if you want me to pick it up.
Will