From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934388AbcI2VAx (ORCPT ); Thu, 29 Sep 2016 17:00:53 -0400 Received: from smtp37.i.mail.ru ([94.100.177.97]:35374 "EHLO smtp37.i.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934277AbcI2VAm (ORCPT ); Thu, 29 Sep 2016 17:00:42 -0400 Subject: Re: [PATCH] mos7840: fix chars_in_buffer() return value To: Johan Hovold References: <1474729257-31498-1-git-send-email-stsp@list.ru> <20160929100929.GF5650@localhost> Cc: Caylan Van Larson , Alan Cox , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, sergei.shtylyov@cogentembedded.com From: Stas Sergeev Message-ID: <5b55f2bb-8936-55bb-597d-68f073ea8620@list.ru> Date: Fri, 30 Sep 2016 00:00:30 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20160929100929.GF5650@localhost> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Authentication-Results: smtp37.i.mail.ru; auth=pass smtp.auth=stsp@list.ru smtp.mailfrom=stsp@list.ru X-Mailru-Sender: CD12F6D16A91A659B59CAA31D804873EC8CE768AD7CF00B4A458773EB967C9BB3B6508AD906F6CCE660823B2EEFD31DC X-Mras: OK Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. In that case sorry for the noise.