Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp29586ybl; Tue, 7 Jan 2020 13:27:52 -0800 (PST) X-Google-Smtp-Source: APXvYqwLRKo5l7660fYAZc3ZEB/afL5LgxJeTYERSDO+YnUB9jxrLxrO23PR6/+qEAVed98IbeF2 X-Received: by 2002:aca:b703:: with SMTP id h3mr398955oif.148.1578432472480; Tue, 07 Jan 2020 13:27:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578432472; cv=none; d=google.com; s=arc-20160816; b=ThH2Ex3o4979k+SBgdJFflrY1CpAmAt/BLdR/jZQKAiryvZTEarAVWcfkRbe/PymNF mmFXBawT4DYtC2j7ZkBa9+Y8wOcPTMG2BeEc5TURe6BFul8OVUtb43qh9i6k5xQAf1nd eiKJoBNV7VwWanCWYpJ75gvuSnFUDIG58kpYaAL8MyZAo34sHWQG3wERMXLjfNYUwt0I Ej+FkC+opL0lx90JarP9fLoFT3tZdPspryq9o4i4XYH9EVVi4LOPBl8KEgJrvY7WlL6e ec/c9/4I+tgRJ9S+VU4BfyrhHu71TW+OObaRDLVANah/Hg0pY7hqjjNRoBQdT593vsLT 93ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bqigaaCd9ncA/B1Q1GUi3nA0uCqkB1W0+wjxfM/XmTo=; b=0eyqIfW8tdzcGU0sAIorEdO718r64UniiwcPpdXZKxNA3R8qhRTBHWdt1qXEs5NdRP c2C/Rs/J6LHh99ox3tSm/hXRosW7UlSRoloT2D4cWIho6kitnHjz1ihQc9DvkP1rTkMY a5bDTgDTwFLCkrkIzYbxOK2xpfmnE2tCyrfsqm/PNw0d8XFH9ZO9Qh3b5y+ozdUAbsIh 454mD7PwPHMJgmMvd3HLUJL3P3m9OvuQwdiTSMGNVBhwYS1H9C2vibbUnIR0gBrnZhRT F1fVftGehjtDoEFPCEFs+95Bw5PG4r0vktm+4zJiLZs6DHg3AEboIk4nzxdE0tCW81v5 kcxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MR0bY7Vc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i20si514703otk.270.2020.01.07.13.27.40; Tue, 07 Jan 2020 13:27:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MR0bY7Vc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729190AbgAGV0i (ORCPT + 99 others); Tue, 7 Jan 2020 16:26:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:58522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727367AbgAGU6n (ORCPT ); Tue, 7 Jan 2020 15:58:43 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 067F7208C4; Tue, 7 Jan 2020 20:58:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578430722; bh=19JIRivrHLm4BzQ3KT1QJXT/8qrNlXSsGID6WapevY8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MR0bY7Vc5NKDf1GdG3Uk1KNQ7XkHB7q4n8nfprQKvJRo0g/RfXWmQTsTlJECfGeIS D70a1a72ziRqPR3VCO/Q4mdkaMbO0I57AUHntfbcoZkCkT9IfYXSli5ATZAyhSEooa 5Xp+2rql+iWz5x7Mt7zIWaubWtK1FvFMIGaqfogk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Klaus Ethgen , Takashi Iwai Subject: [PATCH 5.4 069/191] ALSA: hda - Apply sync-write workaround to old Intel platforms, too Date: Tue, 7 Jan 2020 21:53:09 +0100 Message-Id: <20200107205336.682332722@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200107205332.984228665@linuxfoundation.org> References: <20200107205332.984228665@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Takashi Iwai commit c366b3dbbab14b28d044b94eb9ce77c23482ea35 upstream. Klaus Ethgen reported occasional high CPU usages in his system that seem caused by HD-audio driver. The perf output revealed that it's in the unsolicited event handling in the workqueue, and the problem seems triggered by some communication stall between the controller and the codec at the runtime or system resume. Actually a similar phenomenon was seen in the past for other Intel platforms, and we already applied the workaround to enforce sync-write for CORB/RIRB verbs for Skylake and newer chipsets (commit 2756d9143aa5 "ALSA: hda - Fix intermittent CORB/RIRB stall on Intel chips"). Fortunately, the same workaround is applicable to the old chipset, and the experiment showed the positive effect. Based on the experiment result, this patch enables the sync-write workaround for all Intel chipsets. The only reason I hesitated to apply this workaround was about the possibly slightly higher CPU usage. But if the lack of sync causes a much severer problem even for quite old chip, we should think this would be necessary for all Intel chips. Reported-by: Klaus Ethgen Cc: Link: https://lore.kernel.org/r/20191223171833.GA17053@chua Link: https://lore.kernel.org/r/20191223221816.32572-1-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/pci/hda/hda_intel.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -280,12 +280,13 @@ enum { /* quirks for old Intel chipsets */ #define AZX_DCAPS_INTEL_ICH \ - (AZX_DCAPS_OLD_SSYNC | AZX_DCAPS_NO_ALIGN_BUFSIZE) + (AZX_DCAPS_OLD_SSYNC | AZX_DCAPS_NO_ALIGN_BUFSIZE |\ + AZX_DCAPS_SYNC_WRITE) /* quirks for Intel PCH */ #define AZX_DCAPS_INTEL_PCH_BASE \ (AZX_DCAPS_NO_ALIGN_BUFSIZE | AZX_DCAPS_COUNT_LPIB_DELAY |\ - AZX_DCAPS_SNOOP_TYPE(SCH)) + AZX_DCAPS_SNOOP_TYPE(SCH) | AZX_DCAPS_SYNC_WRITE) /* PCH up to IVB; no runtime PM; bind with i915 gfx */ #define AZX_DCAPS_INTEL_PCH_NOPM \ @@ -300,13 +301,13 @@ enum { #define AZX_DCAPS_INTEL_HASWELL \ (/*AZX_DCAPS_ALIGN_BUFSIZE |*/ AZX_DCAPS_COUNT_LPIB_DELAY |\ AZX_DCAPS_PM_RUNTIME | AZX_DCAPS_I915_COMPONENT |\ - AZX_DCAPS_SNOOP_TYPE(SCH)) + AZX_DCAPS_SNOOP_TYPE(SCH) | AZX_DCAPS_SYNC_WRITE) /* Broadwell HDMI can't use position buffer reliably, force to use LPIB */ #define AZX_DCAPS_INTEL_BROADWELL \ (/*AZX_DCAPS_ALIGN_BUFSIZE |*/ AZX_DCAPS_POSFIX_LPIB |\ AZX_DCAPS_PM_RUNTIME | AZX_DCAPS_I915_COMPONENT |\ - AZX_DCAPS_SNOOP_TYPE(SCH)) + AZX_DCAPS_SNOOP_TYPE(SCH) | AZX_DCAPS_SYNC_WRITE) #define AZX_DCAPS_INTEL_BAYTRAIL \ (AZX_DCAPS_INTEL_PCH_BASE | AZX_DCAPS_I915_COMPONENT)