Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3909988imw; Thu, 7 Jul 2022 09:26:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sznkzwez6hiHxF707EN/a7tMkXJvIRLkCJskjL53GprW2HEqamX1tBl9Q3gyM4BNnzhgK7 X-Received: by 2002:a17:906:847a:b0:72b:1c75:1e69 with SMTP id hx26-20020a170906847a00b0072b1c751e69mr1147796ejc.153.1657211169142; Thu, 07 Jul 2022 09:26:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657211169; cv=none; d=google.com; s=arc-20160816; b=olA892Kfiz/TnI6iqMIpJvLQZkIvLQXux0pQKAI8Mam2ycOFec8j4L0uJ/7dnf6qR5 e6t5V/ngxDtv7PcJGqOEDCXBMfZMJ7I1lDqohBuV4IcVNJUgBo5axOnfiha4m1S1xXLy FBoBNRTddMHxtqf/Bbrd7S4oq5mMBoR5Quy0+HZ9E/Z2VEpeyUFiW/BRwPzl0G9bRzkU lTNsEF1Q2Nz2Cho73nYVb2wI5ttMSY9nH1IOYOjT5cFTqi7TKOOAcp0nwN6wGsUmX5as BQ+/Hrt7in5da5JtE4mJu2quo8UIHju5lGdhyPvh8u8PE3KuEICve7iYHq2Nl9odqFCe RsOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=u8C85sP+kA9Rfj5hk8tCqrLJLi5CaJT9b3HkuUJZtuY=; b=Gv5wRxDIS5S6+KufF/dFBf+Oogcg29hTb+t+2b0ZYLw/uinfVfUK8IZbaTwjAVYWeo JcCRLa+n3rhB7w4719NoF9Eqkfn4G285wSgOUIJ+ZoGCTsKsZBXq0Lo3yLaVgta+oMx+ fbChmvfxLpUd/YKlBbpcpRIGgOJXXbF10d/e+tCTVIV9UaktEWYwDquUvWxl+GAQ9PBu oBgP8ifE7q8Dd8zlFgT6kyuWyHheVn5DeRp+Jm55OH+v/tlKnGZHyLWawIJhjdAelLkS MUpOvCE/pnI1WQ7zqQ/rhD4i/CxlEeOdo2bNgJec2cW151AQlchdbuHhO75x+y23j/oY UoZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=vYAKO0qI; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm14-20020a170907948e00b007262b2de87bsi1769951ejc.839.2022.07.07.09.25.38; Thu, 07 Jul 2022 09:26:09 -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=@quicinc.com header.s=qcdkim header.b=vYAKO0qI; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236277AbiGGQOb (ORCPT + 99 others); Thu, 7 Jul 2022 12:14:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235846AbiGGQMF (ORCPT ); Thu, 7 Jul 2022 12:12:05 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24E5B4F64E; Thu, 7 Jul 2022 09:11:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1657210301; x=1688746301; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=u8C85sP+kA9Rfj5hk8tCqrLJLi5CaJT9b3HkuUJZtuY=; b=vYAKO0qIyloR3IMpUULh7IxpCF6+VhpOR2l8lRGe5Ze3UYZmi1F7gNGh XQoERYP/tp8qR630fGuckRvsE6jsHpdR5ilz4zedvRx35CNNBrjF05G3w h54nPPWHGPvbKenfrSJkQjdxdV74tlCI3/thnoEw1c+Ve66FJ+f+R7yfR o=; Received: from ironmsg07-lv.qualcomm.com ([10.47.202.151]) by alexa-out.qualcomm.com with ESMTP; 07 Jul 2022 09:11:41 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg07-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2022 09:11:40 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 7 Jul 2022 09:11:39 -0700 Received: from hyd-lnxbld559.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 7 Jul 2022 09:11:34 -0700 From: Akhil P Oommen To: freedreno , , , Rob Clark , Bjorn Andersson CC: Jordan Crouse , Douglas Anderson , Matthias Kaehlcke , Jonathan Marek , Akhil P Oommen , Abhinav Kumar , Daniel Vetter , David Airlie , Dmitry Baryshkov , Sean Paul , Subject: [PATCH 2/7] drm/msm: Correct pm_runtime votes in recover worker Date: Thu, 7 Jul 2022 21:40:57 +0530 Message-ID: <20220707213950.2.Ib07ecec3d5c17cb0e1efa6fcddaaa019ec2fb556@changeid> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1657210262-17166-1-git-send-email-quic_akhilpo@quicinc.com> References: <1657210262-17166-1-git-send-email-quic_akhilpo@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 In the scenario where there is one a single submit which is hung, gpu is power collapsed when it is retired. Because of this, by the time we call reover(), gpu state would be already clear. Fix this by correctly managing the pm runtime votes. Signed-off-by: Akhil P Oommen --- 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 eb8a666..f75ff4b 100644 --- a/drivers/gpu/drm/msm/msm_gpu.c +++ b/drivers/gpu/drm/msm/msm_gpu.c @@ -416,7 +416,6 @@ static void recover_worker(struct kthread_work *work) /* Record the crash state */ pm_runtime_get_sync(&gpu->pdev->dev); msm_gpu_crashstate_capture(gpu, submit, comm, cmd); - pm_runtime_put_sync(&gpu->pdev->dev); kfree(cmd); kfree(comm); @@ -464,6 +463,8 @@ static void recover_worker(struct kthread_work *work) } } + pm_runtime_put_sync(&gpu->pdev->dev); + mutex_unlock(&gpu->lock); msm_gpu_retire(gpu); -- 2.7.4