Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3312026pxf; Mon, 15 Mar 2021 06:56:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdqdQS+nXzQ7E+3y8vtb0TqcxBd/8LqazTzVowftZWKx+CGGBmm/yUxjOEskDcZwxHJfvP X-Received: by 2002:aa7:d0d7:: with SMTP id u23mr29580255edo.255.1615816617176; Mon, 15 Mar 2021 06:56:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615816617; cv=none; d=google.com; s=arc-20160816; b=x1+600ArAGIEwIBKcGR+CmHw9lXXL96a+f8pmJ6PaiEHXxlssYR2KcBCoWiA9Uf4yR dzFhNc1jSg/SVlKN2psU/SY8PO0YnFSeepWWWTlLwFsnaw8fX/1d2iIZZgbN+tPA4HY7 rS0lpoXPpgB1SXl06oSUWEXYZvHBnNGBDvWZKFPa3gODiVJjioIC5n41JGgkz6pMeVUS GLFoAfI3Oi+9hjF7Pxl8vjb9hmY1DyJW6sarAE6OoDuhNX1Sp1gnSDs5TNK69NmPMiSc z8qYGjFZhR0m5L/hae1N9n6tvKFjDUXn8gMqdnvyZZmu+Kq/ffn+/3gx0W1x8IzJi6+0 8/Gg== 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=dflJid9qp40zAnFtON7rJ8VgkrDYMv4+tXqcDprgZdc1XblBgeW6cBWkXRVKXxJY26 AH5hMSALRN7T/nfacu2VHfr46P/Jh+O36gTTEFgPY8+p39AjxY4uFN1wYKeYfYD4ALBb haSCHJA4sigbGJtkmEtuizg/yQC3GIfTPtmOogopx2bEwXPtwZ/TdEqaysrahJXD8dRX tf8rc6Zno/4wPp64+TOXobcoMAfPxCUVx4S+LtqqDaxOuc7tLoJQBkS46NBVPMOGf5zU YgsNmtKYI5hHHj9b5QEOMyxFR0MxryQAhWhpdSfkB+Lu7W2BSkJMuGANEfxirAYzyQCy mIIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=c3qTcETC; 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 eb13si887056edb.223.2021.03.15.06.56.33; Mon, 15 Mar 2021 06:56:57 -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=c3qTcETC; 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 S231588AbhCONzY (ORCPT + 99 others); Mon, 15 Mar 2021 09:55:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:56146 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229929AbhCONxg (ORCPT ); Mon, 15 Mar 2021 09:53:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 17AFF64EF6; Mon, 15 Mar 2021 13:53:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816416; bh=xPOyjQVC9zn/UwBkVcl/FOk/o6vGCPsyRe8EBtqcggY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c3qTcETC61KCJLbdDE26yzfaqw/j8Bg/dKBocdXHU4E1jjXXfVbQigL88Tu0E8X5o UtvVkrL09tXxfU9XLT4bqvfj7Boi1x0TabX2cUWCUUudb5y4RDhyiVs/WV498Psmjf 808eHnYRQhgmKdCwGecn0JyW6QGi96jYfo3jeo2o= 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.9 26/78] ALSA: hda: Avoid spurious unsol event handling during S3/S4 Date: Mon, 15 Mar 2021 14:51:49 +0100 Message-Id: <20210315135212.921800364@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135212.060847074@linuxfoundation.org> References: <20210315135212.060847074@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); }