From patchwork Tue Nov 17 16:54:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai-Heng Feng X-Patchwork-Id: 1401657 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CbBr23cmqz9sPB; Wed, 18 Nov 2020 03:54:42 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1kf4FY-00080W-ET; Tue, 17 Nov 2020 16:54:36 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kf4FV-00080Q-Pp for kernel-team@lists.ubuntu.com; Tue, 17 Nov 2020 16:54:33 +0000 Received: from 61-220-137-34.hinet-ip.hinet.net ([61.220.137.34] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kf4FU-0007i5-Uz for kernel-team@lists.ubuntu.com; Tue, 17 Nov 2020 16:54:33 +0000 From: Kai-Heng Feng To: kernel-team@lists.ubuntu.com Subject: [SRU] [G/OEM-5.6] [PATCH 0/4] Fix no headset sound after S3 on Intel HDA Date: Wed, 18 Nov 2020 00:54:25 +0800 Message-Id: <20201117165429.1231318-1-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1904595 [Impact] After system S3, hotplugging headset cannot produce any sound despite of being auto-selected as audio output. [Fix] Avoid using pm_runtime_force_{suspend,resume} helpers to ensure codec suspend/resume flow, and also ensure HDA driver and PCI set correct wakeup settings. [Test case] Plug headset, unplug headset, switch audio ouput from speakers to HDMI to let Intel HDA auto suspend. Suspend/resume the system, plug the headset again, hear no sound. With the patch series applied, the issue is gone. [Where problems could occur] If there is bad firmware/hardware that makes codec have system-wide wakeup capability, direct-complete flow may trigger unwanted system wakeup or even break system suspend. The series was tested on both AMD and Intel platforms, with Realtek and Connexant codecs respectively. Kai-Heng Feng (3): ALSA: hda: Refactor codec PM to use direct-complete optimization ALSA: hda: Separate runtime and system suspend ALSA: hda: Reinstate runtime_allow() for all hda controllers Takashi Iwai (1): ALSA: hda: Workaround for spurious wakeups on some Intel platforms sound/pci/hda/hda_codec.c | 45 +++++++++++++++++++----------- sound/pci/hda/hda_controller.h | 1 + sound/pci/hda/hda_intel.c | 50 +++++++++++++++++++++++----------- 3 files changed, 64 insertions(+), 32 deletions(-) Acked-by: Stefan Bader Acked-by: Kleber Sacilotto de Souza