Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp277425rdh; Thu, 23 Nov 2023 03:57:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IHw7TxjoTqthhEf22D/brmahh9Oip5uPInT+9LPTAfR5gXNmHuXJRgQUAL4dWhu2lkiLdI0 X-Received: by 2002:a05:6a20:a323:b0:18a:7498:de11 with SMTP id x35-20020a056a20a32300b0018a7498de11mr3725651pzk.4.1700740677797; Thu, 23 Nov 2023 03:57:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700740677; cv=none; d=google.com; s=arc-20160816; b=mF0NIWp0B1t4V7xLj6jj1FgQusOPWX5ZP0wKfTZXeqBLm6thFDojEpoPdctCumT8lA bTSMpJ0GumtE9CGM9xNgYhIDCHiUfqHc/2Lo2YzbLMQLf6SkrquiG+FDZEgZbweH6R/y eskWoMMfKRVEzvh6Gb/X8V5OL7uDRMZMWml4UX6BmyuZpeO0Mdbp2dVroeV7jLKRGjgb Z5GF6CC7kmXA3K8oirTTN8Mr9QmEqY0oWGSeHJ0WdPyE8+1I40+DbeqQl5icYdN6CQLX AW+pFiUk/JTvF8MTxTaEEBeplH0p9k8lGWzzHtQ1WK4l0QVTiqM8gFp8FFGuIKFgXSLU ch3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=PQEsbXeAYimqkmWhXRudvZkzCfXqDH0+MOnC7UUP82I=; fh=m9kNOpUSi/9k2oGcuYEeClLPqGDuB6asftfCqu+89os=; b=g54dUvIYkoIMbQOCnFiw7pLJBH6hfDzAqGW+2KWwMvOmgw+eNY7DRk3cCw/OmgPhPT IdVyWJ9rNDeYHLzrKBIhDrpHY0TYSLdYzA6YEaN+yGkKcGoMGCzrCQYk/9PyfweUdFBW Plm5hpiDy1kBlIzM8PAi+knK0vf+gxFK2NIW2IHjlHkhhyMtZRl4+tGVycUaqF+qrKgq qg8RM6Tq19r6TDmcmJov4KVQHTE/Sa48Db6V7f0qjQbci+8WGh/a+sPtHlH3fbsrYX0C tuUHg+5xF5VP/Qcl0eFsCVy9hYTOyUdvWiuO/LSSuwIeA/+GxjpPuAOAGqgVnQ2e8JlY xqwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S5kPbpE6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id s1-20020a056a0008c100b006cb6338dd60si1170512pfu.19.2023.11.23.03.57.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 03:57:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S5kPbpE6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 6A14982096BC; Thu, 23 Nov 2023 03:57:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345150AbjKWL5O (ORCPT + 99 others); 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-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@lin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qa+XdUEciwG/SgNyxBZepj41oVq FPSVE+Ni2tNrW/e16b8mgXNngHSnbsr6pAIXZH3qFW+4TKPMGZ2rZ6zITrMip+12jgw4mGjy 5y06JZvA02rZT2k9aa7i9dUUFggaanI09jNGbRA/ABEBAAHCwXwEGAEKACYCGwwWIQSb0H4O DFH41ZZ3t1Qbk0N9O0FimwUCYDzvagUJFF+UtgAKCRAbk0N9O0Fim9JzD/0auoGtUu4mgnna oEEpQEOjgT7l9TVuO3Qa/SeH+E0m55y5Fjpp6ZToc481za3xAcxK/BtIX5Wn1mQ6+szfrJQ6 59y2io437BeuWIRjQniSxHz1kgtFECiV30yHRgOoQlzUea7FgsnuWdstgfWi6LxstswEzxLZ Sj1EqpXYZE4uLjh6dW292sO+j4LEqPYr53hyV4I2LPmptPE9Rb9yCTAbSUlzgjiyyjuXhcwM qf3lzsm02y7Ooq+ERVKiJzlvLd9tSe4jRx6Z6LMXhB21fa5DGs/tHAcUF35hSJrvMJzPT/+u /oVmYDFZkbLlqs2XpWaVCo2jv8+iHxZZ9FL7F6AHFzqEFdqGnJQqmEApiRqH6b4jRBOgJ+cY qc+rJggwMQcJL9F+oDm3wX47nr6jIsEB5ZftdybIzpMZ5V9v45lUwmdnMrSzZVgC4jRGXzsU 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 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 23 Nov 2023 03:57:32 -0800 (PST) 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