NetBSD Problem Report #57138

From  Mon Dec 26 19:32:26 2022
Return-Path: <>
Received: from ( [])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id C51071A921F
	for <>; Mon, 26 Dec 2022 19:32:25 +0000 (UTC)
Message-Id: <>
Date: Mon, 26 Dec 2022 19:32:24 +0000 (UTC)
Subject: incorrect spl assumption in macppc adb code
X-Send-Pr-Version: www-1.0

>Number:         57138
>Category:       port-macppc
>Synopsis:       incorrect spl assumption in macppc adb code
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-macppc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 26 19:35:01 +0000 2022
>Originator:     Miod Vallat
>Release:        HEAD
In sys/arch/macppc/dev/adb_direct.c send_adb_cuda(), the end of the routine decides to perform polling work if either adb_polling is set or the returned value from splhigh() earlier has bit 18 set.

At the time Tsubai Masanari ported the mac68k adb code, this check made sense as the result of the spl functions was the actual interrupt controller mask, with bit 18 being the cuda interrupt. The check was roughly equivalent to "are we at IPL_TTY or higher?".

However, it has been years since the results of the spl functions no longer match interrupt controller masks.
Code inspection.
Either replace the test with a proper IPL_TTY check, or remove it altogether, since this condition has been always false in the last 20+ years and it looks noone noticed, thus nothing would get broken removing it.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2022 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.