NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-macppc/57138: incorrect spl assumption in macppc adb code



>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
>Organization:
>Environment:
>Description:
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.
>How-To-Repeat:
Code inspection.
>Fix:
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.



Home | Main Index | Thread Index | Old Index