Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3139189pxa; Tue, 18 Aug 2020 07:36:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx32X/BwLO0FF3hkRuUMfC/Qx7em+8Lw8coMfq8kL5urqtykcKuRx5uXHTsjUkrKOGl65NL X-Received: by 2002:a17:906:3756:: with SMTP id e22mr21267974ejc.487.1597761384844; Tue, 18 Aug 2020 07:36:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597761384; cv=none; d=google.com; s=arc-20160816; b=sPSVVUMY4TPm2GVCiEA70wGtk6r/ICoGo3szls6aw40Do3Bsk1bbfWBbX7XdboFdYG cuGjqQOsm5eiAsvR5C9vv/9R/eKOvaypHFG0ecCWLf2INmbUsMfIh/W1IJjoO0u+1Rej +mJjIEtYe4fP85R31aIdHQZ+HtNWzIoSeNfQu91aD7anxLXI1NgO6r6psgnMbm2Wgj/Q DN9uSGxBQ276AArUiHvtKPMGpHxz4RqmyXGckRULUxcLkM8o38NHmZJDLhCRnur22u6P YPYvpJADvNGu4RSR1OTJlauUoVJUi1yw9jw/mvXLc4veZTy8l/6GPhy2D0j3RY1HyXTQ Fsjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:ironport-sdr:ironport-sdr; bh=9/xHV8Qi7Jn6wFet024apfvujFXMaBtb1WCiYM1+Egw=; b=dtP2JF7nA6CmC61mYqY6gqq0RxZZHfd9r/OIkTSpi2NydD2AoPsO12JtYf/UCQkQwj L6DvCXN8JHYjfSWbJxLOotqRE73mOrmhUmtUrnSJBqoD3+bgRRFZFTwrs5aJ9k+eugi/ omNfizCxC+wMDOljxUfFA4pkU2as70/qBz+felGLR8Mw4Q6gM6KEG5izjzM0xOys/97z dRfhzJSeNPUMrBXcAQfDdGGytv7VO2GjgGTBVcqyeFgyjY4X+SKZm6Qux1rDbNcu9Lg9 5A8PD73Rxww8ciLEc/i7JFNIZDBdrDa+UBR3sU3Ye7mLfVQkE3ujIZZIT8Y0lkBBmQPY dLAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e5si13673369ejc.182.2020.08.18.07.36.00; Tue, 18 Aug 2020 07:36:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726977AbgHROfU (ORCPT + 99 others); Tue, 18 Aug 2020 10:35:20 -0400 Received: from mga17.intel.com ([192.55.52.151]:50397 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726585AbgHROfQ (ORCPT ); Tue, 18 Aug 2020 10:35:16 -0400 IronPort-SDR: Dlh81/SrqVgNah3rZAXEa+XBIIKO2BdHjErurBptIRuiwiWMw4NUmbed5RXrGABpUOj7eMWVHj TM3Q6hCx5Fuw== X-IronPort-AV: E=McAfee;i="6000,8403,9716"; a="134972097" X-IronPort-AV: E=Sophos;i="5.76,327,1592895600"; d="scan'208";a="134972097" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2020 07:35:16 -0700 IronPort-SDR: WyHsuadT6jVo+CUsor5B5qJYHT8X3rCEZB3gty/TmdwcpcbIeFrAaYs5I8fkMhfRY6pUTbtpf+ 61chcvHzMSSQ== X-IronPort-AV: E=Sophos;i="5.76,327,1592895600"; d="scan'208";a="471830291" Received: from bard-ubuntu.sh.intel.com ([10.239.13.33]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Aug 2020 07:35:12 -0700 From: Bard Liao To: alsa-devel@alsa-project.org, vkoul@kernel.org Cc: vinod.koul@linaro.org, linux-kernel@vger.kernel.org, tiwai@suse.de, broonie@kernel.org, gregkh@linuxfoundation.org, jank@cadence.com, srinivas.kandagatla@linaro.org, rander.wang@linux.intel.com, ranjani.sridharan@linux.intel.com, hui.wang@canonical.com, pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com, mengdong.lin@intel.com, bard.liao@intel.com Subject: [PATCH 01/11] soundwire: intel: disable shim wake on suspend Date: Tue, 18 Aug 2020 10:41:10 +0800 Message-Id: <20200818024120.20721-2-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200818024120.20721-1-yung-chuan.liao@linux.intel.com> References: <20200818024120.20721-1-yung-chuan.liao@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pierre-Louis Bossart If we enabled the clock stop mode and suspend, we need to disable the shim wake. We do so only if the parent is pm_runtime active due to power rail dependencies. GitHub issue: https://github.com/thesofproject/linux/issues/1678 Signed-off-by: Pierre-Louis Bossart Signed-off-by: Bard Liao --- drivers/soundwire/intel.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index dbcbe2708563..fe9b92fd48db 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -1532,6 +1532,7 @@ static int intel_suspend(struct device *dev) struct sdw_cdns *cdns = dev_get_drvdata(dev); struct sdw_intel *sdw = cdns_to_intel(cdns); struct sdw_bus *bus = &cdns->bus; + u32 clock_stop_quirks; int ret; if (bus->prop.hw_disabled) { @@ -1543,6 +1544,23 @@ static int intel_suspend(struct device *dev) if (pm_runtime_suspended(dev)) { dev_dbg(dev, "%s: pm_runtime status: suspended\n", __func__); + 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); + } + return 0; } -- 2.17.1