2022-05-14 00:23:46

by Abhinav Kumar

[permalink] [raw]
Subject: Re: [PATCH v4] drm/msm/dsi: don't powerup at modeset time for parade-ps8640

Hi,

On 5/12/2022 3:44 PM, Doug Anderson wrote:
> Hi,
>
> On Thu, May 12, 2022 at 3:34 PM Abhinav Kumar <[email protected]> wrote:
>>
>> On 5/12/2022 3:16 PM, Dmitry Baryshkov wrote:
>>> On 13/05/2022 01:00, Douglas Anderson wrote:
>>>> Commit 7d8e9a90509f ("drm/msm/dsi: move DSI host powerup to modeset
>>>> time") caused sc7180 Chromebooks that use the parade-ps8640 bridge
>>>> chip to fail to turn the display back on after it turns off.
>>>>
>>>> Unfortunately, it doesn't look easy to fix the parade-ps8640 driver to
>>>> handle the new power sequence. The Linux driver has almost nothing in
>>>> it and most of the logic for this bridge chip is in black-box firmware
>>>> that the bridge chip uses.
>>>>
>>>> Also unfortunately, reverting the patch will break "tc358762".
>>>>
>>>> The long term solution here is probably Dave Stevenson's series [1]
>>>> that would give more flexibility. However, that is likely not a quick
>>>> fix.
>>>>
>>>> For the short term, we'll look at the compatible of the next bridge in
>>>> the chain and go back to the old way for the Parade PS8640 bridge
>>>> chip. If it's found that other bridge chips also need this workaround
>>>> then we can add them to the list or consider inverting the condition.
>>>>
>>>> [1]
>>>> https://lore.kernel.org/r/[email protected]
>>>>
>>>>
>>>> Fixes: 7d8e9a90509f ("drm/msm/dsi: move DSI host powerup to modeset
>>>> time")
>>>> Suggested-by: Rob Clark <[email protected]>
>>>> Signed-off-by: Douglas Anderson <[email protected]>
>>>
>>> Reviewed-by: Dmitry Baryshkov <[email protected]>
>>>
>> Yes, I think this is a better solution than a full revert
>>
>> Reviewed-by: Abhinav Kumar <[email protected]>
>>
>> I am curious to know why this doesnt work for parade but will not hold
>> this patch back for that. We are initializing and turning on DSI PHY now
>> before turning on the bridge chip which is actually better as we are
>> putting PHY in a good state.
>>
>> So this should have been better, but somehow doesn't work.
>
> I can't really explain it, but mostly because the Parade chip is just
> a big black box. There have been several times when an OEM using this
> bridge chip had one problem or another with getting the display to
> turn on, then the parade FAE would make some magic tweak to the
> firmware and it would be fixed. The current way that the Linux driver
> is working is with pretty much zero configuration so I think this chip
> bakes in a bunch of assumptions about the timings / signal coming from
> the MIPI DSI side. It doesn't surprise me that changing the order like
> this would confuse it.
>
> In theory I believe the Parade chip can run in a less "automatic" mode
> where everything is configured and controlled by Linux. I'd really
> have preferred if we could have gotten that done, but it didn't end up
> happening. :(
>
> -Doug

Again this is not to block this change (you already have my ack) but
perhaps to help you debug this for future reference as we wont know what
change can break parade even in the future if this happens again and the
compatible check for parade will keep growing.

One suggestion I can give is can we read any status bits out of the
parade chip in the power_on() method as its right after the new method
to check why its not in good status or what error bits it throws and
perhaps share those error bits with the FAE to see when this error can
come to decode this black box a bit :)

From those bits, we can narrow down why this timing or sequence change
is affecting them. Like some things could be somehow this is delaying
the video pixels from transmitting, it expects PHY to be in some state
etc and we can kind-of reverse engineer why this change broke it.

Like-wise, it is highly possible at the moment we have identified only
parade not to work but if there is something wrong with this change we
can atleast know what and address it.

Thanks

Abhinav