From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (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 4A62E336881 for ; Thu, 5 Mar 2026 04:06:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772683574; cv=none; b=R0WABvWGVxAanWgfA4exhpm8lpQFMOl9CqzgiyCHyZvLrQ0N6t6H/SvhObwL/ap8fpRrZ2T1OG6y3ho016ErmUhYVQqAujHwvBQQLpwfXJNqKEtTaXwsrDDixsnCWGyXq1B/usK4A2mpOKGA69R/tQgQObWjyua599LqSLBHRPY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772683574; c=relaxed/simple; bh=CFE09PJkud4+xt/wMK7qo+myf5yy07X4TW6dWdIW1z4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qKcGYaXhvgFiRordVaGoVTQG+KRrfndmcGTyoUDYPQkl54xlwEHwKl14n059jJnzYy1eBH6Niv/BSw7nUOvPDZwk3hUciRg20SmSDIO9sBtyd1Hr2rUzh+UPdmTVzCUiGLkXajeQtJpVNf6lv8WcpDJnftpSBoQ4JECui5Xr65w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RnP+AEwv; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RnP+AEwv" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-2ae46b9c70dso17687895ad.1 for ; Wed, 04 Mar 2026 20:06:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772683573; x=1773288373; 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=hzKoIMit9qZ03VESDYjaexQZSnD/V7ffdmJAeddmBhw=; b=RnP+AEwvTqcJj25K7YGOuVPIqVnsTBSItaLKza9/OhEgBzSt7oxwedbKyc//+XCjZg ZSLzb+tW6gYKQiOBd2KiWw3FHyEY+5WFRUPZ9Y/l/6hJ7SPCZAD7mnbit07Ljgn3sYkf j+O86GJF04lUrwBmEUCxJM6znb8EcTVIUvG3l3rthnFehqXpal07TReSuAihxdPUSEMH vICH6CR1TFL8yB2Nh9NocXALaJa4kMl0cflZzzm+4jJoQsJCUImN4A8U6KZxiiYjbNrg jY6rOHDhxBYtEwdl9L5aAqPYJLkxjZhfd9f80qIMB7fokeWPI8YQuk60/Mi8xdibp1+x Uiag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772683573; x=1773288373; 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=hzKoIMit9qZ03VESDYjaexQZSnD/V7ffdmJAeddmBhw=; b=wIg63oI6R/syUKjo3yrl48nGKxpHIbC6hF2aUCB3CM2FCfgPxsOv9GQO3vjlLmJwqP r+qk+TVI/39T4G0XIfmOoRmbofX8myxbaOpePLKi60+8zz3TdGgDFeQXm51OVUQl4J0r EkE3cNIxcLUnfA0WR0pRFrRMsrO0Hdd6ecNJWlpylBopEJXSusnCI/HOffrPIcvIcQJ7 9PZ6t1qKq54RrCxhpDpEE17tCQncXP6U4pt5wtI5XobWkBVrgof2zqolsY9j4x3EnNS2 BuK9EeM4oBUjWVU3p/ger2ud2iFor2NMjsYaJczSa9zIGp2MRBriW6pBjYkzDzIhtBPt pecw== X-Forwarded-Encrypted: i=1; AJvYcCU+rn4BYmpti58R0m7YWiqbdGalJZfn2jUfrVAbcclYcqSptkEEuDQ3FE7xm/RrqoRPv7PvnLdB/3T0sx8=@vger.kernel.org X-Gm-Message-State: AOJu0YyKv+Q/QufDfp/c6EUkEM8Kg11zjFRDzT5uPVV0Hy7fboUuyZwM A1sxpDKMXwtugFwXmLROkQqPaDGTyVdV9q300A4xS3izgf2ZIQGUS9V1 X-Gm-Gg: ATEYQzyweYEH0hUZ7enwCLzsZJEq174jUaV76GXelmW98h4xQAqfAWx8qpbAqNA8+Ux jnMVpm1dCxoKlxIH4uukKE/V4pAwMaiLO4ZnUoxJJ75hNF53AL/enEsJQ/IWZXmzCm4xQmZ+1oR H74y7Wrxr9emT0EcsF61mkoLnUm/cHHeaTx6Qwow8K2syryhGAZrjT8Ue7mbiAND9SuLm0sh/uK 06g3QP2i3x7gALUIrkfw5YKVE/M41BxKH+hwYDFhwCU89ENKnzrF17apj55ddaOsl44jVIUPGNx 5LuX75zi+6ghd9d/q5IfsHlS2E72QFZy+3L4KHwf/HkKb6M65ObXIaurRax7O/DfGeB4JcKS4KW hfTqWbDL+7lOW0bvNxqwjb6N6aMALW2x948uEEvnDWDdf28Ag/pprj1U7BzVJKIz2TqN8gsxieO ZFbPIRKTEI8GwxJX/z4jZvV4DrMHasB8J2j/H0VhF3fgzC5yuJcvucYwG4BABs7e4dybMuiB/Rn VJQmdPkRpMfT0BjJ4PiNTT5AWhiMH3TLu1tIjEbNvsrruNHP7GI1J9aJJUq7wFriJXoVesFOUDa dkFoleCOWxKc X-Received: by 2002:a17:902:e845:b0:2ae:4f4f:1672 with SMTP id d9443c01a7336-2ae75c44e3amr7901535ad.24.1772683572458; Wed, 04 Mar 2026 20:06:12 -0800 (PST) Received: from ?IPV6:2601:1c0:5780:9200:50f9:a2c6:c0a6:8352? ([2601:1c0:5780:9200:50f9:a2c6:c0a6:8352]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2adfb5b257esm211227605ad.4.2026.03.04.20.06.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Mar 2026 20:06:12 -0800 (PST) Message-ID: <5688d830-b8bc-4495-9b5b-0f6ee85df51a@gmail.com> Date: Wed, 4 Mar 2026 20:06:11 -0800 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 v2] drm/panel: novatek-nt36672a: Convert to mipi_dsi_*_multi() helpers To: Doug Anderson Cc: sumit.semwal@linaro.org, neil.armstrong@linaro.org, jesszhan0024@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20260303035508.8288-1-chintanlike@gmail.com> Content-Language: en-US From: Chintan Patel In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Doug, Thanks for the detailed review — this is very helpful. Good catch on a few of these. > > On Mon, Mar 2, 2026 at 7:55 PM Chintan Patel wrote: >> >> -static int nt36672a_panel_power_off(struct drm_panel *panel) >> +static void nt36672a_panel_power_off(struct drm_panel *panel) >> { >> struct nt36672a_panel *pinfo = to_nt36672a_panel(panel); >> - int ret = 0; >> >> gpiod_set_value(pinfo->reset_gpio, 1); >> >> - ret = regulator_bulk_disable(ARRAY_SIZE(pinfo->supplies), pinfo->supplies); >> - if (ret) >> - dev_err(panel->dev, "regulator_bulk_disable failed %d\n", ret); >> - >> - return ret; >> + if (regulator_bulk_disable(ARRAY_SIZE(pinfo->supplies), pinfo->supplies) < 0) >> + dev_err(panel->dev, "regulator_bulk_disable failed\n"); > > nit: IMO It would have been OK to keep the local "ret" variable here, > but I won't insist. That would have allowed you to keep printing the > error code, which is nice. It's OK to have "ret" as a local variable > even if you aren't returning it... > I’ll restore the local ret variable in nt36672a_panel_power_off() so we continue printing the regulator error code even though the function now returns void. >> } >> >> static int nt36672a_panel_unprepare(struct drm_panel *panel) >> { >> struct nt36672a_panel *pinfo = to_nt36672a_panel(panel); >> - int ret; >> + struct mipi_dsi_multi_context dsi_ctx = { .dsi = pinfo->link }; >> >> /* send off cmds */ >> - ret = nt36672a_send_cmds(panel, pinfo->desc->off_cmds, >> - pinfo->desc->num_off_cmds); >> + nt36672a_send_cmds(&dsi_ctx, pinfo->desc->off_cmds, >> + pinfo->desc->num_off_cmds); >> >> - if (ret < 0) >> - dev_err(panel->dev, "failed to send DCS off cmds: %d\n", ret); >> - >> - ret = mipi_dsi_dcs_set_display_off(pinfo->link); >> - if (ret < 0) >> - dev_err(panel->dev, "set_display_off cmd failed ret = %d\n", ret); > > Probably also need a `dsi_ctx.accum_err = 0;` here? Old code still > sent the "display off" command even if nt36672a_send_cmds() returned > an error I think? > You’re right about needing to reset dsi_ctx.accum_err before calling mipi_dsi_dcs_set_display_off_multi(). The old code would still send the display-off command even if nt36672a_send_cmds() failed, so I’ll add the reset there to preserve the original behavior. >> + mipi_dsi_dcs_set_display_off_multi(&dsi_ctx); >> + /* Reset error to continue power-down even if display off failed */ >> + dsi_ctx.accum_err = 0; >> >> /* 120ms delay required here as per DCS spec */ >> msleep(120); >> >> - ret = mipi_dsi_dcs_enter_sleep_mode(pinfo->link); >> - if (ret < 0) >> - dev_err(panel->dev, "enter_sleep cmd failed ret = %d\n", ret); >> + mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx); >> >> /* 0x3C = 60ms delay */ >> - msleep(60); >> + mipi_dsi_msleep(&dsi_ctx, 60); > > I think this one should still be a regular msleep(60), right? Prior > code still did msleep(60) even if mipi_dsi_dcs_enter_sleep_mode() > returned an error, so you probably still should too. > Agreed on keeping the msleep(60) as a regular sleep. Since the old code always slept regardless of DSI errors, using mipi_dsi_msleep() there would subtly change the power-down timing semantics. >> - ret = nt36672a_panel_power_off(panel); >> - if (ret < 0) >> - dev_err(panel->dev, "power_off failed ret = %d\n", ret); >> + nt36672a_panel_power_off(panel); >> >> - return ret; >> + return 0; > > I didn't notice before, but I guess this is a minor change. Previously > nt36672a_panel_unprepare() would ignore all errors (other than > printing) except it would return the final error return from the > regulator_bulk_disable() call. Now it will also ignore the error from > the regulator_bulk_disable(). > > IMO this is fine, but since it's a slight change in functionality it > could be noted in the commit message. Something like: > > This patch is intended to functionally be a no-op, though there is one > slight change. Previously a failure in regulator_bulk_disable() would > have caused nt36672a_panel_unprepare() to return an error. Now it > won't. No other errors in nt36672a_panel_unprepare() were propagated, > so this makes things consistent. I’ll also note in the commit message that nt36672a_panel_unprepare() no longer propagates the regulator error, since previously that was the only error returned and all others were ignored. I’ll send a v3 shortly incorporating these adjustments. Thanks again for the careful review. -Chintan