Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp960712pxb; Fri, 22 Apr 2022 15:22:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBn5WKkuYw0w6QtLekJHZpAMfZ7+/6z+ubNAvthU3fw6pHu0m+ym8Tqwt8mjfvdtYCIbjx X-Received: by 2002:a17:902:f68b:b0:159:48f:1185 with SMTP id l11-20020a170902f68b00b00159048f1185mr6764020plg.83.1650666169511; Fri, 22 Apr 2022 15:22:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650666169; cv=none; d=google.com; s=arc-20160816; b=McMcoLFIdLT9j5Tc2ML+6ZbIGRDlTRdqB8t11rTvKHmJxuF8CkjzuXo+t5Znw5Putc UZH3rmjMuqoHBHnrxJ+0Ev6vGkY8yWWwq8RpaNRXHNJeP3DjYLZzgO/Dljyo8uwl9ydr vbUGgVCyzVabY19dsIK/t9QiAjkCJLM0YmbUO5DW9urg/rDwUDsblhTw+rGGpwU3EeZx zMgWCx2mXn6EB64Af0Y1ytK4EkrgFu68mU82LDY3ZWgIC2QOzB8/k4JaSAFW7UeQzVzB U6lnn8YhWCbfoet2MOz1BWPRPTf0Cb5TaiFm4u4rIN5SGVmoiJC8FEfscRDceqHnyPwP IRBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=uoOgAXpCIrwvMIW3eR4f7RunzVxhzXfwgxNjSgP4JLo=; b=baWwEMhEnHtM4SUOcRzfk1+Adkc5RHLUZuJ6qwM5shvKRNOzLl0Fy2CYl4QpO6oP7K LR7Z4FMzc9URz6LqDGRJWm/MB6ZzE1t3UxwJj5p0hRtQ1dz1Tf3PGWtgQIq0hgSY1DIk lXO6bTkZ/IBdEoRSCc3ybmlsEnWUBrZwku9oH6LP3+21AP4xltgOpLDmSFgF5nwgJbEu NDEBKJuCtBV/0qGksPQUxyWNpres3EpqGZRJczG4kB0DhEo+dwNB2npK11lTNtaX1Jcs ifNWndWvo34vf+G9qq8u2zep77EYocVH5dR9Ww9QUaUN34lguAe1uc+rOasZgVBHEzb8 3hOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Xv+wy1P9; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id n18-20020a170902969200b00155d4e81304si8647391plp.143.2022.04.22.15.22.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 15:22:49 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Xv+wy1P9; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B49F03CCABA; Fri, 22 Apr 2022 13:28:09 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381382AbiDTSCz (ORCPT + 99 others); Wed, 20 Apr 2022 14:02:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381459AbiDTSCh (ORCPT ); Wed, 20 Apr 2022 14:02:37 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10B15BED for ; Wed, 20 Apr 2022 10:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650477590; x=1682013590; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=ZPYh6ii3d6sit1IsGVPNN+fvydkX/ToCt0Ocqq0aUxE=; b=Xv+wy1P94wmB670kpEO70Am6mGM5aUl/wiAhOr0O8trgMs5v7Yiora6D p+O0ESMHuL2r7eqSROoe4JG8goXqhy5NyK91oRYGgJh6jQ3WsH3UcQb/D 3SMYRr0Ay0LyhHCWbRDQgtEqrDmF5z1/Cq7MbTZrquCFOhgRUnlPrPD4E 4wvceK9e4p4UafhY4ourdUaiKNt2oltuRKAnDwbY5lGmJqtqe9cKFl6ZR plGqe8R/UCeUu3UwopqtfazFWf4A4PwFNVeOlmOtBG2dVsY94IbTADHKx s4rBOxIl698q2Bhdz3pcdOjdPKFnF9P/oX4PmrogOd1N4ZJg4ccHLlM02 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10323"; a="327013175" X-IronPort-AV: E=Sophos;i="5.90,276,1643702400"; d="scan'208";a="327013175" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2022 10:59:47 -0700 X-IronPort-AV: E=Sophos;i="5.90,276,1643702400"; d="scan'208";a="576721826" Received: from sbidasar-mobl.amr.corp.intel.com (HELO [10.209.100.171]) ([10.209.100.171]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2022 10:59:46 -0700 Message-ID: Date: Wed, 20 Apr 2022 12:59:12 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.5.0 Subject: Re: [PATCH v4] ASoC: codecs: wsa881x: add runtime pm support Content-Language: en-US To: Srinivas Kandagatla , broonie@kernel.org Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com, linux-kernel@vger.kernel.org, tiwai@suse.com, quic_srivasam@quicinc.com References: <20220228144235.24208-1-srinivas.kandagatla@linaro.org> From: Pierre-Louis Bossart In-Reply-To: <20220228144235.24208-1-srinivas.kandagatla@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Srini, > +static int __maybe_unused wsa881x_runtime_resume(struct device *dev) > +{ > + struct sdw_slave *slave = dev_to_sdw_dev(dev); > + struct regmap *regmap = dev_get_regmap(dev, NULL); > + struct wsa881x_priv *wsa881x = dev_get_drvdata(dev); > + > + gpiod_direction_output(wsa881x->sd_n, 1); > + > + wait_for_completion_timeout(&slave->initialization_complete, > + msecs_to_jiffies(WSA881X_PROBE_TIMEOUT)); while I was revisiting pm_runtime support, I also saw that this codec driver is the only one that doesn't check for errors max98373-sdw.c: time = wait_for_completion_timeout(&slave->initialization_complete, rt1308-sdw.c: time = wait_for_completion_timeout(&slave->initialization_complete, rt1316-sdw.c: time = wait_for_completion_timeout(&slave->initialization_complete, rt5682-sdw.c: time = wait_for_completion_timeout(&slave->initialization_complete, rt5682.c: &slave->initialization_complete, rt700-sdw.c: time = wait_for_completion_timeout(&slave->initialization_complete, rt711-sdca-sdw.c: time = wait_for_completion_timeout(&slave->initialization_complete, rt711-sdw.c: time = wait_for_completion_timeout(&slave->initialization_complete, rt715-sdw.c: time = wait_for_completion_timeout(&slave->initialization_complete, wsa881x.c: wait_for_completion_timeout(&slave->initialization_complete, If the attachment fails for some reason, you probably want to avoid starting regmap syncs that will fail by construction, no? > + > + regcache_cache_only(regmap, false); > + regcache_sync(regmap); > + > + return 0; > +}