Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3519695pxf; Mon, 15 Mar 2021 11:21:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxA4gGutjTDHWaOa3xpb9ZRZQlKnJdVuHIlBvrPP1sijbBTgoEyYwsr9P5Po0S42GB0I01b X-Received: by 2002:a05:6402:35d3:: with SMTP id z19mr31334439edc.143.1615832509304; Mon, 15 Mar 2021 11:21:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832509; cv=none; d=google.com; s=arc-20160816; b=YMgVI7Xxw4lR+ONqk4qXUeV7HdcnDIYAA7xpEd8kgQYZ5jxOYy67q4NFeWVQIR/RNA 8Fga40ydM1g/UE4rIFIG+q6z8xGR0/l9l2bgOSLtolSQBmj0vSSrJCYpLYCfHgWTTHCW wi8MXQphh5+A+EdDB09ItJo/JMoeCP6LWOfBg/8fsHi8cmyu07m7AJnHQY2p1BHGRI6c rIsRHpHI2kGaqs49GUtp9ZWdkJtVectDlWFSJsW8vmoDkfUVp1DtX2RxFzQm/aO1OL4q AcBFtmZtJx6k1aQPZfeoBbPZzsTdaYucgqF0zJu1H1OHatyO1z6G8hPgA3lbesBi1X80 d/2A== 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=14zXOj9b0Sdadq+bqFMjCnxn0LTN0+Nd8Om4R4Q9iAc=; b=nW+XwdiYQhIfA51vi55WXXFEOY+FoVTGQJXB1f4FCRf5AECE+7v4Tf3ijYRLDWldjs Sw3Tpd0xvEUVSs1cYXRBqwImqO7Clz/jXrax6StdJsWlTonwIiMzKpqS/E7zCBVAp5Dy 5iu1IMBAXx1gafhcGgo/gSWWYrf46o4fYvmRChoUaWiqBdrOWWLpvyOyU8XPcVtjC7cA 5SeWNlTu0APx1csW0nGyGj3pPJsHkgd9HA++2KlOHWYrxAc4xgDtf0ar+y8eW4EnEfOS 0CzVxstq3vlWi7KdtuTvGIxZKJaep1ivn5SNxKyEtI1CjMI1AilLqb20/peIVulwdqMW BWUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2VbUbAS9; 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 qw16si10626682ejb.673.2021.03.15.11.21.26; Mon, 15 Mar 2021 11:21:49 -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=2VbUbAS9; 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 S236839AbhCOOSi (ORCPT + 99 others); Mon, 15 Mar 2021 10:18:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:38284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232599AbhCON7l (ORCPT ); Mon, 15 Mar 2021 09:59:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D2B7A64F48; Mon, 15 Mar 2021 13:59:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816763; bh=9ibA2mjQg2zuTjL39SlYdc/2f0IYeUrZryi5svSAFy8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2VbUbAS95j8aQWdfMenRZcMwjO/yXno+nFwakBpzT2qzsSSUBrp2OABYLu0Ir6Yt8 +2lLpuPbAeZNANdTmdlss1/+DiypZIXGbneI94Nmhqfcmq4q0PLZDdiltHtipiXdyJ nulbHKZr89RLDWyiEY4k+CqSWuJsVqbpU49LzJhs= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Abhishek Sahu , Takashi Iwai Subject: [PATCH 5.4 093/168] ALSA: hda: Avoid spurious unsol event handling during S3/S4 Date: Mon, 15 Mar 2021 14:55:25 +0100 Message-Id: <20210315135553.427747080@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 5ff9dde42e8c72ed8102eb8cb62e03f9dc2103ab upstream. When HD-audio bus receives unsolicited events during its system suspend/resume (S3 and S4) phase, the controller driver may still try to process events although the codec chips are already (or yet) powered down. This might screw up the codec communication, resulting in CORB/RIRB errors. Such events should be rather skipped, as the codec chip status such as the jack status will be fully refreshed at the system resume time. Since we're tracking the system suspend/resume state in codec power.power_state field, let's add the check in the common unsol event handler entry point to filter out such events. BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1182377 Tested-by: Abhishek Sahu Cc: # 183ab39eb0ea: ALSA: hda: Initialize power_state Link: https://lore.kernel.org/r/20210310112809.9215-3-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/pci/hda/hda_bind.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/sound/pci/hda/hda_bind.c +++ b/sound/pci/hda/hda_bind.c @@ -47,6 +47,10 @@ static void hda_codec_unsol_event(struct if (codec->bus->shutdown) return; + /* ignore unsol events during system suspend/resume */ + if (codec->core.dev.power.power_state.event != PM_EVENT_ON) + return; + if (codec->patch_ops.unsol_event) codec->patch_ops.unsol_event(codec, ev); }