Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2568949ybf; Mon, 2 Mar 2020 11:15:30 -0800 (PST) X-Google-Smtp-Source: ADFU+vvG/e2Pk6CMm12znw4q1oWcacA7/+6T7F4IltpVaXBs/VhAXg9mYNHZTu4q9xAl0bzBBEJf X-Received: by 2002:a05:6830:1bda:: with SMTP id v26mr507478ota.314.1583176529996; Mon, 02 Mar 2020 11:15:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583176529; cv=none; d=google.com; s=arc-20160816; b=T1BTDnTDsf9buAGZcNSPJyFSk5ulIvnhqi50QluDhRjdxMAaps2K1Y/efFmHiru1u4 ZxwAiSXkqbO2m8PjErKqqlVG1cJ+TDwVVmwo+vTKmffr4qPzFoSCfP2urO5Se6XCFIL7 hq5psBWimwTQ943lFZS9uhP0YZ1y07e9lhWBWev3hZ9aUC02ksj7vFj4MAFJGxq6k7pd QORMbxG9X/TV8HaMlKt8Qhidg9Bob3oY1TO/qSfw7DBoXCT64ySg9JGAAZRUQzev4bVm 7etz+sYVVXvQsARzf1rVE2ALhTG7AAlLtbiB24K5DcjGjQrtJ0osr/1p5AilN3gusl6y 7nQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from; bh=UL0p4ifyovzOav8PSvXnhhP3pyXHYT1FZL+nryeukxQ=; b=bAGhGmjjNut1QpiXCEsgJCwlcIlExQxRN62mPvTh1Y1hjtYdCvIgXPlePaPZvaRjDn VgUa25lRDO/uKCw8TUbVg+rTb9Zs3NNe7TMHyZxyL3ojlp3ssu4AR1FTK/64nKKYsRAK qkX1c12QMnAd9qDpklgSVH/JmBUQUoNwrT1nTLbiw491HeTNnzFwXFGJzVpndxAdO7+Y Gm5x0XAHqTK9Skhn7CBQ7B14jUBnkRV7koIUlNksMJDBw98wvna3I51xbO05uA6zge7n fWZMnoSHolpQRy6w4nSCbga4oX+zgSswDRno6rzR7pxvc3fcVdBgHeyEsjNfzqNCbQyp E9jw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v22si3776677otq.109.2020.03.02.11.15.17; Mon, 02 Mar 2020 11:15:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727711AbgCBTNr (ORCPT + 99 others); Mon, 2 Mar 2020 14:13:47 -0500 Received: from honk.sigxcpu.org ([24.134.29.49]:50568 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727704AbgCBTNq (ORCPT ); Mon, 2 Mar 2020 14:13:46 -0500 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id 70F14FB05; Mon, 2 Mar 2020 20:13:45 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 993ETPkw1lj8; Mon, 2 Mar 2020 20:13:44 +0100 (CET) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id 9E2B84048C; Mon, 2 Mar 2020 20:13:36 +0100 (CET) From: =?UTF-8?q?Guido=20G=C3=BCnther?= To: Lucas Stach , Russell King , Christian Gmeiner , David Airlie , Daniel Vetter , etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] drm/etnaviv: Ignore MC when checking runtime suspend idleness Date: Mon, 2 Mar 2020 20:13:35 +0100 Message-Id: <54839dc5a523a63344c9b53cc4314ee96ef9d5b8.1583176306.git.agx@sigxcpu.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Without that runtime suspend is often blocked due to etnaviv_gpu_rpm_suspend() returning -EBUSY since the FE seems to trigger the MC in its idle loop. Ignoring the MC bit makes the GPU suspend as expected. This was tested on GC7000. Signed-off-by: Guido Günther --- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index 187de610b325..da24e433f82a 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1820,8 +1820,9 @@ static int etnaviv_gpu_rpm_suspend(struct device *dev) if (atomic_read(&gpu->sched.hw_rq_count)) return -EBUSY; - /* Check whether the hardware (except FE) is idle */ - mask = gpu->idle_mask & ~VIVS_HI_IDLE_STATE_FE; + /* Check whether the hardware (except FE and MC) is idle */ + mask = gpu->idle_mask & ~(VIVS_HI_IDLE_STATE_FE | + VIVS_HI_IDLE_STATE_MC); idle = gpu_read(gpu, VIVS_HI_IDLE_STATE) & mask; if (idle != mask) return -EBUSY; -- 2.23.0