Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp185104iob; Mon, 2 May 2022 16:34:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXF4DHYnRPfRVD9eX9ifap+rz6i7Ur+8rGPMyXcr3b716sAWweI7V/jT1voujgn/qvCZS0 X-Received: by 2002:a17:90b:1b52:b0:1dc:54ea:ac00 with SMTP id nv18-20020a17090b1b5200b001dc54eaac00mr1702958pjb.99.1651534480886; Mon, 02 May 2022 16:34:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651534480; cv=none; d=google.com; s=arc-20160816; b=bsIJ4fdE6kp+B1m8dR1QK/YnnYfknYnW6wxPCV0mvedhRJSU/k4hQypr+fWSqlJhfi u9cpiZA7k1IoHUy1zeTrdrG3Xbwz9n3UzaZ35HlfuJblw+d/FQJWkgr9Gq+d94LZoh5G ywy/Pa4WJaDKmmYDOovHbNGdgQWBa6iaFDYTgkt/RYoUArfm4ErRP5WiTjF5CDmcniaE I22ZtiR9n7BYAb4thDFiLp4aayAHrnP+EQ4pZy+DkmOMV5H2u/ZxQ16+kvkuB0kOHjBU muiBW7OHGc0F+yA/eCdd9D+lJPw6b9SuJhOeHfGc04AA+rNpimzfik2H7Qx7fNMjTL0U x0Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=xH1H+dZpcnkoXjkucpaq6JJ/BxwCu2uILw7KNDy7aWQ=; b=jv6G7fPIYC9L9d8bFvWhOuC0BSLISu5mLtKHAsDqoUt+NP7SCyYRNGuXPzRDKJVDIM NAX0ekeAk1sPloSnU3JWh+yJQXNJwV3T8T0nuhJOWNYEzQQ43KEhinkWwXQKFpGSL9nA 2XRGdoHkISL9+n2vOazgi+yHLp4ghq2Y6ZWH+opS9oxkBGIXQl8/CRb5voavX9wqtO7j ILkU3s2Dx9lh4qAVQdNPpDutNaPcl7RM2Nf/Sg3ygLi16fQunHrd4X+rXuaCcH78vGHK 765Duojctf2ESS7R66UzFtd816za5WyuOm1+26zAnM2SWrL90Apy6IIPlzgn0TMX4rzz n0XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=nlTaipuv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j71-20020a63804a000000b003c23c6b393bsi3079901pgd.652.2022.05.02.16.34.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 16:34:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=nlTaipuv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C89B231DEC; Mon, 2 May 2022 16:34:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376361AbiD2NsR (ORCPT + 99 others); Fri, 29 Apr 2022 09:48:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376334AbiD2NsP (ORCPT ); Fri, 29 Apr 2022 09:48:15 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B3D5CC51D; Fri, 29 Apr 2022 06:44:56 -0700 (PDT) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 23TCc4io016956; Fri, 29 Apr 2022 13:44:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : mime-version; s=pp1; bh=xH1H+dZpcnkoXjkucpaq6JJ/BxwCu2uILw7KNDy7aWQ=; b=nlTaipuvXrKUA+OAOSnyBIFwdEWiircPn9NmgYwKt/nl54rcT6+Re0sXMDEjl81v+lfw Cr2NEwYpBfsCJcpVbyvCbqf3Do525Fx4vz/hkv+ghyKytLcqSNzpxxdUSacuaBJMhmnI 9iLfIVugA5JFq5i12cP+kLYwfiBQ4s7UafXQzplBOgLqOHwIc9+/JNvxzB14B3BLEgZT KC3QtNZvwkEOCXSda4oogtT5xXjWGhrXZ6NOxOv3Qszep2tFtCPU8mfMfgKINzCKOChl Hn1DzWNnMyCDkit4IshqACYsoeVLB2zWSv+CASNh87cIKm+uqE85pU1hrq+lkWUAzL9D ag== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3fqqtnspm4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Apr 2022 13:44:36 +0000 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 23TD4LbS032483; Fri, 29 Apr 2022 13:44:35 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3fqqtnspkn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Apr 2022 13:44:35 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 23TDSeZh024602; Fri, 29 Apr 2022 13:44:33 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma01fra.de.ibm.com with ESMTP id 3fm938ya4g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Apr 2022 13:44:33 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 23TDiVQO47251784 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Apr 2022 13:44:31 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2DF26AE053; Fri, 29 Apr 2022 13:44:31 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D188AAE045; Fri, 29 Apr 2022 13:44:30 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 29 Apr 2022 13:44:30 +0000 (GMT) From: Niklas Schnelle To: Arnd Bergmann Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-pci@vger.kernel.org, Bjorn Helgaas , Mauro Carvalho Chehab , Alan Stern , "Rafael J. Wysocki" , Geert Uytterhoeven Subject: [RFC v2 00/39] Kconfig: Introduce HAS_IOPORT config option Date: Fri, 29 Apr 2022 15:43:05 +0200 Message-Id: <20220429134430.2607821-1-schnelle@linux.ibm.com> X-Mailer: git-send-email 2.32.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: NLJ3a5TxLZAN4C-JQTC2Jqrv1a9rtw-_ X-Proofpoint-GUID: -Vn1wGSaeQ2Fe2EKLTRlrGASTLYx_tRo Content-Transfer-Encoding: 8bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-29_06,2022-04-28_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 bulkscore=0 adultscore=0 impostorscore=0 malwarescore=0 suspectscore=0 phishscore=0 priorityscore=1501 spamscore=0 clxscore=1011 mlxlogscore=999 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204290078 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Kernel Hackers, Some platforms such as s390 do not support PCI I/O spaces. On such platforms I/O space accessors like inb()/outb() are stubs that can never actually work. The way these stubs are implemented in asm-generic/io.h leads to compiler warnings because any use will cause a NULL pointer access. In a previous patch we tried handling this with a run-time warning on access. This approach however was rejected by Linus[0] with the argument that this really should be a compile-time check and, though a much more invasive change, we believe that is indeed the right approach. This patch series aims to do exactly that by introducing a HAS_IOPORT config option akin to the existing HAS_IOMEM. When this is unset inb()/outb() and friends may not be defined. This series builts heavily on an original patch for demonstating the concept by Arnd Bergmann[1] and is a stripped down version of a previous RFC[2]. The most important change being that we dropped the LEGACY_PCI config option in favor of using HAS_IOPORT regardless of whether the device is a legacy PCI device. As this is a significant change to the overall series I did not carry over previous R-bs. This version is based on v5.18-rc4 and is also available on my kernel.org tree in the has_ioport branch with the PGP signed tag has_ioport_rfc_v2: https://git.kernel.org/pub/scm/linux/kernel/git/niks/linux.git Thanks, Niklas Schnelle Changes from RFC v1: - Completely dropped the LEGACY_PCI option and replaced its dependencies with HAS_IOPORT as appropriate - In the usb subsystem patch I incorporated the feedback from v1 by Alan Stern: - Used a local macro to nop in*()/out*() in the helpers - Removed an unnecessary further restriction on CONFIG_USB_UHCI_HCD - Added a few more subsystems including wireless, ptp, and, mISDN that I had previously missed due to a blanket !S390. - Removed blanket !S390 dependencies where they are added due to the I/O port problem - In the sound system SND_OPL3_LIB needed to use "depends on" instead of "select" because of its added HAS_IOPORT dependency - In the drm subsystem the bochs driver gets #ifdefs instead of a blanket dependency because its MMIO capable device variant should work without HAS_IOPORT. [0] https://lore.kernel.org/lkml/CAHk-=wg80je=K7madF4e7WrRNp37e3qh6y10Svhdc7O8SZ_-8g@mail.gmail.com/ [1] https://lore.kernel.org/lkml/CAK8P3a0MNbx-iuzW_-=0ab6-TTZzwV-PT_6gAC1Gp5PgYyHcrA@mail.gmail.com/ [2] https://yhbt.net/lore/all/20211227164317.4146918-1-schnelle@linux.ibm.com/ Niklas Schnelle (39): Kconfig: introduce HAS_IOPORT option and select it as necessary ACPI: add dependency on HAS_IOPORT ata: add HAS_IOPORT dependencies char: impi, tpm: depend on HAS_IOPORT comedi: add HAS_IOPORT dependencies counter: add HAS_IOPORT dependencies /dev/port: don't compile file operations without CONFIG_DEVPORT drm: handle HAS_IOPORT dependencies firmware: dmi-sysfs: handle HAS_IOPORT=n gpio: add HAS_IOPORT dependencies hwmon: add HAS_IOPORT dependencies i2c: add HAS_IOPORT dependencies iio: adc: Kconfig: add HAS_IOPORT dependencies Input: add HAS_IOPORT dependencies Input: gameport: add ISA and HAS_IOPORT dependencies leds: add HAS_IOPORT dependencies media: add HAS_IOPORT dependencies misc: add HAS_IOPORT dependencies mISDN: add HAS_IOPORT dependencies mpt fusion: add HAS_IOPORT dependencies net: add HAS_IOPORT dependencies parport: PC style parport depends on HAS_IOPORT PCI: make quirk using inw() depend on HAS_IOPORT PCI/sysfs: make I/O resource depend on HAS_IOPORT pcmcia: add HAS_IOPORT dependencies platform: add HAS_IOPORT dependencies pnp: add HAS_IOPORT dependencies power: add HAS_IOPORT dependencies rtc: add HAS_IOPORT dependencies scsi: add HAS_IOPORT dependencies sound: add HAS_IOPORT dependencies speakup: add HAS_IOPORT dependency for SPEAKUP_SERIALIO staging: add HAS_IOPORT dependencies tty: serial: add HAS_IOPORT dependencies usb: handle HAS_IOPORT dependencies video: handle HAS_IOPORT dependencies watchdog: add HAS_IOPORT dependencies wireless: add HAS_IOPORT dependencies asm-generic/io.h: drop inb() etc for HAS_IOPORT=n arch/alpha/Kconfig | 1 + arch/arm/Kconfig | 1 + arch/arm64/Kconfig | 1 + arch/ia64/Kconfig | 1 + arch/m68k/Kconfig | 1 + arch/microblaze/Kconfig | 1 + arch/mips/Kconfig | 1 + arch/parisc/Kconfig | 1 + arch/powerpc/Kconfig | 1 + arch/riscv/Kconfig | 1 + arch/sh/Kconfig | 1 + arch/sparc/Kconfig | 1 + arch/x86/Kconfig | 1 + drivers/accessibility/speakup/Kconfig | 1 + drivers/acpi/Kconfig | 1 + drivers/ata/Kconfig | 1 + drivers/bus/Kconfig | 2 +- drivers/char/Kconfig | 3 +- drivers/char/ipmi/Makefile | 11 +- drivers/char/ipmi/ipmi_si_intf.c | 3 +- drivers/char/ipmi/ipmi_si_pci.c | 3 + drivers/char/mem.c | 6 +- drivers/char/tpm/Kconfig | 1 + drivers/char/tpm/tpm_infineon.c | 14 +- drivers/char/tpm/tpm_tis_core.c | 19 ++- drivers/comedi/Kconfig | 33 ++++- drivers/counter/Kconfig | 1 + drivers/firmware/dmi-sysfs.c | 4 + drivers/gpio/Kconfig | 2 +- drivers/gpu/drm/qxl/Kconfig | 1 + drivers/gpu/drm/tiny/bochs.c | 19 +++ drivers/gpu/drm/tiny/cirrus.c | 2 + drivers/hwmon/Kconfig | 21 ++- drivers/i2c/busses/Kconfig | 31 +++-- drivers/iio/adc/Kconfig | 2 +- drivers/input/gameport/Kconfig | 4 +- drivers/input/serio/Kconfig | 2 + drivers/input/touchscreen/Kconfig | 1 + drivers/isdn/Kconfig | 1 - drivers/isdn/hardware/mISDN/Kconfig | 12 +- drivers/leds/Kconfig | 2 +- drivers/media/pci/dm1105/Kconfig | 2 +- drivers/media/radio/Kconfig | 14 +- drivers/media/rc/Kconfig | 6 + drivers/message/fusion/Kconfig | 2 +- drivers/misc/altera-stapl/Makefile | 3 +- drivers/misc/altera-stapl/altera.c | 6 +- drivers/net/Kconfig | 2 +- drivers/net/arcnet/Kconfig | 2 +- drivers/net/can/cc770/Kconfig | 1 + drivers/net/can/sja1000/Kconfig | 1 + drivers/net/ethernet/8390/Kconfig | 2 +- drivers/net/ethernet/amd/Kconfig | 2 +- drivers/net/ethernet/intel/Kconfig | 2 +- drivers/net/ethernet/sis/Kconfig | 4 +- drivers/net/ethernet/ti/Kconfig | 2 +- drivers/net/ethernet/via/Kconfig | 1 + drivers/net/fddi/Kconfig | 2 +- drivers/net/hamradio/Kconfig | 6 +- drivers/net/wan/Kconfig | 2 +- drivers/net/wireless/atmel/Kconfig | 2 +- drivers/net/wireless/intersil/hostap/Kconfig | 2 +- drivers/parport/Kconfig | 4 +- drivers/pci/pci-sysfs.c | 16 +++ drivers/pci/quirks.c | 2 + drivers/pcmcia/Kconfig | 2 +- drivers/platform/chrome/Kconfig | 1 + drivers/platform/chrome/wilco_ec/Kconfig | 1 + drivers/pnp/isapnp/Kconfig | 2 +- drivers/power/reset/Kconfig | 1 + drivers/rtc/Kconfig | 4 +- drivers/scsi/Kconfig | 19 +-- drivers/scsi/aic7xxx/Kconfig.aic79xx | 2 +- drivers/scsi/aic7xxx/Kconfig.aic7xxx | 2 +- drivers/scsi/aic94xx/Kconfig | 2 +- drivers/scsi/megaraid/Kconfig.megaraid | 6 +- drivers/scsi/mvsas/Kconfig | 2 +- drivers/scsi/qla2xxx/Kconfig | 2 +- drivers/staging/sm750fb/Kconfig | 2 +- drivers/staging/vt6655/Kconfig | 2 +- drivers/tty/Kconfig | 2 +- drivers/tty/serial/8250/Kconfig | 2 +- drivers/tty/serial/Kconfig | 2 +- drivers/usb/core/hcd-pci.c | 2 + drivers/usb/host/Kconfig | 4 +- drivers/usb/host/pci-quirks.c | 128 ++++++++++--------- drivers/usb/host/pci-quirks.h | 31 +++-- drivers/usb/host/uhci-hcd.c | 2 +- drivers/usb/host/uhci-hcd.h | 33 +++-- drivers/video/fbdev/Kconfig | 25 ++-- drivers/watchdog/Kconfig | 6 +- include/asm-generic/io.h | 5 + include/linux/gameport.h | 9 +- include/linux/parport.h | 2 +- include/video/vga.h | 8 ++ lib/Kconfig | 4 + lib/Kconfig.kgdb | 1 + net/ax25/Kconfig | 2 +- sound/drivers/Kconfig | 5 + sound/isa/Kconfig | 44 +++---- sound/pci/Kconfig | 64 +++++++--- 101 files changed, 489 insertions(+), 246 deletions(-) Cc: Bjorn Helgaas Cc: Mauro Carvalho Chehab Cc: Alan Stern Cc: "Rafael J. Wysocki" Cc: Geert Uytterhoeven -- 2.32.0