Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9618C433DF for ; Fri, 9 Oct 2020 15:01:20 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D2EBA22260 for ; Fri, 9 Oct 2020 15:01:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Ugqsiq2D" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D2EBA22260 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B33CC86E; Fri, 9 Oct 2020 17:00:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B33CC86E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1602255676; bh=tGD94/K/hffkL4YcDfFqcoiMm0xDX2cZ4+Km5UyImJ4=; h=Subject:To:References:From:Date:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Ugqsiq2DI3wPh5v7Wc3qj4Fssy4L55PVhLvPa5OmX9eYGNU8wjEPgNhqEpCGoXNmE EfEMCSTeoidTTVyazqJYla802HUUcoflLsUGyGA7anM3Nd9BT+rgjAigM/rksfmnqu ARgPPnBCH4x7A5QEqsjoooTPf0wWfUJMqeoj6d1M= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2FDAAF80148; Fri, 9 Oct 2020 17:00:26 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D78CFF8015B; Fri, 9 Oct 2020 17:00:24 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3FF86F80128 for ; Fri, 9 Oct 2020 17:00:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3FF86F80128 IronPort-SDR: vCHanfEWqW63Cx/AwF8jky8tdFSk8/pTQgy6obl7pF0SI/TI0AHqCj2k+CgjWKL//PA2y92rbg 5iG4maCWtjjA== X-IronPort-AV: E=McAfee;i="6000,8403,9768"; a="145359378" X-IronPort-AV: E=Sophos;i="5.77,355,1596524400"; d="scan'208";a="145359378" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2020 08:00:17 -0700 IronPort-SDR: O6/lPDeAZFrkMJUCQOW068EFs+Gz9I+mXXeKsgwUEK6Dgtm4yfOecM1SPcXp9lANaSLJhitdmM VApNNyixGHRQ== X-IronPort-AV: E=Sophos;i="5.77,355,1596524400"; d="scan'208";a="419472596" Received: from sjkim-mobl1.amr.corp.intel.com (HELO [10.212.131.60]) ([10.212.131.60]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2020 08:00:16 -0700 Subject: Re: [PATCH 1/1] ALSA: hda: fix jack detection with Realtek codecs when in D3 To: Takashi Iwai References: <20201009140227.691140-1-kai.vehmanen@linux.intel.com> From: Pierre-Louis Bossart Message-ID: <0c7d8dd4-b5cc-34f2-bbbe-7a4824e08128@linux.intel.com> Date: Fri, 9 Oct 2020 10:00:15 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Cc: alsa-devel@alsa-project.org, Kai-Heng Feng , Kailang Yang , Kai Vehmanen X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" >> On 10/9/20 9:02 AM, Kai Vehmanen wrote: >>> In case HDA controller is active, but codec is runtime suspended, jack >>> detection is not successful and no interrupt is raised. This has been >>> observed with multiple Realtek codecs and HDA controllers from different >>> vendors. Bug does not occur if both codec and controller are active, >>> or both are in suspend. Bug can be easily hit on desktop systems with >>> no built-in speaker. >>> >>> The problem can be fixed by powering up the codec once after every >>> controller runtime resume. Even if codec goes back to suspend, the jack >>> detection will now work. Add a flag to 'hda_codec' to describe codecs >>> that require this flow from the controller driver. Mark all Realtek >>> codecs with this flag. >> >> It does make sense to request the codec to resume when the controller >> resumes, we did the same for SoundWire IIRC. >> >> I am still confused on what happens if e.g. the controller resumes and >> remains active, e.g. capturing from the DMIC. The codec would become >> suspended after a while and then we would be back to the same problem, >> wouldn't we? >> >> Or are you saying that this initial resume of the codec is enough? > > When the controller is active and the codec goes to runtime suspend, > the codec will be woken up via the unsolicited event per jack change. > So it seems that the problem is only about the wake up from the > controller's runtime suspend. Right, I guess the first sentence in commit message could be updated as "In case HDA controller becomes active, but codec is runtime suspended, jack detection is not successful and no interrupt is raised."