Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp277737rdh; Thu, 23 Nov 2023 03:58:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IFOajwx6j+wiY2NNYdh8TZQjbXkKJCXPqbeig2egK6LlV8kNZ8RiV8RYlX4UD/H8nQTy672 X-Received: by 2002:a05:6358:6f05:b0:16d:bcb0:d3d8 with SMTP id r5-20020a0563586f0500b0016dbcb0d3d8mr6042911rwn.0.1700740718215; Thu, 23 Nov 2023 03:58:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700740718; cv=none; d=google.com; s=arc-20160816; b=GPRx80hFDTPHxD/+6wSfF8AIFcfNKEXS3oImgudEIDK88DZeFlF2Y5urapCJo5Oe+G skJK/t/2V1fnpZ0UQ9h56i++RlFHqb+uCoe/CCURBTSkHroLbJTVymYtN8GUoNYR/yth g8odsCG4SGP7iho8RsSUMTkQdRAKrjrkKKxCa1xaitQ03blhnBfulL0D7Ib07KHqt0ON uk/woligtglFJ2ttwgoFI7YKZ8Jj6M9YHHWxGNruqfyXNBECJdfue7gzSptNX5zFCxoa 2OfRFPlLZOpY2/YEYbQ9omzKfqkdAjzxnCuAo2Ua2/HFL5j9dKII6kG9S2XVu9TgC7a5 Jsxw== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Zx5SPfupEw+oAQBcrk+/uPYk7AJjADvd99DJXw77knw=; fh=5Tdim7KlUmApEm/DnopcPvuESaVbDC8Pyx+HucN5NGI=; b=genaIRDUoarCJ/oZBc/q7F5g0AbTil0h6Cnb1s+DD40fdR7uFGIXd3o4bnr/q0W3eq Q3rtiCXqp0YbVbit4l1/TRimWt91optRrXI9Oobi9lil2MAiBvMplxjqSh7/bdlHTRfS KmI+dLDtCrvoSCZ3f7zPyXywT9EG5MGzXx+4G7qJh1X33MLOiDmpu3v9dFuASWroo/1F AKyZ8ZKRaKBk95i9yNq1gE6k+109huQ1oeB+Rny+LmIsrL5I+DZ/TBcSx0wtp8H8ltIZ 82/1q2vMW1bsia5EM4vzpdoy1+nQOEmv+LyrgZ2IN0AfsmwMt9y/oGYboMOLpHPSjW+X y4Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=LIjrCro2; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id u31-20020a63471f000000b005b967ddd984si1160439pga.781.2023.11.23.03.58.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 03:58:38 -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=@collabora.com header.s=mail header.b=LIjrCro2; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id BF04582096BC; Thu, 23 Nov 2023 03:58:34 -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 S1345172AbjKWL6U (ORCPT + 99 others); Thu, 23 Nov 2023 06:58:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345199AbjKWL6Q (ORCPT ); Thu, 23 Nov 2023 06:58:16 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D83ED6E for ; Thu, 23 Nov 2023 03:58:22 -0800 (PST) Received: from [100.107.97.3] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 77D6C660739C; Thu, 23 Nov 2023 11:58:20 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1700740701; bh=NUR7NWmLJG7x3qkoi7nPz/LMqTSzR6NXYNSINLPbFko=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=LIjrCro2/jqzussd+3G5b/ksbF+N7x0hbAl/xffwiaEBVWI4oNSOStDCEdvIwSr0N PSb8YNLyCgeYEsow8ZZ4cox4a8m7dk/pYduxd+msa7nLDyxEEVe6zSj3CmVAyP0GjO G/W1HNhEsX5aUkQD8HRB8z781UdIA+xotevHOkJ4yvW4yLUKUQxFBqxdUfTR0eZnw9 cRyOTvP5+4rHFXR0M0XxX3JMcqOtfAUZ7ki5ttq+/o1tkTn5yl8ueIRLVet5/qcA7b /71XSIATnecHQW1iLGQryC+UedZ6imRZD7BX5MUsfRH9+WFiGS/sZW2Er7LIHQH+mb GIcVRCzUwovvA== Message-ID: <3eef79bd-d271-4916-b3f0-220a5ce984ba@collabora.com> Date: Thu, 23 Nov 2023 12:58:17 +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: Krzysztof Kozlowski , 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> <2bd59614-49d8-4829-861e-3b95c44008df@linaro.org> From: AngeloGioacchino Del Regno In-Reply-To: <2bd59614-49d8-4829-861e-3b95c44008df@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed 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:58:35 -0800 (PST) Il 23/11/23 12:57, Krzysztof Kozlowski ha scritto: > 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. > I really have to take a break. My brain starts failing, as I can see. Sorry.