From mboxrd@z Thu Jan 1 00:00:00 1970 From: Charles Keepax Subject: Re: [PATCH v7 12/13] slimbus: qcom: Add runtime-pm support using clock-pause Date: Thu, 23 Nov 2017 10:17:49 +0000 Message-ID: <20171123101749.ojiv6l52jjq6b55b@localhost.localdomain> References: <20171115141043.29202-1-srinivas.kandagatla@linaro.org> <20171115141043.29202-13-srinivas.kandagatla@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20171115141043.29202-13-srinivas.kandagatla@linaro.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: srinivas.kandagatla@linaro.org Cc: mark.rutland@arm.com, alsa-devel@alsa-project.org, michael.opdenacker@free-electrons.com, poeschel@lemonage.de, andreas.noever@gmail.com, arnd@arndb.de, vinod.koul@intel.com, treding@nvidia.com, devicetree@vger.kernel.org, james.hogan@imgtec.com, pawel.moll@arm.com, linux-arm-msm@vger.kernel.org, sharon.dvir1@mail.huji.ac.il, robh+dt@kernel.org, sdharia@codeaurora.org, alan@linux.intel.com, bp@suse.de, mathieu.poirier@linaro.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, broonie@kernel.org, daniel@ffwll.ch, jkosina@suse.cz, joe@perches.com, davem@davemloft.net List-Id: linux-arm-msm@vger.kernel.org On Wed, Nov 15, 2017 at 02:10:42PM +0000, srinivas.kandagatla@linaro.org wrote: > From: Sagar Dharia > > Slimbus HW mandates that clock-pause sequence has to be executed > before disabling relevant interface and core clocks. > Runtime-PM's autosuspend feature is used here to enter/exit low > power mode for Qualcomm's Slimbus controller. Autosuspend feature > enables driver to avoid changing power-modes too frequently since > entering clock-pause is an expensive sequence > > Signed-off-by: Sagar Dharia > Signed-off-by: Srinivas Kandagatla > --- > + > +#ifdef CONFIG_PM_SLEEP > +static int qcom_slim_suspend(struct device *dev) > +{ > + int ret = 0; > + > + if (!pm_runtime_enabled(dev) || > + (!pm_runtime_suspended(dev))) { > + dev_dbg(dev, "system suspend"); > + ret = qcom_slim_runtime_suspend(dev); > + } > + > + /* > + * If the clock pause failed due to active channels, there is > + * a possibility that some audio stream is active during suspend. > + * (e.g. modem usecase during suspend) > + * We dont want to return suspend failure in that case so that > + * display and relevant components can still go to suspend. > + * If there is some other error, then it should prevent > + * system level suspend > + */ > + if (ret == -EISCONN) > + ret = 0; Who actually returns the EISCONN for this to catch? Or will that be added to slim_ctrl_clk_pause once support for the audio channels is added? Thanks, Charles > + > + return ret; > +} From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752495AbdKWKSf (ORCPT ); Thu, 23 Nov 2017 05:18:35 -0500 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:54026 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751375AbdKWKSd (ORCPT ); Thu, 23 Nov 2017 05:18:33 -0500 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.cirrus.com Date: Thu, 23 Nov 2017 10:17:49 +0000 From: Charles Keepax To: CC: , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v7 12/13] slimbus: qcom: Add runtime-pm support using clock-pause Message-ID: <20171123101749.ojiv6l52jjq6b55b@localhost.localdomain> References: <20171115141043.29202-1-srinivas.kandagatla@linaro.org> <20171115141043.29202-13-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20171115141043.29202-13-srinivas.kandagatla@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=4 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1711230142 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 15, 2017 at 02:10:42PM +0000, srinivas.kandagatla@linaro.org wrote: > From: Sagar Dharia > > Slimbus HW mandates that clock-pause sequence has to be executed > before disabling relevant interface and core clocks. > Runtime-PM's autosuspend feature is used here to enter/exit low > power mode for Qualcomm's Slimbus controller. Autosuspend feature > enables driver to avoid changing power-modes too frequently since > entering clock-pause is an expensive sequence > > Signed-off-by: Sagar Dharia > Signed-off-by: Srinivas Kandagatla > --- > + > +#ifdef CONFIG_PM_SLEEP > +static int qcom_slim_suspend(struct device *dev) > +{ > + int ret = 0; > + > + if (!pm_runtime_enabled(dev) || > + (!pm_runtime_suspended(dev))) { > + dev_dbg(dev, "system suspend"); > + ret = qcom_slim_runtime_suspend(dev); > + } > + > + /* > + * If the clock pause failed due to active channels, there is > + * a possibility that some audio stream is active during suspend. > + * (e.g. modem usecase during suspend) > + * We dont want to return suspend failure in that case so that > + * display and relevant components can still go to suspend. > + * If there is some other error, then it should prevent > + * system level suspend > + */ > + if (ret == -EISCONN) > + ret = 0; Who actually returns the EISCONN for this to catch? Or will that be added to slim_ctrl_clk_pause once support for the audio channels is added? Thanks, Charles > + > + return ret; > +}