Re: [PATCH v2 1/2] asm-generic: Remove pci.h copying remaining code to x86
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
- Subject: Re: [PATCH v2 1/2] asm-generic: Remove pci.h copying remaining code to x86
- From: Arnd Bergmann <arnd@xxxxxxxx>
- Date: Mon, 18 Jul 2022 10:40:34 +0200
- Cc: Stafford Horne <shorne@xxxxxxxxx>, LKML <linux-kernel@xxxxxxxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Richard Henderson <rth@xxxxxxxxxxxxxxx>, Ivan Kokshaysky <ink@xxxxxxxxxxxxxxxxxxxx>, Matt Turner <mattst88@xxxxxxxxx>, Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>, Paul Mackerras <paulus@xxxxxxxxx>, Heiko Carstens <hca@xxxxxxxxxxxxx>, Vasily Gorbik <gor@xxxxxxxxxxxxx>, Alexander Gordeev <agordeev@xxxxxxxxxxxxx>, Christian Borntraeger <borntraeger@xxxxxxxxxxxxx>, Sven Schnelle <svens@xxxxxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, "the arch/x86 maintainers" <x86@xxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, Chris Zankel <chris@xxxxxxxxxx>, Max Filippov <jcmvbkbc@xxxxxxxxx>, Bjorn Helgaas <bhelgaas@xxxxxxxxxx>, Paul Walmsley <paul.walmsley@xxxxxxxxxx>, Palmer Dabbelt <palmer@xxxxxxxxxxx>, Albert Ou <aou@xxxxxxxxxxxxxxxxx>, Nick Child <nick.child@xxxxxxx>, Niklas Schnelle <schnelle@xxxxxxxxxxxxx>, Matthew Rosato <mjrosato@xxxxxxxxxxxxx>, Pierre Morel <pmorel@xxxxxxxxxxxxx>, Kees Cook <keescook@xxxxxxxxxxxx>, "Gustavo A. R. Silva" <gustavoars@xxxxxxxxxx>, alpha <linux-alpha@xxxxxxxxxxxxxxx>, "open list:IA64 (Itanium) PLATFORM" <linux-ia64@xxxxxxxxxxxxxxx>, linux-m68k <linux-m68k@xxxxxxxxxxxxxxx>, linuxppc-dev <linuxppc-dev@xxxxxxxxxxxxxxxx>, linux-s390 <linux-s390@xxxxxxxxxxxxxxx>, sparclinux <sparclinux@xxxxxxxxxxxxxxx>, "open list:TENSILICA XTENSA PORT (xtensa)" <linux-xtensa@xxxxxxxxxxxxxxxx>, linux-pci <linux-pci@xxxxxxxxxxxxxxx>, linux-arch <linux-arch@xxxxxxxxxxxxxxx>, linux-riscv <linux-riscv@xxxxxxxxxxxxxxxxxxx>
- In-reply-to: <YtTif+vNq+gkfqsc@infradead.org>
- References: <20220717033453.2896843-1-shorne@gmail.com> <20220717033453.2896843-2-shorne@gmail.com> <YtTif+vNq+gkfqsc@infradead.org>
On Mon, Jul 18, 2022 at 6:33 AM Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
>
> On Sun, Jul 17, 2022 at 12:34:52PM +0900, Stafford Horne wrote:
> > The generic pci.h header now only provides a definition of
> > pci_get_legacy_ide_irq which is used by architectures that support PNP.
> > Of the architectures that use asm-generic/pci.h this is only x86.
>
> Please move this into a separate header, ike legacy-ide.h. It doens't
> have anyting to do with actual PCI support.
It looks like asm/libata-portmap.h is meant to have this information already,
and this is what libata uses, while drivers/ide used the
pci_get_legacy_ide_irq()
function for the same purpose.
Only ia64 and powerpc have interesting definitions of both, and they
return the same thing, so I think this is sufficient to remove the last caller:
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c
index 2fa0f7d55259..d7a6250589d6 100644
--- a/drivers/pnp/resource.c
+++ b/drivers/pnp/resource.c
@@ -16,7 +16,7 @@
#include <asm/io.h>
#include <asm/dma.h>
#include <asm/irq.h>
-#include <linux/pci.h>
+#include <linux/libata.h>
#include <linux/ioport.h>
#include <linux/init.h>
@@ -322,8 +322,8 @@ static int pci_dev_uses_irq(struct pnp_dev *pnp,
struct pci_dev *pci,
* treat the compatibility IRQs as busy.
*/
if ((progif & 0x5) != 0x5)
- if (pci_get_legacy_ide_irq(pci, 0) == irq ||
- pci_get_legacy_ide_irq(pci, 1) == irq) {
+ if (ATA_PRIMARY_IRQ(pci) == irq ||
+ ATA_SECONDARY_IRQ(pci) == irq) {
pnp_dbg(&pnp->dev, " legacy IDE device %s "
"using irq %d\n", pci_name(pci), irq);
return 1;
This is fine on the architectures that currently return an error from
pci_get_legacy_ide_irq() but will change to returning 15/14 instead,
because they do not support ISA devices, so pci_dev_uses_irq()
will never be called either.
Arnd
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]