mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Cédric Bellegarde" <cedric.bellegarde@adishatz.org>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: robin.clark@oss.qualcomm.com, lumag@kernel.org,
	abhinav.kumar@linux.dev, jesszhan0024@gmail.com, sean@poorly.run,
	marijn.suijten@somainline.org, airlied@gmail.com,
	simona@ffwll.ch, antomani103@gmail.com, mitltlatltl@gmail.com,
	krzk@kernel.org, linux-arm-msm@vger.kernel.org,
	dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/msm/dsi: fix race between cmd transfer and host power off
Date: Wed, 25 Mar 2026 21:24:16 +0100	[thread overview]
Message-ID: <b6df67d6-5999-48d4-bb4d-46853ca0aeab@adishatz.org> (raw)
In-Reply-To: <6wu7eezhtqyatbvoryprfpwkcmofdk4albr2zedfrbnrw37amf@rx4lslum3u6b>

Le 18/03/2026 à 14:57, Dmitry Baryshkov a écrit :
> On Wed, Mar 18, 2026 at 11:56:35AM +0100, Cédric Bellegarde wrote:
>> The transfer function dsi_host_transfer() guards against the DSI host
>> being inactive by checking msm_host->power_on. However, power_on is
>> cleared at the end of msm_dsi_host_power_off(), after clocks have
>> already been disabled. This creates a window where a concurrent DCS
>> command (e.g. a brightness update from the backlight driver) can pass
>> the power_on check, call xfer_prepare()/xfer_restore(), and toggle
>> link clocks that are already being torn down, leaving
>> disp_cc_mdss_byte0_clk stuck in the 'on' state.
>>
>> Checking enabled instead of power_on closes the race by rejecting
>> transfers as soon as the bridge starts tearing down, before any clocks
>> are touched.
> 
> Thanks, but it is not correct. The transfer callback is documented as
> requiring to power up the host if it is not on at the time it is
> called. Could you please implement corresponding logic?
> 
>>
>>
>> Signed-off-by: Cédric Bellegarde <cedric.bellegarde@adishatz.org>
>> ---
>>   drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
>> index 4d75529c0e85..f66f138cfba0 100644
>> --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
>> +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
>> @@ -1652,7 +1652,7 @@ static ssize_t dsi_host_transfer(struct mipi_dsi_host *host,
>>   	struct msm_dsi_host *msm_host = to_msm_dsi_host(host);
>>   	int ret;
>>   
>> -	if (!msg || !msm_host->power_on)
>> +	if (!msg || !msm_host->enabled)
>>   		return -EINVAL;
>>   
>>   	mutex_lock(&msm_host->cmd_mutex);
>> -- 
>> 2.53.0
>>
> 
After being able to boot linux 7.0.0 rc4, I can confirm that this issue 
is already fixed.

Regards,

-- 
Cédric Bellegarde

      parent reply	other threads:[~2026-03-25 20:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-18 10:56 Cédric Bellegarde
2026-03-18 13:57 ` Dmitry Baryshkov
2026-03-19  8:52   ` Cédric Bellegarde
2026-03-25 20:24   ` Cédric Bellegarde [this message]

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=b6df67d6-5999-48d4-bb4d-46853ca0aeab@adishatz.org \
    --to=cedric.bellegarde@adishatz.org \
    --cc=abhinav.kumar@linux.dev \
    --cc=airlied@gmail.com \
    --cc=antomani103@gmail.com \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jesszhan0024@gmail.com \
    --cc=krzk@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lumag@kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=mitltlatltl@gmail.com \
    --cc=robin.clark@oss.qualcomm.com \
    --cc=sean@poorly.run \
    --cc=simona@ffwll.ch \
    /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®