Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3525402pxf; Mon, 15 Mar 2021 11:30:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1VAIOmftrlyNzYIHgiaTA9VC19E8kVkbKLxrQGpX53zphGNtYmI7dP2rHvojJpW5ciu+j X-Received: by 2002:aa7:d3ca:: with SMTP id o10mr10442656edr.374.1615833000578; Mon, 15 Mar 2021 11:30:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833000; cv=none; d=google.com; s=arc-20160816; b=X+/wi45/zbVtBh9xj+4wJl/bnmGHl1zvQ+FTrhRjxXfZgUjMrnCEkupj2+yjJGrLTU 9jajli9L+6z9clGbY6tKsV7g+/GeUrX1rqfqpv/bsj/vHdA762BeMb9GUiuu/8Jr0O/4 9y+oRD9/HBge8WLgGok8qQ3z77RsZr1cFpaEDkceuD5bAT6tbg2qiLm43MT9IVNX9ZXg JrLxJ+hrMmQiRtH6yrGd9jSc4Ohaczd38JanmcZNKm8j9jm24x6PnIryotH7DJgCVXJg 9oR3PbiZaQgVoru49/GTVadJZWeLI43xaL8q4y4ii4UCmuXj0OjDR6/nTKoL0Zw2jlcw wGFA== 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=fIcIYGw8laaTlz7sifLh4dC69zRULH/E/AEIBgv88MB4eGBqxOe/EjizkTfBkyimxR giPMc+UmO4+qKlcb9Jphualh8tIPGq14/Ko63A0xAWEKJAfDgjPAk71vvj7ct6yXt1Wq /X+FyWZwvROFEF9AGrCBd4KDUDSzv2i/9+nbZNXCoQ8HVDgHBbCrEnAgNHwkBgk476py uZxP2vSD3jRZwA/pr2psl5Et5utkbSHnJez7NqoaQ0VOfanmtIds3l6vcmbpeseEbVBX KdYet+xZ3hTHKuf75KKHZcjiMbSHRxp77qdC00UN1NOFolFjpTtL0alpL//2+22XvJdD 3Pxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="QPiU/Ryr"; 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 s20si11283422edq.484.2021.03.15.11.29.35; Mon, 15 Mar 2021 11:30:00 -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="QPiU/Ryr"; 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 S236375AbhCOOfR (ORCPT + 99 others); Mon, 15 Mar 2021 10:35:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:34900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233466AbhCOOBn (ORCPT ); Mon, 15 Mar 2021 10:01:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AF15C64EF3; Mon, 15 Mar 2021 14:01:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816900; bh=9ibA2mjQg2zuTjL39SlYdc/2f0IYeUrZryi5svSAFy8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QPiU/RyrThmRUrS2zwHANMkideq15JcSyGZk20cs8cm4UD134X2eCN3YF15/o3+rf tM9HXbT9tVAa/MeIdDIfjmwEM+WJDbnMMswVcRE5+daREinBOSac8zVxCBRVDmvoin X32bUJ6w0a8Zn20PWMXsnXP1aEvJRwSNLFB2XJ5Y= 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.10 177/290] ALSA: hda: Avoid spurious unsol event handling during S3/S4 Date: Mon, 15 Mar 2021 14:54:30 +0100 Message-Id: <20210315135547.896143692@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@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); }