From nobody Sun Jun 28 03:50:56 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A604FC4321E for ; Mon, 14 Feb 2022 20:53:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229991AbiBNUxt (ORCPT ); Mon, 14 Feb 2022 15:53:49 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:54622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230025AbiBNUxb (ORCPT ); Mon, 14 Feb 2022 15:53:31 -0500 Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 93BFADF97; Mon, 14 Feb 2022 12:53:10 -0800 (PST) Received: by angie.orcam.me.uk (Postfix, from userid 500) id D8D9792009C; Mon, 14 Feb 2022 21:16:50 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id D2C4C92009B; Mon, 14 Feb 2022 20:16:50 +0000 (GMT) Date: Mon, 14 Feb 2022 20:16:50 +0000 (GMT) From: "Maciej W. Rozycki" To: Sudip Mukherjee cc: Catalin Marinas , Will Deacon , Guo Ren , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Alexander Gordeev , Sven Schnelle , Jeff Dike , Richard Weinberger , Anton Ivanov , Chris Zankel , Max Filippov , linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] parport_pc: Also enable driver for PCI systems Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Nowadays PC-style parallel ports come in the form of PCI and PCIe option=20 cards and there are some combined parallel/serial option cards as well=20 that we handle in the parport subsystem. There is nothing in particular=20 that would prevent them from being used in any system equipped with PCI=20 or PCIe connectivity, except that we do not permit the PARPORT_PC config=20 option to be selected for platforms for which ARCH_MIGHT_HAVE_PC_PARPORT=20 has not been set for. The only PCI platforms that actually can't make use of PC-style parallel=20 port hardware are those newer PCIe systems that have no support for I/O=20 cycles in the host bridge, required by such parallel ports. Notably,=20 this includes the s390 arch, which has port I/O accessors that cause=20 compilation warnings (promoted to errors with `-Werror'), and there are=20 other cases such as the POWER9 PHB4 device, though this one has variable=20 port I/O accessors that depend on the particular system. Also it is not=20 clear whether the serial port side of devices enabled by PARPORT_SERIAL=20 uses port I/O or MMIO. Finally Super I/O solutions are always either=20 ISA or platform devices. Make the PARPORT_PC option selectable also for PCI systems then, except=20 for the s390 arch, however limit the availability of PARPORT_PC_SUPERIO=20 to platforms that enable ARCH_MIGHT_HAVE_PC_PARPORT. Update platforms=20 accordingly for the required header. Signed-off-by: Maciej W. Rozycki Acked-by: Sudip Mukherjee --- Hi, I have verified this lightly by booting a kernel with PARPORT_PC and=20 PARPORT_SERIAL enabled on a RISC-V HiFive Unmatched system. While I do=20 have a PCIe parallel port option available that I could use with my RISC-V=20 machine (based on the OxSemi OXPCIe952 chip) it is currently plugged in=20 the wrong system, and both machines are in my remote lab I have currently=20 no visit scheduled to in the near future. For the record the device=20 reports as: PCI parallel port detected: 1415:c118, I/O at 0x1000(0x1008), IRQ 18 parport1: PC-style at 0x1000 (0x1008), irq 18, using FIFO [PCSPP,TRISTATE,C= OMPAT,EPP,ECP] in the other system. I'll see if I can verify it with the Unmatched at=20 the next opportunity, though it seems like an overkill to me given that a=20 PC-style parallel port is a generic PCIe device. The OXPCIe952 implements=20 a multifunction device, so it doesn't rely on PARPORT_SERIAL. NB platforms to be updated for generation were chosen by=20 the presence of the HAVE_PCI or FORCE_PCI option from ones that do not=20 already have or generate that header, except for s390, now excluded. Let=20 me know if I got anything wrong here. Maciej Changes from v1: - Exclude s390 systems, update the change description accordingly. --- arch/arm64/include/asm/Kbuild | 1 + arch/csky/include/asm/Kbuild | 1 + arch/riscv/include/asm/Kbuild | 1 + arch/um/include/asm/Kbuild | 1 + arch/xtensa/include/asm/Kbuild | 1 + drivers/parport/Kconfig | 4 ++-- 6 files changed, 7 insertions(+), 2 deletions(-) linux-parport-pc-pci.diff Index: linux-macro/arch/arm64/include/asm/Kbuild =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- linux-macro.orig/arch/arm64/include/asm/Kbuild +++ linux-macro/arch/arm64/include/asm/Kbuild @@ -3,6 +3,7 @@ generic-y +=3D early_ioremap.h generic-y +=3D mcs_spinlock.h generic-y +=3D qrwlock.h generic-y +=3D qspinlock.h +generic-y +=3D parport.h generic-y +=3D user.h =20 generated-y +=3D cpucaps.h Index: linux-macro/arch/csky/include/asm/Kbuild =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- linux-macro.orig/arch/csky/include/asm/Kbuild +++ linux-macro/arch/csky/include/asm/Kbuild @@ -4,5 +4,6 @@ generic-y +=3D extable.h generic-y +=3D gpio.h generic-y +=3D kvm_para.h generic-y +=3D qrwlock.h +generic-y +=3D parport.h generic-y +=3D user.h generic-y +=3D vmlinux.lds.h Index: linux-macro/arch/riscv/include/asm/Kbuild =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- linux-macro.orig/arch/riscv/include/asm/Kbuild +++ linux-macro/arch/riscv/include/asm/Kbuild @@ -2,5 +2,6 @@ generic-y +=3D early_ioremap.h generic-y +=3D flat.h generic-y +=3D kvm_para.h +generic-y +=3D parport.h generic-y +=3D user.h generic-y +=3D vmlinux.lds.h Index: linux-macro/arch/um/include/asm/Kbuild =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- linux-macro.orig/arch/um/include/asm/Kbuild +++ linux-macro/arch/um/include/asm/Kbuild @@ -17,6 +17,7 @@ generic-y +=3D mcs_spinlock.h generic-y +=3D mmiowb.h generic-y +=3D module.lds.h generic-y +=3D param.h +generic-y +=3D parport.h generic-y +=3D percpu.h generic-y +=3D preempt.h generic-y +=3D softirq_stack.h Index: linux-macro/arch/xtensa/include/asm/Kbuild =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- linux-macro.orig/arch/xtensa/include/asm/Kbuild +++ linux-macro/arch/xtensa/include/asm/Kbuild @@ -4,6 +4,7 @@ generic-y +=3D extable.h generic-y +=3D kvm_para.h generic-y +=3D mcs_spinlock.h generic-y +=3D param.h +generic-y +=3D parport.h generic-y +=3D qrwlock.h generic-y +=3D qspinlock.h generic-y +=3D user.h Index: linux-macro/drivers/parport/Kconfig =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- linux-macro.orig/drivers/parport/Kconfig +++ linux-macro/drivers/parport/Kconfig @@ -42,7 +42,7 @@ if PARPORT =20 config PARPORT_PC tristate "PC-style hardware" - depends on ARCH_MIGHT_HAVE_PC_PARPORT + depends on ARCH_MIGHT_HAVE_PC_PARPORT || (PCI && !S390) help You should say Y here if you have a PC-style parallel port. All IBM PC compatible computers and some Alphas have PC-style @@ -77,7 +77,7 @@ config PARPORT_PC_FIFO =20 config PARPORT_PC_SUPERIO bool "SuperIO chipset support" - depends on PARPORT_PC && !PARISC + depends on ARCH_MIGHT_HAVE_PC_PARPORT && PARPORT_PC && !PARISC help Saying Y here enables some probes for Super-IO chipsets in order to find out things like base addresses, IRQ lines and DMA channels. It