Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp2485144pxt; Mon, 9 Aug 2021 01:28:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+XDpwIiTBKyeiDmLT0hM9Jkztur6nWl/dd2KJNcoa7CKs05nprPOzoBybNXdLXwzMlqX7 X-Received: by 2002:a05:6402:30b6:: with SMTP id df22mr998818edb.375.1628497723883; Mon, 09 Aug 2021 01:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628497723; cv=none; d=google.com; s=arc-20160816; b=TIzzyM9lGGIMDcIZ9YPZ/Mg47+d/G58x36bhZupyD9QlK3YxmBwDdZ2fm4zuvyRN/9 2F7RYPnXKuiebbrG8u9of0QUsYut554hNTKMAt3NtKAgW1wG8iNaPLzyD9xlcuOWQ+Lx 6AftN1CedfOkuQKIkBPsNUjTGUoYHMEw4nh7rNS6FN0X9Dr/TyTNcPPLWLz0ROy30Vjm BZWUlfELU9nVgZUd/sgZBxPRPayqeYE79bGbcLUMt2lbK2cz432luPV8PPxJlSg+gmsX fcEuI5OoUO3Q0CL/UIuj8xJ5MQYdWSsw0rHrQQ1yr/elKsuN/Mw2QrbKyxd+mTZeM8hq +GLw== 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=MMllCfmYFnjcwZk6yJ9SVZujM0OJeGztI30MGIz0Avw=; b=SBWYcmNOaa07Fu/2VHTTHfMItZE5QeMq/xvMWU28pFB3UH0P9yDzQT1xmQ6GkigYkc i+Xf1eMFoiZnW3pb3lNhtVxBqWSYIow2VrifpLA+OSa5f9ESzc/1HcOxMac0v6xk2kDU 8/qOE1Lr8nr7IOGP2jAMrR7hxt01wrkvsYCdziSnEySVlkwvww0FppuxbwgWx9lHTC40 0WXKxaJo9k8mbetJ2X6xMM9trYpwL/Uf7sxclTdMjPa0DYWrCaVReGRx1k1+HjAAajsA olIzUCLr/MQU3H5EAvfFb7kG7Eu5mlnpe/6mvqXAiKVxVeF6Vrruzgdkc0T3fMrKbM8u iBOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hN2Aw1lF; 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 e11si15823689edy.255.2021.08.09.01.28.20; Mon, 09 Aug 2021 01:28:43 -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=hN2Aw1lF; 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 S233973AbhHIIZJ (ORCPT + 99 others); Mon, 9 Aug 2021 04:25:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233958AbhHIIZE (ORCPT ); Mon, 9 Aug 2021 04:25:04 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08798C061796 for ; Mon, 9 Aug 2021 01:24:44 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id k5-20020a05600c1c85b02902e699a4d20cso292803wms.2 for ; Mon, 09 Aug 2021 01:24:43 -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=MMllCfmYFnjcwZk6yJ9SVZujM0OJeGztI30MGIz0Avw=; b=hN2Aw1lF5hQbakvLyby19k7M45wABivNCeDHhtq1VuNjrwu0cjHqIf1XiVB07lWqgI BdmDpWx+vR46Zx46h/GvjbciWePm5uSPWTxvOzYzTK+4WOcEBm4DHFRcyXLuJRF2JXmJ ee8Mhr3YE2I8fF8SDBt8sd/oHh40NnxpJDhZh+gizS3RqiWJyofoL3VKI+bSFSf238Jf ihB4xp2do2OSoylH9VOKIMF27FfvoyTjAy77F6s7nUX4UiaLwfR0RFKfDxKQQaD6vKfe yfvxmctk3s4wpQKHci/Q9uEN/cQHtGXmj2o5WgbDNA5WH+7dm4EZLC4bnuRqvgnrGyEB JQZA== 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=MMllCfmYFnjcwZk6yJ9SVZujM0OJeGztI30MGIz0Avw=; b=MtiJXR+tx+hS2+q6P0ZzLYOXcOv9a4Dg9gyc0uAZYQ05ngf2kHFHWc5TthxMRfroqm lfK4O0GEZ2751kNNtjPfQHmfF+Ud9QylSZT3Ay+I2kUVN6dkKXjgEaI4mi4/WPCkBpCM fvK+1ionJbyDhZbPzgWfRN7A/JvpNyu5M3/hKF4052CrXMpS+obplFhzs+BIgE0ljx2w xJd3pc0BDbMak4YWJEReQmvLTk7Mu767t1YLYC6vcENTfeI4lV94EP0ahs3tXlpb697J jXl7RE4OyxPEmPHS/NavEVRl1F/8erdTVyYUjtgAqtSToo8PDwV1It9/2fq1giSwKSLU WSGQ== X-Gm-Message-State: AOAM532RRJtiLMokAd43ZYOlKsozvkb0oy2MHpyaaGfgKdRWWQXB5qH7 dS5sQnOOWv6eleLiBHaNPPbTlQ== X-Received: by 2002:a7b:c114:: with SMTP id w20mr15727927wmi.85.1628497482667; Mon, 09 Aug 2021 01:24:42 -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 t15sm18036371wrw.48.2021.08.09.01.24.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 01:24:42 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Srinivas Kandagatla , stable@vger.kernel.org Subject: [RESEND PATCH 3/4] slimbus: ngd: set correct device for pm Date: Mon, 9 Aug 2021 09:24:27 +0100 Message-Id: <20210809082428.11236-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210809082428.11236-1-srinivas.kandagatla@linaro.org> References: <20210809082428.11236-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") Cc: 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