From nobody Wed Sep 27 12:36:55 2023 X-Original-To: dev-commits-src-all@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 4Rwbhl3jzXz4vP7J; Wed, 27 Sep 2023 12:36:55 +0000 (UTC) (envelope-from git@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 4Rwbhl37MDz4NwP; Wed, 27 Sep 2023 12:36:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695818215; 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; bh=S8L898ye5CXTqMSHfLS/nw/e22dIQrXrdE79TjWPOt8=; b=jbuMZeeBH7LS+ACm9QH/9VCEG4+fxWpni0rjq9zVQGWHzI/CXNJkTURWHKVQNomV1nwGqv Km9Pioj+v4HPBYOUEr95KFMU19/6b3ns/vJVMKLVhUfx1SooNxD1g1uvmoScaYos26z6nI Ja4UzyIgjFaUP8WOe1gzpCE4AyrBeQkX577+aQ9UTPHhlf6dIr7ngl6//Fx2t5PX98i67p xxhmLVZyUNG64WpYeLwIc2Y1HZMpVBcA6PtHVCLAdppfxUbSW7BLdZF2S9TqLkrmsdgCjk +nLHIxTq6oihQeY2BwrubBv7MpVZhp/C5CR2NwbrdkAgnhU9vDLaRviJdVzbdw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695818215; a=rsa-sha256; cv=none; b=N3VprlbHleAuQGwA5CYDF+CJOsBF6reyIZubPhTJlMQU6G89sofJQn0GAciZ9OtcG+bMq3 UMf6ycdhxpQHgVfwuOtm+YT45C0p6wnLGazADYUilfjXqj9E45EHCxJn9CWoJQw+gYDtqh HcToK3fo91ICqxGM7tMAxMgJlDdrDyoZjn5bL/rM9PfImIDyBnUQXr8Fo+ujdpy73vsbXR Uj/o1hFIIjnvvXpa8nfo+mPZ61L0yo+2Jk1TBsxfltul3PN2h8QAw0LaTKlx86ZKVTzEo2 mbHBl8gaQzWuMU3KEo1Qb94eocb3zT63mjHe9FgF2+lZfxzH1BKbhuVwrtVrjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695818215; 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; bh=S8L898ye5CXTqMSHfLS/nw/e22dIQrXrdE79TjWPOt8=; b=IaiOG5XLakd6ryK+YJaWV2LyPbNdwaqVufnx1++JbtVsPjgpRx5sk+wPgNYI5qN+yq64/7 R35n0DTp8oicWoYhTHW2CpiCpkxgfoPboRToWkEE9y8wgH7V+Rv2JERRATMvA6XD8vaQxf GG82FYnE0mfWTiyIvtSdhuJaGunN2fjwkdzlz+g8+xXhaRwR/vls7KpOCW3yQr9qw2dpc/ Il9dnV3wdkKiG3kn2McZz/CcRrNGxN+7UEhfxNvRth4cHU1jBSFZHNaVIOlseAQagIOLTP 3cusszSu4RnxDKJCJUOvsj1KqLAeHb0v8xlwkjHF//FOM+78uz2wThDzTv8Ndg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4Rwbhl20HBzfh9; Wed, 27 Sep 2023 12:36:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38RCatmm091602; Wed, 27 Sep 2023 12:36:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38RCatc5091599; Wed, 27 Sep 2023 12:36:55 GMT (envelope-from git) Date: Wed, 27 Sep 2023 12:36:55 GMT Message-Id: <202309271236.38RCatc5091599@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 015daf5221f7 - main - hdac: Defer interrupt allocation in hdac_attach() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 015daf5221f7588b9258fe0242cee09bde39fe21 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=015daf5221f7588b9258fe0242cee09bde39fe21 commit 015daf5221f7588b9258fe0242cee09bde39fe21 Author: Mark Johnston AuthorDate: 2023-09-27 12:23:58 +0000 Commit: Mark Johnston CommitDate: 2023-09-27 12:28:27 +0000 hdac: Defer interrupt allocation in hdac_attach() hdac_attach() registers an interrupt handler before allocating various driver resources which are accessed by the interrupt handler. On some platforms we observe what appear to be spurious interrupts upon a cold boot, resulting in panics. Partially work around the problem by deferring irq allocation until after other resources are allocated. I think this is not a complete solution, but is correct and sufficient to work around the problems reported in the PR. PR: 268393 Tested by: Alexander Sherikov Tested by: Oleh Hushchenkov MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D41883 --- sys/dev/sound/pci/hda/hdac.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/sound/pci/hda/hdac.c b/sys/dev/sound/pci/hda/hdac.c index 422f7f930ea5..2cf9239499af 100644 --- a/sys/dev/sound/pci/hda/hdac.c +++ b/sys/dev/sound/pci/hda/hdac.c @@ -1270,9 +1270,6 @@ hdac_attach(device_t dev) /* Allocate resources */ result = hdac_mem_alloc(sc); - if (result != 0) - goto hdac_attach_fail; - result = hdac_irq_alloc(sc); if (result != 0) goto hdac_attach_fail; @@ -1347,6 +1344,10 @@ hdac_attach(device_t dev) hdac_corb_init(sc); hdac_rirb_init(sc); + result = hdac_irq_alloc(sc); + if (result != 0) + goto hdac_attach_fail; + /* Defer remaining of initialization until interrupts are enabled */ sc->intrhook.ich_func = hdac_attach2; sc->intrhook.ich_arg = (void *)sc;