Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1236499imw; Fri, 8 Jul 2022 23:21:28 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sCqzgHiOYeS8bEpWkzx6VHEyoF6xgua7+aqSbPWW2R/82nuT5AHiTwQwwzWxZrk87y9pAh X-Received: by 2002:a17:907:6d92:b0:726:cbdd:465e with SMTP id sb18-20020a1709076d9200b00726cbdd465emr7383407ejc.155.1657347688109; Fri, 08 Jul 2022 23:21:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657347688; cv=none; d=google.com; s=arc-20160816; b=UoffWUMzDD2VoUza2XdxPAagyZZJeFjnDxxp3PC4yc3Nyay5D4eytyNa7vTWsLmX+o 805486YhDODEtevwnGfN1KNq4a/ySWx+d3+tSWRYOOMMTE7bbjztHtagCPnibXzgMNLd UIes7WzCjf99EeKJeCl8kCXc0uGdspyAWHSGS3YvvQ7EXF2sxUdcxT/C70eYUISmJ9zS eqeSP4HYJbPP3dDOMqI5s2I1E1ZbX1MrtLTTY6a7bzwK9AN2IsqzS8rbO9cL9pJ+JXwN jbH4VNAXiACcpy6x/UOqIh7q+uQB7EZFPOw0fxhYvsyam+4iDCD8oIUcGia+TlNNgTvs rJiQ== 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=szSAz8ROfVHFgMHsQ/LOkkqGXDYJLFJ2B2IrwKUm1WM=; b=pSMFYQHHsAhbtE5qRkuxItOk/1btBIvsH3eFEf21JTbIRvBNvcIm+XCqNAeGG4zxJb WmTHB/VPKoulXULPlF3ExwpQ3JTkYnbfqrXg9ZMu1rCedwlx84x65DmLGd7EaNih0mcS DFwJb1dWOtqab4RVvQUZ+3C3D4c3+WF+s84w8dq4y7sLhgEbul+Lc9T4j0IgyvrXmXjg GE5Pl2ZXJIuN9rbUzQSxNCHLqDcZytVyRD1b6cxnYrKEmaUjuS97PF0rFBzggbJIB1VV NkxPV+9HQtDwl6ltLkgdApaLnqBCnbfvRN/eHIRQIMXj8NOc3lZHVCTmyAk/wLrm280T xWgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=kl4ISqkV; 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 d21-20020a170906345500b00722fb2281c0si906503ejb.417.2022.07.08.23.21.01; Fri, 08 Jul 2022 23:21:28 -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=kl4ISqkV; 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 S229591AbiGIGAU (ORCPT + 99 others); Sat, 9 Jul 2022 02:00:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbiGIGAS (ORCPT ); Sat, 9 Jul 2022 02:00:18 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA3FF4E86D; Fri, 8 Jul 2022 23:00:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1657346415; x=1688882415; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=szSAz8ROfVHFgMHsQ/LOkkqGXDYJLFJ2B2IrwKUm1WM=; b=kl4ISqkVRAfHJDNGz99SOegNDnREaz77+Wdf5NghsMglYlCeEJxBi3b3 QdUBEa6nGX9tJWVCb7QSJpvxkEe2Kc78wpX3A6rNVvAX5c5NzkoGKZ/gQ 8jqVOaDVZbhLcfihxzNlP9+gL6Ng8lbBIVmW99qsIghhVFSM8pCbbjXs1 0=; Received: from ironmsg09-lv.qualcomm.com ([10.47.202.153]) by alexa-out.qualcomm.com with ESMTP; 08 Jul 2022 23:00:14 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg09-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2022 23:00:13 -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; Fri, 8 Jul 2022 23:00:12 -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; Fri, 8 Jul 2022 23:00:07 -0700 From: Akhil P Oommen To: freedreno , , , Rob Clark , Bjorn Andersson CC: Jonathan Marek , Jordan Crouse , Matthias Kaehlcke , "Douglas Anderson" , Akhil P Oommen , Abhinav Kumar , Daniel Vetter , David Airlie , Dmitry Baryshkov , Sean Paul , Subject: [PATCH v2 2/7] drm/msm: Correct pm_runtime votes in recover worker Date: Sat, 9 Jul 2022 11:29:30 +0530 Message-ID: <20220709112837.v2.2.Ib07ecec3d5c17cb0e1efa6fcddaaa019ec2fb556@changeid> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1657346375-1461-1-git-send-email-quic_akhilpo@quicinc.com> References: <1657346375-1461-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 --- (no changes since v1) 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 c2bfcf3f..18c1544 100644 --- a/drivers/gpu/drm/msm/msm_gpu.c +++ b/drivers/gpu/drm/msm/msm_gpu.c @@ -394,7 +394,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); @@ -442,6 +441,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