From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E7AA606A31C for ; Mon, 30 Nov 2026 18:26:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=r/21ikw7; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=WGK93j7P DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=6R6R6zekbe23E6uKZULVLeYcvWJKjGX9GiXxnkYTUvs=; b=r/21ikw7s7TIW5dV3nAbQouIrU PX2Vgkoxtg5Qhp1lVrSGgbc/Fs5eXofkW3Q31GyLnj9rRf6xMVzdWNtcq97hpRoTSB9Z2OvM/6U/n usqSQN2OlPsKSK9hAu5irltXLU8GNdqObfBNNqnGwcJyHGOorzazKS0c5KmLMysoys+3tEfMjccBp KXvq6DC/icDrpiHtFz1XzyWLDVMcQS8U4InkUGzf/3pFItZAPLl03TDijro2G1kxQJt5N8UUJbcaY SUg0JNYe0RGDwsIOkpgsO/v9EeWHffNTaHhCLGoSVuqwjiEdA5cWH4ijbtDU76FG5qUYJGeWJcIK/ tE6wTIOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xY64n-00000005bWa-1XZI; Mon, 30 Nov 2026 18:26:09 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xY64k-00000005bVl-1m9W for linux-arm-kernel@lists.infradead.org; Mon, 30 Nov 2026 18:26:07 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4bb64ef5a14so103031515e9.1 for ; Mon, 30 Nov 2026 10:26:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796063164; x=1796667964; darn=lists.infradead.org; h=content-type:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=6R6R6zekbe23E6uKZULVLeYcvWJKjGX9GiXxnkYTUvs=; b=WGK93j7PgyKvqcAqsqD4mTeBDJfMexLBVxwnLoJfDuSOnXr67WwXamNdPEQEvbxDJW fpDlIBO17Y/lV1yJ2poCTrduC9Bh0KiHWaswB3JezoC/ksAcpkb4/WWxFOluc2IzRUSF k7x63fhph52E/luWN6vgTt1wZQaNDXFBfVoq4KmPZy1ImSAx9Ui+mb5Ueun0Chk8Un8y wY0gUG1/FMm0QEve0Njn2Twq4ch6xPXVdI74/6XtAhaTFWE9Aur0xKg05h8YTARGX5yq AzhdPVyuM7NJwyZj2qGSBzqjbxEeL6HPuYL2QVmjbXu6HOhIgKOENCmrvpsE9x6cpylE QJUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796063164; x=1796667964; h=content-type:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=6R6R6zekbe23E6uKZULVLeYcvWJKjGX9GiXxnk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DFOew5zbayc/OHPkhjD/enO16QLv3YXBPeWzoBJiO8XOB48Rz9IMr NuzfDzwJnmYNE12oJfyEaMm9qYCUuJt2aZy3kVcbMzpPn49c5j5cOdetCMRV5k95PqA1myvafjx CQKvuDn2J/pgprDg8nucVgqpvpMTu3GezFoJ+QVZFjPst54lLF85IgKZvEBgqt84PucWZm9eQy9 3TKu5ups8DQm82GXFJGN+HpFm/npv/Cf9ABNUhBqpZKiTJ+darN+WzMkirYTZOZR68VEPT+VSls 0tjWq4ut2vh7jI4BrPrM607rGLEHiTJp8kCTN793hvYF7EobvlDVOEc1gZabhLNjLsSOLAW8ZAo Qk/VOn15iymmMsJeLLa+7MPSmO09ZuUqq92XaZZFuTr7nA/uoOSuw== X-Received: by 2002:a05:600c:4e87:b0:4a7:6bc7:f778 with SMTP id 5b1f17b1804b1-4bb88938d38mr707215925e9.30.1796063164259; Mon, 30 Nov 2026 10:26:04 -0800 (PST) Received: from jernej-laptop.localnet (77-38-7-250.dynamic.telemach.net. [77.38.7.250]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6ae2dd55sm64685485f8f.30.2026.11.30.10.26.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 10:26:03 -0800 (PST) From: Jernej =?UTF-8?B?xaBrcmFiZWM=?= To: Chen-Yu Tsai , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Samuel Holland , Jiawen Liu <1298662399@qq.com> Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] drm/sun4i: layer: stop frontend programming after resume failure Date: Mon, 30 Nov 2026 19:26:02 +0100 Message-ID: In-Reply-To: References: X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261130_102606_477594_7F996F83 X-CRM114-Status: GOOD ( 23.11 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Dne nedelja, 29. november 2026 ob 14:05:07 Srednjeevropski standardni =C4= =8Das je Jiawen Liu napisal(a): > sun4i_backend_layer_atomic_update() ignores a failed > sun4i_frontend_init() and still programs the frontend through MMIO. Now > that the runtime resume callback can report clock and reset failures, > stop the update before touching the frontend. >=20 > pm_runtime_get_sync() returns 1 when the device is already active, so > only a negative result is an error. On failure it retains the usage > reference, which the existing deferred-vblank path releases when the > plane is disabled. >=20 > Fixes: dd0421f47505 ("drm/sun4i: Add a driver for the display frontend") > Signed-off-by: Jiawen Liu <1298662399@qq.com> > --- > drivers/gpu/drm/sun4i/sun4i_layer.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/= sun4i_layer.c > index cdfefbeee7b88..384e210d78503 100644 > --- a/drivers/gpu/drm/sun4i/sun4i_layer.c > +++ b/drivers/gpu/drm/sun4i/sun4i_layer.c > @@ -84,11 +84,17 @@ static void sun4i_backend_layer_atomic_update(struct = drm_plane *plane, > struct sun4i_layer *layer =3D plane_to_sun4i_layer(plane); > struct sun4i_backend *backend =3D layer->backend; > struct sun4i_frontend *frontend =3D backend->frontend; > + int ret; > =20 > sun4i_backend_cleanup_layer(backend, layer->id); > =20 > if (layer_state->uses_frontend) { > - sun4i_frontend_init(frontend); > + ret =3D sun4i_frontend_init(frontend); > + if (ret < 0) { > + dev_err(frontend->dev, "failed to resume frontend: %d\n", > + ret); > + return; > + } sun4i_backend_cleanup_layer() above has already cleared LAY_VDOEN, but returning here skips sun4i_backend_layer_enable(), so if the layer was enabled in the previous state it stays enabled and the backend starts fetching directly from whatever the layer framebuffer address registers still point at, which may be a buffer that's already been released. Please disable the layer explicitly on this path: sun4i_backend_layer_enable(backend, layer->id, false); Also, atomic_update runs on every commit, and once runtime resume has failed, subsequent pm_runtime_get_sync() calls keep failing, so this will print on every frame. Please use dev_err_ratelimited() or dev_err_once(). Side note, not for this patch: frontend runtime PM refcounting is unbalanced already (get on every update, put only once on disable), so the frontend never suspends once used. That deserves a separate fix. Best regards, Jernej > sun4i_frontend_update_coord(frontend, plane); > sun4i_frontend_update_buffer(frontend, plane); > sun4i_frontend_update_formats(frontend, plane, >=20