Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3113774rwb; Fri, 16 Dec 2022 10:13:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXsRDl0RmZMgF7PKwZL7aQ7NC2VrGTSDTbzjLuPH3vasyALr7O9VCFRFK58FW0THu7GUkanq X-Received: by 2002:a05:6a21:358c:b0:af:c491:d4ba with SMTP id az12-20020a056a21358c00b000afc491d4bamr5040574pzc.53.1671214415725; Fri, 16 Dec 2022 10:13:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671214415; cv=none; d=google.com; s=arc-20160816; b=ZUjOAIb55fa5QGPiCFGbuWXSsxdY3Ah82IRvFcn35zsWcctdZjqkCaJGpZnwhkNKXX 482Ho7sxPWAFy6fuiCERM/4SF0wx7Nb+/DKFZu8OJp7c6AnU/5JNZGDg1YGHeFEz03GO eHUay4r9ERazK2FyYgYHp9x1FLjYPhyHlMmdFutqIIeSHbB7BGH1qtIicB6XhYtD9KJC 5+UrNEew22++i1CDgRkro+cy5jwMJp/OCAtzeRHMs3Z9FAhGPCkH7W2PWkrPhp7R9dQg dXllzNqRpFN2VJSMT2egZrqVLLqXfiLIdsDQvyDTSvtc+oHe3UPOIApTtN+Gk1UWsbF3 lPiA== 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=ntXrIWy3g7F8DOKpf/KfcLsGQUh9U4PLzvddY3yOycw=; b=0HhmIUlKEBUosFV8N75JSlBgI81xWrmVH4JFtgLVYX3D9yBQpxLYoSZTqlZFQxBJ1U 3Au0SlnCXi5bou940Y/BseP7Dt7EzVPPZALKHkWKFF6RzjUHgiS7cfJAdxdIml8cWdVp GrS92/EukvXKjuVQ1/Xt/rEDHkR6bTFzLU0AOeXvHjwZAnepsF8YasaJpPxaD1ZvMit8 EqW2fhm9e5p05etk1aneKkf8BfZpLOHsHJ8qshoP/jCq7LgdmFu0eVMYmAYJxXyVo2Jw O6V/S2k6+OBmxFJExGXcrwnh4519+ZO+llfX66/pS3dNuq/SYIuSyvVtY62YGpAAo4fa jaNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Wcg7CqR1; 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 f23-20020a63dc57000000b0046f75bc53d0si3112915pgj.241.2022.12.16.10.13.25; Fri, 16 Dec 2022 10:13:35 -0800 (PST) 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=Wcg7CqR1; 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 S231246AbiLPRD6 (ORCPT + 68 others); Fri, 16 Dec 2022 12:03:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231311AbiLPRD4 (ORCPT ); Fri, 16 Dec 2022 12:03:56 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EC0369AB6; Fri, 16 Dec 2022 09:03:55 -0800 (PST) Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BGGgdUw018661; Fri, 16 Dec 2022 17:03:34 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=ntXrIWy3g7F8DOKpf/KfcLsGQUh9U4PLzvddY3yOycw=; b=Wcg7CqR1HkySpS0RZSKx4TansrIx/aVeieFpalXOFwmx4cp2wzmt/UrigRXsX303vKg+ jqPEghsu09SB93ub1DaE+1llRGjW53OHXPiOdsn4V2UPuyj5MnvDVCgywN+U+fKZ16hl wwLX4BoQWDRD21pUbEsjTZTVSsrsXTlvrYKXYAh79P8Fq+6beINLsJlbyA/c5bdXoXZx zJvkoz9xs0G10V7DVZiksyy0N3W7SrkUEZPPze0xDL7le8/OK5LgO3AkTxMgqf2o/ZgD Sye1oWDRkWlmrbKdB39zlydhaZPuiP3W5GAHapkSEuDIXRlQBAksNGgpMXPoPJ+yaQtQ Yw== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3mgvecr33y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Dec 2022 17:03:34 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2BGH3Xv9014718 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Dec 2022 17:03:33 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.36; Fri, 16 Dec 2022 09:03:28 -0800 From: Akhil P Oommen To: freedreno , , CC: Akhil P Oommen , Abhinav Kumar , Chia-I Wu , Daniel Vetter , David Airlie , Dmitry Baryshkov , Douglas Anderson , Geert Uytterhoeven , Guenter Roeck , Konrad Dybcio , Rob Clark , Sean Paul , Subject: [PATCH] drm/msm/a6xx: Avoid gx gbit halt during rpm suspend Date: Fri, 16 Dec 2022 22:33:14 +0530 Message-ID: <20221216223253.1.Ice9c47bfeb1fddb8dc377a3491a043a3ee7fca7d@changeid> 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: nasanex01b.na.qualcomm.com (10.46.141.250) 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: _6cMaQZsCremYi6FIwuGooSqXmvm_tJ0 X-Proofpoint-ORIG-GUID: _6cMaQZsCremYi6FIwuGooSqXmvm_tJ0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-16_11,2022-12-15_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 lowpriorityscore=0 phishscore=0 mlxlogscore=999 priorityscore=1501 bulkscore=0 suspectscore=0 malwarescore=0 mlxscore=0 clxscore=1015 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212160148 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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 As per the downstream driver, gx gbif halt is required only during recovery sequence. So lets avoid it during regular rpm suspend. Signed-off-by: Akhil P Oommen --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 15 +++++++++------ drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 7 +++++++ drivers/gpu/drm/msm/adreno/a6xx_gpu.h | 1 + 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c index e033d6a67a20..870252bef23f 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c @@ -876,7 +876,8 @@ static void a6xx_gmu_rpmh_off(struct a6xx_gmu *gmu) #define GBIF_CLIENT_HALT_MASK BIT(0) #define GBIF_ARB_HALT_MASK BIT(1) -static void a6xx_bus_clear_pending_transactions(struct adreno_gpu *adreno_gpu) +static void a6xx_bus_clear_pending_transactions(struct adreno_gpu *adreno_gpu, + bool gx_off) { struct msm_gpu *gpu = &adreno_gpu->base; @@ -889,9 +890,11 @@ static void a6xx_bus_clear_pending_transactions(struct adreno_gpu *adreno_gpu) return; } - /* Halt the gx side of GBIF */ - gpu_write(gpu, REG_A6XX_RBBM_GBIF_HALT, 1); - spin_until(gpu_read(gpu, REG_A6XX_RBBM_GBIF_HALT_ACK) & 1); + if (gx_off) { + /* Halt the gx side of GBIF */ + gpu_write(gpu, REG_A6XX_RBBM_GBIF_HALT, 1); + spin_until(gpu_read(gpu, REG_A6XX_RBBM_GBIF_HALT_ACK) & 1); + } /* Halt new client requests on GBIF */ gpu_write(gpu, REG_A6XX_GBIF_HALT, GBIF_CLIENT_HALT_MASK); @@ -929,7 +932,7 @@ static void a6xx_gmu_force_off(struct a6xx_gmu *gmu) /* Halt the gmu cm3 core */ gmu_write(gmu, REG_A6XX_GMU_CM3_SYSRESET, 1); - a6xx_bus_clear_pending_transactions(adreno_gpu); + a6xx_bus_clear_pending_transactions(adreno_gpu, true); /* Reset GPU core blocks */ gpu_write(gpu, REG_A6XX_RBBM_SW_RESET_CMD, 1); @@ -1083,7 +1086,7 @@ static void a6xx_gmu_shutdown(struct a6xx_gmu *gmu) return; } - a6xx_bus_clear_pending_transactions(adreno_gpu); + a6xx_bus_clear_pending_transactions(adreno_gpu, a6xx_gpu->hung); /* tell the GMU we want to slumber */ ret = a6xx_gmu_notify_slumber(gmu); diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index e495d8e192db..cdce27adbd03 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -1270,6 +1270,12 @@ static void a6xx_recover(struct msm_gpu *gpu) if (hang_debug) a6xx_dump(gpu); + /* + * To handle recovery specific sequences during the rpm suspend we are + * about to trigger + */ + a6xx_gpu->hung = true; + /* Halt SQE first */ gpu_write(gpu, REG_A6XX_CP_SQE_CNTL, 3); @@ -1312,6 +1318,7 @@ static void a6xx_recover(struct msm_gpu *gpu) mutex_unlock(&gpu->active_lock); msm_gpu_hw_init(gpu); + a6xx_gpu->hung = false; } static const char *a6xx_uche_fault_block(struct msm_gpu *gpu, u32 mid) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.h b/drivers/gpu/drm/msm/adreno/a6xx_gpu.h index ab853f61db63..eea2e60ce3b7 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.h +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.h @@ -32,6 +32,7 @@ struct a6xx_gpu { void *llc_slice; void *htw_llc_slice; bool have_mmu500; + bool hung; }; #define to_a6xx_gpu(x) container_of(x, struct a6xx_gpu, base) -- 2.7.4