From patchwork Wed May 17 16:50:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 95432 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1279280vqo; Wed, 17 May 2023 09:52:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4hvirYBjyGE/2eukYlr/45fwInPwKfuhkkKgK4hC1Ee6h7IzVXsxaiEgmQKyRRjCuEXf/A X-Received: by 2002:a17:902:7295:b0:1a2:6257:36b9 with SMTP id d21-20020a170902729500b001a2625736b9mr40351654pll.31.1684342321729; Wed, 17 May 2023 09:52:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684342321; cv=none; d=google.com; s=arc-20160816; b=qxrK/zUdR8hw924gCE4BIRnSonmne5zS10LooSrUeo1UeqUynaxoiRItsYYTSvUVVJ ykIltxDVgJmUdf2JZYVEuLLYNHvjzkkEsN62Io3XJTxOK4Bt0+KU3e4fUB6f17FhiQCo 2HRbNkyR8yluUhZSYLebKLGJRfYgCHtVLPjUUJnjtS3sjUgG9gHTOm7oFZMPtWt4h9US eEdeMujIjtBhZawON6TSQE7cpVJu2cqiXlHaV8y8svtT+7g4X5a6EHbG9sZiK5IwoQ5T P9/xJvhM9DfWuDLaEVhgSTA1pDmKXD0Q1G0DH2qOBg6igUmXKtu3/lyUpR4FtobVfqPS vzCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=Xbg/GarYLH0aFj2Z0GcGyUdxXKd4AWIEjgCUU5KwNKM=; b=ipfD9gJ4vDov6dqEfAqUWhDL2jaVO3UG7GlI7B+3vWYrs98PWKA5mlSPa7xEGGTRMT KyHW4x/t3Pi3//aDY5s5JQiVjB8IafUIueReC+2lb/fIYD27ZyHT2RtqY41AxZrZTw9v 2h5qGBhDU57VCI0udtjKelwkbDIewkjzK3upw1QVXgKza3o3TrpgXxDF2EADgR4zDUrs UzLHLSI5BJk2JQjxeReMHy4augrd3L4lbiSVrRnYOzbzRvJXP/pBvJu5PfJXvd8X2JlI +o85UB4NkHlRv/eHQyjGBaHx5PYhdt0TvGQwtc5nIvZjM5jkFiUhGQFcb3RE3RXNcG4I 7nWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zMaSSOs9; 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 c16-20020a170902b69000b001aafe3f40a7si20725408pls.579.2023.05.17.09.51.49; Wed, 17 May 2023 09:52:01 -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=@linaro.org header.s=google header.b=zMaSSOs9; 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 S229763AbjEQQuj (ORCPT + 99 others); Wed, 17 May 2023 12:50:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229815AbjEQQuX (ORCPT ); Wed, 17 May 2023 12:50:23 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1778E420B for ; Wed, 17 May 2023 09:50:22 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2ac8ee9cf7aso10404921fa.2 for ; Wed, 17 May 2023 09:50:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684342220; x=1686934220; 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=Xbg/GarYLH0aFj2Z0GcGyUdxXKd4AWIEjgCUU5KwNKM=; b=zMaSSOs9zSEtB4oW2mhF2Q2/mXwdY7jTNC+h1bBoN34mmDx29JN+E/4OdpCeDpjp/v E6TrOiDrPwfFRRx/pYbm9kD7BAds9kRPwgy+6JTWZa+Z4gC9SBbo6xl/0nn4m/zUOF0U qJFfGb40qFoJL3w/GfllmK5PDlBXDSFslZJDroYHLd/dKTH2LdxIT6RIQAyEDwNFhUie /6iQmM0aqaaiKxjCUAEz8ZZOI/Qo6Iy9I6qW6rAktG+oZyibRB5RLuz6a8ccI8/H2UR7 7tuCVIld7pBvOWWlc1Y1W47Ob/psq38Gjwa8CXy5shBFgUsEETqNHWYth4ADmPTavRlX R6Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684342220; x=1686934220; 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=Xbg/GarYLH0aFj2Z0GcGyUdxXKd4AWIEjgCUU5KwNKM=; b=lpJe5Ja/aonSCY307WmYNzPvOMGp8BULthb7DY3tEvTyF78nxqZoz/z71nfrd1ultI KhbpLi3olX59xuKsmwESrp7LwqHze3owB8AE6dIW24Hofz75Xe03BC4oKXpeTdUeaqy6 smWvf0StYvvrkwJToB5PvGJTSeNXJy4ibuM7dxk1eKfLj8tK20dCAEKoQNFiV/KSNtsb yd65TEYXmiM5GmJv3Qp2y7Er+eyxWnQnRDWmC/shIrsCwR62NC8+e47vC19wd154FWRI l1vbJwVXT6l5xveC9G/Be+NRQ22aE8gm+xMiL9tafQhDRmo9Jeh2NrcTcLXz/D0E27aW bedQ== X-Gm-Message-State: AC+VfDxhSfHfTkB3gfgjaw1YCkydkmbe67KTTfSpZAUH6INmt52pknqj fdpEXKYimF/sUMrHRHQvDcFvLabUERJhjTjMbgw= X-Received: by 2002:a2e:9252:0:b0:2a7:6fee:2503 with SMTP id v18-20020a2e9252000000b002a76fee2503mr10225196ljg.14.1684342220351; Wed, 17 May 2023 09:50:20 -0700 (PDT) Received: from [192.168.1.101] (abxi58.neoplus.adsl.tpnet.pl. [83.9.2.58]) by smtp.gmail.com with ESMTPSA id g6-20020a2e9cc6000000b002af0e9abaf6sm159224ljj.131.2023.05.17.09.50.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 09:50:20 -0700 (PDT) From: Konrad Dybcio Date: Wed, 17 May 2023 18:50:11 +0200 Subject: [PATCH 4/6] drm/msm/a6xx: Improve GMU force shutdown sequence MIME-Version: 1.0 Message-Id: <20230517-topic-a7xx_prep-v1-4-7a964f2e99c2@linaro.org> References: <20230517-topic-a7xx_prep-v1-0-7a964f2e99c2@linaro.org> In-Reply-To: <20230517-topic-a7xx_prep-v1-0-7a964f2e99c2@linaro.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , Daniel Vetter Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684342212; l=999; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=tIqOHRwnY5c8M0EJh8c6iF51VO5nfDTSDxvclL4zDow=; b=ippU5bfqmqMFyeRemvIfdDfB/dEI0Dag1wtnOk8dtad5ZqSn5m9G/Fn+WuYt4/235ZmGWag1a ysNfvVb+q/HCrjjoG85N3/1nkGUPR6jMjj0y9YHWyEaawakOzT8zf10 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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=unavailable 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?1766160934343759474?= X-GMAIL-MSGID: =?utf-8?q?1766160934343759474?= The GMU force shutdown sequence involves some additional register cleanup which was not implemented previously. Do so. Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c index ea6d671e7c6c..8004b582e45f 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c @@ -930,6 +930,13 @@ static void a6xx_gmu_force_off(struct a6xx_gmu *gmu) /* Make sure there are no outstanding RPMh votes */ a6xx_gmu_rpmh_off(gmu); + /* Clear the WRITEDROPPED fields and put fence into allow mode */ + gmu_write(gmu, REG_A6XX_GMU_AHB_FENCE_STATUS_CLR, 0x7); + gmu_write(gmu, REG_A6XX_GMU_AO_AHB_FENCE_CTRL, 0); + + /* Make sure the above writes go through */ + wmb(); + /* Halt the gmu cm3 core */ gmu_write(gmu, REG_A6XX_GMU_CM3_SYSRESET, 1);