Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3526418pxf; Mon, 15 Mar 2021 11:31:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHYLdOF+AWXW/amKRXRfyUVeu70DjI6SqiHSrdpFJj4E5gD7DUJBePcDvVdtjjbFkid6V7 X-Received: by 2002:aa7:cb4d:: with SMTP id w13mr31651197edt.249.1615833077281; Mon, 15 Mar 2021 11:31:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833077; cv=none; d=google.com; s=arc-20160816; b=CUV8XirGieKf4/QQg4Uqt1tzW1BR9kdpI6XbYi08JJfkzSV1dliIAHXtIftDYOrW/x jnkm4RG8DXAyQLq+9fQjjLPzinUW6J9BCUEg0HhxjT9zsP9tdbjJHVMH7n+FAsa50YmG WOPpXC9Nj+KXPaS4TyGtoJwVZ/RUOnWrTSD+Z2fAmW6l9prmHgvuUxb8AFmsL6Bfd5NV d6XecQdD3TG3m1L3+RPlwPHlZEQaXhkr6qmuU9AjcMactdUogRtDJS4omjs4JzRvEjc9 ZW/gxnDyYGVkOawJPCKay1FkYpEw79xai3Aao9C61qIx8VeYJD+q6xA23MhWxu4I8qca f9tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PLnKqrGd0wGuKZBgtPi+RWE5UdUp1fPRKZMKNmKRAvI=; b=pf9KZF7CyOSYD2nNE/ePsujKC7XsWCLGJN50tXn1aP2bTqFzPtJnogvIpq82utTRhW 6IAk0CzwQd6Egfld95OAHtBBFkEhzgOCjENri42S3l/g+BZ95KeQE8Qg/j2ihJoWkTa6 nuP4Y/9BaG3tanCYhaer3waX7lLhG8tWsBwRXhnWBvuhKXc0TWce8StJe6JFYEztuctz Sd7Sxqs0VwMc5iOXnrbVzWsji5FMk5jM2j86CAn2+MafISqfrJ6GlZ3Mzq4Dr5whs6UT dEyDfeVIu4j0+40mPVzda/vJTgcB6PrCOb8jcQ2DHt2y+anl3xEWa0Q5NxgOCcD+DMdH Tgkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ftdejxeF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r3si11558539eja.625.2021.03.15.11.30.55; Mon, 15 Mar 2021 11:31:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ftdejxeF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240357AbhCOOhl (ORCPT + 99 others); Mon, 15 Mar 2021 10:37:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:35446 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233342AbhCOOBc (ORCPT ); Mon, 15 Mar 2021 10:01:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DC60864F94; Mon, 15 Mar 2021 14:01:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816862; bh=m0eptkftbLSjQQQ0ZaN37gBHuvMAVpnT1UwmsFU+owc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ftdejxeF7ni31jPXmtzR45O5s8TFft9cPYnM/S2fIeSFAnSb8rR6rzH3TA+kKaj4/ S7AXs+Vob+AgleVkLI5IVn8Dq8VEND7l6q8Le+NT+Bi2Rsk9hlS2EORW6kvIYlBT3l 6I3kIfNpuqPIMwySeF+aLSosTIJLzYsA2izwtE4o= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai , Abhishek Sahu Subject: [PATCH 5.11 169/306] ALSA: hda: Flush pending unsolicited events before suspend Date: Mon, 15 Mar 2021 14:53:52 +0100 Message-Id: <20210315135513.336425794@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Takashi Iwai commit 13661fc48461282e43fe8f76bf5bf449b3d40687 upstream. The HD-audio controller driver processes the unsolicited events via its work asynchronously, and this might be pending when the system goes to suspend. When a lengthy event handling like ELD byte reads is running, this might trigger unexpected accesses among suspend/resume procedure, typically seen with Nvidia driver that still requires the handling via unsolicited event verbs for ELD updates. This patch adds the flush of unsol_work to assure that pending events are processed before going into suspend. Buglink: https://bugzilla.suse.com/show_bug.cgi?id=1182377 Reported-and-tested-by: Abhishek Sahu Cc: Link: https://lore.kernel.org/r/20210310112809.9215-2-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/pci/hda/hda_intel.c | 2 ++ 1 file changed, 2 insertions(+) --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -1026,6 +1026,8 @@ static int azx_prepare(struct device *de chip = card->private_data; chip->pm_prepared = 1; + flush_work(&azx_bus(chip)->unsol_work); + /* HDA controller always requires different WAKEEN for runtime suspend * and system suspend, so don't use direct-complete here. */