Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3527388pxf; Mon, 15 Mar 2021 11:32:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXUlpQcE5zRAehlROGVr6/+30vEe70wJmFMUr6IXjzoTEvkDpRjnf3uPUZFLWrCYMmuTLl X-Received: by 2002:aa7:d484:: with SMTP id b4mr31624276edr.63.1615833157815; Mon, 15 Mar 2021 11:32:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833157; cv=none; d=google.com; s=arc-20160816; b=vyVsOv4LMYCRP+SECiIp21X8vY6VrOfx5VZsUQkfMP2RnD0g1jMC2FCWXezcbooAd7 lSgK7AYDrPQfwPZLGDhEr7scX9547S2FrjDNZZVm6ciGiFxUOG3eQOjO0ExvLFHslmw9 9i/qDTVo2eq9Rt8nBpCN1U3o/y5ku4lTL7rZHTt7Y/40cZfHbeBoHE5s1YjhdtWYuBh1 oozy0YhTmiFUKRxQsb4+cEssHvNUZN/Y+66vHazqROWljeb2I1FExsaXoMHoJooHLkiA iTvVLFleJaOzcW4P+f3DvwZm4bY6eSfvYQXCQ9ybt5D/Tf7+VYtuORe1xIZD1EuxfqXK 0BCw== 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=BOfVZIJ4V0V8JU1umdlYgdOAVyrvD86ll0lUvNCL7NkFGZe/pISC4LQ9Rz7UrNlmiZ /Qgjk55iuJSzKSg/UgVs9feOR2P2rKz4EaJepDw0Ujj3BPo00yy0g2MJ3/4GGL6kCiUI z/Zzlqprozam6bzLAhldXTvEpQXf26W6sxmpUmbHQogFiY/8XGWjjh6QXrqlXFqtk8I+ UcytKWQKD/KL4PEndfQ0fv6VcSD9CBCrv/47Zm6XHNWdwUzpDNrXI/5i6Uey7FvxJ6p8 5djb8ZxK+uGQIK4oGLHGKDHMcXUFj5k4Kq7EfrT1zigfLYM2PlAQt9fC+2TvHHhloyM6 CVMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HtTnr18D; 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 gv29si2212771ejc.61.2021.03.15.11.32.14; Mon, 15 Mar 2021 11:32:37 -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=HtTnr18D; 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 S240459AbhCOOh6 (ORCPT + 99 others); Mon, 15 Mar 2021 10:37:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:37582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233365AbhCOOBh (ORCPT ); Mon, 15 Mar 2021 10:01:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 480B764F84; Mon, 15 Mar 2021 14:01:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816864; bh=9ibA2mjQg2zuTjL39SlYdc/2f0IYeUrZryi5svSAFy8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HtTnr18DhRl38p+hn9CYTrympsHp5WcWdpNjNJojz2hQTGYKLrYi377SYq25rScw1 2n8Am+DidyBQXX86heu95c4MdcFypWRNLHPIomOzVGw6MIuzBE6jYx7t5PJLR+y3/E 4/C7juRJw8C5GJ2l9po3xSvnbNsm9hGxqCYRY/i4= 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.11 170/306] ALSA: hda: Avoid spurious unsol event handling during S3/S4 Date: Mon, 15 Mar 2021 14:53:53 +0100 Message-Id: <20210315135513.367896046@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@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); }