NetBSD-Bugs archive

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

kern/61029: eap(4): ES1371 "eap1371_ready_codec timeout 2/3" flood at attach, depends on kernel build, on hppa



>Number:         61029
>Category:       kern
>Synopsis:       eap(4): ES1371 "eap1371_ready_codec timeout 2/3" flood at attach, depends on kernel build, on hppa
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 19 19:55:01 +0000 2026
>Originator:     Brandon Applegate
>Release:        NetBSD 11.99.11 (daily 20261116083232Z)
>Organization:
>Environment:
NetBSD c3700.retronet.burn.net 11.99.11 NetBSD 11.99.11 (GENERIC-AC97_TEST) #1: Thu Nov 19 13:07:56 EST 2026  root%c3700.retronet.burn.net@localhost:/usr/src/sys/arch/hppa/compile/GENERIC-AC97_TEST hppa

HP 9000/785 C3700, PA-8700
eap0 at pci1 dev 6 function 0: Ensoniq AudioPCI 97 (rev. 0x02)
eap0: ac97: Asahi Kasei AK4540 codec; no 3D stereo
Kernel config: GENERIC plus "eap* at pci? dev ? function ?"
sys/dev/pci/eap.c 1.103, eapreg.h unmodified
>Description:
On most boots, eap0 logs about 170 pairs of

  eap0: autoconfiguration error: eap1371_ready_codec timeout 2
  eap0: autoconfiguration error: eap1371_ready_codec timeout 3

at attach, starting before the ac97 codec identification line,
followed by further pairs whenever the device is opened. The
messages are enough to overflow the message buffer, so the
early boot lines are lost from dmesg.

Despite the messages, the codec is identified correctly and
playback works (tested with mikmod).

It is all or nothing: each boot logs either about 170
timeouts (169-171) or none at all. Timeout 1 never appears.

Observations:

- Whether it happens depends on the kernel build, not on cold
  vs warm boot or on PDC activity:
    stock GENERIC + eap kernel:                       3 of 3 boots flooded
    same, EAP_READ_TIMEOUT 5000 -> 50000:             1 of 1 flooded
    same, settle time and read-back after the attach
      E1371_SYNC_RES pulse (see below):               1 of 1 flooded
    same, with only the timeout 2/3 messages changed
      to also print src and t:                        0 of 3 flooded

- I compared the disassembly of the stock and message-only
  builds (objdump -d of eap.o). Only
  eap1371_ready_codec.isra.0 differs. Its polling loops are
  functionally identical: same register reads, same masks
  (0x870000 / 0x10000), same delay(1) calls, same 5000
  limit. The message build adds one register copy per pass
  to keep t. Maybe  a timing-sensitive race in
  sample rate converter setup, decided early in attach, that
  stays stuck for the rest of the boot?

- A 10x longer EAP_READ_TIMEOUT doesn't helpp, so the state
  bits never reach the values the driver waits for. The
  converter does not seem to be merely slow.

- Adding (void)EREAD4(sc, EAP_ICSC) after both writes of the
  attach-time E1371_SYNC_RES pulse, plus delay(1000) before
  the converter is programmed, did not help either.

- From the timestamps, each 5000-iteration loop takes about
  12 ms, so delay() is not cutting the waits short.

The same card in the same slot booted without these messages
on an earlier install of this machine.

Unrelated, noticed while reading the code: both timeout checks
in eap1371_read_codec use "if (to > EAP_WRITE_TIMEOUT)". The
loop stops when to reaches EAP_WRITE_TIMEOUT, so neither
message can ever print, and a failed codec read is never
reported. I think they should be ">=" ?
>How-To-Repeat:
Boot a GENERIC + eap kernel on an HP C3700 with an Ensoniq
AudioPCI 97 rev 0x02 (AK4540 codec):

  dmesg | grep -c 'ready_codec timeout'
>Fix:
Unknown. The ">" -> ">=" change in eap1371_read_codec is
trivial. Happy to test out patches on this hardware...




Home | Main Index | Thread Index | Old Index