• D
    tty: n_gsm: fix broken virtual tty handling · a8c5b825
    Daniel Starke 提交于
    Dynamic virtual tty registration was introduced to allow the user to handle
    these cases with uevent rules. The following commits relate to this:
    Commit 5b87686e ("tty: n_gsm: Modify gsmtty driver register method when config requester")
    Commit 0b91b533 ("tty: n_gsm: Save dlci address open status when config requester")
    Commit 46292622 ("tty: n_gsm: clean up indenting in gsm_queue()")
    
    However, the following behavior can be seen with this implementation:
    - n_gsm ldisc is activated via ioctl
    - all configuration parameters are set to their default value (initiator=0)
    - the mux gets activated and attached and gsmtty0 is being registered in
      in gsm_dlci_open() after DLCI 0 was established (DLCI 0 is the control
      channel)
    - the user configures n_gsm via ioctl GSMIOC_SETCONF as initiator
    - this re-attaches the n_gsm mux
    - no new gsmtty devices are registered in gsmld_attach_gsm() because the
      mux is already active
    - the initiator side registered only the control channel as gsmtty0
      (which should never happen) and no user channel tty
    
    The commits above make it impossible to operate the initiator side as no
    user channel tty is or will be available.
    On the other hand, this behavior will make it also impossible to allow DLCI
    parameter negotiation on responder side in the future. The responder side
    first needs to provide a device for the application before the application
    can set its parameters of the associated DLCI via ioctl.
    Note that the user application is still able to detect a link establishment
    without relaying to uevent by waiting for DTR open on responder side. This
    is the same behavior as on a physical serial interface. And on initiator
    side a tty hangup can be detected if a link establishment request failed.
    
    Revert the commits above completely to always register all user channels
    and no control channel after mux attachment. No other changes are made.
    
    Fixes: 5b87686e ("tty: n_gsm: Modify gsmtty driver register method when config requester")
    Cc: stable@vger.kernel.org
    Signed-off-by: NDaniel Starke <daniel.starke@siemens.com>
    Link: https://lore.kernel.org/r/20220422071025.5490-1-daniel.starke@siemens.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    a8c5b825
n_gsm.c 80.4 KB