Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3520961pxf; Mon, 15 Mar 2021 11:23:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHNkkyHtSgn7Pv+Vlp6dtd3p6E/PQtKIMvapzE8HmH2nizyKqgARK2r5XlMEl9Y7KKiBtb X-Received: by 2002:a17:907:3e9e:: with SMTP id hs30mr25607001ejc.66.1615832625170; Mon, 15 Mar 2021 11:23:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832625; cv=none; d=google.com; s=arc-20160816; b=WTsyVikb3tD8R0O/yBGyqU4QcA8x5jgD1CuuTJlayhk6j8mTCso8TGkZgSFyDtRAbu z5Y/U+y7bx6F4OhkwTDIff56EJvosq1BXM7u6EkJ8pITfsVHCRE95TpYwhehQB01Wmy+ d49GAN9ke2nwXuFBsXiklHVZ2G/O8HxtrgUGFfmg/hQ/DuccVVrniq/cxMMtR+hqMPYu bt4oJWKmWfvVaapmeWTdMkes6hT6oVT1xIaNhqkd2VsAJ3w5Jc+UCZ/nn/4gKbeIG01s +/cFV/qcdraC95U7QdU/XAtWzFSaPgqsYBetBsbM5XVnd2SGUtEzEgBh9/mvqdzLAwJm dv2g== 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=JrMSYpHJGW9OaGLGkqtJJaWC0kidblwLYeafw7t5Fx0=; b=nzu6QoU1T/9ZTQ6hDOZ1WKdaNbCRqYST5Ixwzz9kCLF2v1pv6yxa/ykH8iZWSff8Pc 5dxCZ95FqZprF6WoFF0z1yVAijCms61l+gPigHJ3FrMOMPmkBBRMiG66YSZp45ipTS9I 4oTVDypsyL3iwgXNryHnKtnAQkZY3tkq5OxH8t8WED9CrMI1hek+Fw/x9AXrEgQO9vHJ UiJZY0Ro9ANXOAZ+d9afDtJReYjlheLzTzB1U138K2Z0kYTDAW/yXuXZvr5Ghcq05on0 iyiPNuse/7/AqJyYUN/Cj3OaqOpgS+3S0dRylDFPeq+rDtlJHfrO+2dPCbe3xSpN6Vjq GkfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=O9xvh1Bh; 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 g14si11625759edr.362.2021.03.15.11.23.23; Mon, 15 Mar 2021 11:23:45 -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=O9xvh1Bh; 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 S233175AbhCOOU5 (ORCPT + 99 others); Mon, 15 Mar 2021 10:20:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:37670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232807AbhCON75 (ORCPT ); Mon, 15 Mar 2021 09:59:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E94EB64EEA; Mon, 15 Mar 2021 13:59:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816780; bh=xPOyjQVC9zn/UwBkVcl/FOk/o6vGCPsyRe8EBtqcggY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O9xvh1BhuEq8cuNZjkbmt9AIJQZLlCpdcqEAiDlgVVUfxWiovTNb+iDxIKtUsLLuk NO32XeQ+Efi1Ro47viXWfjOs98TmH+4kAek4k0UXzWQeM7q4lNw5IiGm9UBPCYCxRO siK2U9Z65T2XysYbY1OqAtKo8OpSh6N8oBWfP8RQ= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Abhishek Sahu , Takashi Iwai Subject: [PATCH 4.19 062/120] ALSA: hda: Avoid spurious unsol event handling during S3/S4 Date: Mon, 15 Mar 2021 14:56:53 +0100 Message-Id: <20210315135722.008348499@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135720.002213995@linuxfoundation.org> References: <20210315135720.002213995@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 @@ -46,6 +46,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); }