On Thu, May 06, 2021 at 02:36:21PM +0200, Mark Kettenis wrote:
> > Date: Thu, 6 May 2021 21:59:12 +1000
> > From: Jonathan Gray <j...@jsg.id.au>
> > 
> > On Wed, May 05, 2021 at 04:47:50PM -0500, Scott Cheloha wrote:
> > > 
> > > [...]
> > > 
> > > On a hunch I added additional parameter checks to task_add(9) and
> > > task_del(9) and caught intel(4) doing something strange.
> > > 
> > > [...]
> > > 
> > > And here is the panic on my machine.  I had to reconstruct it from
> > > OCR, the machine has no serial port, sorry if there are typos.
> > 
> > boot crash can be helpful for such machines

Oh nice, thanks.

> > > [...]
> > > 
> > > db_enter() at db_enter+Oxa
> > > panic(ffffffff81db24fb) at panic+0x12f
> > > task del(0,ffff8000010633e0) at task_del+Oxa8
> > > edp_panel vdd_on(ffff800001063128) at edp_panel_vdd_on+0x6a
> > > intel_dp_aux_xfer(ffff800001063128, ffffffff82512a20,4, 
> > > ffffffff82512400,2,0) at intel_dp_aux_xfer+0x18b
> > > intel_dp_aux_transfer(ffff8000010631e8, ffffffff82512a88) at 
> > > intel_dp_aux_transfer+0x183
> > > drm_dp_dpcd_access(ffff8000010631e8,9,0,ffff80000106313a, 1) at 
> > > drm_dp_dpcd_access+Oxa9
> > > drm_dp_dpcd_read(ffff8000010631e8,0,ffff80000106313a, f) at 
> > > drm_dp_dpcd_read+0x61
> > > intel_dp_read_dpcd(ffff800001063128) at intel_dp_read_dpcd+0x45
> > > intel_dp_init_connector(ffff800001063000, ffff800001064000) at 
> > > intel_dp_init_connector+0x988
> > > intel_ddi_init(ffff800000272000,0) at intel_ddi_init+0x454
> > > intel_modeset_init(ffff800000272000) at intel_modeset_init+0x1c9f
> > > i915_driver_probe(ffff800000272000, ffffffff82052f98) at 
> > > i915_driver_probe+0x7df
> > > inteldrm_attachhook(ffff800000272000) at inteldrm_attachhook+0x46
> > > end trace frame: Oxffffffff82512700, count: 0
> > > 
> > > From the backtrace, I gather the following:
> > > 
> > > edp_panel_vdd_on() calls clear_delayed_work() which is just a macro
> > 
> > cancel_delayed_work()

whoops

> > > that calls task_del().  And for whatever reason the taskq passed to
> > > task_del() is NULL.  Maybe there is a missing INIT_DELAYED_WORK() call
> > > somewhere prior to this point?
> > 
> > the call to that is in
> > INIT_DELAYED_WORK(&intel_dp->panel_vdd_work, edp_panel_vdd_work);
> > but tq doesn't get set until work is scheduled as there are interfaces
> > to pick a tq when scheduling work.
> > 
> > So perhaps you want something like this to catch the cases where work is
> > cancelled before it is scheduled.
> 
> Yeah, I think that makes sense.
> 
> ok kettenis@

This patch fixes the panic, running with it now.

ok cheloha@

Caveat: my confidence in my understanding of these interfaces is
pretty low.

-Scott

Reply via email to