From patchwork Tue Jul 27 05:56:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liao, Bard" X-Patchwork-Id: 486779 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=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT 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 52629C4338F for ; Tue, 27 Jul 2021 05:58:54 +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 B3B7560FE3 for ; Tue, 27 Jul 2021 05:58:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B3B7560FE3 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-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 7E8C41EF9; Tue, 27 Jul 2021 07:58:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7E8C41EF9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1627365531; bh=RuBzuG8/EjmDuSelbknJJndCn700nyrXWZ2G8Fjzpqc=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ADDhQsgQLHHfwicCCtGRbd/BJBSOk4hudKW6SGMmuS+hVLczg9DzpmkhOsvO+RmMb nz/5nVYsB19YrykoGxfOW7VOX0hYO2o7krT06djYTEf9uCsv5+t+DvNQ40vswa1WXf 6aT9jfUDJReFaFq0Cogu1rJXXC/Z9p+bEgAT4t6o= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1A79CF804E2; Tue, 27 Jul 2021 07:56:39 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4CC3BF8026C; Tue, 27 Jul 2021 07:56:37 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 2E8B3F804AF for ; Tue, 27 Jul 2021 07:56:27 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2E8B3F804AF X-IronPort-AV: E=McAfee;i="6200,9189,10057"; a="276163952" X-IronPort-AV: E=Sophos;i="5.84,272,1620716400"; d="scan'208";a="276163952" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2021 22:56:24 -0700 X-IronPort-AV: E=Sophos;i="5.84,272,1620716400"; d="scan'208";a="474302633" Received: from bard-ubuntu.sh.intel.com ([10.239.185.57]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2021 22:56:23 -0700 From: Bard Liao To: broonie@kernel.org, tiwai@suse.de Subject: [PATCH 4/4] soundwire: intel: simplify pm_runtime handling in suspend/resume Date: Tue, 27 Jul 2021 13:56:08 +0800 Message-Id: <20210727055608.30247-5-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210727055608.30247-1-yung-chuan.liao@linux.intel.com> References: <20210727055608.30247-1-yung-chuan.liao@linux.intel.com> Cc: vkoul@kernel.org, alsa-devel@alsa-project.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.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" From: Pierre-Louis Bossart Since we've introduced a .prepare callback that brings all devices to full power on S state transitions if the clock-stop mode was used, we no longer need to special-case when the device was pm_runtime suspended. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index 9d05e158fe0e..ec8d6fcbfc9e 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -1610,19 +1610,9 @@ static int __maybe_unused intel_suspend(struct device *dev) clock_stop_quirks = sdw->link_res->clock_stop_quirks; - if ((clock_stop_quirks & SDW_INTEL_CLK_STOP_BUS_RESET || - !clock_stop_quirks) && - !pm_runtime_suspended(dev->parent)) { - - /* - * if we've enabled clock stop, and the parent - * is still active, disable shim wake. The - * SHIM registers are not accessible if the - * parent is already pm_runtime suspended so - * it's too late to change that configuration - */ - - intel_shim_wake(sdw, false); + if (clock_stop_quirks & SDW_INTEL_CLK_STOP_BUS_RESET || !clock_stop_quirks) { + /* this should not happen but throw a log in case of a broken sequence */ + dev_err(dev, "%s: pm_runtime status is suspended with clock-stop mode\n", __func__); } return 0;