Bug 45791

Summary: [PATCH] mos7840: fix chars_in_buffer
Product: Drivers Reporter: Stas Sergeev (stsp)
Component: SerialAssignee: Alan (alan)
Status: RESOLVED CODE_FIX    
Severity: normal CC: alan, johan, peter, stsp2
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.6.0-rc1-git and any other Subsystem:
Regression: No Bisected commit-id:
Attachments: the fix
the fix

Description Stas Sergeev 2012-08-09 16:00:01 UTC
Created attachment 77241 [details]
the fix

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.
The attached patch should fix it.
But it is not tested: customer reported the problem
and fails to test the patch.
Comment 1 Alan 2012-08-09 16:48:02 UTC
Looks sensible but it needs a Signed-off-by: and to be posted to linux-usb (cc me by all means)

Alan
Comment 2 Stas Sergeev 2016-09-23 21:41:21 UTC
Hmm, I have probably missed the last
message from Alan, and I think (looking
at the code) that the problem is still there.
Comment 3 Stas Sergeev 2016-09-24 13:21:09 UTC
Created attachment 239621 [details]
the fix

Patch updated.
All sign-offs added.
Comment 4 Johan Hovold 2016-09-30 11:06:57 UTC
This was addressed back in 2012 by commit 5c263b92f828 ("usb:
serial: mos7840: Fixup mos7840_chars_in_buffer()").
Comment 5 Stas Sergeev 2016-09-30 21:35:38 UTC
Thanks.