On Mon, May 07, 2018 at 05:09:21PM +0200, Daniel Vetter wrote:
> On Mon, May 07, 2018 at 02:33:25PM +0100, Chris Wilson wrote:
> > Quoting Feng Tang (2018-05-07 22:26:34)
> > > Hi Chris,
> > > 
> > > Thanks for the prompt review!
> > > 
> > > On Mon, May 07, 2018 at 11:40:45AM +0100, Chris Wilson wrote:
> > > > Quoting Feng Tang (2018-05-07 11:36:09)
> > > > > To fulfil the Dell 4K monitor, the dpcd max retries has been bumped
> > > > > from 7 to 32, which may hurt the boot/init time for some platforms,
> > > > > as the 32 retries may take hundreds of ms.
> > > > 
> > > > If we need that many retries, so be it. No modparam, the driver just has
> > > > to work.
> > > 
> > > I understand your point. The retry numer was originally 7, and worked
> > > fine untill the Dell 4K monitor which changes to 32.  According to my 
> > > test,
> > > each retry will take about 8ms on the A3960 based NUC.
> > > 
> > > One of our product need to boot up within a given time limit, this
> > > 32 retries will take about 1/3 of the budget (about 270ms), that's
> > > why I would try to make it a parameter.
> > 
> > The essence is that probing whether a monitor is connected should not be
> > blocking boot. If an async probe tries and fails to find a monitor,
> > fine - no one will notice. If it does take 270ms to find a monitor, it
> > turns on 200ms after userspace kicks in, just like any other hotplug.
> 
> Yeah, the fix here is to get the probing out of the driver load path, not
> to break the driver for some funky monitors. And definitely not using a
> modparam.

Hi Chris and Daniel,

After reading the i915 modeset init code, I did some experiments:
1. make the intel_modeset_init() function async (here async means
   creating a async func wrapper and call async_schedul() for it)
2. make the intel_setup_outpus()+intel_modeset_setup_hw_state() async 

But both of them will trigger kernel panic (log msg pasted in the end),
did I made some mistakes, or maybe the i915 codes following these functions
has dependency over them?

IIUC the dpcd access first happens in
    i915_driver_load --> i915_load_modeset_init --> intel_modeset_init
    --> intel_setup_outputs --> intel_ddi_init --> intel_edp_init_connector
    --> intel_edp_init_dpcd (to check if DPCD exist)

Should we postpone it to later phase or even after user space kick in?

Thanks,
Feng

---
Error msg for my async experiment:

[    0.715706] No backend configured for hyper_dmabuf in kernel config
[    0.716079] Hyper_dmabuf: no backend found
[    0.736361] intel_powerclamp: CPU does not support MWAIT
[    0.737643] [drm:wait_panel_status] *ERROR* PPS state mismatch
[    0.741381] genirq: Setting trigger mode 3 for irq 127 failed 
(intel_gpio_irq_type+0x0/0x110)
[    0.743244] dmi-sysfs: dmi entry is absent.
[    0.765116] [edp_panel_vdd_on()]: exit
[    0.765360] BUG: unable to handle kernel NULL pointer dereference at         
  (null)
[    0.765809] IP:           (null)
[    0.766005] PGD 0 P4D 0 
[    0.766168] Oops: 0010 [#1] PREEMPT SMP
[    0.766401] Modules linked in:
[    0.766592] CPU: 0 PID: 28 Comm: kworker/u8:1 Tainted: G     U  W       
4.14.39-sos+ #26
[    0.767075] Workqueue: events_unbound async_run_entry_fn
[    0.767392] task: ffff88027433c240 task.stack: ffff880274340000
[    0.767743] RIP: 0010:          (null)
[    0.767969] RSP: 0000:ffff880274343ab8 EFLAGS: 00010246
[    0.768281] RAX: 0000000000000000 RBX: 000000002d4003ff RCX: 0000000000000001
[    0.768701] RDX: 0000000080000000 RSI: 0000000000000000 RDI: ffff880272f21100
[    0.769121] RBP: 0000000000000000 R08: 000000002d4003ff R09: 0000000000000001
[    0.769541] R10: ffff880274343a60 R11: ffffffff82e7fe0d R12: 0000000000000001
[    0.769961] R13: ffff880273038000 R14: 0000000000000004 R15: ffff880272f21100
[    0.770383] FS:  0000000000000000(0000) GS:ffff88027dc00000(0000) 
knlGS:0000000000000000
[    0.770858] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    0.771199] CR2: 0000000000000000 CR3: 0000000002613000 CR4: 00000000003426f0
[    0.771619] Call Trace:
[    0.771779]  ? intel_dp_aux_ch+0x1a7/0x770
[    0.772031]  ? remove_wait_queue+0x60/0x60
[    0.772281]  ? intel_dp_aux_transfer+0xa6/0x200
[    0.772556]  ? drm_dp_dpcd_access+0x9d/0x150
[    0.772815]  ? drm_dp_dpcd_read+0x2c/0x60
[    0.773059]  ? drm_dp_read_desc+0x43/0xf0
[    0.773303]  ? intel_dp_detect+0x346/0x6a0
[    0.773554]  ? drm_helper_probe_single_connector_modes+0xcd/0x6b0
[    0.773920]  ? _raw_spin_unlock+0x14/0x30
[    0.774165]  ? vt_console_print+0x22a/0x3d0
[    0.774420]  ? preempt_count_add+0x56/0xa0
[    0.774669]  ? _raw_spin_lock_irqsave+0x32/0x40
[    0.774944]  ? drm_setup_crtcs+0x143/0x9e0
[    0.775195]  ? __drm_fb_helper_initial_config_and_unlock+0x3f/0x410
[    0.775567]  ? mutex_lock+0x1c/0x40
[    0.775783]  ? intel_fbdev_initial_config+0x14/0x30
[    0.776076]  ? async_run_entry_fn+0x39/0x160
[    0.776335]  ? process_one_work+0x14a/0x3c0
[    0.776588]  ? worker_thread+0x4d/0x3e0
[    0.776823]  ? kthread+0x10a/0x140
[    0.777031]  ? process_one_work+0x3c0/0x3c0
[    0.777284]  ? kthread_create_on_node+0x40/0x40
[    0.777557]  ? ret_from_fork+0x3a/0x50
[    0.777785] Code:  Bad RIP value.
[    0.777995] RIP:           (null) RSP: ffff880274343ab8
[    0.778305] CR2: 0000000000000000
[    0.778508] ---[ end trace f4e157ae338a4060 ]---
[    0.778786] Kernel panic - not syncing: Fatal exception
[    0.779160] Kernel Offset: disabled
[    0.779376] Rebooting in 10 seconds..
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to