linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: imx6: hdmi black screen issue after resume
       [not found] ` <CAOuPNLjqm+Dv5RARP6dzZRKSttCvqoLe7MNYOeChAGUWX1krRA@mail.gmail.com>
@ 2019-09-29 16:54   ` Pintu Agarwal
  2019-10-04 10:17     ` Pintu Agarwal
  0 siblings, 1 reply; 3+ messages in thread
From: Pintu Agarwal @ 2019-09-29 16:54 UTC (permalink / raw)
  To: p.zabel, bob.beckett, dri-devel, open list,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-pm

>
> On Mon, Sep 23, 2019 at 1:28 PM Pintu Agarwal <pintu.ping@gmail.com> wrote:
> >
> > Dear Philipp,
> >
> > I have a iMX6dl custom board with custom Linux Kernel 4.8.
> > I have both LCD and HDMI connected to the board.
> > And we are using weston/wayland as the display interface.
> > In normal boot, both LCD and HDMI display is working fine.
> >
> > But, currently, for one of the requirement, I am trying to explore and
> > support hibernation image booting on it.
> > Currently, we are able to resume the system without display.
> > Also, if we make the entire imx-drm as modules, and then install the
> > modules after resume, even LCD is also coming up.
> > But HDMI display is black out.
> >
> > After, resume, when I try to launch the weston, I noticed the following errors:
> > enabling vblank on crtc 0, ret: 0
> > drm_vblank_get: CALLED: vblank->refcount: 1
> > ------------[ cut here ]------------
> > WARNING: at drivers/gpu/drm/drm_atomic_helper.c:1121
> > drm_atomic_helper_wait_for_vblanks+0x228/0x24c [drm_kms_helper]()
> > [CRTC:24] vblank wait timed out
> > .....
> > [drm:drm_atomic_helper_commit_cleanup_done [drm_kms_helper]] *ERROR*
> > [CRTC:24:crtc-0] flip_done timed out
> >
> > ....
> > [00:06:42.600] Warning: computed repaint delay is insane: -5069 msec
> > [00:06:42.665] unexpectedly large timestamp jump (from 397522 to 402648)
> > ....
> >
> > And, when I try to reboot the system, the system does not reboot.
> > And I get the following error:
> > /wayland # reboot
> > ....
> > [17:55:01.180] destroy output while page flip pending
> > ...
> > imx-ipuv3 2400000.ipu: DC stop timeout after 50 ms
> >
> >
> > -------------
> > If you have any clue about this issue, please let me know.
> >
> > Any help will be really appreciated!
> >
> >
> > Thank You!
> >
> > Regards,
> > Pintu


Hi All,

I need some help, on the above issue.
Finally, I could boil down the issue to be vblank refcount issue.
After system resume, vblank ref count is getting screwed up, because
of which vblank_enable is not happening.
As per below code path: drivers/gpu/drm/drm_vblank.c:
drm_vblank_get()
{
[...]
/* Going from 0->1 means we have to enable interrupts again */
if (atomic_add_return(1, &vblank->refcount) == 1) {
    ret = drm_vblank_enable(dev, pipe);
} else {
    if (!vblank->enabled) {
        atomic_dec(&vblank->refcount);
        ret = -EINVAL;
    }
}
[...]
First time, everything seems fine.
drm_vblank_get: CALLED: pipe: 0, vblank->refcount: 0, vblank-enabled: 0
..
drm_vblank_enable: calling - enable_vblank
enabling vblank on crtc 0, ret: 0
...

But, after resume, somewhere during HDMI initialization, the refcount
is getting incremented.
drm_vblank_get: CALLED: pipe: 0, vblank->refcount: 1, vblank-enabled: 1
Thus, due to the above logic, drm_vblank_enable() will not be called,
if previous refcount is not 0.

What I further noticed is that, after resume, during hdmi_setup the
refcount is automatically getting updated.
drm_update_vblank_count - storing vblank count: diff: 1

This does not happen in normal case.
Now, I am not sure, why the vblank counter is getting incremented
during hdmi setup.
Is it like, hdmi setup is taking slightly longer time for
initialization, after resume??
Because of which the vblank timestamp counter is getting disturbed.

If anybody observed this issue, or aware about the fixes, please let me know.
It will be of great help.

Meanwhile, I am further continue to debug this more..

Regards,
Pintu

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: imx6: hdmi black screen issue after resume
  2019-09-29 16:54   ` imx6: hdmi black screen issue after resume Pintu Agarwal
@ 2019-10-04 10:17     ` Pintu Agarwal
  2019-10-16  6:51       ` imx6: i2c-transfer timeout " Pintu Agarwal
  0 siblings, 1 reply; 3+ messages in thread
From: Pintu Agarwal @ 2019-10-04 10:17 UTC (permalink / raw)
  To: p.zabel, bob.beckett, dri-devel, open list,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-pm

Hi,

On Sun, Sep 29, 2019 at 10:24 PM Pintu Agarwal <pintu.ping@gmail.com> wrote:
>
> >
> > On Mon, Sep 23, 2019 at 1:28 PM Pintu Agarwal <pintu.ping@gmail.com> wrote:
> > >
> > > Dear Philipp,
> > >
> > > I have a iMX6dl custom board with custom Linux Kernel 4.8.
> > > I have both LCD and HDMI connected to the board.
> > > And we are using weston/wayland as the display interface.
> > > In normal boot, both LCD and HDMI display is working fine.
> > >
> > > But, currently, for one of the requirement, I am trying to explore and
> > > support hibernation image booting on it.
> > > Currently, we are able to resume the system without display.
> > > Also, if we make the entire imx-drm as modules, and then install the
> > > modules after resume, even LCD is also coming up.
> > > But HDMI display is black out.
> > >

I just found the main root cause of the HDMI screen blackout issue
after system resume.
* HDMI is trying to get EDID data from the monitor using I2C interface.
* But its seems i2c_transfer is getting timeout after 5 retries.
* Thus EDID data is failing, and HDMI could not able to detect the monitor.

This is the logs:

[  441.104989] [drm:drm_helper_probe_single_connector_modes]
[CONNECTOR:29:HDMI-A-1] status updated from unknown to connected
[  441.116080]: drm_helper_probe_single_connector_modes - inside -
else override_edid
[  441.124416]: drm_helper_probe_single_connector_modes - inside -
else - drm_load_edid_firmware: count: 0
[  441.134546]: drm_helper_probe_single_connector_modes - calling - get_modes
[  441.142157]: dw_hdmi_connector_get_modes : called
[  441.147652]: dw_hdmi_connector_get_modes : called - calling -> drm_get_edid
[  441.155346]: drm_do_probe_ddc_edid : called!
[  441.660759]: drm_do_probe_ddc_edid : i2c_transfer: ret: -110, retry: 5
[  442.170758]: drm_do_probe_ddc_edid : i2c_transfer: ret: -110, retry: 4
[  442.680755]: drm_do_probe_ddc_edid : i2c_transfer: ret: -110, retry: 3
[  443.190755]: drm_do_probe_ddc_edid : i2c_transfer: ret: -110, retry: 2
[  443.700754]: drm_do_probe_ddc_edid : i2c_transfer: ret: -110, retry: 1
[  443.707989]: drm_get_edid : called - drm_probe_ddc - failed
[  443.714303] dwhdmi-imx 120000.hdmi: failed to get edid

Is there any clue, how to resolve this i2c failure issue, after resume?
This does not happen in normal booting case.

These are the steps I follow:
* Boot the system normally (without display) and install all imx-drm as modules.
* Then uninstall the modules in reverse order.
* Take the snapshot of the system (suspend to disk).
* Reboot the system and boot with the image.
* Install all the modules again.
* Then launch the Weston.
* During the weston launch in the beginning we observe this error.


Regards,
Pintu

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: imx6: i2c-transfer timeout issue after resume
  2019-10-04 10:17     ` Pintu Agarwal
@ 2019-10-16  6:51       ` Pintu Agarwal
  0 siblings, 0 replies; 3+ messages in thread
From: Pintu Agarwal @ 2019-10-16  6:51 UTC (permalink / raw)
  To: p.zabel, bob.beckett, dri-devel, open list,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	linux-pm

On Fri, Oct 4, 2019 at 3:47 PM Pintu Agarwal <pintu.ping@gmail.com> wrote:
>
> Hi,
>
> On Sun, Sep 29, 2019 at 10:24 PM Pintu Agarwal <pintu.ping@gmail.com> wrote:
> >
> > >
> > > On Mon, Sep 23, 2019 at 1:28 PM Pintu Agarwal <pintu.ping@gmail.com> wrote:
> > > >
> > > > Dear Philipp,
> > > >
> > > > I have a iMX6dl custom board with custom Linux Kernel 4.8.
> > > > I have both LCD and HDMI connected to the board.
> > > > And we are using weston/wayland as the display interface.
> > > > In normal boot, both LCD and HDMI display is working fine.
> > > >
> > > > But, currently, for one of the requirement, I am trying to explore and
> > > > support hibernation image booting on it.
> > > > Currently, we are able to resume the system without display.
> > > > Also, if we make the entire imx-drm as modules, and then install the
> > > > modules after resume, even LCD is also coming up.
> > > > But HDMI display is black out.
> > > >
>
> I just found the main root cause of the HDMI screen blackout issue
> after system resume.
> * HDMI is trying to get EDID data from the monitor using I2C interface.
> * But its seems i2c_transfer is getting timeout after 5 retries.
> * Thus EDID data is failing, and HDMI could not able to detect the monitor.
>
> This is the logs:
>
> [  441.104989] [drm:drm_helper_probe_single_connector_modes]
> [CONNECTOR:29:HDMI-A-1] status updated from unknown to connected
> [  441.116080]: drm_helper_probe_single_connector_modes - inside -
> else override_edid
> [  441.124416]: drm_helper_probe_single_connector_modes - inside -
> else - drm_load_edid_firmware: count: 0
> [  441.134546]: drm_helper_probe_single_connector_modes - calling - get_modes
> [  441.142157]: dw_hdmi_connector_get_modes : called
> [  441.147652]: dw_hdmi_connector_get_modes : called - calling -> drm_get_edid
> [  441.155346]: drm_do_probe_ddc_edid : called!
> [  441.660759]: drm_do_probe_ddc_edid : i2c_transfer: ret: -110, retry: 5
> [  442.170758]: drm_do_probe_ddc_edid : i2c_transfer: ret: -110, retry: 4
> [  442.680755]: drm_do_probe_ddc_edid : i2c_transfer: ret: -110, retry: 3
> [  443.190755]: drm_do_probe_ddc_edid : i2c_transfer: ret: -110, retry: 2
> [  443.700754]: drm_do_probe_ddc_edid : i2c_transfer: ret: -110, retry: 1
> [  443.707989]: drm_get_edid : called - drm_probe_ddc - failed
> [  443.714303] dwhdmi-imx 120000.hdmi: failed to get edid
>
> Is there any clue, how to resolve this i2c failure issue, after resume?
> This does not happen in normal booting case.
>
> These are the steps I follow:
> * Boot the system normally (without display) and install all imx-drm as modules.
> * Then uninstall the modules in reverse order.
> * Take the snapshot of the system (suspend to disk).
> * Reboot the system and boot with the image.
> * Install all the modules again.
> * Then launch the Weston.
> * During the weston launch in the beginning we observe this error.
>

* Changing the subject to be more relevant.

I need some pointers in debugging this i2c_transfer timeout issue,
after system resume.
I am not so much familiar with i2c, so I am looking for some clue here.

i2c-experts (or pm experts), please help me to find the root cause and
debug further.

Thanks,
Pintu

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-16  6:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAOuPNLgH=JQeT3=tZ_AdBsV0e-S_JNEe4CtpFW8Wj5NfYW5PsA@mail.gmail.com>
     [not found] ` <CAOuPNLjqm+Dv5RARP6dzZRKSttCvqoLe7MNYOeChAGUWX1krRA@mail.gmail.com>
2019-09-29 16:54   ` imx6: hdmi black screen issue after resume Pintu Agarwal
2019-10-04 10:17     ` Pintu Agarwal
2019-10-16  6:51       ` imx6: i2c-transfer timeout " Pintu Agarwal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).