From patchwork Sat Jul 9 05:59:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akhil P Oommen X-Patchwork-Id: 12912095 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2165AC43334 for ; Sat, 9 Jul 2022 06:00:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229561AbiGIGAF (ORCPT ); Sat, 9 Jul 2022 02:00:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbiGIGAF (ORCPT ); Sat, 9 Jul 2022 02:00:05 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DED474E86C; Fri, 8 Jul 2022 23:00:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1657346403; x=1688882403; h=from:to:cc:subject:date:message-id:mime-version; bh=cG91PKDYaCd256B46xmBvw0NNT7YMphG4vcv7jLZDuE=; b=g0k77lRO3euhfoiegYjMqUQ4HFPAJGowJwQJXAoSlxR/EaCVXjsn+JSm gWFrmA7YM74pHshRwV96mjmpK5drlUA8EIMadG/MwuxbCMtZAFsN095D6 GUP6arIGxtj3/J6R7dgly/hCHDfu4x8NflB/BN9OvUSnBfOLDUH4GbCav M=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-02.qualcomm.com with ESMTP; 08 Jul 2022 23:00:03 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2022 23:00:02 -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:01 -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 22:59:54 -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 , Andy Gross , Chia-I Wu , =?utf-8?q?Christian_K=C3=B6nig?= , Daniel Vetter , David Airlie , Dmitry Baryshkov , "Geert Uytterhoeven" , Konrad Dybcio , Krzysztof Kozlowski , Rob Herring , "Sean Paul" , Stephen Boyd , Wang Qing , , Subject: [PATCH v2 0/7] Improve GPU Recovery Date: Sat, 9 Jul 2022 11:29:28 +0530 Message-ID: <1657346375-1461-1-git-send-email-quic_akhilpo@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 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) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Recently, I debugged a few device crashes which occured during recovery after a hangcheck timeout. It looks like there are a few things we can do to improve our chance at a successful gpu recovery. First one is to ensure that CX GDSC collapses which clears the internal states in gpu's CX domain. First 5 patches tries to handle this. Rest of the patches are to ensure that few internal blocks like CP, GMU and GBIF are halted properly before proceeding for a snapshot followed by recovery. Also, handle 'prepare slumber' hfi failure correctly. These are A6x specific improvements. Changes in v2: - Rebased on msm-next tip Akhil P Oommen (7): drm/msm: Remove unnecessary pm_runtime_get/put drm/msm: Correct pm_runtime votes in recover worker drm/msm: Fix cx collapse issue during recovery drm/msm: Ensure cx gdsc collapse during recovery arm64: dts: qcom: sc7280: Update gpu register list drm/msm/a6xx: Improve gpu recovery sequence drm/msm/a6xx: Handle GMU prepare-slumber hfi failure arch/arm64/boot/dts/qcom/sc7280.dtsi | 6 ++- drivers/gpu/drm/msm/adreno/a6xx.xml.h | 4 ++ drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 83 ++++++++++++++++++++++------------- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 36 +++++++++++++-- drivers/gpu/drm/msm/msm_gpu.c | 9 ++-- drivers/gpu/drm/msm/msm_gpu.h | 1 + drivers/gpu/drm/msm/msm_ringbuffer.c | 4 -- 7 files changed, 100 insertions(+), 43 deletions(-)