[PATCH] SCX200_ACB: eliminate spurious timeout errors
[PATCH] SCX200_ACB: eliminate spurious timeout errors

While busy-waiting for completion, check the hardware after scheduling;
don't schedule and then immediately check the _timeout_.  If the yield()
took a long time (as it does on my OLPC prototype board when it's busy),
we'd report a timeout even though the hardware was now ready.

This fixes it, and also switches the yield() for a cond_resched() because
we don't actually want to be _that_ nice about it.  I see nice
tightly-packed SMBus transactions now, rather than waiting for milliseconds
between successive phases.

Actually, we shouldn't be busy-waiting here at all.  We should be using
interrupts.  That's an exercise for another day though.

Signed-off-by: David Woodhouse <97b3379caa91f4ee97e44013ae4dc6350540fa9d@infradead.org>
Cc: Christer Weinigel <3f001f887642f7432bd253a5ee0996d8189addbf@nano-system.com>
Cc: <05af90f7931e66ab39ae7a0c5216d03345b70a6c@amd.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@osdl.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>

KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs