From: Bryan O'Donoghue Date: Mon, 21 May 2007 00:59:46 +0100 Subject: [U-Boot-Users] PXA27x usbtty start up sequence In-Reply-To: <20070521001158.6056ad5d@localhost.localdomain> References: <20070512231906.GG11070@enneenne.com> <20070513132536.6ab397df@localhost.localdomain> <20070518171521.GA4199@enneenne.com> <20070520145436.180807c6@localhost.localdomain> <20070520160702.GB3887@enneenne.com> <20070520224017.1e50894c@localhost.localdomain> <20070520222342.GD30191@enneenne.com> <20070521001158.6056ad5d@localhost.localdomain> Message-ID: <20070521005946.3b3ab7b9@localhost.localdomain> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, 21 May 2007 00:11:58 +0100 Bryan O'Donoghue wrote: > On Mon, 21 May 2007 00:23:42 +0200 > Rodolfo Giometti wrote: > > > The problem is that the defice __is__ into configured state (USB > > cable is connected and /dev/ttyUSB0 is running) but nobody has > > opened the serial line (no minicom/kermit running). > > > > So, I suppose, the above modification is useless... For some reason I seem to fail to parse English occasionally I thought you'd said your device was in the configured state but, not physically connected to the HOST ! oops ! You are of course right checking for state configured would not fix your stall problem if the cable is connected to your PC but, this pseudo-code below would be a better improvement still... since we wouldn't even bother _trying_ to send unless the bus was in the configured state... which is what my warped mind was in fact attempting to get at. if(data && state == STATE_CONFIGURED && retries < 10000L){ /* Blah */ } You're still wrong about not having to deal with EP0 control requests after host enumeration, though. g_serial might let you away with it but, that's just g_serial's oddities I guess. There's no reason a host couldn't or wouldn't send you periodic get_status requests using g_serial or any other high level USB protocol and so theoretically if you don't respond to EP0 control requests the host can reset you ! I doubt any other driver then g_serial would let you away with this either ! I still think the fix is #1 above but, having re-read your email #2 If on TX timeout you propagate an error code upwards to write_buffer, it should be sufficient I think. write_buffer should be smart enough to retry tx on the data that didn't get sent and eventually the __puts() function itself should just give-up !