[PATCH] serial/imx: check that the buffer is non-empty before sending it out

Greg KH greg at kroah.com
Thu Oct 14 14:47:53 EDT 2010


On Thu, Oct 14, 2010 at 01:27:35PM +0200, Daniel Mack wrote:
> On Wed, Oct 13, 2010 at 11:03:57AM +0200, Uwe Kleine-König wrote:
> > From: Volker Ernst <volker.ernst at txtr.com>
> > 
> > The .start_tx callback (imx_start_tx here) isn't only called when the
> > buffer is non-empty.  E.g. after resume or when handshaking is enabled
> > and the other side starts to signal being ready.
> > 
> > So check for an empty puffer already before sending the first character.
> > This prevents sending out stale (or uninitialised) data.
> > 
> > Signed-off-by: Volker Ernst <volker.ernst at txtr.com>
> > Signed-off-by: Daniel Mack <daniel at caiaq.de>
> > Cc: Andy Green <andy at warmcat.com>
> > [ukl: reword commit log, put check in while condition]
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> > ---
> > Hello,
> > 
> > as I didn't sent a patch, here comes my current version.  Don't know if
> > it makes it easier to test for you ...
> > 
> > I faked Daniel's SoB as Andrew said he did, compressed the changelog a
> > bit and put the check in the while condition as I suggested.
> 
> FWIW, that looks good to me. Thanks for finishing the work :)

Nice, I've replaced the original patch in my tree with this one.

thanks,

greg k-h



More information about the linux-arm-kernel mailing list