Re: [RFC] drm/i915: _wait_for might be called when irq is off

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 02, 2015 at 07:21:40PM +0530, deepak.s@xxxxxxxxxxxxxxx wrote:
> From: Deepak S <deepak.s@xxxxxxxxxxxxxxx>
> 
> Sometimes, i915 might call _wait_for when irq is disabled.
> If the cpu is the main cpu to process jiffies, jiffies
> wouldn't be increased as this cpu disables irq. Then,
> time_after(jiffies, timeout__) becomes meaningless. If
> gunit doesn't work now, kernel wouldn't exit as the timeout
> doesn't work.
> 
> The patch fixes it by using sched_clock instead of jiffies.

sched_clock() requires irq disabled, or at least so the header claims,
at the very least it would require preemption disabled - definitely not
for our general waits of many ms. Also local_clock() would seem to be the
right choice in these tight loops.

I think you want a specialised macro (if any) that is very aware of the
constraints it is running under. I would hope we never have to busy spin
with interrupts disabled. And so I want such code that does to blatantly
obvious and scrutinised carefully.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux