Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3525572pxf; Mon, 15 Mar 2021 11:30:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1zDCdS/NL+QKZVdGc0VwixQzUL8af9q9mfMS3BWyEd+Nm2yHL7IX3NKbVyap8AqkTh/Kq X-Received: by 2002:a50:f314:: with SMTP id p20mr31397802edm.236.1615833014392; Mon, 15 Mar 2021 11:30:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833014; cv=none; d=google.com; s=arc-20160816; b=ngiT6A82zYdzSONLQ3TXJbOWb8xo8WKSg+Sx/UoedE9QGK7KdUZyHfV+9wEnvEN9T9 fe+XOjHcV+yR3c3YCLvbS7+4lmCFz43r1IpwQYG0pllI/EON8CHNFmG/Tnsbce0x1dUU iJvfb+IGh7dVoz8gj0uRB6MJTHIlFIAm23DHREIcrxPuwxFK8hBz15/ZPNbrImbossOi NiAH2AmBTFAiXUkXbI2yRNwJBW6ejh3cMUAxaoh/S+uebMu9EKD3kTu6QjKhRJ5zFOsy 22gf+zd3EtxpaOuHV06L3SEJ4PkBKiNe/SN4SRL8MZxKx9hQhDWzMYANTIJcitX0nqPB LBkw== 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=xV+Y87rSQGhuJtwTVCZeNnLvE2m54dVf9e+CcfqH33Ip1saux9w2+rqR5yRjlAlxjD IOV8h605ZrR2LhxX1LWoMbhfosxivoIFwTzjppndbDWaabVmdHs2S6gw8uiU0Wsuvt17 Lq3aH8c9cHFQAVaiE4P3SsjqGvc3pjnYtE2pBE+3/3tKdE1wDTfx4Syx5748a3p3Flw2 ugnlt7F1F0FK9W/ZS70PY7FfXUGEhvGumogykPM0w/LC00I5KfPBdk8N/U97DarrPKId AzgIPN9OK4lXKlT10ProyXDjKFr4xunqpNGsZ8rNc4dYIaa+6ck2n4FuezhfwWW+m1Tv m2BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cuHGO3nJ; 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 n15si11350195edv.534.2021.03.15.11.29.52; Mon, 15 Mar 2021 11:30:14 -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=cuHGO3nJ; 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 S233443AbhCOOgY (ORCPT + 99 others); Mon, 15 Mar 2021 10:36:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:37476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233465AbhCOOBn (ORCPT ); Mon, 15 Mar 2021 10:01:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 15B7864F3A; Mon, 15 Mar 2021 14:01:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816898; bh=m0eptkftbLSjQQQ0ZaN37gBHuvMAVpnT1UwmsFU+owc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cuHGO3nJp+I9O/HxbYDdU2gw7uXsKBoSi12WnQGImvMYVz6eBdAmLo/VgnnNSKF+F vD0ajJJWu/diX53dbDGbLz6dQdKwZuzsukHhdQm/BhkXiIoxgbZbJPyZnIpcQKolsp xQNj9G3Ajlzu8tmAPWGT0hxDi/BJ7x62uIm0M97Y= 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.10 176/290] ALSA: hda: Flush pending unsolicited events before suspend Date: Mon, 15 Mar 2021 14:54:29 +0100 Message-Id: <20210315135547.857180943@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@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. */