cafe_ccic/ov7670 hang on boot

Daniel Drake dsd at laptop.org
Wed Jun 18 11:08:24 EDT 2008


On Tue, 2008-06-17 at 13:08 -0600, Jonathan Corbet wrote:
> Daniel Drake <dsd at laptop.org> wrote:
> 
> > OK, thanks for the input. However there doesn't seem to be a timeout in
> > the case added by commit 6d77444aca29:
> > +	do {
> > +		prepare_to_wait(&cam->smbus_wait, &the_wait,
> > +				TASK_UNINTERRUPTIBLE);
> > +		schedule_timeout(1); /* even 1 jiffy is too long */
> > +		finish_wait(&cam->smbus_wait, &the_wait);
> > +	} while (!cafe_smbus_write_done(cam));
> > 
> > 
> > I'm only guessing, but I have a feeling we're looping infinitely there.
> 
> That, of course, would be easy enough to determine empirically.

I added a loop counter and made it print out a message when it reaches
the 500th iteration. It hit the condition rather quickly, and in the
first case: addr=0x42 command=0x46 value=0x58

This is one of the "More reserved magic, some of which tweaks white
balance" writes in ov7670_default_regs.

Turned it off, repeated the test, 2nd time it was different:
addr=0x42 command=0x69 value=0x0
This is the REG_GFIX write.

Reproduced it again, 3rd time: addr=0x42 command=0x45 value=0x34
This is another "more reserved magic" write.

There does not seem to be any consistency to the failures here.

> > We're testing an XO with that patch reverted, so far so good but we
> > should leave it for longer before making conclusions.

It has now rebooted 385 times without crashing, so this patch does
appear to be the culprit.

> But does that get you back to the long startup times that the patch went
> in to fix?  That won't make anybody happy.

As far as we can see, this patch was never included in any OLPC builds.
However, we do ship some other delay improvements such as 
http://dev.laptop.org/git?p=olpc-2.6;a=commitdiff;h=4ef53002

Any thoughts on where we go from here?

Thanks,
Daniel





More information about the Devel mailing list