From nobody Thu Mar 24 15:23:24 2022 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 684E01A3B5D1; Thu, 24 Mar 2022 15:23:24 +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 4KPTWc24Jjz4YWf; Thu, 24 Mar 2022 15:23:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648135404; 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=m95yH1c7HE7x1ye0oboxwrVN+TtQpPN3hzUn8oS9Ils=; b=RMHw//ze1uykCh5GtXF4+cLeDcPUJfIDWFjBxKHzwuI3EPjClXyoOtj3CSiDRT3ywU1V8Z d/F22gNH6jrLGIJmC3F8WRvJc0T5Sfy8p+hxJ+Xy3o5/lQOC0n9UJrKEvz+9DZL18/fBSB JWx845uk1H9YlJtBR7q17K69su6JUErQsliQGnntuquLILu1T8sI67FgjBqZlJZjRaUKBz 988IYiBjaIRgWDISFVl7aK3swjRSxFZK2X+kyqWwQK0GTVpzBKlZQdbxZOPCgK+rMME25v wEtejTE3gGcCiqMHk+RA1WiwqO53iQoABp6Pe0+6zuZJ0DLCXKzPjRBWRG2cSw== 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 273931A794; Thu, 24 Mar 2022 15:23:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 22OFNO2b008588; Thu, 24 Mar 2022 15:23:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22OFNOeg008587; Thu, 24 Mar 2022 15:23:24 GMT (envelope-from git) Date: Thu, 24 Mar 2022 15:23:24 GMT Message-Id: <202203241523.22OFNOeg008587@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: 18a3bada308d - stable/13 - hdac: Handle interrupts racing with device suspend 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: 18a3bada308d89928f170f4098c85cd3f11db864 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648135404; 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=m95yH1c7HE7x1ye0oboxwrVN+TtQpPN3hzUn8oS9Ils=; b=UNhJ/HtBH6RC6f0/RvWr75Q55mnfEk/dbXUpKYw32czoZ+5LjjXXqxKquWN2floI9BmJzn 4LAoNSa5rPnEDoTd0VNXysUqIOYRR6QtU7yrYkdoOCiudo26ap/dEVpUiQmMPXeP39GAQ/ YArjKbuPCGJDXJMKPQ4XuBMNC356JC6Erjc5y+93/MNkg7F31jzGO5+watBkYvss02w+wy jfdkOoe7aldHcMtrzRrUTA9jD+HCRWZpBY69m0jyzNoY76p+bsJWslpxIaAwsvtJlrVv5l dPEZMGXcmGNoV9WTkVnquCy+6foXYBdeS7+VbMOc4mftVptTyAoaR6zgiqtjTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648135404; a=rsa-sha256; cv=none; b=o00Q29ae7JrNFy6gotlZhX2OBNARW4GeBpHSJtgdqjesilOeAgA6FHWx7G/EZ8iDJ3s5Vw SmG8UAutmyE1GO2wA0qV7ieaM2RrosK5+r7gQ4L9162TqOJnN7cIage2AXiGjsNCu8ALiw Chei3J39a39qBaSIKIspl4yg3jp2gBVCmmEEbKNoB6fXETsoIKDn5DlwISADoTmXeyDgYS 2V9lZhO46rF4F2NXcJwQZ/W9DI/hntKkVy6XsTILeyu1M5NStJkcyW/Df2468bzzmLcEYb U1HUKCiZWcKUtoALR7NdPJHxR7TKcIp7LJmlsER5jSuCTC1kXZcWko8TdBcN4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=18a3bada308d89928f170f4098c85cd3f11db864 commit 18a3bada308d89928f170f4098c85cd3f11db864 Author: Mark Johnston AuthorDate: 2022-03-16 16:09:17 +0000 Commit: Mark Johnston CommitDate: 2022-03-24 14:28:14 +0000 hdac: Handle interrupts racing with device suspend - Avoid looping forever if a concurrent reset causes a read of the interrupt status register to return all ones. - Lock the softc before reading the interrupt status, so as to avoid a similar infinite loop in hdac_one_intr(). This fixes suspend-to-S3 on some laptops. PR: 261207 Reviewed by: mav, imp Tested by: uqs Sponsored by: The FreeBSD Foundation (cherry picked from commit 077564cfdb7285ff7d256424715e563cbac36f8b) --- sys/dev/sound/pci/hda/hdac.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/sound/pci/hda/hdac.c b/sys/dev/sound/pci/hda/hdac.c index beed29e955d2..92af1a79ccd2 100644 --- a/sys/dev/sound/pci/hda/hdac.c +++ b/sys/dev/sound/pci/hda/hdac.c @@ -384,13 +384,13 @@ hdac_intr_handler(void *context) * re-examine GIS then we can leave it set and never get an interrupt * again. */ + hdac_lock(sc); intsts = HDAC_READ_4(&sc->mem, HDAC_INTSTS); - while ((intsts & HDAC_INTSTS_GIS) != 0) { - hdac_lock(sc); + while (intsts != 0xffffffff && (intsts & HDAC_INTSTS_GIS) != 0) { hdac_one_intr(sc, intsts); - hdac_unlock(sc); intsts = HDAC_READ_4(&sc->mem, HDAC_INTSTS); } + hdac_unlock(sc); } static void