From nobody Mon Feb 9 13:37:11 2026 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 284F933A9EC for ; Thu, 15 Jan 2026 08:49:28 +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=1768466970; cv=none; b=PZvHI1oWzFR4+u1mGi25+V768lDPZIkRL6WKDFdVvRdbp83KfCDxqZk7Upn6mgzK4cDBBkx7Dzu80I1TTiW5JPeStPvmRERusp+X014EWEaPlrCMnF0/sdVrYVShDTpLoiaVaoo8Du0rUkhxcVKQ2CTthFa83CKcsGlFVApkdUI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768466970; c=relaxed/simple; bh=gFSbBjIDqVRRr9ofGxQ2lXnaFEcmeWZJsBtstl9Ohpk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KQskoeyCcREwP40kB8UHfMt5TUtzHly+vrFqCcsFZbURHKUJdSeMe7o11fS6D6JWzIPM/yFTxrMnFJmKkomRo7Zsg3gbQzQTqBsBmeLIUVt5Zn4SRia8ThGmdCNfHFfzG3/6OdSSkBeSFyBAZNXdZZE4JtXBZfmSCzNcTCZvDkM= 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; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=hlyUnFem; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=hlyUnFem; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="hlyUnFem"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="hlyUnFem" 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 620735BCF1; Thu, 15 Jan 2026 08:49:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1768466966; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T1gh+x7kyD7JqH6OripkK/Ko+9DgqVkLN47n1gKxFhI=; b=hlyUnFemceSZq1iqsptyyXMgWSv8SeJZvG01hpQktb9R+YZFggmdT39p5dYZH5ry43QO8F 94w3uEugwD6YblsGT0axE3H4hG/Cd0jCFd+oDneoUW6opIjf3gINu5/eXWb+LbMnoT/Kg+ iV8vHr0CMD24lV5i75qNw1oesEq1Qcs= Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=hlyUnFem DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1768466966; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T1gh+x7kyD7JqH6OripkK/Ko+9DgqVkLN47n1gKxFhI=; b=hlyUnFemceSZq1iqsptyyXMgWSv8SeJZvG01hpQktb9R+YZFggmdT39p5dYZH5ry43QO8F 94w3uEugwD6YblsGT0axE3H4hG/Cd0jCFd+oDneoUW6opIjf3gINu5/eXWb+LbMnoT/Kg+ iV8vHr0CMD24lV5i75qNw1oesEq1Qcs= 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 C79523EA63; Thu, 15 Jan 2026 08:49:25 +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 xXZDKxWqaGkHIQAAD6G6ig (envelope-from ); Thu, 15 Jan 2026 08:49:25 +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 v3 5/5] x86/io_delay: Add config option for controlling build of io_delay. Date: Thu, 15 Jan 2026 09:48:49 +0100 Message-ID: <20260115084849.31502-6-jgross@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260115084849.31502-1-jgross@suse.com> References: <20260115084849.31502-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-Spam-Score: -3.01 X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.com:+]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from,2a07:de40:b281:106:10:150:64:167:received]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_VIA_SMTP_AUTH(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,suse.com:mid,suse.com:email,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo] X-Spam-Level: X-Rspamd-Action: no action X-Rspamd-Queue-Id: 620735BCF1 X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Flag: NO Content-Type: text/plain; charset="utf-8" Prepare phasing out support of io_delay() by adding a config option (default on for now) controlling the build of io_delay.c. Signed-off-by: Juergen Gross --- V2: - new patch (kind of suggested by Ingo Molnar) --- arch/x86/Kconfig | 8 ++++++++ arch/x86/include/asm/floppy.h | 4 ++++ arch/x86/include/asm/io.h | 6 ++++++ arch/x86/kernel/Makefile | 3 ++- arch/x86/kernel/setup.c | 2 ++ 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 62e11572da27..e93abd2ffeb9 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -3169,6 +3169,14 @@ config HAVE_ATOMIC_IOMAP def_bool y depends on X86_32 =20 +config IO_DELAY + bool "Support delay of I/O-port activities" + default y + help + Include code allowing to delay I/O-port activities. This might be + needed on some rather old hardware. The delay mechanism will still + require to be selected via the "io_delay" boot parameter. + source "arch/x86/kvm/Kconfig" =20 source "arch/x86/Kconfig.cpufeatures" diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h index 8d1e86687b98..d7df95255761 100644 --- a/arch/x86/include/asm/floppy.h +++ b/arch/x86/include/asm/floppy.h @@ -50,9 +50,11 @@ static inline u8 fd_inb(u16 base, u16 reg) { u8 ret =3D inb_p(base + reg); =20 +#ifdef CONFIG_IO_DELAY native_io_delay(); native_io_delay(); native_io_delay(); +#endif =20 return ret; } @@ -61,9 +63,11 @@ static inline void fd_outb(u8 value, u16 base, u16 reg) { outb_p(value, base + reg); =20 +#ifdef CONFIG_IO_DELAY native_io_delay(); native_io_delay(); native_io_delay(); +#endif } =20 static irqreturn_t floppy_hardint(int irq, void *dev_id) diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index d50d31023385..4946f870bdb7 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h @@ -237,6 +237,7 @@ static inline void __iowrite32_copy(void __iomem *to, c= onst void *from, =20 #endif /* __KERNEL__ */ =20 +#ifdef CONFIG_IO_DELAY extern void native_io_delay(void); =20 extern int io_delay_type; @@ -254,6 +255,11 @@ static inline void slow_down_io(void) =20 native_io_delay(); } +#else +static inline void slow_down_io(void) +{ +} +#endif =20 #define BUILDIO(bwl, type) \ static inline void out##bwl##_p(type value, u16 port) \ diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index e9aeeeafad17..879c1b7bf7c2 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -66,11 +66,12 @@ obj-$(CONFIG_X86_32) +=3D sys_ia32.o obj-$(CONFIG_IA32_EMULATION) +=3D sys_ia32.o signal_32.o obj-$(CONFIG_X86_64) +=3D sys_x86_64.o obj-$(CONFIG_X86_ESPFIX64) +=3D espfix_64.o +obj-$(CONFIG_IO_DELAY) +=3D io_delay.o obj-$(CONFIG_SYSFS) +=3D ksysfs.o obj-y +=3D bootflag.o e820.o obj-y +=3D pci-dma.o quirks.o kdebugfs.o obj-y +=3D alternative.o i8253.o hw_breakpoint.o -obj-y +=3D tsc.o tsc_msr.o io_delay.o rtc.o +obj-y +=3D tsc.o tsc_msr.o rtc.o obj-y +=3D resource.o obj-y +=3D irqflags.o obj-y +=3D static_call.o diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 8ef29c1ebb8d..a3fa38a23807 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -183,6 +183,7 @@ static const struct ctl_table x86_sysctl_table[] =3D { .mode =3D 0444, .proc_handler =3D proc_dointvec, }, +#ifdef CONFIG_IO_DELAY { .procname =3D "io_delay_type", .data =3D &io_delay_type, @@ -190,6 +191,7 @@ static const struct ctl_table x86_sysctl_table[] =3D { .mode =3D 0644, .proc_handler =3D proc_dointvec, }, +#endif #if defined(CONFIG_ACPI_SLEEP) { .procname =3D "acpi_video_flags", --=20 2.51.0