Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1173498pxv; Fri, 16 Jul 2021 03:24:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqrfwj/Vd+5DdGYpMeE9ubk4AVdNEwgtCM+LM074ve2k8JBQElF7CyQPTorV8s5wlSWD7Y X-Received: by 2002:a5d:9d07:: with SMTP id j7mr6748046ioj.33.1626431045579; Fri, 16 Jul 2021 03:24:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626431045; cv=none; d=google.com; s=arc-20160816; b=aP03bV7d92Cgyybe07/lifyzZijpl1vuWwziCUawVC8oqozw02r0HsBvwFUeH3ydBp 5UdjVyI7G8ACjGr+nDyQ4O9OIgj+0fogpXA0/w0P6/x/O/qgBel7JAuXoF75njOHZKI0 JK9paLvO3UEfsru72OxbevGPbu+Hprum8WtdD7h7OrWsPgcHS6JUVScihUT6ay1tJF7h 96C0SEaBba/fm+yEQVRKHQkEePEujo7T0eeG7HblC9JOA4Oj+5vvCv+SYQMSznuPuKXQ EClYN/V9Yd86EKf2a/3sof4vVMrUasnYR7x5xV0qRvccbNt2rCtW0wBDUEA2LDDwVEV5 /2kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RH8cJpfI22EW3WzQFW97y0L55bfdGZoYafA5iYEI+Gs=; b=LUFobwFDnmPpBSEiPdavcs6ppCRkV5JnVb7jOuiobNA/cxJVyHLFCct6ReLe6uwL5+ r7OkTxa613DvEq+IM+Uz6BR+kwETdbtSho7hwyhH5swN9nUIuxgfU1nk4qSySxXpr9HD Vsc1+bePToh0ZenUtL33Qwg2pIE1Lx20rQtL+TZn4RkKaYwTH1Q9/+4AhdBHBi+4bkaX ignuXcv4UllICrIkef6w9Qi28mvnnro3YKw4w6D8zoAdKNkoBHa0P8v+Bf5p1og2uxDo o7lGViBg46JBfJ6vosGzFrm2ZJWKW3CLsWv4s5nX1m7/xu0Yr+5llh8aaDtxyEuQrqOj s32Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xSyYife0; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m19si11066740jav.63.2021.07.16.03.23.51; Fri, 16 Jul 2021 03:24:05 -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; dkim=pass header.i=@linaro.org header.s=google header.b=xSyYife0; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238726AbhGPKZi (ORCPT + 99 others); Fri, 16 Jul 2021 06:25:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238646AbhGPKZe (ORCPT ); Fri, 16 Jul 2021 06:25:34 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1E44C06175F for ; Fri, 16 Jul 2021 03:22:39 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id i94so11477620wri.4 for ; Fri, 16 Jul 2021 03:22:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RH8cJpfI22EW3WzQFW97y0L55bfdGZoYafA5iYEI+Gs=; b=xSyYife0tK8Wfn1AeIqVivedOLa58eDWnp2XZ/NO8MbdLNwDv2h5WY/icWPtYUorEv THnhvCJFfY7DbION+eaZnVdlFIo738ELu3z8hK8jH9RXCWUgYR+QwdMIBb8qsBjl3AID dYx6WsO6/rcNYAtbvNOFWhUB4TLof2I2fLpplYd6Z2pMjhgEBipZ1gVN6l435fPoOyTy OfLIyNn28MNMJJOT343A8thpGAzWkTSshp8RvfD3OK+6la4NtmUSs9JbNjDY9uBlRcqo wowE1Y6vWw9i+wu7Iohh1HamHfw3xUnGcc6srf/d+35Zhht1z42oazBl3f3f3voecOar Vbqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RH8cJpfI22EW3WzQFW97y0L55bfdGZoYafA5iYEI+Gs=; b=Fg3gYf9pPy/SQeGBqiL2qoM1PR/FGtQKmWZ81qrbKvpITWm3lCEDQ+Zj3veCxwpXKZ jr3MsPJ3bC5KVRm2spOylU2E9pDpI9RMoqFHXw72Ph45c+VX0ENOd9dNb/VvcLiFY/o2 AH1n2YrthR0SMtbylcJZkxeHH/qf4ntOF40U9nWbK5CoPN2+dWmvSaeq45eynCPSZSF7 dwM4w30ydnYCkXsyGuB/TtDpD+ItkcEGeEJrONPI4hEc5gH/RoOfxXPPVa0fmGpL9ZLi exQFRfqa9yBK/Qjy1sw+v+a1H/Mov3wld+z+CrtLz7rUTFWiJ3Vdb5Qqp5jnWqmqnr4N 8z1g== X-Gm-Message-State: AOAM530xsfrMHj2XQoT/gJMBmA2WicIdyN9v1yFLs1H/qq2EGk3u2XuD VB4nVRWLtz8RcpPIYG19otMaiQ== X-Received: by 2002:adf:e107:: with SMTP id t7mr11391576wrz.165.1626430958309; Fri, 16 Jul 2021 03:22:38 -0700 (PDT) Received: from srini-hackbox.lan (cpc86377-aztw32-2-0-cust226.18-1.cable.virginm.net. [92.233.226.227]) by smtp.gmail.com with ESMTPSA id g15sm7421796wmh.44.2021.07.16.03.22.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jul 2021 03:22:37 -0700 (PDT) From: Srinivas Kandagatla To: srini@kernel.org Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Srinivas Kandagatla Subject: [PATCH 3/4] slimbus: ngd: set correct device for pm Date: Fri, 16 Jul 2021 11:21:22 +0100 Message-Id: <20210716102123.26861-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210716102123.26861-1-srinivas.kandagatla@linaro.org> References: <20210716102123.26861-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For some reason we ended up using wrong device in some places for pm_runtime calls. Fix this so that NGG driver can do runtime pm correctly. Fixes: 917809e2280b ("slimbus: ngd: Add qcom SLIMBus NGD driver") Signed-off-by: Srinivas Kandagatla --- drivers/slimbus/qcom-ngd-ctrl.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index c054e83ab636..f3ee8e036372 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -618,7 +618,7 @@ static void qcom_slim_ngd_rx(struct qcom_slim_ngd_ctrl *ctrl, u8 *buf) (mc == SLIM_USR_MC_GENERIC_ACK && mt == SLIM_MSG_MT_SRC_REFERRED_USER)) { slim_msg_response(&ctrl->ctrl, &buf[4], buf[3], len - 4); - pm_runtime_mark_last_busy(ctrl->dev); + pm_runtime_mark_last_busy(ctrl->ctrl.dev); } } @@ -1257,13 +1257,14 @@ static int qcom_slim_ngd_enable(struct qcom_slim_ngd_ctrl *ctrl, bool enable) } /* controller state should be in sync with framework state */ complete(&ctrl->qmi.qmi_comp); - if (!pm_runtime_enabled(ctrl->dev) || - !pm_runtime_suspended(ctrl->dev)) - qcom_slim_ngd_runtime_resume(ctrl->dev); + if (!pm_runtime_enabled(ctrl->ctrl.dev) || + !pm_runtime_suspended(ctrl->ctrl.dev)) + qcom_slim_ngd_runtime_resume(ctrl->ctrl.dev); else - pm_runtime_resume(ctrl->dev); - pm_runtime_mark_last_busy(ctrl->dev); - pm_runtime_put(ctrl->dev); + pm_runtime_resume(ctrl->ctrl.dev); + + pm_runtime_mark_last_busy(ctrl->ctrl.dev); + pm_runtime_put(ctrl->ctrl.dev); ret = slim_register_controller(&ctrl->ctrl); if (ret) { @@ -1389,7 +1390,7 @@ static int qcom_slim_ngd_ssr_pdr_notify(struct qcom_slim_ngd_ctrl *ctrl, /* Make sure the last dma xfer is finished */ mutex_lock(&ctrl->tx_lock); if (ctrl->state != QCOM_SLIM_NGD_CTRL_DOWN) { - pm_runtime_get_noresume(ctrl->dev); + pm_runtime_get_noresume(ctrl->ctrl.dev); ctrl->state = QCOM_SLIM_NGD_CTRL_DOWN; qcom_slim_ngd_down(ctrl); qcom_slim_ngd_exit_dma(ctrl); -- 2.21.0