Staging
v0.8.1
https://github.com/torvalds/linux
Revision 3e3183bab0257a6d02038658c53b491e1378612f authored by David Woodhouse on 05 August 2006, 19:15:19 UTC, committed by Linus Torvalds on 06 August 2006, 15:57:49 UTC
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 <dwmw2@infradead.org>
Cc: Christer Weinigel <wingel@nano-system.com>
Cc: <Jordan.Crouse@amd.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 225add6
Raw File
Tip revision: 3e3183bab0257a6d02038658c53b491e1378612f authored by David Woodhouse on 05 August 2006, 19:15:19 UTC
[PATCH] SCX200_ACB: eliminate spurious timeout errors
Tip revision: 3e3183b
unroll.pl
#!/usr/bin/perl
#
# Take a piece of C code and for each line which contains the sequence $$
# repeat n times with $ replaced by 0...n-1; the sequence $# is replaced
# by the unrolling factor, and $* with a single $
#

($n) = @ARGV;
$n += 0;

while ( defined($line = <STDIN>) ) {
    if ( $line =~ /\$\$/ ) {
	$rep = $n;
    } else {
	$rep = 1;
    }
    for ( $i = 0 ; $i < $rep ; $i++ ) {
	$tmp = $line;
	$tmp =~ s/\$\$/$i/g;
	$tmp =~ s/\$\#/$n/g;
	$tmp =~ s/\$\*/\$/g;
	print $tmp;
    }
}
back to top