From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6676C3845AE for ; Tue, 21 Apr 2026 09:11:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776762695; cv=none; b=Akus/WgMd8/yabLqwasQi7Pi7v+RbVSfd38a5kMrMJ5+mSquwRc727GopySnoFJKtLKtLAJp95tKS3BUt/kw1Zb6AJu45yLwBiZVD0E0hYSJMUndzZbNSGvQIw/OcC4RqXjEFWqeFV16JOgzmIvYq1DvPNg2zkt/A0WR0/fB1Jo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776762695; c=relaxed/simple; bh=niz+CPjCc0QKcD0G2DUKyllqyoOHdqsDE1K7p92a4fc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=KThM+QrYFVaBXwdz6Mu+sU9c3ozy8nl2MvOqqyRJN51wW1u9Uz+ikFIn6l7Efy5W5+UyWHIbFumyUC2Cl46YGA0EiDcfJ4AztXtuUtS2vnvnu3v3e/SAG4qSzBWfAPZMXY/6oiALzKA2WT6j6denzTSpUithfZ2G/iQyWRsdi24= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=OCwOAE5o; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="OCwOAE5o" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-488b0046078so36823995e9.1 for ; Tue, 21 Apr 2026 02:11:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1776762690; x=1777367490; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=yNfuWJu37z+/2le7LSB6+FRY2Cw1Ca4xlFzZNv69CQ0=; b=OCwOAE5oIKtlyrHktEbpB04ZSgNqb5gN4eEuIFbLXw1n+R6RDsGmQFfBUDppZ7Tsd3 WSgIuVT4tPZcSztTTD8YUuNF8nIa7qX6tMs/qfMtRCCcqPP+N9QgZdpWTMmTwlCKeC6k O4envsWZ7PTZFpn3IswT3AZp8XPdHlxXbI2vOBsELZHId3Tos76jGfXJc4bggT2OQ4oR +w2yMSz+I8LAG4dApG84QJxXw9MVUOz6Du4MCSNpIT4KeesgiA1ooxdH4C8GJJTgpIyN KNaZ/mkQr6qC0zCvLmK4YwIgBzbSplZH0Spp30ofF3ESwbXKkkR5co0RKiMmj2VJhVXt JnMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776762690; x=1777367490; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yNfuWJu37z+/2le7LSB6+FRY2Cw1Ca4xlFzZNv69CQ0=; b=DLxDWB1RvlirZ6SkwHMx556QzKRitdphNpemdFZXk7sUcAoWKhMUn07B7P8sHj8ZeR fcgV2PRw6gR8nOMuSnvJNULJWXxwdcZ3DqGhA+8FKaR+bC/MdA6YhyLRaHB0aR+BXyZh xYxJAbHG4wn8OU7TtqbjlYHItejZi043ZIloazubmA4mxBTqrTeX3KwA99VDqrZSjLq8 Q0LDWUeeT7jImagQMHRfNSviiHWSoPYdKhrg1gvWC3MjOZpNetr7hZuCuGX25oxR45H1 Xw9YcGpYQGkfj81osJY0sTIfYplQTEn59zFDK79S0wOCjFV4aIjcy4a2uAdHM3hsvCwU DHCg== X-Forwarded-Encrypted: i=1; AFNElJ+REEsFm3Cy50/fgkiZX73vOZKmrVDoIbCgRHVoOX4ivt5Sz9p8kMjYEwQPRYV+I+wtOgTjhbPJKPXPo2Y=@vger.kernel.org X-Gm-Message-State: AOJu0Yx2+jWcSEqo8eMADTTPzDiMIW+YPkHQA5nPUEyP+rytQRQ3e1ul eFSfdtyU24Ku69QaRA0IaPonmGLzaFpjPGV2yykHvmZzer4WL1rECmVvF5wPkgekfT0= X-Gm-Gg: AeBDievTNvTu5/98JAKvFEfnxKTK+gUwQsGEb2s0GCCZkbDHZvCc89BPe926rMelf/C Fa+dOJeKzgPTQ09OKVrpapjjiLla4+X4qAaILdkdgY+NYbabgZR52Z+RAnLsqVNCV+a2SejoB9J y4V0JrLMTSiXjNrXBgCUbPqf1mgCxRbzBkjigMu8GA8xqfuCFcydkPqCUU1epcrrWPmELt7etqk WikUpYZpY81ywmafAyuvFuAb7Ob897qtmV423yi3rjjq7rpka1ICOWc73oJW32lqu13Vcy9ZvPj XMdK+PCjbzCQF8AhA+/AAWDloms7tCXqidke3wK/swzMS7J92iv4bWDKbdLbqWHiqh97WGkKlc5 p76oKEoHViFpc1Dxtftj6v0QaOeAUzLrWoy/Q5at8sLLMfHyvw34BiV1zdJhW3LxgesFh2w3Q/S pJas2pM7oz1OxkWGdmoa5aOEFbPOYYvlBTCXidNYiHYw== X-Received: by 2002:a05:600c:498a:b0:489:ad:7b5b with SMTP id 5b1f17b1804b1-48900ad7b76mr107952685e9.24.1776762690040; Tue, 21 Apr 2026 02:11:30 -0700 (PDT) Received: from [192.168.50.4] ([82.78.167.162]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a55b8baaesm55126775e9.10.2026.04.21.02.11.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Apr 2026 02:11:29 -0700 (PDT) Message-ID: <9523bd97-2730-4b99-b3d0-6accc7622478@tuxon.dev> Date: Tue, 21 Apr 2026 12:11:28 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] drm: renesas: rz-du: Add support for RZ/G3L LVDS encoder To: Dmitry Baryshkov , Biju Cc: Biju Das , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Philipp Zabel , Geert Uytterhoeven , Magnus Damm , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, Prabhakar Mahadev Lad , Tommaso Merciai References: <20260417175235.224809-1-biju.das.jz@bp.renesas.com> <20260417175235.224809-4-biju.das.jz@bp.renesas.com> Content-Language: en-US From: Claudiu Beznea In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, On 4/19/26 18:58, Dmitry Baryshkov wrote: > On Fri, Apr 17, 2026 at 06:52:30PM +0100, Biju wrote: >> From: Biju Das >> >> Add support for the RZ/G3L LVDS encoder driver. It operates in single-link >> mode with 4 lanes (Data) + 1 lane (Clock) and supports pixel clock rates >> from 25 to 87 MHz. The LVDS module cannot be used at the same time as >> MIPI-DSI. However, LVDS and the DSI interface share a peripheral clock and >> the MIPI_DSI_PRESET_N reset signal. Also, the MIPI_DSI_CMN_RSTB and >> MIPI_DSI_ARESET_N reset signals must be asserted before using the LVDS >> module. >> >> Signed-off-by: Tommaso Merciai >> Signed-off-by: Biju Das >> --- [ ...] >> +/* ----------------------------------------------------------------------------- >> + * Bridge >> + */ >> +static void rzg3l_lvds_atomic_enable(struct drm_bridge *bridge, >> + struct drm_atomic_state *state) >> +{ >> + struct rzg3l_lvds *lvds = bridge_to_rzg3l_lvds(bridge); >> + const struct drm_bridge_state *bridge_state; >> + int ret; >> + u32 fmt; >> + >> + /* Get the LVDS format from the bridge state. */ >> + bridge_state = drm_atomic_get_new_bridge_state(state, bridge); >> + if (!bridge_state) { >> + dev_err(lvds->dev, "failed to get bridge state\n"); >> + return; >> + } >> + >> + switch (bridge_state->output_bus_cfg.format) { >> + case MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA: >> + fmt = RZG3L_LVDS_MODE_JEIDA; >> + break; >> + case MEDIA_BUS_FMT_RGB888_1X7X4_SPWG: >> + fmt = RZG3L_LVDS_MODE_VESA; >> + break; >> + default: >> + fmt = RZG3L_LVDS_MODE_VESA; >> + dev_warn(lvds->dev, "Unsupported bus fmt 0x%04x\n", >> + bridge_state->output_bus_cfg.format); >> + break; >> + } >> + >> + ret = pm_runtime_resume_and_get(lvds->dev); > > If this fails for any reason, the atomic_disable() would still be > called and it will decrement the counter, potentially undeflowing it. > Consider switching to pm_runtime_get_sync(), which suits better here. AFAIK, the clocks of this HW blocks have MSTOP functionality. HW manual of RZ/G3S [1] (should be the same for RZ/G3L as well) mentions the following in the chapter 41.2.1. "If the master accesses a module that has the clock stopped and the MSTOP bit set, a bus error will occur". [1] MSTOP is set though the clock enable/disable APIs. The clocks on RZ/G3L are part of clock power domains. If the pm_runtime_resume_and_get() fails (or any runtime PM resume calls), the clocks will be off and MSTOP set. In this case, calling atomic_disable() or any API setting HW registers will lead to sync aborts. Thank you, Claudiu [1] https://renesasweb.s3.us-west-2.amazonaws.com/prod/docs/X014/X0141882/r01uh1014ej0120-rzg3s.pdf?response-content-disposition=inline%3B%20filename%3D%22r01uh1014ej0120-rzg3s.pdf%22&response-content-type=application%2Fpdf&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA3WXFIBJWSDVTHJX3%2F20260421%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20260421T075408Z&X-Amz-SignedHeaders=host&X-Amz-Expires=86700&X-Amz-Signature=435eb49a37a080094aecf291bc3dc2d5b7ee62d3de8075151082e9db6c6acbe7