[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251216134150.2710-5-jgross@suse.com>
Date: Tue, 16 Dec 2025 14:41:48 +0100
From: Juergen Gross <jgross@...e.com>
To: linux-kernel@...r.kernel.org,
x86@...nel.org
Cc: Juergen Gross <jgross@...e.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>
Subject: [PATCH v2 4/5] x86/io_delay: Switch io_delay() default mechanism to "none"
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 <jgross@...e.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 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, 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.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.51.0
Powered by blists - more mailing lists