From nobody Wed Oct 4 13:43:37 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 4S0wrV0WdLz4vxtJ; Wed, 4 Oct 2023 13:43:38 +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 4S0wrV028Sz3YT7; Wed, 4 Oct 2023 13:43:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696427018; 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=oJGzwB+iwIADL9nHlsCMBWC7CnP5/8/AuReKmHAbQ6M=; b=EvpE9dIEQypfg6/wgA1WTjjUolxAGcdobTocHxO2XO0sbEkwAhGDOZVKUxwJ85SpMF59+8 gN+9kb3Z7FM+oY8uAfwbZMw2xGb4CN41m+SFLC6vEsvTB3+uBzWPO5j/wg8zXBxk1PgGgS rpblKnQ4rU2mhYoSGswsf82X1RWzblxYUeol11vaCj/0HIZ8GOeQUzu5eQVbwy0rl7xpCX cK7ypk6ALo3cOB+SR6wa8jIDx7xZT4iYD60JCa22Dhd1882fgDGErEhYR3viGBnVVug3yn vuYznDuJu73wvrRLniYN4pW1DjAbYWmML2JQDKGhL5iIabywQWvY26sfRQZXfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696427018; a=rsa-sha256; cv=none; b=nxLU7+zxlU7LZxscs6474omBndnwFWI7o8HWVbHLdJxPNmkeNSvgZ1XI1LJdcCIV3R1q2J 3cQhk0O+YnSTWZ22gCdREEjbIJiu1o03qQ2QgvZHzabLiRHfLDOBYYKmLQorAU3QdmtHpI GCEjPcbUI8KBkh7T3tYpHjqSzjFAYOQIOwTy4p7nP7C+Do/A14WUGwTKQRu8dKepgrP3jr g+o6413iPPRQ5F0iwjq7J3rDSItd4eHI7G+mSHWOlmNVdzJy0aWpwFn7rRn+gzTOoNsGh2 +XEzRgQaaZ4jbja5n1fs4cHdqPQMgu12v/6sm5TJoUVR7zdebi+PxQH5ZA3+GQ== 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=1696427018; 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=oJGzwB+iwIADL9nHlsCMBWC7CnP5/8/AuReKmHAbQ6M=; b=xKm7IDXylTITOj5iYkEWfSFqWjoCf77S1Wjai+EBO6BgF4CZAEGa/SAkdAuBO6RL2pG505 n/MrGXovyTncENIXwbWL6a/w3FTJy/ljipSbkrwwm2MRCn6xhy8DI2szDqALcyQKITPbP+ d3M5FEKab6P5ZtWq0uFpFmPe9N/twBVJesJ073RfMeo71ckl+37xTSRmnRS9sRSUscuw0g m7G1/X129SReC2iV6bLFZkDEn2RTb9rnN+771zrT/8//mROKOWohuECpwwC8ZW0Tf3NFlX YCud9j9cVjM9+FTLNuGOSrXxVbI9z2tM3+lXZVs4FT8NiezpfLGkn1GPwSo6RQ== 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 4S0wrT6BPHzfxD; Wed, 4 Oct 2023 13:43:37 +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 394Dhbda019688; Wed, 4 Oct 2023 13:43:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 394Dhbjo019685; Wed, 4 Oct 2023 13:43:37 GMT (envelope-from git) Date: Wed, 4 Oct 2023 13:43:37 GMT Message-Id: <202310041343.394Dhbjo019685@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 32ca3712a8c4 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 32ca3712a8c4295d14770ad9cc55c1c837d834ad Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=32ca3712a8c4295d14770ad9cc55c1c837d834ad commit 32ca3712a8c4295d14770ad9cc55c1c837d834ad Author: Mark Johnston AuthorDate: 2023-09-27 12:23:58 +0000 Commit: Mark Johnston CommitDate: 2023-10-04 13:43:14 +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 (cherry picked from commit 015daf5221f7588b9258fe0242cee09bde39fe21) --- 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 82b1baacfa98..3d2c4001d68d 100644 --- a/sys/dev/sound/pci/hda/hdac.c +++ b/sys/dev/sound/pci/hda/hdac.c @@ -1272,9 +1272,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; @@ -1349,6 +1346,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;