Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2957826rdh; Mon, 27 Nov 2023 03:26:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IHQSDRO+CbX0c48XeA0rSc5yvgMZCpbi3xo2j91MDj+7LqXS8kQTIDxTT5zykeN8030gKhZ X-Received: by 2002:a17:902:d4c5:b0:1cf:b7ef:2b9e with SMTP id o5-20020a170902d4c500b001cfb7ef2b9emr6586002plg.3.1701084395939; Mon, 27 Nov 2023 03:26:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701084395; cv=none; d=google.com; s=arc-20160816; b=ndQGTLpj4mNdSqyHakh+Ap2NN6wXhhn6FmtSwOejf0VL6HS4352YtjN3ujU+5/Baa6 pofjpuQXQuNYhGz4Fx3P7Dea2iuKEi7Ey84O7YLInvzKfalSaHOZPySXB56XcHagD/3r 3TIYD26tYtjiC79xdxLZsvAXqYnUIbcUKJSzawFlsW75AmiKZaMXc3I0y0Gal/0P4c+K D8BC3qTMD/b7VlhNh6DVnf6VGjX79s1AHspowhwXjsbrc1+ViA6PuY6HNEZwkqGUhTek PjFQmM/ms0/3EXyTKhvCo3EdRzV3yBqNrHvIrattmS8DeJg8m8hdIHkj1AoYd/a3oMWn 9//w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :in-reply-to:cc:to:from:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature:dkim-filter; bh=RGhhL7XXl0hEOVf83TtpufSve7Y/eXk4j3SDGa7Vcog=; fh=35nY7z0fNATbR7+d53xTOT22Glt7Z58uflonZlXXqNA=; b=l154KVyCmayXnkTJM6bHIR4aIX7aF9KotkdHu8l8i9FaixbI3mc0uS6FKkCL1sJzaJ r5KtNUT0uL8XHucZFXoZAK4mHlfDoeacc/MYqTiJhCqqHSSWZIwk+2ipSJ8zvCv3I2mT GHUpAYpMB/3ocjqdtGje+VjpiUGcWfxKa1VPjAeURP1eW1m2OolE40L5+lOINuoz3zNZ E3TbY/AUdBkfOB0vGtgnqmlLAe4twqoU2JxBX5PuEPtJv0L95pczkQ2JZ4HE3JZCFJ5P 5lTNCdM99KQVcWYHaL750+6bKXvwqzFqwJbusqwK78O0jcbeCPUP02kPwNfQ/x0W9s7n I9tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=R+v8Fd1o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id v10-20020a1709029a0a00b001c60c109ce7si9076244plp.295.2023.11.27.03.26.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 03:26:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=R+v8Fd1o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id C4FB4807AC7D; Mon, 27 Nov 2023 03:25:08 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233158AbjK0LYt (ORCPT + 99 others); Mon, 27 Nov 2023 06:24:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233140AbjK0LYp (ORCPT ); Mon, 27 Nov 2023 06:24:45 -0500 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1275D10DA for ; Mon, 27 Nov 2023 03:24:33 -0800 (PST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20231127112432euoutp02151540272c4d4c73537402e656699cf8~bdyIGClcX1433014330euoutp02T for ; Mon, 27 Nov 2023 11:24:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20231127112432euoutp02151540272c4d4c73537402e656699cf8~bdyIGClcX1433014330euoutp02T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1701084272; bh=RGhhL7XXl0hEOVf83TtpufSve7Y/eXk4j3SDGa7Vcog=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=R+v8Fd1oFcKwPDC6zHd3t0YiokGd4hy/ymteKgdtsCalerrfV0XA6i7qUBQ/eLPO1 NqaKeYHINqeVdAuBD/h/Jk4sIkWpeGML4d6n+WlJFwD0FBxOXw9iNBlQAs76qHubft WDE3pEth906QGZ4ATNVY5BLGOliv1X1r4ypVSJys= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20231127112431eucas1p2302dc6bfd4747a11a64a603149d12b27~bdyHpDUWL2065920659eucas1p2b; Mon, 27 Nov 2023 11:24:31 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 51.06.09814.F6C74656; Mon, 27 Nov 2023 11:24:31 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20231127112431eucas1p2e5cfc376fc3d771cb23c50adc424ab1f~bdyHLuxpv2062420624eucas1p2b; Mon, 27 Nov 2023 11:24:31 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20231127112431eusmtrp2ea6b0ee7f72daa68de80cab944f51163~bdyHKO_tX0076800768eusmtrp2t; Mon, 27 Nov 2023 11:24:31 +0000 (GMT) X-AuditID: cbfec7f4-727ff70000002656-fe-65647c6f63ea Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 04.8D.09146.F6C74656; Mon, 27 Nov 2023 11:24:31 +0000 (GMT) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231127112430eusmtip25fcfd6652bdfe64de8db7bf2832183e1~bdyGN4nft1493714937eusmtip2H; Mon, 27 Nov 2023 11:24:30 +0000 (GMT) Message-ID: <054f6a93-8911-40bb-b677-ccdfd27d132b@samsung.com> Date: Mon, 27 Nov 2023 12:24:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] drm/panfrost: Really power off GPU cores in panfrost_gpu_power_off() Content-Language: en-US From: Marek Szyprowski To: Krzysztof Kozlowski , AngeloGioacchino Del Regno , Boris Brezillon Cc: Steven Price , tzimmermann@suse.de, linux-kernel@vger.kernel.org, mripard@kernel.org, dri-devel@lists.freedesktop.org, wenst@chromium.org, kernel@collabora.com, "linux-samsung-soc@vger.kernel.org" In-Reply-To: <37d373e1-8850-4ab2-8fdb-6b069e2d6976@samsung.com> Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrHKsWRmVeSWpSXmKPExsWy7djPc7r5NSmpBht2a1lcWilhcfrMKSaL K1/fs1lsPtfDarH39VZ2i8u75rBZzDi/j8mirXMZq0XjEaDsljcTWS1mtF1mdeD2WDNvDaPH 7Ia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Za12IDAAA= X-CMS-MailID: 20231127112431eucas1p2e5cfc376fc3d771cb23c50adc424ab1f X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20231122092952eucas1p291af9a5570a05c67014f5c871c85e98c X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20231122092952eucas1p291af9a5570a05c67014f5c871c85e98c References: <20231102141507.73481-1-angelogioacchino.delregno@collabora.com> <7928524a-b581-483b-b1a1-6ffd719ce650@arm.com> <1c9838fb-7f2d-4752-b86a-95bcf504ac2f@linaro.org> <6b7a4669-7aef-41a7-8201-c2cfe401bc43@collabora.com> <20231121175531.085809f5@collabora.com> <4c73f67e-174c-497e-85a5-cb053ce657cb@collabora.com> <39e9514b-087c-42eb-8d0e-f75dc620e954@linaro.org> <37d373e1-8850-4ab2-8fdb-6b069e2d6976@samsung.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,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 groat.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 (groat.vger.email [0.0.0.0]); Mon, 27 Nov 2023 03:25:09 -0800 (PST) On 24.11.2023 13:45, Marek Szyprowski wrote: > On 22.11.2023 10:29, Krzysztof Kozlowski wrote: >> On 22/11/2023 10:06, AngeloGioacchino Del Regno wrote: >>>>>> Hey Krzysztof, >>>>>> >>>>>> This is interesting. It might be about the cores that are missing >>>>>> from the partial >>>>>> core_mask raising interrupts, but an external abort on >>>>>> non-linefetch is strange to >>>>>> see here. >>>>> I've seen such external aborts in the past, and the fault type has >>>>> often been misleading. It's unlikely to have anything to do with a >>>> Yeah, often accessing device with power or clocks gated. >>>> >>> Except my commit does *not* gate SoC power, nor SoC clocks ???? >> It could be that something (like clocks or power supplies) was missing >> on this board/SoC, which was not critical till your patch came. >> >>> What the "Really power off ..." commit does is to ask the GPU to >>> internally power >>> off the shaders, tilers and L2, that's why I say that it is strange >>> to see that >>> kind of abort. >>> >>> The GPU_INT_CLEAR GPU_INT_STAT, GPU_FAULT_STATUS and >>> GPU_FAULT_ADDRESS_{HI/LO} >>> registers should still be accessible even with shaders, tilers and >>> cache OFF. >>> >>> Anyway, yes, synchronizing IRQs before calling the poweroff sequence >>> would also >>> work, but that'd add up quite a bit of latency on the >>> runtime_suspend() call, so >>> in this case I'd be more for avoiding to execute any register r/w in >>> the handler >>> by either checking if the GPU is supposed to be OFF, or clearing >>> interrupts, which >>> may not work if those are generated after the execution of the >>> poweroff function. >>> Or we could simply disable the irq after power_off, but that'd be >>> hacky (as well). >>> >>> >>> Let's see if asking to poweroff *everything* works: >> Worked. > > Yes, I also got into this issue some time ago, but I didn't report it > because I also had some power supply related problems on my test farm > and everything was a bit unstable. I wasn't 100% sure that the > $subject patch is responsible for the observed issues. Now, after > fixing power supply, I confirm that the issue was revealed by the > $subject patch and above mentioned change fixes the problem. Feel free > to add: > > Tested-by: Marek Szyprowski I must revoke my tested-by tag for the above fix alone. Although it fixed the boot issue and system stability issue, it looks that there is still something missing and opening the panfrost dri device causes a system crash: root@target:~# ./modetest -C trying to open device 'i915'...failed trying to open device 'amdgpu'...failed trying to open device 'radeon'...failed trying to open device 'nouveau'...failed trying to open device 'vmwgfx'...failed trying to open device 'omapdrm'...failed trying to open device 'exynos'...done root@target:~# 8<--- cut here --- Unhandled fault: external abort on non-linefetch (0x1008) at 0xf0c6803c [f0c6803c] *pgd=42d87811, *pte=11800653, *ppte=11800453 Internal error: : 1008 [#1] PREEMPT SMP ARM Modules linked in: exynos_gsc s5p_mfc s5p_jpeg v4l2_mem2mem videobuf2_dma_contig videobuf2_memops videobuf2_v4l2 videobuf2_common videodev mc s5p_cec CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.7.0-rc2-next-20231127-00055-ge14abcb527d6 #7649 Hardware name: Samsung Exynos (Flattened Device Tree) PC is at panfrost_gpu_irq_handler+0x18/0xfc LR is at __handle_irq_event_percpu+0xcc/0x31c ... Process swapper/0 (pid: 0, stack limit = 0x0e2875ff) Stack: (0xc1301e48 to 0xc1302000) ...  panfrost_gpu_irq_handler from __handle_irq_event_percpu+0xcc/0x31c  __handle_irq_event_percpu from handle_irq_event+0x38/0x80  handle_irq_event from handle_fasteoi_irq+0x9c/0x250  handle_fasteoi_irq from generic_handle_domain_irq+0x24/0x34  generic_handle_domain_irq from gic_handle_irq+0x88/0xa8  gic_handle_irq from generic_handle_arch_irq+0x34/0x44  generic_handle_arch_irq from __irq_svc+0x8c/0xd0 Exception stack(0xc1301f10 to 0xc1301f58) ...  __irq_svc from default_idle_call+0x20/0x2c4  default_idle_call from do_idle+0x244/0x2b4  do_idle from cpu_startup_entry+0x28/0x2c  cpu_startup_entry from rest_init+0xec/0x190  rest_init from arch_post_acpi_subsys_init+0x0/0x8 Code: e591300c e593402c f57ff04f e591300c (e593903c) ---[ end trace 0000000000000000 ]--- Kernel panic - not syncing: Fatal exception in interrupt CPU2: stopping It looks that the panfrost interrupts must be somehow synchronized with turning power off, what has been already discussed. Let me know if you want me to test any patch. Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland