From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752641AbcI3LEU (ORCPT ); Fri, 30 Sep 2016 07:04:20 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:34226 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751168AbcI3LEK (ORCPT ); Fri, 30 Sep 2016 07:04:10 -0400 Date: Fri, 30 Sep 2016 13:04:11 +0200 From: Johan Hovold To: Stas Sergeev Cc: Johan Hovold , Caylan Van Larson , Alan Cox , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, sergei.shtylyov@cogentembedded.com Subject: Re: [PATCH] mos7840: fix chars_in_buffer() return value Message-ID: <20160930110411.GG5650@localhost> References: <1474729257-31498-1-git-send-email-stsp@list.ru> <20160929100929.GF5650@localhost> <5b55f2bb-8936-55bb-597d-68f073ea8620@list.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5b55f2bb-8936-55bb-597d-68f073ea8620@list.ru> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 30, 2016 at 12:00:30AM +0300, Stas Sergeev wrote: > 29.09.2016 13:09, Johan Hovold пишет: > > On Sat, Sep 24, 2016 at 06:00:57PM +0300, Stas Sergeev wrote: > >> The TIOCOUTQ ioctl calls chars_in_buffer(), and some apps depend on > >> a correct behaviour of that. > >> mos7840 implements it wrongly: if you write just one char, TIOCOUTQ > >> will return 32. > >> This patch should fix it by accounting the number of chars actually > >> written. > >> This patch, unfortunately, misses the Tested-by tag. > >> The reporter didn't test it, and I don't have the hardware in question. > > Why do you think the driver returns 32b in chars_in_buffer after writing > > a single character? > Hi Johan, this actually came from this ancient bug report: > https://bugzilla.kernel.org/show_bug.cgi?id=45791 > I was trying to add you back then and now, but your e-mail > doesn't seem to be registered in a bug tracker. Yeah, Greg does good job at direction bug reports to the usb mailing list. > The code in question was different when I submitted the > original patch: > https://bugzilla.kernel.org/attachment.cgi?id=77241 > Maybe the bug was since fixed. It does seem to have been addressed by commit 5c263b92f828 ("usb: serial: mos7840: Fixup mos7840_chars_in_buffer()") around the time of your original report in 2012. > In that case sorry for the noise. No worries. Thanks, Johan