stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Hurley <peter@hurleysoftware.com>
To: Tilman Schmidt <tilman@imap.cc>
Cc: Jiri Slaby <jslaby@suse.cz>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	Linux kernel mailing list <linux-kernel@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH 3.12 16/33] isdn/gigaset: reset tty->receive_room when attaching ser_gigaset
Date: Mon, 21 Sep 2015 09:13:47 -0400	[thread overview]
Message-ID: <5600028B.4050904@hurleysoftware.com> (raw)
In-Reply-To: <55FC05C7.1000207@imap.cc>

On 09/18/2015 08:38 AM, Tilman Schmidt wrote:
> Am 17.09.2015 um 20:13 schrieb Peter Hurley:
>> On Wed, Sep 16, 2015 at 7:26 AM, Tilman Schmidt <tilman@imap.cc> wrote:
>>> Am 16.09.2015 um 03:18 schrieb Peter Hurley:
>>>> On Tue, Sep 15, 2015 at 8:37 PM, Tilman Schmidt <tilman@imap.cc> wrote:
>>>>> Am 16.09.2015 um 01:08 schrieb Peter Hurley:
>>>>>> On Tue, Sep 15, 2015 at 10:22 AM, Jiri Slaby <jslaby@suse.cz> wrote:
>>>>>>
>>>>>>     From: Tilman Schmidt <tilman@imap.cc>
>>>>>>
>>>>>>     3.12-stable review patch.  If anyone has any objections, please let
>>>>>>     me know.
>>>>>>
>>>>>>     ===============
>>>>>>
>>>>>>     [ Upstream commit fd98e9419d8d622a4de91f76b306af6aa627aa9c ]
>>>>>>
>>>>>>     Commit 79901317ce80 ("n_tty: Don't flush buffer when closing ldisc"),
>>>>>>     first merged in kernel release 3.10, caused the following regression
>>>>>>     in the Gigaset M101 driver:
>>>>>>
>>>>>>
>>>>>> Again, I'll just note my objection to this commit log.
>>>>>>
>>>>>> This driver was always broken because it never initialized
>>>>>> tty->receive_room,
>>>>>> but rather relied on common but not guaranteed circumstances to
>>>>>> function.
>>>>>>
>>>>>> The commit noted simply made the underlying bug more evident, but the
>>>>>> root cause was from the original merge commit of this driver.
>>>>>
>>>>> I must admit I still don't understand that objection. The meaning of the
>>>>> term "regression" is simply that something which previously worked
>>>>> stopped working. It doesn't imply any statement about the root cause.
>>>>>
>>>>> The ser-gigaset driver worked before the introduction of commit
>>>>> 79901317ce80. It didn't work anymore after the introduction of that
>>>>> commit. So it is correct, and does not contradict your statements above
>>>>> in any way, to state that commit introduced the described regression.
>>>>
>>>> By asserting that commit 79901317ce80 caused the regression, you're
>>>> claiming that this fix is unnecessary for kernel versions prior to 3.10
>>>
>>> Correct.
>>>
>>>> Are you certain that no other sequence of state leads to the same
>>>> condition (and thus requiring the same fix) in earlier kernel versions?
>>>
>>> Reasonably certain, yes, for three reasons:
>>> - There where no reports of that problem before 3.10.
>>
>>
>>
>>> - My own tests did never encounter that condition, and even after being
>>> made aware of it I was not able to come up with a test that would
>>> provoke it with a kernel version before 3.10.
>>
>> Do any of your tests switch to this line discipline from any other than N_TTY?
> 
> Of course not. That wouldn't make any sense.
> 
>> So for example, if you manually set N_PPP (as if by user error)
> 
> User error wouldn't suffice, as the LD would get reset to N_TTY when the
> serial device is closed. You would have to write a program that
> deliberately switched the LD first to N_PPP and then to N_GIGASET_M101
> without closing the device in between.

???

The tool you authored will do it from the command line

$ ldattach PPP /dev/ttyS1
$ ldattach GIGASET_M101 /dev/ttyS1

Note that nothing here closes the serial device 'in between', and
the tty core has switched directly from PPP to GIGASET_M101.
n_tty->receive_room is now 64K.

Please add switching from line disciplines other than N_TTY to your
regression testing.

>> and then set this line discipline, tty->receive_room will be 64K, not 4K.
> 
> That wouldn't affect the operation of ser_gigaset,

I've explained this before to you, but here it is again:

tty->receive_room announces the maximum amt of data the line discipline
can accept from tty core with each call to its receive_buf() method (for
line disciplines that don't provide flow control).

If the line discipline sets ->receive_room to 64K but can only handle
8K (as in the case of GIGASET_M101), then data loss should be the expected
result.


> so even if I had set
> up such a contrived test scenario it wouldn't have exposed any problem.
> Only setting tty->receive_room to 0 causes the problem, and N_TTY with
> commit 79901317ce80 is the only LD which does that.
> 
>>> - The requirement for line disciplines to set receive_room wasn't (and
>>> btw still isn't) documented anywhere, so it's unlikely anything actively
>>> relied on it.
>>
>> Nevertheless, that is the requirement, and what every other in-tree line
>> discipline does.
> 
> Your word for it. Still I don't understand the curious resistance to
> documenting it. If it is the requirement, why keep it secret?

Nothing sinister here :)

Feel free to submit documentation patches.

Regards,
Peter Hurley 


  reply	other threads:[~2015-09-21 13:13 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-15 14:22 [PATCH 3.12 00/33] 3.12.48-stable review Jiri Slaby
2015-09-15 14:21 ` [PATCH 3.12 01/33] mfd: lpc_ich: Assign subdevice ids automatically Jiri Slaby
2015-09-15 14:21 ` [PATCH 3.12 02/33] drm/radeon: fix hotplug race at startup Jiri Slaby
2015-09-15 14:21 ` [PATCH 3.12 03/33] ipv6: Make MLD packets to only be processed locally Jiri Slaby
2015-09-15 14:21 ` [PATCH 3.12 04/33] net: graceful exit from netif_alloc_netdev_queues() Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 05/33] rtnetlink: verify IFLA_VF_INFO attributes before passing them to driver Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 06/33] ip_tunnel: fix ipv4 pmtu check to honor inner ip header df Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 07/33] net/tipc: initialize security state for new connection socket Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 08/33] bridge: mdb: zero out the local br_ip variable before use Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 09/33] net: pktgen: fix race between pktgen_thread_worker() and kthread_stop() Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 10/33] net: do not process device backlog during unregistration Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 11/33] net: call rcu_read_lock early in process_backlog Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 12/33] net: Clone skb before setting peeked flag Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 13/33] net: Fix skb csum races when peeking Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 14/33] net: Fix skb_set_peeked use-after-free bug Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 15/33] bridge: mdb: fix double add notification Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 16/33] isdn/gigaset: reset tty->receive_room when attaching ser_gigaset Jiri Slaby
     [not found]   ` <CAKU3ayUyyYZzDr-AiZEW7uy=kwTtNptnOZMAKEYyn+=dd_47bg@mail.gmail.com>
2015-09-16  0:37     ` Tilman Schmidt
2015-09-16  1:18       ` Peter Hurley
2015-09-16 11:26         ` Tilman Schmidt
2015-09-17 18:13           ` Peter Hurley
2015-09-18 12:38             ` Tilman Schmidt
2015-09-21 13:13               ` Peter Hurley [this message]
2015-09-21 13:38                 ` Tilman Schmidt
2015-09-21 16:54                   ` Peter Hurley
2015-09-21 17:31                     ` Tilman Schmidt
2015-09-21 16:07                 ` Tilman Schmidt
2015-10-06 21:00                   ` Paul Bolle
2015-10-12  9:18                     ` Tilman Schmidt
2015-09-15 14:22 ` [PATCH 3.12 17/33] ipv6: lock socket in ip6_datagram_connect() Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 18/33] bonding: fix destruction of bond with devices different from arphrd_ether Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 19/33] bonding: correct the MAC address for "follow" fail_over_mac policy Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 20/33] inet: frags: fix defragmented packet's IP header for af_packet Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 21/33] netlink: don't hold mutex in rcu callback when releasing mmapd ring Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 22/33] net/mlx4_core: Fix wrong index in propagating port change event to VFs Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 23/33] rds: fix an integer overflow test in rds_info_getsockopt() Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 24/33] mtip32xx: dynamically allocate buffer in debugfs functions Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 25/33] cifs: Send a logoff request before removing a smb session Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 26/33] lpfc: Fix scsi prep dma buf error Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 27/33] bio: fix argument of __bio_add_page() for max_sectors > 0xffff Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 28/33] dm cache mq: fix memory allocation failure for large cache devices Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 29/33] aio: fix reqs_available handling Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 30/33] netfilter: nf_conntrack: fix RCU race in nf_conntrack_find_get Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 31/33] netfilter: nf_conntrack: don't release a conntrack with non-zero refcnt Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 32/33] PCI: Add dev_flags bit to access VPD through function 0 Jiri Slaby
2015-09-15 14:22 ` [PATCH 3.12 33/33] PCI: Add VPD function 0 quirk for Intel Ethernet devices Jiri Slaby
2015-09-15 14:53 ` [PATCH 3.12 00/33] 3.12.48-stable review Nikolay Borisov
2015-09-16 13:59   ` Jiri Slaby
2015-09-15 16:12 ` Shuah Khan
2015-09-16  9:29   ` Jiri Slaby
2015-09-18  8:11   ` Jiri Slaby
2015-09-18 16:31     ` Rustad, Mark D
2015-09-15 16:27 ` Guenter Roeck
2015-09-18  8:12   ` Jiri Slaby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5600028B.4050904@hurleysoftware.com \
    --to=peter@hurleysoftware.com \
    --cc=davem@davemloft.net \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tilman@imap.cc \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).