From patchwork Sat Apr 1 11:54:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 669665 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 B16FBC77B6D for ; Sat, 1 Apr 2023 11:55:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229562AbjDALzh (ORCPT ); Sat, 1 Apr 2023 07:55:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229894AbjDALzV (ORCPT ); Sat, 1 Apr 2023 07:55:21 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DD5624AEE for ; Sat, 1 Apr 2023 04:55:09 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id x17so32258432lfu.5 for ; Sat, 01 Apr 2023 04:55:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680350109; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=TqvvserEEXfM7bfoSIgCSJ4UIeQQqPEniXobIbd6OmA=; b=MfjdIHHRqsbWEVlfHK0yGymcYsI7duJyM63jJzDNNQPTU0pcfN9iep6PvHm3ABq5dj F/dtRF4FNAA086+KXdcWwmyDia1xv8k+i+kr2LOmzkTMltgWxJJcUedkQApqV1qh27R7 X2/8+VksnkZ2CuSP+WPcBRMwX0Wsh54fhS/j30VEZwJf2UQI6Z5HCi8JEHZ7NJ74s2VH w7m6t20chxaDnJhIptbRR8sc5YK9KdXqiZl0OsD+isjFwI5F7KuK1tXja3JPNPjbYEXS 3aPLmix353GOLFIfD+oTKaZuiZTgZ75+9+XM1Qi8A2GWJBE6URjPzNLYfA/VTJl4/W6S MAfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680350109; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TqvvserEEXfM7bfoSIgCSJ4UIeQQqPEniXobIbd6OmA=; b=oF2UsmmNYDNVGklqEXZxvR9vIWyT0ekvMMa9LeRnhEMA3l7iI91pWLgNYsE89AJsRW jOd7JAMJ7ZeRJOtCHLr/4QlHEfyMn7cgL907IzuC4ypoDj42FHQg7sXlpZiWGDHMb2L7 pNW2hIIVOlAvTg8cqBxN5V3wAoV3fYAdgsDZuSuUGrE/PqI5J4hQycvMGvZ/FJg+044l +LL5GDL7OLwNt9MHVsh3kSU3mwdHW9ZTfK3WvaKzYtOMHQXpTcQD0xHsTGJnz44tzjnQ wzrLLinAfUy1Q7Pg9JTZo3qSitcVHTDHsg3xAK9It9EhqdqZxJUWA6FZd8aQ7BTdiEXn sDhw== X-Gm-Message-State: AAQBX9doU07hLLl8LxJHZsbkXIKPJh7i/V1ub1tqRoLXY9D2W8hnvs8n EeQ1FcvSC8UOA8EUai1F/oyK/g== X-Google-Smtp-Source: AKy350ZKsnq/mrUrLvubE5qPEGQ/Cxi2AShVFNWxCEZi7DwG0jehzrqC/mrcfTHsYp8T63gYlCU9lA== X-Received: by 2002:a19:c51a:0:b0:4de:3c94:da15 with SMTP id w26-20020a19c51a000000b004de3c94da15mr9296547lfe.4.1680350108727; Sat, 01 Apr 2023 04:55:08 -0700 (PDT) Received: from [192.168.1.101] (abxj225.neoplus.adsl.tpnet.pl. [83.9.3.225]) by smtp.gmail.com with ESMTPSA id w8-20020ac254a8000000b004e83f386878sm786737lfk.153.2023.04.01.04.55.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Apr 2023 04:55:08 -0700 (PDT) From: Konrad Dybcio Date: Sat, 01 Apr 2023 13:54:44 +0200 Subject: [PATCH v6 07/15] drm/msm/a6xx: Remove both GBIF and RBBM GBIF halt on hw init MIME-Version: 1.0 Message-Id: <20230223-topic-gmuwrapper-v6-7-2034115bb60c@linaro.org> References: <20230223-topic-gmuwrapper-v6-0-2034115bb60c@linaro.org> In-Reply-To: <20230223-topic-gmuwrapper-v6-0-2034115bb60c@linaro.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Bjorn Andersson , Konrad Dybcio , Akhil P Oommen Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Clark , Marijn Suijten , Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1680350084; l=1312; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=LfJKI18ku3LCGvhXVjTfawfZ9xevg/d8d9jIr1dnQAM=; b=CV/tjUnURsDiZN4KzTdlbV/FyDcpzvhj9HHJ4JsESoZynabtlFtD5aJ2O1Zi5t0SpVVptHxNEgVF xPBV/dlRBEBxymgIl8ldYKixPvQxBkelTh8mkZowc9zhAnRmgELD X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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. Reviewed-by: Dmitry Baryshkov 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 8e0345ffab81..17e314a745c3 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -1031,8 +1031,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);