Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp860285rwb; Thu, 18 Aug 2022 13:41:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR6n3WOCJ9XfUBLlGa6MLxGsSO0oe+DZ5AWOgbcmmklxKqJRhhnHlxy9+RgcuuNMPUhCB7Do X-Received: by 2002:a05:6402:f22:b0:43e:8623:d32c with SMTP id i34-20020a0564020f2200b0043e8623d32cmr3555839eda.265.1660855263541; Thu, 18 Aug 2022 13:41:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660855263; cv=none; d=google.com; s=arc-20160816; b=s0Pi0eXIYGc7D/7rbqMu9Hw+8iiXPDURryE70ACZgueCQZnXFdkXlRpLgJS6Yem6rp N7WiSV3mTTHrBEk9Ol37NkS6zelBwTH4Dmzhg7qh3/br9vPU6FFcQN4ONqgffrlN+A+U zaVuolpuJsTKpm71UblP3fVHgd/m2b0BulOHO+2Obh472+4h8FHPqfuSX7NnhVICjY3d Pq84APLmiMqbrUaNncEsi0mFA3ZoMGPK2HN1H4Ylmjsl8plRq6L780Y9IQGbgAa3SNCy z7420KuNZdMV9oNZTpXB20nTHHMEQ15Xd1cF86ytud4ZVhg2WYMxAH1rsrqrKanMcR8A 0vGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=ST6cSIm9kf1Z44mjX2XYiENe198NzsZb482/DuTvvVo=; b=t2MUh+naonlkOuiqsZBfzi99Ps1EzDNPrSn+0AZRgbibMho9vqBZL+W06l62L2Vs74 9dCO++3h4mwKKQQv6vYLBCt560rW31UJnFv+70gPkwqeitfk8QdY5J/mmkCxQ9ptoPHu ZAckveL3DAnYqvETxgRXF82wp5nM9hfSCAhkPMr02RHkYwidgkRDEG4xEVbvexCZdVim CPfStaPql9WYfDaHRFFTrmFttrnIkV+1iJiSq2Ro+jcftQGGldW5hmD6QL01oyr/GcdM FE3Ma0TzOP8K5sOJ5ailjevYyHDJKRKqNcOEAdoQe2nmVDqMRoqtVtQwLKRb4zji5lfh LgXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=fcdYhh8e; 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 ds13-20020a170907724d00b0073bd9771c65si1755819ejc.389.2022.08.18.13.40.38; Thu, 18 Aug 2022 13:41:03 -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=qcppdkim1 header.b=fcdYhh8e; 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 S1345357AbiHRUWn (ORCPT + 99 others); Thu, 18 Aug 2022 16:22:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234407AbiHRUWl (ORCPT ); Thu, 18 Aug 2022 16:22:41 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37CB7C0E47; Thu, 18 Aug 2022 13:22:41 -0700 (PDT) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27IJvsh2021734; Thu, 18 Aug 2022 20:22:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=qcppdkim1; bh=ST6cSIm9kf1Z44mjX2XYiENe198NzsZb482/DuTvvVo=; b=fcdYhh8ewSP+DJwo+WrulV3MHR2Q1zWI6D3SJOCE5Sxnr7gS+XIAGTP4d7iyhdoEUhqk nozJ3UOhXNaSTzdPeGvjYk79JF1RHcIlwwaYTHjRVMEVfhqK02LiacuPnR6+Gsizlrqb ll3ZtyeWQsN3N0HRu5MFm0aSdXESAj8M7RpqSt0f9rcP3txceFtbctbkj0WBLIK8+JnI ogH7OU8AHlCtJLdbR6UbYfDqE0JmHjX7/9JTNDmbu1QQaysudWgpMAOGkdsBRyKW9beV 7OSsnKbUf7++CWcZHcEvdSy8XgOtVHZYSvHqSoeXFESRI9DnKR+rEI2WNtbSmZX0wYAT uA== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3j1d803f55-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Aug 2022 20:22:31 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 27IKMUFd020513 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 Aug 2022 20:22:30 GMT 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, 18 Aug 2022 13:22:24 -0700 From: Akhil P Oommen To: freedreno , , , Rob Clark , Bjorn Andersson , "Dmitry Baryshkov" CC: Jordan Crouse , Matthias Kaehlcke , Jonathan Marek , Douglas Anderson , Akhil P Oommen , "Abhinav Kumar" , Chia-I Wu , "Dan Carpenter" , Daniel Vetter , "David Airlie" , Philipp Zabel , Sean Paul , Wang Qing , Subject: [PATCH v5 0/7] Improve GPU Recovery Date: Fri, 19 Aug 2022 01:52:08 +0530 Message-ID: <1660854135-1667-1-git-send-email-quic_akhilpo@quicinc.com> X-Mailer: git-send-email 2.7.4 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-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: Fh42LxGgqeV6WW-i706-XLRa_KuJWAqd X-Proofpoint-ORIG-GUID: Fh42LxGgqeV6WW-i706-XLRa_KuJWAqd X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-18_14,2022-08-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 impostorscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 lowpriorityscore=0 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208180074 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 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. This series is rebased on top of v2 version of [1] which is based on linus's master branch. [1] https://patchwork.freedesktop.org/series/106860/ Changes in v5: - Replace devm_reset_control_get_optional() with devm_reset_control_get_optional_exclusive() (Philipp) Changes in v4: - Keep active_submit lock across the suspend & resume (Rob) - Clear gpu->active_submits to silence a WARN() during runpm suspend (Rob) Changes in v3: - Use reset interface from gpucc driver to poll for cx gdsc collapse https://patchwork.freedesktop.org/series/106860/ - Use single pm refcount for all active submits Changes in v2: - Rebased on msm-next tip Akhil P Oommen (7): drm/msm: Remove unnecessary pm_runtime_get/put drm/msm: Take single rpm refcount on behalf of all submits drm/msm: Correct pm_runtime votes in recover worker drm/msm: Fix cx collapse issue during recovery drm/msm/a6xx: Ensure CX collapse during gpu recovery drm/msm/a6xx: Improve gpu recovery sequence drm/msm/a6xx: Handle GMU prepare-slumber hfi failure 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 | 43 ++++++++++++++++-- drivers/gpu/drm/msm/msm_gpu.c | 21 ++++++--- drivers/gpu/drm/msm/msm_gpu.h | 4 ++ drivers/gpu/drm/msm/msm_ringbuffer.c | 4 -- 6 files changed, 114 insertions(+), 45 deletions(-) -- 2.7.4