From mboxrd@z Thu Jan 1 00:00:00 1970 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 2F5C0C5AD4C for ; Thu, 23 Nov 2023 11:57:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345164AbjKWL5O (ORCPT ); Thu, 23 Nov 2023 06:57:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345136AbjKWL5M (ORCPT ); Thu, 23 Nov 2023 06:57:12 -0500 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC42DB2 for ; Thu, 23 Nov 2023 03:57:17 -0800 (PST) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2c8790474d5so9875441fa.2 for ; Thu, 23 Nov 2023 03:57:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700740636; x=1701345436; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=PQEsbXeAYimqkmWhXRudvZkzCfXqDH0+MOnC7UUP82I=; b=S5kPbpE6bnZ6HedMQYwxCNTzFrzRbzphY8xx68iXSFIjS62Rc65LjGEpeSWg82aIba WqkoqWzgAUGssExT1gVOhX4ArFC3eaPmldi+qJXQ+evWe6flSKUognSKJDS0wS0AJL/k lPM4wE5OjGh7UnerVverIzt7JihmFx4vAVbGsl7xELq8T5CZELZWN6mXPQOcAux9MJW7 fQzO9KedRRfmWMkpliBWZ/swhtHhvsMHjG6nsuUf55SlQkOsylRRnUkwzUBzhdChP7jS nphzNvf+ey4vdCE0GW0oOx3QBIvYnwQ0Zyt4eOZc2OWD9CmI5FAGqKjy1EnmQZ6SHeGX pwxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700740636; x=1701345436; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PQEsbXeAYimqkmWhXRudvZkzCfXqDH0+MOnC7UUP82I=; b=ufpBVrnPh8WC5xmKW5BAfzjYZTwKYqCjn56cV8lJR001fY+dOeRpGBlA4ay+WtO5S9 iFu48yh8Da9EMDVV4EanVG7vAKVkEsYwidhEc2rPvfOH1axQc2nOznJgKdwyhRQljKBK W5Ujz+GVvlD0/OFv02QcbgcHQ5pzP0ZU7hBNbiQc4C5Hq30VBSd3VczhsLDIITABM+D4 Ug4NpQLIlJuKxddt2mcj6YTk3siHn89V/VUh0msJDN4l1uxU+3z9tv8y9+BS/xSgCTb9 11m2LP8v0RWHKWZUxY27tJUsUNlMeq2mfBg4jhLczlnNcz/J7ISpYYjEO7WUe1J35+wb E7cQ== X-Gm-Message-State: AOJu0YyE9CBbaR1OUsDaPkUaNQKd5N0rjI5fhoTwG+Dv7G+5GbakrwL3 IoMbfFupWw+uDh7x5Y2hzUxvew== X-Google-Smtp-Source: AGHT+IFViVby8v5iHLBcwqM38tnUJAWtGryoSaANfBVrqD/K2QUAUQ5EndZ6R2B4voMAGWSVRPpO1Q== X-Received: by 2002:a2e:8853:0:b0:2c8:721a:ec37 with SMTP id z19-20020a2e8853000000b002c8721aec37mr3610588ljj.46.1700740635816; Thu, 23 Nov 2023 03:57:15 -0800 (PST) Received: from [192.168.1.20] ([178.197.218.100]) by smtp.gmail.com with ESMTPSA id fc18-20020a05600c525200b0040472ad9a3dsm1766039wmb.14.2023.11.23.03.57.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Nov 2023 03:57:15 -0800 (PST) Message-ID: <2bd59614-49d8-4829-861e-3b95c44008df@linaro.org> Date: Thu, 23 Nov 2023 12:57:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] drm/panfrost: Ignore core_mask for poweroff and sync interrupts Content-Language: en-US To: AngeloGioacchino Del Regno , steven.price@arm.com Cc: boris.brezillon@collabora.com, robh@kernel.org, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20231123115029.68422-1-angelogioacchino.delregno@collabora.com> From: Krzysztof Kozlowski Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZo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EB5ZftdybIzpMZ5V9v45lUwmdnMrSzZVgC4jRGXzsU EViBQt2CopXtHtYfPAO5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <20231123115029.68422-1-angelogioacchino.delregno@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/11/2023 12:50, AngeloGioacchino Del Regno wrote: > Some SoCs may be equipped with a GPU containing two core groups > and this is exactly the case of Samsung's Exynos 5422 featuring > an ARM Mali-T628 MP6 GPU: the support for this GPU in Panfrost > is partial, as this driver currently supports using only one > core group and that's reflected on all parts of it, including > the power on (and power off, previously to this patch) function. > > The issue with this is that even though executing the soft reset > operation should power off all cores unconditionally, on at least > one platform we're seeing a crash that seems to be happening due > to an interrupt firing which may be because we are calling power > transition only on the first core group, leaving the second one > unchanged, or because ISR execution was pending before entering > the panfrost_gpu_power_off() function and executed after powering > off the GPU cores, or all of the above. > > Finally, solve this by introducing a new panfrost_gpu_suspend_irq() > helper function and changing the panfrost_device_suspend() flow to > 1. Mask and clear all interrupts: we don't need nor want any, as > for power_off() we are polling PWRTRANS, but we anyway don't > want GPU IRQs to fire while it is suspended/powered off; > 2. Call synchronize_irq() after that to make sure that any pending > ISR is executed before powering off the GPU Shaders/Tilers/L2 > hence avoiding unpowered registers R/W; and > 3. Ignore the core_mask and ask the GPU to poweroff both core groups > > Of course it was also necessary to add a `irq` variable to `struct > panfrost_device` as we need to get that in panfrost_gpu_power_off() > for calling synchronize_irq() on it. > > Fixes: 22aa1a209018 ("drm/panfrost: Really power off GPU cores in panfrost_gpu_power_off()") > [Regression detected on Odroid HC1, Exynos5422, Mali-T628 MP6] > Reported-by: Krzysztof Kozlowski > Signed-off-by: AngeloGioacchino Del Regno > --- > > Changes in v2: > - Fixed the commit hash of "Really power off [...]" > - Actually based on a clean next-20231121 > - Renamed "irq" to "gpu_irq" as per Boris' suggestion > - Moved the IRQ mask/clear/sync to a helper function and added > a call to that in panfrost_device.c instead of doing that in > panfrost_gpu_power_off(). > > NOTE: I didn't split 1+2 from 3 as suggested by Boris, and I'm sending > this one without waiting for feedback on my reasons for that which I > explained as a reply to v1 because the former couldn't be applied to > linux-next, and I want to unblock Krzysztof ASAP to get this tested. > This does not compile. Best regards, Krzysztof