Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3518159pxf; Mon, 15 Mar 2021 11:19:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwYTqLGF9blf584oxzYzjQVg2kE+FAuoIIOS1oNzs+gfe8Jj4SOkcekkB+EbN78DhGA8S4 X-Received: by 2002:a17:906:801:: with SMTP id e1mr24540813ejd.465.1615832364849; Mon, 15 Mar 2021 11:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832364; cv=none; d=google.com; s=arc-20160816; b=d11y2txvxozNWn1RvA6bDUL4wzKOXKO1c1BIA5BOrafb70n2Pee1cvWOBuJwwdgc4u FWMKITG3G4hEbAOJB9HTnTtKvGenKAKpeOFONUCuYjpForJrrtwKdL5Caq+fvirkH+xA zXhQQUYqsIfUkohulkCVI5UhCPsjlxBiZPM20W2BpvvTuRZaBuK/QzCexEV5Gh/vfLL5 UMxuINyfHP0PZv5UJrXTZdanstFs2gOCM6lrxPR5+25Ha52Gz44C6JJlvbmG3QuMkzLA h4eOzMekjS1EGe/0CjDvLVIHeTFF8wLAmPZYcRsH9FnHLvVexP6bckg8Y/kiAMR/VZsz KVlw== 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=5NvGwg5F8rt73YTrOQpl7LNO8AmxsLYk5xI/vTmTLKc=; b=KGcSpS5c0GoTDvs3ePfB9WELiONrPtosexSKJUakQ5ZM7/YGK++YdiRkeMX3se9M5H +sitiH0bKPnRij8AxkBYN4IwIZoXhieT+gbV4qTPdPsMljwdxFj7OMRkdxb3v91HfvBA OzP4GyXu0WzmaVZVTnk2GjJQ4wWDhK1w4EVYu8kvyR1P/JeL1Y1z2p886bAWVzTaGLSa 8HjEuSeWjGOyTSM430ofgWOTEqgPSp6e8lccgXO+hMZjqIw26fsqQAnGJ/NiZ0gxrLqP bhMqCYsFr7H5Gon43/vJsb1/m4E63gmU0DySoyNXz1Gfltv86JItJyl9tgfJSptzHJY+ V6Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oxvbYHNS; 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 m13si11466190edd.35.2021.03.15.11.19.02; Mon, 15 Mar 2021 11:19:24 -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=oxvbYHNS; 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 S237424AbhCOORw (ORCPT + 99 others); Mon, 15 Mar 2021 10:17:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:35186 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232753AbhCON7j (ORCPT ); Mon, 15 Mar 2021 09:59:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 719D964F71; Mon, 15 Mar 2021 13:59:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816762; bh=ozORQh8hrikD8yt6BfDuS1JtpN8Qi+X8VEgoqeZk4Yk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oxvbYHNSo+qoJ47PppGPoEXjhqbPcCecHQ3d7WWKYc1OWWdRFoZAyeGxOZeOobZEU S5xa0OfWhuB0hazIH+AI4/u1cfpKt/zYMz5v48ND4nQtYl5MMEHvF8UGq+MNt5+r3Z HUSI+qN6614FkFut0AxGfKy2MMk4us/KUcT6xdvA= 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.4 092/168] ALSA: hda: Flush pending unsolicited events before suspend Date: Mon, 15 Mar 2021 14:55:24 +0100 Message-Id: <20210315135553.396141668@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135550.333963635@linuxfoundation.org> References: <20210315135550.333963635@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 @@ -1025,6 +1025,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. */