mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Kumar, Abhash" <a-kumar2@ti.com>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: <linux-kernel@vger.kernel.org>, <dri-devel@lists.freedesktop.org>,
	<Laurent.pinchart@ideasonboard.com>, <jonas@kwiboo.se>,
	<jernej.skrabec@gmail.com>, <s-jain1@ti.com>, <y-d@ti.com>,
	<andrzej.hajda@intel.com>, <neil.armstrong@linaro.org>,
	<rfoss@kernel.org>, <mripard@kernel.org>, <tzimmermann@suse.de>,
	<airlied@gmail.com>, <simona@ffwll.ch>, <devarsht@ti.com>,
	<u-kumar1@ti.com>, <sjakhade@cadence.com>
Subject: Re: [PATCH v3] drm/bridge: cdns-mhdp8546: Add suspend resume support to the bridge driver
Date: Tue, 6 Oct 2026 14:19:20 +0530	[thread overview]
Message-ID: <f1089720-2a8e-4f0f-b995-fc7ef0836da0@ti.com> (raw)
In-Reply-To: <982ffabf-4709-427a-b2b6-481eb074f2d0@ideasonboard.com>

Hi,

On 10/1/2026 1:10 PM, Tomi Valkeinen wrote:
> Hi,
>
> On 29/06/2026 13:32, abhash wrote:
>>
>> Hi Tomi,
>>
>> Thanks for the review.
>>
>> On 18/06/26 14:19, Tomi Valkeinen wrote:
>>> Hi,
>>>
>>> On 01/06/2026 12:50, Abhash Kumar Jha wrote:
>>>> Add system suspend and resume hooks to the cdns-mhdp8546 bridge 
>>>> driver.
>>>>
>>>> While resuming we either load the firmware or activate it. Firmware
>>>> is loaded only when resuming from a successful suspend-resume cycle.
>>>
>>> It's not clear from the patch if this is a fix or improvement. It 
>>> sounds a bit like a fix, but it doesn't mention any kind of issue in 
>>> the driver. So, why is this patch needed?
>>
>> The driver lacked support for suspend-resume as stated in the todo on 
>> the driver, So the patch adds this improvement.
>
> The patch doesn't remove any todo lines. Was that just a miss, or is 
> there more to add wrt. PM?
Yeah, i will remove the TODO in the next revision.
>
> What does it mean it didn't support PM? Does the driver not work after 
> suspend-resume cycle? Or does the driver prevent a proper suspend? 

When we resume, the cdns_mhdp_link_up function fails.

Failure log at resume:

[  55.329452] tidss 4a00000.dss: PM: calling tidss_resume [tidss] @ 
1053, parent: bus@100000

[ 183.381228] cdns-mhdp8546 a000000.bridge: Failed to read receiver 
capabilities

[ 191.391548] cdns-mhdp8546 a000000.bridge: get block[0] edid failed: -110

[ 193.392713] cdns-mhdp8546 a000000.bridge: Failed to read register

[ 261.415544] cdns-mhdp8546 a000000.bridge: Failed to read register

[ 263.946153] tidss 4a00000.dss: Timeout waiting for framedone on crtc 0

[ 391.991358] cdns-mhdp8546 a000000.bridge: Failed to read receiver 
capabilities

[ 392.026847] tidss 4a00000.dss: PM: tidss_resume [tidss] returned 0 
after 336689133 usecs

I guess it is fair to say that the driver does not work after 
suspend-resume cycle.

>>>> If resuming due to an aborted suspend, loading the firmware is not
>>>> possible because the uCPU's IMEM is only accessible after a reset 
>>>> and the
>>>> bridge has not gone through a reset in this case. Hence, Activate the
>>>> firmware that is already loaded.
>>>>
>>>> Use genpd_notifier to get the power domain status of the bridge and
>>>> accordingly load the firmware.
>>>>
>>>> Additionally, introduce phy_power_off/on to control the power to 
>>>> the phy.
>>>
>>> If you write "also" or "additionally" or such in a commit desc, you 
>>> should stop and think if that part should actually be a separate 
>>> patch. Also, why is that change needed? 
>>
>> The phy device could be powered off while resuming. So we are 
>> explicitly powering it on.
>>
>> The phy driver api also recommends to always call phy_init() first 
>> followed by a phy_power_on().
>>
>> "Some PHY drivers may not implement `phy_init` or `phy_power_on`, but 
>> controllers should always call these functions to be compatible with 
>> other PHYs"
>
> It still sounds like a separate patch to me: the current driver is 
> missing phy_power_on/off from the probe/remove functions.
>
I will add that as a separate patch
>>> Overall, this sounds fragile/hacky to me.
>>>
>>> The first thing is that usually you shouldn't use system suspend/ 
>>> resume in a bridge driver. When a system suspend happend, the 
>>> display pipeline will be disabled, so this driver will get an 
>>> atomic_disable() call, and enable when resuming. You can use runtime 
>>> PM hooks if you need resume/suspend hooks.
>>>
>> Thanks for the suggestion, I will use the runtime PM instead.
>>
>>> The second thing is the PD notifier. Is there really no way we can 
>>> see the state from the MDHP IP registers? 
>>
>> The other way that i found was to read the MHDP KEEP_ALIVE_p register 
>> twice to know if the firmware is incrementing the counter.
>>
>> Based on that we can decide if the bridge is active or not. Do you 
>> think this approach would be okay over the PD notifier?
> I think it would be best to be able somehow to ask this from the HW to 
> find the true state, instead of guessing it second hand from the PD 
> notifier (which also doesn't tell us the initial HW state at probe).
>
> KEEP_ALIVE_p sounds fine. Or what does the mdhp IP do if you send a 
> message to the firmware when it's not up? Say, if you always do 
> cdns_mhdp_set_firmware_active, what happens if the FW has not been 
> loaded? I would guess that there's a timeout, and that could be used 
> to find out the FW is not up.
>
Yes, there is a 2 second timeout if we send a message and the firmware 
is not up. I would prefer the KEEP_ALIVE_p method, as that is a better 
indication of the

firmware being active.

> Also, if the IMEM is not accessible and you load the FW, what happens?

If IMEM is not accessible and we load the FW, the kernel crashes due to 
S-error.


Thanks,

Abhash


  reply	other threads:[~2026-10-06  8:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-01  9:50 Abhash Kumar Jha
2026-06-18  8:49 ` Tomi Valkeinen
2026-06-29 10:32   ` abhash
2026-10-01  7:40     ` Tomi Valkeinen
2026-10-06  8:49       ` Kumar, Abhash [this message]
2026-10-14 13:25         ` Tomi Valkeinen

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=f1089720-2a8e-4f0f-b995-fc7ef0836da0@ti.com \
    --to=a-kumar2@ti.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=devarsht@ti.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=s-jain1@ti.com \
    --cc=simona@ffwll.ch \
    --cc=sjakhade@cadence.com \
    --cc=tomi.valkeinen@ideasonboard.com \
    --cc=tzimmermann@suse.de \
    --cc=u-kumar1@ti.com \
    --cc=y-d@ti.com \
    /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®