From nobody Fri Jul 07 01:38:12 2023 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QxwyX3vbcz4lJwD for ; Fri, 7 Jul 2023 01:38:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QxwyX1b5xz3jRT for ; Fri, 7 Jul 2023 01:38:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688693892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Uv9vUMoEgDxQpyk2S65NB2o8BXYYB6tXK18s/qbm+tk=; b=d0cEGRIxndopAqfnwrpQDsL8GSIyvKru58Owa1it1wf4EhVyAlPFrkOYnB7yKnS6cNd28i dnYt0JrgBraL9I3qwA+ycUX7xX+wKb7/GzgN+woyG4gAvODSwU8kJcwi1KPsfstUlZdZHl tIN0xGXbynMFGW3Z5E3VCDUPZco8uv3icCQRW/58pi6xUo27hfQ/J01b3+6Od4dcvcI1qh IYE2lWdZcwGvfx9RRa4aQjziOFWzQaAym9EOdd++WJL8oZ6zudyeYR2LvqJOYqz4GoaU7r ON/Z17P3r+U+rNVpijPaLHuXdtnPH46fBCwXYW+BR8dQZv4EsxJheTtEWT8pQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688693892; a=rsa-sha256; cv=none; b=Q1nyXq668o90UgEM343NiYESJB2lxK5kTfj92m2Ngmk7or4MrkO7Y05RJp1rav86osqwtj PQN+Rd6wBW50heHb/WDnVe6q1tyhLtAti4CJERYL/Zwj+nblXxVxN7AhI7lRav8yEaw9kw 0YPycegm46bmoBoxuAoO0pGH6wHsfqRXgZ35GDqoSjnupcVP6qpNkkCcoeBoIIErI0OKP9 7HCIH4241expyUyX/PuNxV7wih3fOTMc4/+X8yew/CiatEEcrA+1IKRvI6CdziFuSIfvdX OGvX/uLkI92ZiBgHcaj8O/4W/YtpTzBjJrmCpN6bS5wxgC+zsbSt4S20TWH55Q== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QxwyX0CQgzKlY for ; Fri, 7 Jul 2023 01:38:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 3671cB1e027658 for ; Fri, 7 Jul 2023 01:38:11 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 3671cBXx027657 for bugs@FreeBSD.org; Fri, 7 Jul 2023 01:38:11 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 268393] system always reboots once from a powered off state Date: Fri, 07 Jul 2023 01:38:12 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.1-STABLE X-Bugzilla-Keywords: crash, needs-qa X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: jon@xyinn.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D268393 --- Comment #48 from Jonathan Vasquez --- Hey all, So I spent a few hours today debugging this issue on 13.2-RELEASE and I have interesting stuff to report. TLDR: 1. There definitely seems to be a race condition somewhere with how either = the AMD Raven HDA Controller is being enumerated, or how it's being accessed. 2. I was able to build on John's idea regarding the delays and come up with something that seems to no longer crash my system. Although I don't think it might be an acceptable solution since it would introduce a delay to all "hdac_intr_handler()" calls for any device that uses that function. But I'll keep testing it locally to see if I notice any new types of weirdness (outs= ide of any known ones that I've experienced before this patch), and also becaus= e I don't want to have my system continuing to crash. A side note is that I ord= ered 2 PCIe sound cards that I want to see if they are FreeBSD compatible, which would help mitigate this issue if anything. Best case scenario, we fix this issue, and I also end up having a better sounding sound card that's not the on-board sound :). 3. We can experience different types of severity levels depending on the le= ngth of the delay. ----- So this is how the patch looks like in order to allow my system to no longer crash on first boot: diff --git a/sys/dev/sound/pci/hda/hdac.c b/sys/dev/sound/pci/hda/hdac.c index 9aa0e4bffdc8..e9d581a422cb 100644 --- a/sys/dev/sound/pci/hda/hdac.c +++ b/sys/dev/sound/pci/hda/hdac.c @@ -378,6 +378,11 @@ hdac_one_intr(struct hdac_softc *sc, uint32_t intsts) static void hdac_intr_handler(void *context) { + /* + * Add slight delay to avoid crashes with AMD Raven HDA Controllers + */ + DELAY(5000); + struct hdac_softc *sc; uint32_t intsts; ----- - If there is no DELAY (the default), the system will crash. - If there is a DELAY of 1000, the system won't crash, but we will see acce= ss errors! Which is revealing. Example: hdac2: mem 0xfc980000-0xfc987fff at device 0.6 on pci19 hdac2: Unexpected unsolicited response from address 0: 00000000 hdac2: Unexpected unsolicited response from address 0: 00000000 hdac2: Unexpected unsolicited response from address 0: 00000000 hdac2: Unexpected unsolicited response from address 0: 00000000 - If there is a DELAY of 5000, the system won't crash, and we no longer see= any errors. In the situations where I don't use delays (and leading up to this reduced solution), I was able to have the machine stop crashing if I added at least= 4 printf statements lol. If I used 3 printf, it would crash. I suppose 4 prin= tf is relatively equal to a DELAY of 5000 for me. As stated before, with the above patch, the machine no longer crashes for m= e on a cold boot. I was also able to access and use my pcm8 device immediately a= nd sound worked. This is progress. I've attached the following files: - bad.0.txt - Shows the access errors with a delay of 1000 with my previous expanded debug messages. - good.0.txt - Shows a good cold boot with a delay of 5000 with my previous expanded debug messages. - bad.1.txt - Shows the access errors with a delay of 1000 (minimal logging= ). root@weshly:/usr/src # uname -a FreeBSD weshly 13.2-RELEASE-p1 FreeBSD 13.2-RELEASE-p1 #23 releng/13.2-n254621-08b87f63a046-dirty: Thu Jul 6 21:22:10 EDT 2023=20=20= =20=20 root@weshly:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 debugging on: commit 08b87f63a046bd966bd0ed548211ae98ff50e638 (HEAD -> releng/13.2, origin/releng/13.2) Author: Gordon Tetlow Date: Tue Jun 20 22:40:02 2023 -0700 Add UPDATING entries and bump version. Approved by: so --=20 You are receiving this mail because: You are the assignee for the bug.=