mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: David Heidelberg <david@ixit.cz>
Cc: Dzmitry Sankouski <dsankouski@gmail.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Jessica Zhang <jesszhan0024@gmail.com>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	Abel Vesa <abelvesa@kernel.org>,
	Petr Vorel <petr.vorel@gmail.com>,
	dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	phone-devel@vger.kernel.org
Subject: Re: [PATCH v2 06/11] drm/panel: s6e3ha8: Correct the polarity logic within
Date: Tue, 29 Sep 2026 12:36:09 +0200	[thread overview]
Message-ID: <ce6379a5-2a60-4d65-9553-e39f8398d6cf@kernel.org> (raw)
In-Reply-To: <739ce9f4-8bdb-4bc4-9cc1-9a1a7eba80ce@ixit.cz>

On 29/09/2026 11:59, David Heidelberg wrote:
> On 29/09/2026 11:51, Krzysztof Kozlowski wrote:
>> On 29/09/2026 11:41, David Heidelberg wrote:
>>> On 29/09/2026 09:45, Krzysztof Kozlowski wrote:
>>>> On Thu, Sep 24, 2026 at 04:01:34PM +0200, David Heidelberg wrote:
>>>>> The reset was introduced with wrong polarity. Correct for the future
>>>>> compatibles and keep current with reverted logic.
>>>>>
>>>>> Old DTs keep GPIO_ACTIVE_HIGH and are fixed up via
>>>>> gpiod_toggle_active_low() on the deprecated compatible.
>>>>>
>>>>> Assisted-by: LLM
>>>>> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
>>>>> Signed-off-by: David Heidelberg <david@ixit.cz>
>>>>> ---
>>>>>    drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c | 23 +++++++++++++++++++----
>>>>>    1 file changed, 19 insertions(+), 4 deletions(-)
>>>>>
>>>>> diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c b/drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c
>>>>> index 5e1e997b83b36..99290913de69a 100644
>>>>> --- a/drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c
>>>>> +++ b/drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c
>>>>> @@ -20,16 +20,17 @@
>>>>>    #include "panel-samsung-dsi.h"
>>>>>    
>>>>>    struct s6e3ha8_desc {
>>>>>    	const struct drm_panel_funcs *funcs;
>>>>>    	const struct drm_display_mode *mode;
>>>>>    	unsigned long mode_flags;
>>>>>    	const struct regulator_bulk_data *supplies;
>>>>>    	unsigned int num_supplies;
>>>>> +	bool broken_reset_polarity;
>>>>>    };
>>>>>    
>>>>>    struct s6e3ha8 {
>>>>>    	struct drm_panel panel;
>>>>>    	struct mipi_dsi_device *dsi;
>>>>>    	const struct s6e3ha8_desc *desc;
>>>>>    	struct drm_dsc_config dsc;
>>>>>    	struct gpio_desc *reset_gpio;
>>>>> @@ -62,22 +63,22 @@ static int s6e3ha8_unprepare(struct drm_panel *panel)
>>>>>    {
>>>>>    	struct s6e3ha8 *priv = to_s6e3ha8(panel);
>>>>>    
>>>>>    	return regulator_bulk_disable(priv->desc->num_supplies, priv->supplies);
>>>>>    }
>>>>>    
>>>>>    static void s6e3ha8_amb577px01_wqhd_reset(struct s6e3ha8 *priv)
>>>>>    {
>>>>> -	gpiod_set_value_cansleep(priv->reset_gpio, 1);
>>>>> -	usleep_range(5000, 6000);
>>>>>    	gpiod_set_value_cansleep(priv->reset_gpio, 0);
>>>>>    	usleep_range(5000, 6000);
>>>>>    	gpiod_set_value_cansleep(priv->reset_gpio, 1);
>>>>>    	usleep_range(5000, 6000);
>>>>> +	gpiod_set_value_cansleep(priv->reset_gpio, 0);
>>>>
>>>> This breaks all users and this usage of ABI was already released.
>>>
>>> See the gpiod_toggle_active_low() usage later in the patch which keep the logic
>>> for the original compatible as intended.
>>>
>>
>> OK, I went way too fast, that's correct part. But splitting fix is still
>> just confusing. Backporting to stable is a different thing than fixing
>> issues.
> 
> Sure, I already droped the previous commit changing it for stable.
> 
> Btw. looking at gpiod_toggle_active_low(), would it make sense to do a series 
> correcting panel reset logic? I see many panels keep "reset asserted" in the 
> driver (but ofc not in the reality).


To my knowledge it is impossible task to do, without breaking something.
Either you break users of ABI (so the DTS) or break existing users of
DTS. One could try to avoid both by using your approach here with
compatibles having fallback. But then what polarity actually would be in
such DTS node? If you know your users, like for some SoC components, you
could argue that none of then will be affected. But both the driver and
DTS here can be used externally.

Best regards,
Krzysztof

  reply	other threads:[~2026-09-29 10:36 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 14:01 [PATCH v2 00/11] Pixel 3 XL display panel support David Heidelberg via B4 Relay
2026-09-24 14:01 ` [PATCH v2 01/11] dt-bindings: display: panel: s6e3ha8: Adjust to reflect the DDIC and panel used David Heidelberg via B4 Relay
2026-09-29  7:39   ` Krzysztof Kozlowski
2026-09-24 14:01 ` [PATCH v2 02/11] dt-bindings: display: panel: samsung,s6e3ha8: Add AMB630QY01 panel David Heidelberg via B4 Relay
2026-09-29  7:40   ` Krzysztof Kozlowski
2026-09-24 14:01 ` [PATCH v2 03/11] drm/panel: s6e3ha8: Really assert reset on the failure David Heidelberg via B4 Relay
2026-09-24 20:00   ` Petr Vorel
2026-09-29  7:43   ` Krzysztof Kozlowski
2026-09-24 14:01 ` [PATCH v2 04/11] drm/panel: s6e3ha8: Introduce AMB577PX01 panel compatible David Heidelberg via B4 Relay
2026-09-24 14:01 ` [PATCH v2 05/11] drm/panel: s6e3ha8: Prepare for supporting multiple panels David Heidelberg via B4 Relay
2026-09-24 14:01 ` [PATCH v2 06/11] drm/panel: s6e3ha8: Correct the polarity logic within David Heidelberg via B4 Relay
2026-09-29  7:45   ` Krzysztof Kozlowski
2026-09-29  9:41     ` David Heidelberg
2026-09-29  9:51       ` Krzysztof Kozlowski
2026-09-29  9:59         ` David Heidelberg
2026-09-29 10:36           ` Krzysztof Kozlowski [this message]
2026-09-29 12:12             ` David Heidelberg
2026-09-29 12:26               ` Krzysztof Kozlowski
2026-09-24 14:01 ` [PATCH v2 07/11] drm/panel: s6e3ha8: Assert reset GPIO in unprepare David Heidelberg via B4 Relay
2026-09-24 14:01 ` [PATCH v2 08/11] drm/panel: s6e3ha8: add Samsung AMB630QY01 (Google Pixel 3 XL) panel David Heidelberg via B4 Relay
2026-09-24 14:01 ` [PATCH v2 09/11] arm64: dts: qcom: sdm845-samsung-starqltechn: Update panel compatible David Heidelberg via B4 Relay
2026-09-29  7:46   ` Krzysztof Kozlowski
2026-09-24 14:01 ` [PATCH v2 10/11] arm64: dts: qcom: sdm845-google: Move panel pins into common David Heidelberg via B4 Relay
2026-09-24 14:01 ` [PATCH v2 11/11] arm64: dts: qcom: sdm845-google-crosshatch: Add display panel David Heidelberg via B4 Relay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ce6379a5-2a60-4d65-9553-e39f8398d6cf@kernel.org \
    --to=krzk@kernel.org \
    --cc=abelvesa@kernel.org \
    --cc=airlied@gmail.com \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=david@ixit.cz \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=dsankouski@gmail.com \
    --cc=jesszhan0024@gmail.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=petr.vorel@gmail.com \
    --cc=phone-devel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®