[lkml]   [2019]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [RFC][PATCH] drm: kirin: Fix dsi probe/attach logic
On Mon, Sep 2, 2019 at 6:22 AM Andrzej Hajda <> wrote:
> On 30.08.2019 19:00, Rob Clark wrote:
> > On Thu, Aug 29, 2019 at 11:52 PM Andrzej Hajda <> wrote:
> >> On 29.08.2019 19:39, Rob Clark wrote:
> >>> On Wed, Aug 28, 2019 at 11:06 PM John Stultz <> wrote:
> >>>> Since commit 83f35bc3a852 ("drm/bridge: adv7511: Attach to DSI
> >>>> host at probe time") landed in -next the HiKey board would fail
> >>>> to boot, looping:
> >>> No, please revert 83f35bc3a852.. that is going in the *complete* wrong
> >>> direction. We actually should be moving panels to not require dsi
> >>> host until attach time, similar to how bridges work, not the other way
> >>> around.
> >>
> >> Devices of panels and bridges controlled via DSI will not appear at all
> >> if DSI host is not created.
> >>
> >> So this is the only direction!!!
> >>
> > I disagree, there is really no harm in the bridge probing if there is no dsi.
> >
> > Furthermore, it seems that this change broke a few other drivers.
> If the bridge/panel is controlled via dsi, it will not be probed at all
> if DSI host/bus is not created, so it will not work at all. Upstream
> device will wait forever for downstream drm_(panel|bridge).
> So IMO we just do not have choice here.
> If you know better alternative let us know, otherwise we should proceed
> with "drm: kirin: Fix dsi probe/attach logic" patch.
> >
> >>> The problem is that, when dealing with bootloader enabled display, we
> >>> need to be really careful not to touch the hardware until the display
> >>> driver knows the bridge/panel is present. If the bridge/panel probes
> >>> after the display driver, we could end up killing scanout
> >>> (efifb/simplefb).. if the bridge/panel is missing some dependency and
> >>> never probes, it is rather unpleasant to be stuck trying to debug what
> >>> went wrong with no display.
> >>
> >> It has nothing to do with touching hardware, you can always (I hope)
> >> postpone it till all components are present.
> > Unfortunately this is harder than it sounds, since we need to read hw
> > revision registers for display and dsi blocks to know which hw
> > revision we are dealing with.
> >
> > (Also, we need to avoid
> > drm_fb_helper_remove_conflicting_framebuffers() until we know we are
> > ready to go.)
> >
> > We could possibly put more information in dt. But the less we depend
> > on dt, the easier time we'll have adding support for ACPI boot on the
> > windows arm laptops.
> >
> >> But it is just requirement of device/driver model in Linux Kernel.
> > yes and no.. the way the existing bridges work with a bridge->attach()
> > step seems fairly pragmatic to me.
> >
> >>> Sorry I didn't notice that adv7511 patch before it landed, but the
> >>> right thing to do now is to revert it.
> >>
> >> The 1st version of the patch was posted at the end of April and final
> >> version was queued 1st July, so it was quite long time for discussions
> >> and tests.
> > sorry I didn't notice the patch sooner, most of my bandwidth goes to mesa.
> >
> >> Reverting it now seems quite late, especially if the patch does right
> >> thing and there is already proper fix for one encoder (kirin), moreover
> >> revert will break another platforms.
> > kirin isn't the only other user of adv75xx.. at least it is my
> > understanding that this broke db410c as well.
> >
> >> Of course it seems you have different opinion what is the right thing in
> >> this case, so if you convince us that your approach is better one can
> >> revert the patch.
> > I guess my strongest / most immediate opinion is to not break other
> > existing adv75xx bridge users.
> It is pity that breakage happened, and next time we should be more
> strict about testing other platforms, before patch acceptance.
> But reverting it now will break also platform which depend on it.
> Anyway the old order was incorrect and prevented other users from adv*
> driver usage, so it should be fixed anyway.
> > Beyond that, I found doing mipi_dsi_attach() in bridge->attach() was
> > quite convenient to get display handover from efifb work. And that
> > was (previously) the way most of the bridges worked.
> >
> > But maybe there is another way.. perhaps somehow the bridges/panels
> > could be added as sub-components using the component framework, to
> > prevent the toplevel drm device from probing until they are ready?
> If you mean 'probe' as in initialization from component_master::bind
> callback with this patch it still works, DSI-HOST calls component_add
> after drm_bridge is found.
> > We'd still have the problem that the dsi component wants to be able to
> > read hw revision before registering dsi host.. but I suppose if CCF
> > exported a way that we could query whether the interface clk was
> > already enabled, we could have the clk enable/disable cycle that would
> > break efifb.
> I am not familiar with efifb, if you describe the issue you have in more
> detail we can try to find some solution together.

You don't really need to know too much about efifb.. the story would
be the same with simplefb, the only difference is that the scanout
address/size/format come from EFI GOP instead of dt.

The main thing is we really want to avoid a runpm resume/suspend cycle
until the we have all the components of the display, including
bridge/panel. If the display is enabled by bootloader, then the
initial resume will be no-op (turning on clks and power domains that
are already on), but the following suspend will actually turn things
off. If this happens because, for example, the bridge driver didn't
get copied to initrd, or probe-deferred because it is missing one of
it's dependencies, the result will be a black screen with no way to
debug what went wrong.

I guess if we can rely on panel/bridge being probed indirectly from
mipi_dsi_host_register() (but before it returns, so dsi host can defer
if bridge/panel is missing) maybe that works out..


 \ /
  Last update: 2019-09-03 18:00    [W:0.061 / U:1.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site