Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2910502iog; Mon, 27 Jun 2022 05:35:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tirWE/Z3CP6Y3TGXh9AmKwzmRMZj7LmpDY7kk+EE8gVYGmKl9KLMywmEBt1JlBLCuWMDHF X-Received: by 2002:a17:907:9606:b0:70a:e140:6329 with SMTP id gb6-20020a170907960600b0070ae1406329mr12535165ejc.471.1656333317686; Mon, 27 Jun 2022 05:35:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333317; cv=none; d=google.com; s=arc-20160816; b=y09QrsZW3WSY7jddgen3oPsVOYV969SUQbJA2l5G6+yJODRaiKHaTMYhydOWl25Luq 1sXrI3vLH2ot9C33nYUt4k5I5YkpvvWmOzUPKEdqgjY95bXmFlLYko/II3BqyDh0/B1Q RlRaxHzU3XosgV7XPZ/9yQ8Nn/wO0T4POMIvmjepXX78u1MrDX4DC6PWpIYSTZTx6ggG s4eYrUZ3YeoOU3F7woBXSjarE0jPhQRx/9ggrclbRwu1X0JCu1juvwFi3KqWWjw3GYan SNw0w/xvbCG34qS1ZY6GoTPd+K7Xx/Kvr6NKIL/kfJQ5n9CY2HN2t4AoOrSP5UBKWCsJ ty7Q== 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=UXdseqfhYw+QbxkfSJCgVIfNPlTC0qMsPCDv/iXvK90=; b=dmZx+M+wo5/Foy3XU1K3+wIetkHY4UWNqp/iqgkyBCvDWVj500EYoh86qrEaHeSeam 3u4YKT+ESzZze555U5ofzK07h8NavRNBUKPyR88rWEgW3s9TvhjA0hFa5k77/mWkCuxs ycM6sP4e8uhXmaW3FogDLkw+ku6akF605QBovt2wkw+Ce9g4Uciht8dhFKAaKTmxvdz/ Kh7REEsEq8alF5dTELMrENHPqRT7Dt/JK3M+6wnPG215mkNDjpy+vHU3VjBkqDmA5FEw aGDgWQQFznAotdmhCv43pmd9/LdhvdTTVorzOO4IuXfbvtgMKMh5f05Mt3WpfB0L+zz5 QNpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JPHn51Hp; 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 qa18-20020a170907869200b006efb71530d8si10977950ejc.859.2022.06.27.05.34.50; Mon, 27 Jun 2022 05:35:17 -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=JPHn51Hp; 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 S238363AbiF0LvA (ORCPT + 99 others); Mon, 27 Jun 2022 07:51:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238261AbiF0LsL (ORCPT ); Mon, 27 Jun 2022 07:48:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31825BE00; Mon, 27 Jun 2022 04:40:11 -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 dfw.source.kernel.org (Postfix) with ESMTPS id A7C14611BB; Mon, 27 Jun 2022 11:40:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE179C341CF; Mon, 27 Jun 2022 11:40:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656330010; bh=NiBFSxYw9p6awrk2HMjxUuocnzIhb19bIwy+ia+nCtU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JPHn51Hpk4lpYunDyAhgFi9WVmc1vTTojRmOcBmnPTuzBTy47fQwyu4k+ARRdj+Me fGjDWOrZ5YwOCy8c0WVsRXduLYASr0lodHJQyJlalNVKn1pf0mtO75g35VKGZd21hb rSM2DnTX1q1rPkK49zqWpIkKLv+MEGOrCe7UV120= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rob Clark , Akhil P Oommen , Douglas Anderson , Sasha Levin Subject: [PATCH 5.18 046/181] drm/msm: Switch ordering of runpm put vs devfreq_idle Date: Mon, 27 Jun 2022 13:20:19 +0200 Message-Id: <20220627111945.898166864@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111944.553492442@linuxfoundation.org> References: <20220627111944.553492442@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.5 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,T_SCC_BODY_TEXT_LINE 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: Rob Clark [ Upstream commit 49e477610087a02c3604061b8f3ee3a25a493987 ] In msm_devfreq_suspend() we cancel idle_work synchronously so that it doesn't run after we power of the hw or in the resume path. But this means that we want to ensure that idle_work is not scheduled *after* we no longer hold a runpm ref. So switch the ordering of pm_runtime_put() vs msm_devfreq_idle(). v2. Only move the runpm _put_autosuspend, and not the _mark_last_busy() Fixes: 9bc95570175a ("drm/msm: Devfreq tuning") Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20210927152928.831245-1-robdclark@gmail.com Reviewed-by: Akhil P Oommen Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20220608161334.2140611-1-robdclark@gmail.com Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/msm_gpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c index 58eb3e1662cb..7d27d7cee688 100644 --- a/drivers/gpu/drm/msm/msm_gpu.c +++ b/drivers/gpu/drm/msm/msm_gpu.c @@ -664,7 +664,6 @@ static void retire_submit(struct msm_gpu *gpu, struct msm_ringbuffer *ring, msm_submit_retire(submit); pm_runtime_mark_last_busy(&gpu->pdev->dev); - pm_runtime_put_autosuspend(&gpu->pdev->dev); spin_lock_irqsave(&ring->submit_lock, flags); list_del(&submit->node); @@ -678,6 +677,8 @@ static void retire_submit(struct msm_gpu *gpu, struct msm_ringbuffer *ring, msm_devfreq_idle(gpu); mutex_unlock(&gpu->active_lock); + pm_runtime_put_autosuspend(&gpu->pdev->dev); + msm_gem_submit_put(submit); } -- 2.35.1