On Wed, Dec 12, 2012 at 12:54:47PM -0800, Jesse Barnes wrote:
On Wed, 12 Dec 2012 14:06:44 +0100 Daniel Vetter daniel.vetter@ffwll.ch wrote:
Spinning for up to 200 us with interrupts locked out is not good. So let's just spin (and even that seems to be excessive).
And we don't call these functions from interrupt context, so this is not required. Besides that doing anything in interrupt contexts which might take a few hundred us is a no-go. So just convert the entire thing to a mutex. Also move the mutex-grabbing out of the read/write functions (add a WARN_ON(!is_locked)) instead) since all callers are nicely grouped together.
Finally the real motivation for this change: Dont grab the modeset mutex in the dpio debugfs file, we don't need that consistency. And correctness of the dpio interface is ensured with the dpio_lock.
Signed-off-by: Daniel Vetter daniel.vetter@ffwll.ch
Looks fine, I guess you could convert the wait_for_atomic_us to the non-atomic variant now that you have a mutex. Either way:
I like that _us purely to document the correct timeout ...
Reviewed-by: Jesse Barnes jbarnes@virtuousgeek.org
Queued for -next, thanks for the review. -Daniel