From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.46 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796293146; b=qqUg97e06AOFSdUaKSZ/b+7Ftfz9yBTAynot8fWOWZMorwzJzj8890rI7zsOFOZmMIEo tJQL94Nxnx6KAChqfRYSQB0NmpfplC6bBUNOvQFs+rYG2AqD1M1eudneWMtBzVro0vqy4 w4Vnb5Jljrs4bFWOWX1k4jstXZrfAS1q0vegCkZIHNk8Giy2NnMxQilCe3TtToS6zRRtz gtj2bjEonTTbSVbUiEA5+BUcm6muBEys04byynksdb1pf5i0F5Nykxzs1KEBjmjdNBB8b yOxL6AKNjBU5C7HNwSlm2m9Rr3/QnD7on2CjrcXDQd7RFh+raoQxRyDNgJ6/R//4eiQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796293146; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:From:Reply-To:Subject:To:Cc: References:Content-Language:Autocrypt:Organization:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=r4zuR14JLMhW/qV9AVaWwvdtBXyx6XX/HuG5h/u1ba4=; b=WiL9NsVEY2esTUTFBwvLc7yCoS9hhADh5yV9v2JoELVZiWvCslg9R9/gJhZmyyLG/Lzb pwMvc4QsuEqCpUDbOQafUlxDkdqvB2m5CTK9U9MPGRn9btkGWA9p/XzvD1kN7ac8e/4eB WB62aS53bea9UuY0lm07ABTH4mSuKp4Gww3MxyuxzYY/v8+ORlJoy8Lf7aSzYRkaidkuN 56asRaPfwew+kSapOmb0O/c8WFPwaOGG9/1sHnMczJU7NMBhIc2ww6jLkpcQQ/V6ODzIm SEeuF27XtKG6OkZlZKx9DGhaS844h6mMZ27jQVamK8EWMz6jq1PpZKw2Ytflq3zRx4w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=aOstV0ZA; arc=none smtp.remote-ip=209.85.221.46 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 345C3606A32F for ; Thu, 3 Dec 2026 10:19:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 345C3606A32F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=aOstV0ZA Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-49412eb1474so9486558f8f.3 for ; Thu, 03 Dec 2026 02:19:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1796293143; x=1796897943; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:organization :autocrypt:content-language:references:cc:to:subject:reply-to:from :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to:content-type; bh=r4zuR14JLMhW/qV9AVaWwvdtBXyx6XX/HuG5h/u1ba4=; b=aOstV0ZA+evHKMbotI2MybTOBL8hUb93R+iNC0JGVN0GRIAm8DWJ0vtU0sW7slMCb4 ragtBATx1hrSURZdux7ziWHczaxBXx7Nk6tcepTcVwN985DYy4loD6tndH+VzFPvNAo/ cqWt9Sw1GfQI0KLskTch/nWBkdjAg/UDbijkQtqVnRwi2RBDoNNjC7qdRbYP40TPtaGs U+AY1sfrrSP6KWXHWqzyLR1YK+orHVHe3TYVaSSBvBZrLUHIUupDNWDPpqkLcjVHOCLR xMJtx7YJmVeG3NveCrRuF34f8m2ZJdkUZCHVgjfN2cqs6ZHE6FebPZ7UY7MiALEUCHdV SSIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796293143; x=1796897943; h=content-transfer-encoding:content-type:in-reply-to:organization :autocrypt:content-language:references:cc:to:subject:reply-to:from :user-agent:mime-version:date:message-id:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to:content-type; bh=r4zuR14JLMhW/qV9AVaWwvdtBXyx6XX/HuG5h/u1ba4=; b=D47NSE9EE1H6nB1+az7VHU5m375UDsuKasYLjhiUQdpidWG6B2+sLhaa3AcTF0ls0u gxJSMBUgC4FCXTFT1MahsFn97zoLrfKne+Vue2KnbgE2kHze5a2Y6+MOf23y+WJnPQxz Ehe/UHd+MMs5YHAdsCmMMtVFG29NxtMgZpSd5TergmbTHyUAaUmS54/oLoK+X9ZYBz+c N9p8va7Vp9G68UD7ex/QaIXp3FbwR4enDmEKEQS3xRgv4iG+qwq1Xnx6oPyS2uMGyJMN BwB4pKYiyhjKUs/fghY9L5eGCfTdST1BU/k4ZNH+7ZzfL9CTKCU31YPCg+wxn6rkdE40 2NOw== X-Forwarded-Encrypted: i=1; AL+hErGmEqq5eEFF41i5VcwMW/fRL3U0/o5WII1IyEYSXrHP1TqXfqYX4boamZ1UmiQjV5AkJR+6fAjqzWzUjgw=@vger.kernel.org X-Gm-Message-State: APuU4Z992YUFzj1Q/4QcoczKt1hIc4cZ2mwtc+QJgXou6xycjUEPd/Ek pJEeIrg+SNfPzRJ6bpu+XRh7BzS9PJfd8Lwrsnj0wCK1c75oo+HAVVaughqn4JjQLDw= X-Gm-Gg: AZFdTZdHb9lX2u2PIdMI8Nq5oVbZnnsdbFNaluVarqnPrhRbPvZxoiQpLF1ePkgRZ8M 3YaYPlrc1VNrmflPLq+jqPL7VzeBBMou0ZROk65KubweHMkfPQsCwsNMVFC6uh5qqX8D4z5C2+a cBpa03MN5QBjn51Q1v6usTaGDHRdGsTFlTlU88dF9bNBzf7HBQtukoaELKVMhaOqWthClHNuh9g irt07mfZlXs38/g4YEL18XkevQ+N85acb4HehP14YM0C1uY+dEkZ2wNVLH09sgLmlp7l6NiTFL0 rJ9KNYcWFI/ohsJyNzLZXg0sqtpPTNKFxwo/bscDVZgRlDhbqPnsl/UY3X4tgND3lmJik4Eemlv zPBnP8WEOtFBqSuQVAwXuKpGwktgpNQgJ48ccC1JdfsaltRbapc6r/HoP/FSuQ/1JsfKViy2/em Bufit6J+slcNqKnV18GRCpdg6mwKxQpx5+kphIvL2sSsqEwnuPp2vkpLA/9K3NcCWiDew7HHhHK exUF50AXuxNCn7qtTkDr59z+e4ATkHDPJFd5JvVgg9JOKqDUVwPWOr34PBkfsYiADYtTYQsYKNs obsnR5It+4h/d3kTJFXxKS/8obS9wJrNC/zE9igEQLteLMPWRNdm7seGXusiOPZN1tVncVYd8i0 vuOOp8pKc1uPt53eEzmNS7TwXT20scA== X-Received: by 2002:a05:600c:674b:b0:4bb:6847:791f with SMTP id 5b1f17b1804b1-4bb8880f267mr774853405e9.7.1796293143425; Thu, 03 Dec 2026 02:19:03 -0800 (PST) Received: from ?IPV6:2a01:e0a:106d:1080:7de3:fcb2:e184:4e7b? ([2a01:e0a:106d:1080:7de3:fcb2:e184:4e7b]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbc184d8dcsm283153805e9.1.2026.12.03.02.19.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Dec 2026 02:19:03 -0800 (PST) Message-ID: <7b327751-9f4a-442d-a398-79c736f57461@linaro.org> Date: Thu, 3 Dec 2026 11:19:01 +0100 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Neil Armstrong Reply-To: Neil Armstrong Subject: Re: [PATCH v3 3/4] drm/panel: novatek-nt36536: power off on any prepare failure To: Qianhui Xu , Jessica Zhang , dri-devel@lists.freedesktop.org Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20261202090911.3987891-1-xiaqinghuan@mail.ustc.edu.cn> <20261202090911.3987891-4-xiaqinghuan@mail.ustc.edu.cn> Content-Language: en-US, fr Autocrypt: addr=neil.armstrong@linaro.org; keydata= xsBNBE1ZBs8BCAD78xVLsXPwV/2qQx2FaO/7mhWL0Qodw8UcQJnkrWmgTFRobtTWxuRx8WWP GTjuhvbleoQ5Cxjr+v+1ARGCH46MxFP5DwauzPekwJUD5QKZlaw/bURTLmS2id5wWi3lqVH4 BVF2WzvGyyeV1o4RTCYDnZ9VLLylJ9bneEaIs/7cjCEbipGGFlfIML3sfqnIvMAxIMZrvcl9 qPV2k+KQ7q+aXavU5W+yLNn7QtXUB530Zlk/d2ETgzQ5FLYYnUDAaRl+8JUTjc0CNOTpCeik 80TZcE6f8M76Xa6yU8VcNko94Ck7iB4vj70q76P/J7kt98hklrr85/3NU3oti3nrIHmHABEB AAHNKk5laWwgQXJtc3Ryb25nIDxuZWlsLmFybXN0cm9uZ0BsaW5hcm8ub3JnPsLAkQQTAQoA OwIbIwULCQgHAwUVCgkICwUWAgMBAAIeAQIXgBYhBInsPQWERiF0UPIoSBaat7Gkz/iuBQJk Q5wSAhkBAAoJEBaat7Gkz/iuyhMIANiD94qDtUTJRfEW6GwXmtKWwl/mvqQtaTtZID2dos04 YqBbshiJbejgVJjy+HODcNUIKBB3PSLaln4ltdsV73SBcwUNdzebfKspAQunCM22Mn6FBIxQ GizsMLcP/0FX4en9NaKGfK6ZdKK6kN1GR9YffMJd2P08EO8mHowmSRe/ExAODhAs9W7XXExw UNCY4pVJyRPpEhv373vvff60bHxc1k/FF9WaPscMt7hlkbFLUs85kHtQAmr8pV5Hy9ezsSRa GzJmiVclkPc2BY592IGBXRDQ38urXeM4nfhhvqA50b/nAEXc6FzqgXqDkEIwR66/Gbp0t3+r yQzpKRyQif3OwE0ETVkGzwEIALyKDN/OGURaHBVzwjgYq+ZtifvekdrSNl8TIDH8g1xicBYp QTbPn6bbSZbdvfeQPNCcD4/EhXZuhQXMcoJsQQQnO4vwVULmPGgtGf8PVc7dxKOeta+qUh6+ SRh3vIcAUFHDT3f/Zdspz+e2E0hPV2hiSvICLk11qO6cyJE13zeNFoeY3ggrKY+IzbFomIZY 4yG6xI99NIPEVE9lNBXBKIlewIyVlkOaYvJWSV+p5gdJXOvScNN1epm5YHmf9aE2ZjnqZGoM Mtsyw18YoX9BqMFInxqYQQ3j/HpVgTSvmo5ea5qQDDUaCsaTf8UeDcwYOtgI8iL4oHcsGtUX oUk33HEAEQEAAcLAXwQYAQIACQUCTVkGzwIbDAAKCRAWmrexpM/4rrXiB/sGbkQ6itMrAIfn M7IbRuiSZS1unlySUVYu3SD6YBYnNi3G5EpbwfBNuT3H8//rVvtOFK4OD8cRYkxXRQmTvqa3 3eDIHu/zr1HMKErm+2SD6PO9umRef8V82o2oaCLvf4WeIssFjwB0b6a12opuRP7yo3E3gTCS KmbUuLv1CtxKQF+fUV1cVaTPMyT25Od+RC1K+iOR0F54oUJvJeq7fUzbn/KdlhA8XPGzwGRy 4zcsPWvwnXgfe5tk680fEKZVwOZKIEuJC3v+/yZpQzDvGYJvbyix0lHnrCzq43WefRHI5XTT QbM0WUIBIcGmq38+OgUsMYu4NzLu7uZFAcmp6h8g Organization: Linaro In-Reply-To: <20261202090911.3987891-4-xiaqinghuan@mail.ustc.edu.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/2/26 10:09, Qianhui Xu wrote: > prepare() only undid the power-up when the initialisation sequence > failed. Failures of the picture parameter set, the compression mode > commands or the backlight enable were ignored, leaving the panel powered > with a wrong state and -- for the backlight -- with the error swallowed. > Use a single power_off label for all error paths and also check > dsi_ctx.accum_err after the batched MIPI writes, as those helpers only > record their error there. > > Fixes: 75a5dbd1f4f7 ("drm/panel: Add Novatek NT36536 panel driver") > Cc: > Signed-off-by: Qianhui Xu > --- > drivers/gpu/drm/panel/panel-novatek-nt36536.c | 19 ++++++++++++++----- > 1 file changed, 14 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-novatek-nt36536.c b/drivers/gpu/drm/panel/panel-novatek-nt36536.c > index 7aa26796e2a90..e372e346d8b77 100644 > --- a/drivers/gpu/drm/panel/panel-novatek-nt36536.c > +++ b/drivers/gpu/drm/panel/panel-novatek-nt36536.c > @@ -100,18 +100,27 @@ static int novatek_prepare(struct drm_panel *panel) > ret = ctx->desc->init_sequence(&dsi_ctx); > if (ret < 0) { > dev_err(dev, "Failed to initialize panel: %d\n", ret); > - gpiod_set_value_cansleep(ctx->reset_gpio, 1); > - regulator_bulk_disable(ARRAY_SIZE(novatek_supplies), > - ctx->supplies); > - return ret; > + goto power_off; > } > > drm_dsc_pps_payload_pack(&pps, &ctx->dsc); > mipi_dsi_picture_parameter_set_multi(&dsi_ctx, &pps); > mipi_dsi_compression_mode_multi(&dsi_ctx, true); > mipi_dsi_msleep(&dsi_ctx, 28); > + ret = dsi_ctx.accum_err; > + if (ret) > + goto power_off; > + > + ret = backlight_enable(ctx->backlight); > + if (ret) > + goto power_off; > + > + return 0; > > - return backlight_enable(ctx->backlight); > +power_off: > + gpiod_set_value_cansleep(ctx->reset_gpio, 1); > + regulator_bulk_disable(ARRAY_SIZE(novatek_supplies), ctx->supplies); > + return ret; > } > > static int novatek_off(struct mipi_dsi_multi_context *dsi_ctx) Reviewed-by: Neil Armstrong Thanks, Neil