Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3949065ioa; Tue, 26 Apr 2022 13:09:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYTRX1CfK8s3iuOrkTDlHXtET6IsPsBZuO21mcPEbCcCP9TuhDrxsLHMc1ZQXhVq3Ygzq7 X-Received: by 2002:a05:6402:1941:b0:413:2555:53e3 with SMTP id f1-20020a056402194100b00413255553e3mr26393979edz.164.1651003799356; Tue, 26 Apr 2022 13:09:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651003799; cv=none; d=google.com; s=arc-20160816; b=gzLAkDD1VScgvUBCm9blZkd/Y3LYe8NUQasu0yPrOdlTssfi4JsI2OkY7JwfvkIjeq uOp/7QV1zAjYQPIDelmcQC9+1piFqzB4W7jrVjAdRE1O33jC9vBGHmboGWTq/3PIQCtD yYNZEjzzq/m3zdrKYyFG5rvEV61f4WTFcQ2WbZamPavPumRmmPROLmeQbEQCXIm7BTww +Y6lpG3gTD7gO3BWazeVdA/LxfgukW2jXdnwFQMA+dwqcNafM3hfv4aRn0QQkbyhfLf0 neifG2aDlXkgzU4n4L/rsladP6rWQAmmejgs/6aoc9AVnvQNO7y5DUczAiPp6PoiP1aT BKug== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qIyG8JAYR7e50q71382GTYJNsojkXO+f2hgAaKtZWOc=; b=oKDl6GdS3Q0JahUGicjT+nXbIOl7pWHZoXHTFXidctSo9lSoB5peRMjnW06Dz5ey5i NdpdLfJN+8+uw0YWP4z+DrXxhbExOQPvXqtT19h+Y1IISI5u71f06J/GjvLOKcLad8FA HihEejUFgwPjsA4PlTi7vlVaJlhJtrzBpEpMHNOdYrxfLOWD0K7TMzJMnBHwKCvpFIpr 0mZV7648GjcfkWlko3itaJ5jlEE4G3vb/d7/IZ2CboJB/G+vtwkcxx4hfzIDw63bSKVd yBhwKAS7WPnrKRZZ8gBsUWtxAc11F2VAEORyusOtblIvIp4sMI6e13t8qaWBe0MeqALP mT7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yll4TiK4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 26-20020a17090602da00b006e8c4151894si15931072ejk.753.2022.04.26.13.09.33; Tue, 26 Apr 2022 13:09:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yll4TiK4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346124AbiDZJNC (ORCPT + 99 others); Tue, 26 Apr 2022 05:13:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347568AbiDZIvp (ORCPT ); Tue, 26 Apr 2022 04:51:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1997E140B4; Tue, 26 Apr 2022 01:40:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9D7E3B81D09; Tue, 26 Apr 2022 08:40:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C557EC385AC; Tue, 26 Apr 2022 08:40:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650962428; bh=5cNMDaIEYZzeu4vkFN9gxIy78NnoWPCduzJNsD4hMWs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yll4TiK4rk8dP3Zofs97fu+UHSaY+/Iu7OKCCT1RfZBiaK+AjkDwcYhY/GlovRLIy 5iKAhMA1ZdJOYVMDgNXsSQ5gFw2/XESc6HsfAOT7tsWFX7gCd4W86NsXR8h9YEBaSO 1gPYYCnsWkNdk4bF8Xw1ox3VupXVYPb/Luo0O+8Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Maxime Ripard , Sasha Levin Subject: [PATCH 5.15 094/124] drm/vc4: Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() usage Date: Tue, 26 Apr 2022 10:21:35 +0200 Message-Id: <20220426081749.971585561@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220426081747.286685339@linuxfoundation.org> References: <20220426081747.286685339@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miaoqian Lin [ Upstream commit 3d0b93d92a2790337aa9d18cb332d02356a24126 ] If the device is already in a runtime PM enabled state pm_runtime_get_sync() will return 1. Also, we need to call pm_runtime_put_noidle() when pm_runtime_get_sync() fails, so use pm_runtime_resume_and_get() instead. this function will handle this. Fixes: 4078f5757144 ("drm/vc4: Add DSI driver") Signed-off-by: Miaoqian Lin Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220420135008.2757-1-linmq006@gmail.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/vc4/vc4_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c index d09c1ea60c04..ca8506316660 100644 --- a/drivers/gpu/drm/vc4/vc4_dsi.c +++ b/drivers/gpu/drm/vc4/vc4_dsi.c @@ -846,7 +846,7 @@ static void vc4_dsi_encoder_enable(struct drm_encoder *encoder) unsigned long phy_clock; int ret; - ret = pm_runtime_get_sync(dev); + ret = pm_runtime_resume_and_get(dev); if (ret) { DRM_ERROR("Failed to runtime PM enable on DSI%d\n", dsi->variant->port); return; -- 2.35.1