From patchwork Tue Feb 14 17:31:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 57166 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3120568wrn; Tue, 14 Feb 2023 10:02:13 -0800 (PST) X-Google-Smtp-Source: AK7set+Lvh1sstA9UYjiPmQc8uxe8KyL8OMEUyukrnbon8h0LrIyCxSwXgguD37Dkg4WEeh5i3jW X-Received: by 2002:a17:906:fa0f:b0:8b1:3866:1b37 with SMTP id lo15-20020a170906fa0f00b008b138661b37mr1445575ejb.22.1676397733432; Tue, 14 Feb 2023 10:02:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676397733; cv=none; d=google.com; s=arc-20160816; b=Ii/ZhI5UGFu7UGlDWGXtWko/P0UcUMSm3yIIyWAp91MLLKsYcgIdvPijrVI4ocNHAA tSyJKGbVnwOZQaruvn1nyErJWz0ivbkVwhkn6UdjnmJjEUlD/ZiAg9lsJkS8fNkCwpm+ cZ8bLTpQIoXkPFprB+Y3RgsplvFjK15gXFgrHN7v11Ipl8IO6OyAOnSB37cm8un+Byec aarBmf2p8nr66DtIZmGCi7138LeSlvi+IEb5/OtOx1eVu5NhYCuwIXL8T5cl0vp4sIae 5lDteV8BsQGFWK2q+tdzHTQoHxmvZcMuEGyUUmZJ5JGjRpovd+sr2PRJBrT3rbrjYP0d bxVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9EA1b5UTex55XllBD6bRoH4DWPyBOS6Byl63HktcTps=; b=mMG8GgUa0eEzB5+rBwK39Kolp9B6u8baVhs89rOapImSaw/YJorVS02C8in5LeAUVF SVIkR1Deu7+3ULoN2JUkJdpvCohNFKhwvPCV6EnkQwH1WP00kjd/Wala1a/2tT+ZLIAV Gv/k3zHrW25QQj4rW5hPI4SXdy0BMjYeTcxYdFPLlDcr8JKv809k72gKtKEQ/zc9n2Hu mPLB8U///oNlr3VPRoQkwNwehO4pAcdfIMO/jy0h8buY81cOWf20wn4LwIvoftnolL3Y 5SYjxAgVL/PcF7u9XdHcuJtihTJKRQ8BpVMtGJZ1T0lKpEl3xRMwDQ0BZjxZpQDthoff GObQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="K6/tdJd6"; 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=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cq18-20020a170906d51200b00872236c2754si15945773ejc.223.2023.02.14.10.01.50; Tue, 14 Feb 2023 10:02:13 -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=@linaro.org header.s=google header.b="K6/tdJd6"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232544AbjBNRcQ (ORCPT + 99 others); Tue, 14 Feb 2023 12:32:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232050AbjBNRcM (ORCPT ); Tue, 14 Feb 2023 12:32:12 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7BB7222D7 for ; Tue, 14 Feb 2023 09:32:07 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id cq19so15759490edb.5 for ; Tue, 14 Feb 2023 09:32:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9EA1b5UTex55XllBD6bRoH4DWPyBOS6Byl63HktcTps=; b=K6/tdJd6N0v3nJ8vDPKfNTISEMq95ZGjV9FRfudOu07WSeljh+UpcF1v2zh/0MCzL3 8R0Ay0qWaJ2MBu3EHNgb57mkdTcgC/lHF6Xvnpx8xuxdlUSGsv5PYlVSzFBpblMb7A2B agJBMWrqquIOsf7Q63LXMJsQn+iwnPjkJztNMlCLQRASV1WJf+0vMkxonhYkhEYeR2K/ wg9+P5/vTLAd4RpuQv0+4k0cv2V4ckLiaw1ARY37JE/q413qnyLZx2PC8wu/hcU7Zyof kVsbNkakV80AKKTn0il1RM9dYGhoIBhIEFoH75/d0YRfW3UuVVD/GlIA7T7FZ6LKwTa6 q6ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9EA1b5UTex55XllBD6bRoH4DWPyBOS6Byl63HktcTps=; b=YL15kurEkMxmjL+yaJm5Dm/gav78j6LYriGqw3LuDGJIJvAV/ZCQ6Ps0ZdZPU38h68 VLTzJIv0FVTjy737xIhNDhnVc1EuRLStNuvHbABJu3MtQtEDa4ahAfNMGvgvh5aOlHVO 4FVc1JY8+Xt6QBkiilbq1cMLg3AyGdy0g7Nt0yQYpk1b92knEyS9/IH5xm+IY39XA8gg udRKnVjYtnbPr65bepb+ZPmWFd20McHPCGNdU5CI1t9UWzf4iiKPP7ykmDZW7YBaVcQa CU4pusqZyWsytheGT7UCJoa0fUrO0YoF15NzYjhWxoGZl3WgLJj+Yxm/INsVdCKUfxSn WdNg== X-Gm-Message-State: AO0yUKU/pGKPzpJfxbE9OVNDJUSlVJt0ioPm6gBH9HfWdUyxvTMUOnip R9eDWjC7/Xguh0OsBGOIW80W3g== X-Received: by 2002:a50:a456:0:b0:4ac:cf29:1a6a with SMTP id v22-20020a50a456000000b004accf291a6amr3517283edb.20.1676395926186; Tue, 14 Feb 2023 09:32:06 -0800 (PST) Received: from localhost.localdomain (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id w8-20020a50c448000000b0049668426aa6sm8325787edf.24.2023.02.14.09.32.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 09:32:05 -0800 (PST) From: Konrad Dybcio To: linux-arm-msm@vger.kernel.org, andersson@kernel.org, agross@kernel.org Cc: marijn.suijten@somainline.org, Konrad Dybcio , Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , Daniel Vetter , Akhil P Oommen , Chia-I Wu , Douglas Anderson , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 04/14] drm/msm/a6xx: Remove both GBIF and RBBM GBIF halt on hw init Date: Tue, 14 Feb 2023 18:31:35 +0100 Message-Id: <20230214173145.2482651-5-konrad.dybcio@linaro.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214173145.2482651-1-konrad.dybcio@linaro.org> References: <20230214173145.2482651-1-konrad.dybcio@linaro.org> MIME-Version: 1.0 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757830430166581354?= X-GMAIL-MSGID: =?utf-8?q?1757830430166581354?= Currently we're only deasserting REG_A6XX_RBBM_GBIF_HALT, but we also need REG_A6XX_GBIF_HALT to be set to 0. For GMU-equipped GPUs this is done in a6xx_bus_clear_pending_transactions(), but for the GMU-less ones we have to do it *somewhere*. Unhalting both side by side sounds like a good plan and it won't cause any issues if it's unnecessary. Also, add a memory barrier to ensure it's gone through. Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index 72bf5c9f7ff1..75cf94b03c29 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -1007,8 +1007,12 @@ static int hw_init(struct msm_gpu *gpu) } /* Clear GBIF halt in case GX domain was not collapsed */ - if (a6xx_has_gbif(adreno_gpu)) + if (a6xx_has_gbif(adreno_gpu)) { + gpu_write(gpu, REG_A6XX_GBIF_HALT, 0); gpu_write(gpu, REG_A6XX_RBBM_GBIF_HALT, 0); + /* Let's make extra sure that the GPU can access the memory.. */ + mb(); + } gpu_write(gpu, REG_A6XX_RBBM_SECVID_TSB_CNTL, 0);