From nobody Fri Dec 19 07:18:39 2025 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6EF93A5C13 for ; Tue, 16 Dec 2025 13:42:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765892542; cv=none; b=YWjMrpUGsjvxhGqgGEDsB+yEOBmFnkrDH4z7XhY4V7sKw6Ub24t5tCeHvtA0w4tkN1UkooX5EX48zcmM1vMoh0ViCRGwf1yPFnzCQHPQVUYEZ4+gzjph+wrpCu8HMssm9bSBKs1kdlRJ/kAvGLWuiyKOFSbl6h8phkrY8xQG+jk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765892542; c=relaxed/simple; bh=NQW7jR9a/irDzU36QL35naxWFFub6FIL1/Ft5qL3lGQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gIpqYrIKeowRq1+qUAll92u/J8EJghBdRQib++XsTOTyHv/5rK1Xdc7KvkPgeBmUKDZ7Tbl1/a2jPMruj1otcB5HD1g42OZSCDbj2qPHm8bwaqaEFVd7Odg5BqNBVJvPaOu9ep2LKEQ21vwA6AtrmQFAx455SAC4vDvnparnHOg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 5B3D95BCD6; Tue, 16 Dec 2025 13:42:16 +0000 (UTC) Authentication-Results: smtp-out2.suse.de; none Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 1862D3EA63; Tue, 16 Dec 2025 13:42:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id pdt7BLhhQWmgHwAAD6G6ig (envelope-from ); Tue, 16 Dec 2025 13:42:16 +0000 From: Juergen Gross To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: Juergen Gross , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" Subject: [PATCH v2 4/5] x86/io_delay: Switch io_delay() default mechanism to "none" Date: Tue, 16 Dec 2025 14:41:48 +0100 Message-ID: <20251216134150.2710-5-jgross@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251216134150.2710-1-jgross@suse.com> References: <20251216134150.2710-1-jgross@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Flag: NO X-Spam-Score: -4.00 X-Rspamd-Queue-Id: 5B3D95BCD6 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Action: no action X-Spam-Level: Content-Type: text/plain; charset="utf-8" The habit to delay some port operations via io_delay() is probably a no longer needed relict from i386 times. Switch the default to no longer do delays for port operations. In case this is breaking some still supported hardware, the default can still be overwritten via boot parameter. Remove the Kconfig options to select the default io_delay() mechanism. This makes io_delay_init() a nop, so it can be removed together with dmi_io_delay_0xed_port() and the associatedr io_delay_0xed_port_dmi_table(). Signed-off-by: Juergen Gross --- V2: - new patch (kind of suggested by Ingo Molnar) --- arch/x86/Kconfig.debug | 30 -------------- arch/x86/include/asm/io.h | 1 - arch/x86/kernel/io_delay.c | 81 +------------------------------------- arch/x86/kernel/setup.c | 2 - 4 files changed, 1 insertion(+), 113 deletions(-) diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index c95c3aaadf97..56888156a64b 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug @@ -120,36 +120,6 @@ config X86_DECODER_SELFTEST decoder code. If unsure, say "N". =20 -choice - prompt "IO delay type" - default IO_DELAY_0X80 - -config IO_DELAY_0X80 - bool "port 0x80 based port-IO delay [recommended]" - help - This is the traditional Linux IO delay used for in/out_p. - It is the most tested hence safest selection here. - -config IO_DELAY_0XED - bool "port 0xed based port-IO delay" - help - Use port 0xed as the IO delay. This frees up port 0x80 which is - often used as a hardware-debug port. - -config IO_DELAY_UDELAY - bool "udelay based port-IO delay" - help - Use udelay(2) as the IO delay method. This provides the delay - while not having any side-effect on the IO port space. - -config IO_DELAY_NONE - bool "no port-IO delay" - help - No port-IO delay. Will break on old boxes that require port-IO - delay for certain operations. Should work on most new machines. - -endchoice - config DEBUG_BOOT_PARAMS bool "Debug boot parameters" depends on DEBUG_KERNEL diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index c4ddaaa1b81c..9c4178f2d094 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h @@ -240,7 +240,6 @@ static inline void __iowrite32_copy(void __iomem *to, c= onst void *from, extern void native_io_delay(void); =20 extern int io_delay_type; -extern void io_delay_init(void); =20 #if defined(CONFIG_PARAVIRT) #include diff --git a/arch/x86/kernel/io_delay.c b/arch/x86/kernel/io_delay.c index fdb6506ceaaa..458e2fd9279b 100644 --- a/arch/x86/kernel/io_delay.c +++ b/arch/x86/kernel/io_delay.c @@ -9,8 +9,6 @@ #include #include #include -#include -#include #include =20 #define IO_DELAY_TYPE_0X80 0 @@ -18,19 +16,7 @@ #define IO_DELAY_TYPE_UDELAY 2 #define IO_DELAY_TYPE_NONE 3 =20 -#if defined(CONFIG_IO_DELAY_0X80) -#define DEFAULT_IO_DELAY_TYPE IO_DELAY_TYPE_0X80 -#elif defined(CONFIG_IO_DELAY_0XED) -#define DEFAULT_IO_DELAY_TYPE IO_DELAY_TYPE_0XED -#elif defined(CONFIG_IO_DELAY_UDELAY) -#define DEFAULT_IO_DELAY_TYPE IO_DELAY_TYPE_UDELAY -#elif defined(CONFIG_IO_DELAY_NONE) -#define DEFAULT_IO_DELAY_TYPE IO_DELAY_TYPE_NONE -#endif - -int io_delay_type __read_mostly =3D DEFAULT_IO_DELAY_TYPE; - -static int __initdata io_delay_override; +int io_delay_type __read_mostly =3D IO_DELAY_TYPE_NONE; =20 /* * Paravirt wants native_io_delay to be a constant. @@ -61,70 +47,6 @@ void native_io_delay(void) } EXPORT_SYMBOL(native_io_delay); =20 -static int __init dmi_io_delay_0xed_port(const struct dmi_system_id *id) -{ - if (io_delay_type =3D=3D IO_DELAY_TYPE_0X80) { - pr_notice("%s: using 0xed I/O delay port\n", id->ident); - io_delay_type =3D IO_DELAY_TYPE_0XED; - } - - return 0; -} - -/* - * Quirk table for systems that misbehave (lock up, etc.) if port - * 0x80 is used: - */ -static const struct dmi_system_id io_delay_0xed_port_dmi_table[] __initcon= st =3D { - { - .callback =3D dmi_io_delay_0xed_port, - .ident =3D "Compaq Presario V6000", - .matches =3D { - DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), - DMI_MATCH(DMI_BOARD_NAME, "30B7") - } - }, - { - .callback =3D dmi_io_delay_0xed_port, - .ident =3D "HP Pavilion dv9000z", - .matches =3D { - DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), - DMI_MATCH(DMI_BOARD_NAME, "30B9") - } - }, - { - .callback =3D dmi_io_delay_0xed_port, - .ident =3D "HP Pavilion dv6000", - .matches =3D { - DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), - DMI_MATCH(DMI_BOARD_NAME, "30B8") - } - }, - { - .callback =3D dmi_io_delay_0xed_port, - .ident =3D "HP Pavilion tx1000", - .matches =3D { - DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), - DMI_MATCH(DMI_BOARD_NAME, "30BF") - } - }, - { - .callback =3D dmi_io_delay_0xed_port, - .ident =3D "Presario F700", - .matches =3D { - DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), - DMI_MATCH(DMI_BOARD_NAME, "30D3") - } - }, - { } -}; - -void __init io_delay_init(void) -{ - if (!io_delay_override) - dmi_check_system(io_delay_0xed_port_dmi_table); -} - static int __init io_delay_param(char *s) { if (!s) @@ -141,7 +63,6 @@ static int __init io_delay_param(char *s) else return -EINVAL; =20 - io_delay_override =3D 1; return 0; } =20 diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 1b2edd07a3e1..8ef29c1ebb8d 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1176,8 +1176,6 @@ void __init setup_arch(char **cmdline_p) =20 vsmp_init(); =20 - io_delay_init(); - early_platform_quirks(); =20 /* Some platforms need the APIC registered for NUMA configuration */ --=20 2.51.0