Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp536043pxt; Fri, 6 Aug 2021 07:55:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvtoi7Qunq++OzbTnNf46RdZvkg/QCLPv2/6RKdyl39QGR4+p3byMeCcBzYJCQ708BgRin X-Received: by 2002:a92:b108:: with SMTP id t8mr23514ilh.6.1628261744120; Fri, 06 Aug 2021 07:55:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628261744; cv=none; d=google.com; s=arc-20160816; b=mk2LUsoWHX2hL7vQT2F3Uu8VLm1yN6L1wGy4YU1A1rPE2G6ClyXiiK2IpZIcBX3OKW WSyiv/6rV+kY3PZdEFAZXqRB84zLuHAasq93lRHHrD89o9b7m4NonfTQlrbmsSee2bpn OPFRN5CIL78AaiuVfiAMAsoNiUrPUU4juYOuEh8ko6TdTwxh14P971GMW4DAh4ANw6+o SWCcyPkcT1R9VJh5OrkQw5ch2mjrQAufvS7iSWBrWUVhuoTxBAsnMQiKbPhiEFBX5Pui rllGZptAbtVVUg7Jc+n83kpWB9w9DryqXc/4RZfD6UoUcfdve9Q6uNbL0md5p51JaCdU 9Jjg== 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=ocHdEOaA2LCC7SidP87YUwV8OZW7B4dPkng9rnl4UGfCy795jlLEKRLWNb18hrmcvX XeyiYLaLYmXMZbF+cLlDcRibcS9wooVUsqwYk5gEO17k/ylzlpNSi+1Exp58peAbb1xq kljZKf8uHxMiIJRkEdKR+vgaypUQghhpK/mtPRPqlc3A085PdriVYYsnJG8izM6mqEDM r2sFyEU3k5+37pxWjItD70emAhspPHAcjdwg0LjsS5jWH8O4WBiz1R5yEq94FJacqVqx HUjlNiXhE/eSkMx05aIISUxDzYngP5Qz4tX0ZdvjHgWuVHpZzB+hqI/ri86jKGkULbas 9Zfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C+M+wamI; 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 f7si9586468ioj.68.2021.08.06.07.55.32; Fri, 06 Aug 2021 07:55:44 -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=C+M+wamI; 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 S244432AbhHFJRL (ORCPT + 99 others); Fri, 6 Aug 2021 05:17:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244398AbhHFJRF (ORCPT ); Fri, 6 Aug 2021 05:17:05 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F165C061799 for ; Fri, 6 Aug 2021 02:16:49 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id d8so10188224wrm.4 for ; Fri, 06 Aug 2021 02:16:49 -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=C+M+wamIDYBLchdf5EIbEUE8eIQaJfS6Ld5016M5g/s/yPTVB3y5mDTqOxxcK9eP0L z3z/DR9Ch2hZP9i1WpJel5qKzCUcFndM/FWQY0mIuRgCw/7S8y5FkcSa1hCvKVchrFDY 6aBHrEjtzc87Kgm6jEgYTJsfbQrKPs0gUup76RHeNhmpkynWKUEsFfuK66D95OvCxHof Nhi/ofrwV0XlWJyIB24+ounrK8+1sR2HyZFH8+cL4I4js9xTyzFJoHjEDUoaDq7F5OUd N/t8fLofeAZbTOVciTk16cd5sjxII1ZiosngcYeqDGnFXcQpPBwC4z2pAxOROfvld0oT lKYA== 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=ojea3PKOsZVQfEjZwI4wT3UnR6+g+vDX0YBT0PgumU9USEF+UuEFf99zOnmzfC9YwE rf9ztV7bP+VlfSoI6UYIHFx4Wk0X3LxUc1mwLi1AaHvxP+sitZlhKIOKcNdGr5opMUhJ he7Mp1evvozca1CbriHUaDp3yrGqtEGjXx8macyK2LdVApSxbCDQA2sy5r58cSFLmJv/ CMpifwPXSBmtltlAvKJpm34bWp60J9ZbIuFy0aI7PLQJR22eqj6Ap681uBBlALqgI0IO GiD3YvtOSxz8U1OiXoZ1vm1k8nAWpMjmfAnz43Nv1y/faLB7DXtRzuji6ge1PXoH5E/q 256g== X-Gm-Message-State: AOAM532UGUObwpXsSTFB5k8v10GbC5IfTb1vt2RG2B6bXpf7GAFq3oar SvZEj5FyYXtYDBgOw7NnzIdPGw== X-Received: by 2002:a5d:6b8f:: with SMTP id n15mr9496103wrx.103.1628241408108; Fri, 06 Aug 2021 02:16:48 -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 w3sm7811760wmi.44.2021.08.06.02.16.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 02:16:47 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Srinivas Kandagatla , stable@vger.kernel.org Subject: [PATCH 3/4] slimbus: ngd: set correct device for pm Date: Fri, 6 Aug 2021 10:16:38 +0100 Message-Id: <20210806091639.532-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210806091639.532-1-srinivas.kandagatla@linaro.org> References: <20210806091639.532-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