NetBSD Problem Report #60675
From www@netbsd.org Tue Sep 1 08:51:42 2026
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
client-signature RSA-PSS (2048 bits) client-digest SHA256)
(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 8A1571A923B
for <gnats-bugs@gnats.NetBSD.org>; Tue, 1 Sep 2026 08:51:42 +0000 (UTC)
Message-Id: <20260901085140.DC5131A923C@mollari.NetBSD.org>
Date: Tue, 1 Sep 2026 08:51:40 +0000 (UTC)
From: jack@zage.org.uk
Reply-To: jack@zage.org.uk
To: gnats-bugs@NetBSD.org
Subject: prep i8259 cascade interrupt wrong polarity.
X-Send-Pr-Version: www-1.0
X-From4GNATS: "jack@zage.org.uk via gnats" <gnats-admin@NetBSD.org>
>Number: 60675
>Category: port-prep
>Synopsis: prep i8259 cascade interrupt wrong polarity.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: port-prep-maintainer
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Sep 01 08:55:00 +0000 2026
>Last-Modified: Tue Sep 08 11:30:03 +0000 2026
>Originator: Jack Dunn
>Release: current
>Organization:
>Environment:
NetBSD rs6000-43p 11.99.7 NetBSD 11.99.7 (GENERIC) #1: Mon Aug 31 13:39:26 UTC 2026 jack@build:/home/jack/netbsd/obj/sys/arch/prep/compile/GENERIC prep
>Description:
This is the same bug as PR port-ofppc/60640, in a second place.
On a prep machine which has an i8259 cascaded into an OpenPIC the kernel hangs immediately after printing:
OpenPIC Version 1.1: Supports 4 CPUs and 16 interrupt sources.
pic_handle_intr() never leaves its pic_get_irq(PIC_GET_RECHECK) loop and the CPU spends 100% of its time in the interrupt handler.
sys/arch/prep/prep/machdep.c, prep_setup_openpic(), registers the ISA cascade with IST_LEVEL. IST_LEVEL is an alias for IST_LEVEL_LOW but the i8259's INT output is active high, so opic_establish_irq() programs source 0 as OPENPIC_POLARITY_NEGATIVE and the OpenPIC sees the cascade asserted while the 8259 is idle.
Unlike ofppc this is a total hang rather than "progresses on keypress".
With DIAGNOSTIC it panics instead of spinning:
kernel diagnostic assertion "virq != 0" failed ... powerpc/pic/intr.c
Tested on an IBM RS/6000 7043-140. This issue only affects pic_openpic, not pic_distopenpic or pic_mpcsoc.
>How-To-Repeat:
Boot prep on a machine with an OpenPIC/cascaded i8259, e.g. an IBM RS/6000 7043-140.
>Fix:
Change the line (sys/arch/prep/prep/machdep.c, in prep_setup_openpic())
intr_establish(16, IST_LEVEL, IPL_HIGH, pic_handle_intr, isa_pic);
to
intr_establish(16, IST_LEVEL_HIGH, IPL_HIGH, pic_handle_intr, isa_pic);
>Audit-Trail:
From: "Michael Lorenz" <macallan@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/60675 CVS commit: src/sys/arch/prep/prep
Date: Tue, 8 Sep 2026 11:29:14 +0000
Module Name: src
Committed By: macallan
Date: Tue Sep 8 11:29:14 UTC 2026
Modified Files:
src/sys/arch/prep/prep: machdep.c
Log Message:
apply the same cascaded interrupt patch as on ofppc
should fix PR60675
To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/prep/prep/machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.