Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2896323pxb; Tue, 24 Aug 2021 10:05:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCPlJ6abcNxEDShOO2mn8iy4L699l6gtI5HxdaXirSmrieRHMKWkvaZQ58eFgfzlnPvgOq X-Received: by 2002:a5d:990c:: with SMTP id x12mr12453394iol.122.1629824732956; Tue, 24 Aug 2021 10:05:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629824732; cv=none; d=google.com; s=arc-20160816; b=cuCJfmzLTxGNL2fI6vx2If/R5Q8yyzS4L9mJ/EU8RBz1LmACkvhwL/HMjGKwcEmG36 C21nXSt2FcxcwNJWMRvReHAcN3JTFv2qDD1gwXwhkB2g9gUmvYbaqD48ouK7FO/wT76E OzDNAlG5eglDx6xADliQyf2bG1wBC4RHqe7IlbkusHsU6KiZM9T+BCC+r1ZGVXUxLl2u nzjfycX1oBLxrHaSxJdiFH7mAEREgagVgKeupm+lF+EYKBKECEbZA+O2RWvj0N4qt5GQ aXRq/BIQoiO2EYWC34IqsmEPfR7th7MUWixJaQkSTGAxHEEmjIwHth+N8ZtR1GwKSQ/9 b0rw== 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=udpkDqTg3+X3jEnIJXMb60xu7Lukl3jOPNQOfhQ3Mgo=; b=S3WqXKL49evz5A+wiMwDCf9hGEXAPUWY1ipK0wQL2syCGLxqh8V+joUMLTRYgbvDtl OHjt9sJFN1O8cQac0NOeQKfKRRL2S3wem7QZWCYbZY7gH3/kvDwLDVhapDusEXnQXndh Zd6xdK8p9mwd7m+/raUnl9V+si9vMeZcKUYWpEFPMNFP0K5eEnIQqPndW27qK7H7OR7j lv7krZsKDh3Apkzaca9boG/P+/c/JM+lojtyU7gs4Zn4z3ciVLrUdPpgDxDpdYfhVeSX YveVYv36Oc7CxWDjH4UeMCa9Rkdpx+btQsSbCPcSHVe1cVYY4/a/grAQPrSrJrxQslf7 wcng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="J1CBd/KO"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t39si20688435jal.96.2021.08.24.10.05.18; Tue, 24 Aug 2021 10:05:32 -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=@kernel.org header.s=k20201202 header.b="J1CBd/KO"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239071AbhHXRDZ (ORCPT + 99 others); Tue, 24 Aug 2021 13:03:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:39664 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239229AbhHXRAE (ORCPT ); Tue, 24 Aug 2021 13:00:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7CF3461527; Tue, 24 Aug 2021 16:57:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629824265; bh=r+V0A17tgxcA82XXwN7/StijCPPl5o6+3j+cTO0dLn4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J1CBd/KOoYCa5uZjs7lnJwWPLK8qDamF49jbHXjUcZJptm3f/9J+ZO3NIHQDmauWd ITa0rCQ25qFQCq6OBB0ko6OfukNpiyrUNesNqWd8ObzdZImDrjFTwT8W0PFVjBUU6I TofHb2A4RwdstpihlN6R1hnkyko7lHpgoS8EYGi58GyDzmc6FwSWwJaYon3Vnz0pPW r+nFKtmlhed1ZRXj4G4r1tSgNWCQ8orGNBCWj37ruMEpGfCtY8KrOlmxfgj0hyUmrp XcSFpjNu5mzcfINv01+4ZH8M6UDIoRtN9/qVLZWmWFbEsJ1jtJTyIQQrewujRudX/N O1vBt+FXWhrZA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Srinivas Kandagatla , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH 5.13 098/127] slimbus: ngd: set correct device for pm Date: Tue, 24 Aug 2021 12:55:38 -0400 Message-Id: <20210824165607.709387-99-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210824165607.709387-1-sashal@kernel.org> References: <20210824165607.709387-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.13.13-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.13.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.13.13-rc1 X-KernelTest-Deadline: 2021-08-26T16:55+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srinivas Kandagatla [ Upstream commit c0e38eaa8d5102c138e4f16658ea762417d42a8f ] 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 Link: https://lore.kernel.org/r/20210809082428.11236-4-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- 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.30.2