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=-3.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 8A4F4C433DB for ; Thu, 4 Feb 2021 14:05:46 +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 AB72E64F51 for ; Thu, 4 Feb 2021 14:05:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AB72E64F51 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de 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 1CD5116D9; Thu, 4 Feb 2021 15:04:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1CD5116D9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1612447544; bh=q1RXq/wlIkpMqTVZQiS8l3WecNymckD/sXqm01W4Niw=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=eZos6xRD7Mu2FUQ5HLRzELEAHgDlyGlpyDwCqViHeu5j2MKfv8h5Lf+lJ0pjwEs9C XhjNAXG6M0RNK269fU6FDGHoDntt4xLhrWShjmReltuoFtxuOPqQLHIemdwAogfqot m9O3Te8DOclyTsmeP1tU63/Kb28MtA0aQpURha1k= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 979E9F80139; Thu, 4 Feb 2021 15:04:53 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C5137F80171; Thu, 4 Feb 2021 15:04:51 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id ACA66F80152 for ; Thu, 4 Feb 2021 15:04:44 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz ACA66F80152 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id EC830AD24; Thu, 4 Feb 2021 14:04:43 +0000 (UTC) Date: Thu, 04 Feb 2021 15:04:43 +0100 Message-ID: From: Takashi Iwai To: Kai Vehmanen Subject: Re: [RFC PATCH] ALSA: hda: call ext hda codec link up/down if available In-Reply-To: References: <20210204075821.1503539-1-kai.vehmanen@linux.intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: alsa-devel@alsa-project.org, Ranjani Sridharan 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 Thu, 04 Feb 2021 11:42:20 +0100, Kai Vehmanen wrote: > > Hey, > > On Thu, 4 Feb 2021, Takashi Iwai wrote: > > > On Thu, 04 Feb 2021 09:07:09 +0100, Kai Vehmanen wrote: > > > Takashi and others, this patch is a follow-up to the earlier thread about > > > hdac link management: > > > https://mailman.alsa-project.org/pipermail/alsa-devel/2021-January/179715.html > > > > > > We have absolutely no calls from sound/pci/hda/ to hdaudio_ext.h before > > > this patch, so I'm wondering if this is the right approach to take. > > > > An obvious drawback by this patch is that it'll make the hda-ext code > > always loaded whenever it's enabled, no matter whether it's really > > used or not. > > > > Maybe adding a new callback (link) in hdac_bus_ops can help? > > hmm, that's true. Let me try adding a separate callback and resend for > review. That will look cleaner in hda_codec.c. Thanks. BTW, one more thing: the code link up/down isn't always paired. It's a bit map and only holding states. For example, in hda_codec.c, the link power down may happen conditionally marked in hda_codec_runtime_suspend() while the resume always marks the link power up. So you'd need to check the bitmap change to perform the refcount up/down in the hda-ext side. Takashi