The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org, x86@kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: [PATCH v4 5/6] x86/io_delay: Switch io_delay() default mechanism to "none"
Date: Mon, 19 Jan 2026 19:26:31 +0100	[thread overview]
Message-ID: <20260119182632.596369-6-jgross@suse.com> (raw)
In-Reply-To: <20260119182632.596369-1-jgross@suse.com>

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 associated
io_delay_0xed_port_dmi_table().

Signed-off-by: Juergen Gross <jgross@suse.com>
---
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".
 
-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 843f23044754..d50d31023385 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, const void *from,
 extern void native_io_delay(void);
 
 extern int io_delay_type;
-extern void io_delay_init(void);
 
 #if defined(CONFIG_PARAVIRT)
 #include <asm/paravirt-base.h>
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 <linux/kernel.h>
 #include <linux/export.h>
 #include <linux/delay.h>
-#include <linux/init.h>
-#include <linux/dmi.h>
 #include <linux/io.h>
 
 #define IO_DELAY_TYPE_0X80	0
@@ -18,19 +16,7 @@
 #define IO_DELAY_TYPE_UDELAY	2
 #define IO_DELAY_TYPE_NONE	3
 
-#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 = DEFAULT_IO_DELAY_TYPE;
-
-static int __initdata io_delay_override;
+int io_delay_type __read_mostly = IO_DELAY_TYPE_NONE;
 
 /*
  * Paravirt wants native_io_delay to be a constant.
@@ -61,70 +47,6 @@ void native_io_delay(void)
 }
 EXPORT_SYMBOL(native_io_delay);
 
-static int __init dmi_io_delay_0xed_port(const struct dmi_system_id *id)
-{
-	if (io_delay_type == IO_DELAY_TYPE_0X80) {
-		pr_notice("%s: using 0xed I/O delay port\n", id->ident);
-		io_delay_type = 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[] __initconst = {
-	{
-		.callback	= dmi_io_delay_0xed_port,
-		.ident		= "Compaq Presario V6000",
-		.matches	= {
-			DMI_MATCH(DMI_BOARD_VENDOR,	"Quanta"),
-			DMI_MATCH(DMI_BOARD_NAME,	"30B7")
-		}
-	},
-	{
-		.callback	= dmi_io_delay_0xed_port,
-		.ident		= "HP Pavilion dv9000z",
-		.matches	= {
-			DMI_MATCH(DMI_BOARD_VENDOR,	"Quanta"),
-			DMI_MATCH(DMI_BOARD_NAME,	"30B9")
-		}
-	},
-	{
-		.callback	= dmi_io_delay_0xed_port,
-		.ident		= "HP Pavilion dv6000",
-		.matches	= {
-			DMI_MATCH(DMI_BOARD_VENDOR,	"Quanta"),
-			DMI_MATCH(DMI_BOARD_NAME,	"30B8")
-		}
-	},
-	{
-		.callback	= dmi_io_delay_0xed_port,
-		.ident		= "HP Pavilion tx1000",
-		.matches	= {
-			DMI_MATCH(DMI_BOARD_VENDOR,	"Quanta"),
-			DMI_MATCH(DMI_BOARD_NAME,	"30BF")
-		}
-	},
-	{
-		.callback	= dmi_io_delay_0xed_port,
-		.ident		= "Presario F700",
-		.matches	= {
-			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;
 
-	io_delay_override = 1;
 	return 0;
 }
 
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)
 
 	vsmp_init();
 
-	io_delay_init();
-
 	early_platform_quirks();
 
 	/* Some platforms need the APIC registered for NUMA configuration */
-- 
2.52.0


  parent reply	other threads:[~2026-01-19 18:27 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-19 18:26 [PATCH v4 0/6] x86: Cleanups around slow_down_io() Juergen Gross
2026-01-19 18:26 ` [PATCH v4 1/6] x86/irqflags: Fix build failure Juergen Gross
2026-03-21 15:47   ` [tip: x86/cleanups] x86/irqflags: Preemptively move include paravirt.h directive where it belongs tip-bot2 for Juergen Gross
2026-03-22  7:47   ` tip-bot2 for Juergen Gross
2026-01-19 18:26 ` [PATCH v4 2/6] x86/paravirt: Replace io_delay() hook with a bool Juergen Gross
2026-03-21 15:47   ` [tip: x86/cleanups] " tip-bot2 for Juergen Gross
2026-03-22  7:46   ` tip-bot2 for Juergen Gross
2026-01-19 18:26 ` [PATCH v4 3/6] block/floppy: Don't use REALLY_SLOW_IO for delays Juergen Gross
2026-03-21 15:47   ` [tip: x86/cleanups] " tip-bot2 for Juergen Gross
2026-03-22  7:46   ` tip-bot2 for Juergen Gross
2026-01-19 18:26 ` [PATCH v4 4/6] x86/io: Remove REALLY_SLOW_IO handling Juergen Gross
2026-03-26  8:39   ` Juergen Gross
2026-03-26 10:04     ` Borislav Petkov
2026-03-26 10:23       ` Jürgen Groß
2026-01-19 18:26 ` Juergen Gross [this message]
2026-03-20 22:02   ` [PATCH v4 5/6] x86/io_delay: Switch io_delay() default mechanism to "none" Borislav Petkov
2026-03-21  6:29     ` Jürgen Groß
2026-03-21 11:32       ` Borislav Petkov
2026-01-19 18:26 ` [PATCH v4 6/6] x86/io_delay: Add config option for controlling build of io_delay Juergen Gross
2026-02-02 10:27 ` [PATCH v4 0/6] x86: Cleanups around slow_down_io() Juergen Gross
2026-02-09  9:11 ` Juergen Gross
2026-02-09 10:19   ` Borislav Petkov
2026-03-11  9:16 ` Juergen Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260119182632.596369-6-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox