Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp527333rdf; Tue, 21 Nov 2023 08:56:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IG+PaimdgZpMetyRfm3ZxAUjc09X0JR6M7Ud3Mtm9uQJEOk5dmHqyuB6eFtPeaHTQ695ZVI X-Received: by 2002:a05:6a21:3403:b0:189:bde9:9cb0 with SMTP id yn3-20020a056a21340300b00189bde99cb0mr14500809pzb.27.1700585789604; Tue, 21 Nov 2023 08:56:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700585789; cv=none; d=google.com; s=arc-20160816; b=LRWlKZnhO9gj5gp2j3WdSSXcsW8OQtkN1LEEXxs204Pjx7lMi67gT/7GBVlCfZoX+5 XwmwrnRaOXzJ4l7vQgyqyCHxmTRIBkM2H8RykAkOzmXkRJHr6r5lia57sX0Zy1vpjRiN 8iOBxcx9CDzC7lW1FC9KMMpPPmYM2DN/nco50TLJJT0y0ggXOAxUyen0/w+29ERCKIAw CaXlrf7UVG3QK2C979dFlaC3o4mXg2yp8/tpDB/A+j01diArszpeSuSlUBX6UJulc/am ZJZpYy8OSg0wW83zHZsiu+SgPsCJYBejlK1e+CKvOqKgCNseN/FDCiBaBVIGrNFnnc+S Crgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=1u66+2pUrXFY4so+0iq9cGa0faKmswOjCToG5hrDe9o=; fh=5AyAsRoSATjZAg9KjaXNlk3jo3G7NB0HeKB83Ouz3Qw=; b=DgM71VjWq8iZPYvh+6qJTwr8ZNi9eFohjib5J4Q8zc5Dv0ep9Oomy6ReKnVRn/mE9j JEqK/a4Rehqwg8zYPepZwx9WxiQ1DCeUFHiZO+6gEyWpcj71sbrNIskAKKVSgudqWpNT S2W5MUs2X5YY7GN9/zHSaVIzEGewzRZkKhjELkT7lUsYNQGJ+7n8xgJV441b2WAe+U5D RMm2sh9V4zfQII0ZzOGa7FHTzfWTmmpI5rNMu0w3rNKd0q8YaOzchg/z7hgraoRdTrWW G2acycVZUIP2YPz0/dS4bzVFEXCzx1504aCbPaF37p6mHZi5BNIBB0UQCkBKRVC+I/7N PDXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=SQcNNBZM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id lb8-20020a17090b4a4800b002791baa4729si11198338pjb.57.2023.11.21.08.56.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 08:56:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=SQcNNBZM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 AD5E48083E59; Tue, 21 Nov 2023 08:56:10 -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 S232508AbjKUQzu (ORCPT + 99 others); Tue, 21 Nov 2023 11:55:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233592AbjKUQzl (ORCPT ); Tue, 21 Nov 2023 11:55:41 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E4B1194; Tue, 21 Nov 2023 08:55:37 -0800 (PST) Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by madras.collabora.co.uk (Postfix) with ESMTPSA id 1CE896607295; Tue, 21 Nov 2023 16:55:35 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1700585735; bh=mdGg1nddgmW59PVR/+jB1h2IWASeId6LzRHfz+nJCBE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=SQcNNBZMj0lhMZdq5kybwuucz82fO2JZBlE3rqS+k3sNJ4eYpyhOghO9QxM5aTbxT MMZGUe/IwQ/GqLlfrWmBejzlKfT+Lqfdrc8gM/48xhRhT1ouGDE5tAThvSGUYuIVp8 PB2GfrNU+9FPg90MoDPrAesDOuenQ5S4qSvpLcIjuCB8VG6OJrbvN5yw1MmK9onImx d0faVeghkmsnKUJYbdRnSjRseFejp7z05WAxR+Qiddu2Y067NUOpS38eFcjb2bGCTe 8xcuaBPqX3dQjnkEGLAcX+SPog4So8TlnK3wHPlpQqGGbxITfrtgbqORUBMIYDZ7Q+ 1Ah5AaqHiph5Q== Date: Tue, 21 Nov 2023 17:55:31 +0100 From: Boris Brezillon To: AngeloGioacchino Del Regno Cc: Krzysztof Kozlowski , 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" , Marek Szyprowski Subject: Re: [PATCH] drm/panfrost: Really power off GPU cores in panfrost_gpu_power_off() Message-ID: <20231121175531.085809f5@collabora.com> In-Reply-To: <6b7a4669-7aef-41a7-8201-c2cfe401bc43@collabora.com> 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> Organization: Collabora X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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]); Tue, 21 Nov 2023 08:56:10 -0800 (PST) On Tue, 21 Nov 2023 17:11:42 +0100 AngeloGioacchino Del Regno wrote: > Il 21/11/23 16:34, Krzysztof Kozlowski ha scritto: > > On 08/11/2023 14:20, Steven Price wrote: > >> On 02/11/2023 14:15, AngeloGioacchino Del Regno wrote: > >>> The layout of the registers {TILER,SHADER,L2}_PWROFF_LO, used to request > >>> powering off cores, is the same as the {TILER,SHADER,L2}_PWRON_LO ones: > >>> this means that in order to request poweroff of cores, we are supposed > >>> to write a bitmask of cores that should be powered off! > >>> This means that the panfrost_gpu_power_off() function has always been > >>> doing nothing. > >>> > >>> Fix powering off the GPU by writing a bitmask of the cores to poweroff > >>> to the relevant PWROFF_LO registers and then check that the transition > >>> (from ON to OFF) has finished by polling the relevant PWRTRANS_LO > >>> registers. > >>> > >>> While at it, in order to avoid code duplication, move the core mask > >>> logic from panfrost_gpu_power_on() to a new panfrost_get_core_mask() > >>> function, used in both poweron and poweroff. > >>> > >>> Fixes: f3ba91228e8e ("drm/panfrost: Add initial panfrost driver") > >>> Signed-off-by: AngeloGioacchino Del Regno > > > > > > Hi, > > > > This commit was added to next recently but it causes "external abort on > > non-linefetch" during boot of my Odroid HC1 board. > > > > At least bisect points to it. > > > > If fixed, please add: > > > > Reported-by: Krzysztof Kozlowski > > > > [ 4.861683] 8<--- cut here --- > > [ 4.863429] Unhandled fault: external abort on non-linefetch (0x1008) at 0xf0c8802c > > [ 4.871018] [f0c8802c] *pgd=433ed811, *pte=11800653, *ppte=11800453 > > ... > > [ 5.164010] panfrost_gpu_irq_handler from __handle_irq_event_percpu+0xcc/0x31c > > [ 5.171276] __handle_irq_event_percpu from handle_irq_event+0x38/0x80 > > [ 5.177765] handle_irq_event from handle_fasteoi_irq+0x9c/0x250 > > [ 5.183743] handle_fasteoi_irq from generic_handle_domain_irq+0x28/0x38 > > [ 5.190417] generic_handle_domain_irq from gic_handle_irq+0x88/0xa8 > > [ 5.196741] gic_handle_irq from generic_handle_arch_irq+0x34/0x44 > > [ 5.202893] generic_handle_arch_irq from __irq_svc+0x8c/0xd0 > > > > Full log: > > https://krzk.eu/#/builders/21/builds/4392/steps/11/logs/serial0 > > > > 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 non-linefetch access, but it might be caused by a register access after the clock or power domain driving the register bank has been disabled. The following diff might help validate this theory. If that works, we probably want to make sure we synchronize IRQs before disabling in the suspend path. --->8--- diff --git a/drivers/gpu/drm/panfrost/panfrost_regs.h b/drivers/gpu/drm/panfrost/panfrost_regs.h index 55ec807550b3..98df66e5cc9b 100644 --- a/drivers/gpu/drm/panfrost/panfrost_regs.h +++ b/drivers/gpu/drm/panfrost/panfrost_regs.h @@ -34,8 +34,6 @@ (GPU_IRQ_FAULT |\ GPU_IRQ_MULTIPLE_FAULT |\ GPU_IRQ_RESET_COMPLETED |\ - GPU_IRQ_POWER_CHANGED |\ - GPU_IRQ_POWER_CHANGED_ALL |\ GPU_IRQ_PERFCNT_SAMPLE_COMPLETED |\ GPU_IRQ_CLEAN_CACHES_COMPLETED) #define GPU_IRQ_MASK_ERROR \