From mboxrd@z Thu Jan 1 00:00:00 1970 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=-10.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 8C3FBC433E6 for ; Fri, 28 Aug 2020 06:49: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 14FDC20825 for ; Fri, 28 Aug 2020 06:49:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="kvL0kePU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 14FDC20825 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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 A4608181E; Fri, 28 Aug 2020 08:48:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A4608181E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1598597358; bh=TkhgczOGtkifWB/TVIlRts5Vlh4369xzTFV+is7IYo0=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=kvL0kePU27afsNfh5OlI1OjpyxjzVyuxfSZwd1cok3bPjyVFebmyNwmFXnQdJ0L65 GiTmq3rVv8kD38kgaN3lrQAH+gGRPrlmTmqKCIic5rDapduEy03RlUafQIJw4m3pkE gO7I7P9fXwCdD6x5IyGO/CacTa71/6kW5chnogGM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1204FF80143; Fri, 28 Aug 2020 08:48:28 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 788BEF8016F; Fri, 28 Aug 2020 08:48:26 +0200 (CEST) Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1B5D6F80105 for ; Fri, 28 Aug 2020 08:48:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1B5D6F80105 Received: by mail-ej1-f65.google.com with SMTP id d26so123996ejr.1 for ; Thu, 27 Aug 2020 23:48:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=yGha4SiD+sJIY9+V0onyYAsFpD65q4MyMopm/dvyYaY=; b=dacc/fGEMznz7IUIFXK0o2G6gBoRinQI6SLbzs2FZaaBIk6/SN8oEboLBpFjqTxXMy j4E9feQBHyJ/gZcpZWlegGcjjfdtJGs+skGt9EpuyPQ8tXXkj+bvdaSHG8KAyWy14aHJ eOVA3dAqSIYDOhX+1mjzxPBg7yrQOL1nwm0hJGjQkRKLZl9nib5TdpjhVmRxOAI8wN+Z zDZKF5Dj3m6ojSCbdST33pF/VHMlyoAJImgEl5U/SoOu+h2Oll0C0ckXfxkAkTEp4hAn B7Ss/w2sApJkCEROrQQJFxFdgPacCWM6PqLtyJTZrY4lI0lE4p5t7unT6OvkBbKwOqbU 9Ysg== X-Gm-Message-State: AOAM530K5OBp4mcqwAhtu56gQcSnlaFu6vAOAfIKI8VCLEtewmPr60AU aR624/Uxh3wxlLzdUxfTs5A= X-Google-Smtp-Source: ABdhPJxhsWIy8WW+Tr4xQbQCXRqLiOto2ndTlcft3CciYCq2dpG8mxvQSmAG9Sd2ZbVjMFwrTmeR6Q== X-Received: by 2002:a17:906:4c97:: with SMTP id q23mr327734eju.11.1598597295563; Thu, 27 Aug 2020 23:48:15 -0700 (PDT) Received: from pi3 ([194.230.155.216]) by smtp.googlemail.com with ESMTPSA id dr21sm22807ejc.112.2020.08.27.23.48.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 23:48:15 -0700 (PDT) Date: Fri, 28 Aug 2020 08:48:12 +0200 From: Krzysztof Kozlowski To: Sylwester Nawrocki Subject: Re: [PATCH 2/2] ASoC: wm8994: Ensure the device is resumed in wm89xx_mic_detect functions Message-ID: <20200828064812.GE17406@pi3> References: <20200827173357.31891-1-s.nawrocki@samsung.com> <20200827173357.31891-2-s.nawrocki@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200827173357.31891-2-s.nawrocki@samsung.com> Cc: alsa-devel@alsa-project.org, ckeepax@opensource.cirrus.com, b.zolnierkie@samsung.com, patches@opensource.cirrus.com, lgirdwood@gmail.com, linux-kernel@vger.kernel.org, broonie@kernel.org, m.szyprowski@samsung.com 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, Aug 27, 2020 at 07:33:57PM +0200, Sylwester Nawrocki wrote: > When the wm8958_mic_detect, wm8994_mic_detect functions get called from > the machine driver, e.g. from the card's late_probe() callback, the CODEC > device may be PM runtime suspended and any regmap writes have no effect. > Add PM runtime calls to these functions to ensure the device registers > are updated as expected. > This suppresses an error during boot > "wm8994-codec: ASoC: error at snd_soc_component_update_bits on wm8994-codec" > caused by the regmap access error due to the cache_only flag being set. > > Signed-off-by: Sylwester Nawrocki > --- > sound/soc/codecs/wm8994.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c > index b3ba053..fc9ea19 100644 > --- a/sound/soc/codecs/wm8994.c > +++ b/sound/soc/codecs/wm8994.c > @@ -3514,6 +3514,8 @@ int wm8994_mic_detect(struct snd_soc_component *component, struct snd_soc_jack * > return -EINVAL; > } > > + pm_runtime_get_sync(component->dev); The driver enables PM runtime unconditionally so you should probably handle the error code here. I know that driver does not do it in other cases but it should not be a reason to multiple this pattern... unless it really does not matter as there are no runtime PM ops? Best regards, Krzysztof From mboxrd@z Thu Jan 1 00:00:00 1970 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=-11.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 99D4BC433E2 for ; Fri, 28 Aug 2020 06:48:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 781FB2098B for ; Fri, 28 Aug 2020 06:48:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598597311; bh=TkhgczOGtkifWB/TVIlRts5Vlh4369xzTFV+is7IYo0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=E5GeTupCNgaoOCE570cPmyFWgH7Kd8bXy3dr+L/qLzniRgDIRkB7jx4M1kpmB/WFW lbP9k/QNZYkp8WvTTV0cXOULb6wpuIU8s++mSFUg+aDkc5tJRK14zzUqS2yOpWQTJh C5vsKuFPSpnUTi78SQM33lKzxg9N5DvJpZSc845Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727961AbgH1GsT (ORCPT ); Fri, 28 Aug 2020 02:48:19 -0400 Received: from mail-ej1-f68.google.com ([209.85.218.68]:40217 "EHLO mail-ej1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725858AbgH1GsR (ORCPT ); Fri, 28 Aug 2020 02:48:17 -0400 Received: by mail-ej1-f68.google.com with SMTP id o18so93255eje.7 for ; Thu, 27 Aug 2020 23:48:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=yGha4SiD+sJIY9+V0onyYAsFpD65q4MyMopm/dvyYaY=; b=QCTH3cQnG7wXYfj1DjdsdM9+DYXcwdAKbX6r9tB87itXGO7HvJjWz+Y7FVt1RkjL7u zsPqkbYgSMpLv4zSW5vyFkZGmIHEYk+GEOhMxpqbXiS5dc+anc/naEcwcpspdE1kj2cl 4lXmODdVxkCx6qgWHDo/1m36gqWw6qPolF9NtCdsHJEiiiW7pe4S7shlCN1iCbXHNaY/ oy1N2OH64RPuNAzIwep6PtvXegGDuJiCebf+3uiSdmRbY1xNkLr/5Hym3ghtbYAd6OFb 72aABIBva0TA8pfEnc0GH9bdC477xJfmvW8mHJwIM7hVGOOW0HEshYCd5JpdcVloqR3y X8tA== X-Gm-Message-State: AOAM530GTziBcq7CVuROvFVgMhMJZX4/DQ7X7qxRiIJAAS4yBgS0+K7f vG9MHF/b1Lc2um/7O86oxxlwKZKfCbWW6qAa X-Google-Smtp-Source: ABdhPJxhsWIy8WW+Tr4xQbQCXRqLiOto2ndTlcft3CciYCq2dpG8mxvQSmAG9Sd2ZbVjMFwrTmeR6Q== X-Received: by 2002:a17:906:4c97:: with SMTP id q23mr327734eju.11.1598597295563; Thu, 27 Aug 2020 23:48:15 -0700 (PDT) Received: from pi3 ([194.230.155.216]) by smtp.googlemail.com with ESMTPSA id dr21sm22807ejc.112.2020.08.27.23.48.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 23:48:15 -0700 (PDT) Date: Fri, 28 Aug 2020 08:48:12 +0200 From: Krzysztof Kozlowski To: Sylwester Nawrocki Cc: broonie@kernel.org, lgirdwood@gmail.com, ckeepax@opensource.cirrus.com, patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, m.szyprowski@samsung.com, b.zolnierkie@samsung.com Subject: Re: [PATCH 2/2] ASoC: wm8994: Ensure the device is resumed in wm89xx_mic_detect functions Message-ID: <20200828064812.GE17406@pi3> References: <20200827173357.31891-1-s.nawrocki@samsung.com> <20200827173357.31891-2-s.nawrocki@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200827173357.31891-2-s.nawrocki@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 27, 2020 at 07:33:57PM +0200, Sylwester Nawrocki wrote: > When the wm8958_mic_detect, wm8994_mic_detect functions get called from > the machine driver, e.g. from the card's late_probe() callback, the CODEC > device may be PM runtime suspended and any regmap writes have no effect. > Add PM runtime calls to these functions to ensure the device registers > are updated as expected. > This suppresses an error during boot > "wm8994-codec: ASoC: error at snd_soc_component_update_bits on wm8994-codec" > caused by the regmap access error due to the cache_only flag being set. > > Signed-off-by: Sylwester Nawrocki > --- > sound/soc/codecs/wm8994.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c > index b3ba053..fc9ea19 100644 > --- a/sound/soc/codecs/wm8994.c > +++ b/sound/soc/codecs/wm8994.c > @@ -3514,6 +3514,8 @@ int wm8994_mic_detect(struct snd_soc_component *component, struct snd_soc_jack * > return -EINVAL; > } > > + pm_runtime_get_sync(component->dev); The driver enables PM runtime unconditionally so you should probably handle the error code here. I know that driver does not do it in other cases but it should not be a reason to multiple this pattern... unless it really does not matter as there are no runtime PM ops? Best regards, Krzysztof