24 Jul, 2015

1 commit

  • In little endian cases, macro htons unfolds to __swab16 which
    provides special case for constants. In big endian cases,
    __constant_htons and htons expand directly to the same expression.
    So, replace __constant_htons with htons with the goal of getting
    rid of the definition of __constant_htons completely.

    The semantic patch that performs this transformation is as follows:

    @@expression x;@@

    - __constant_htons(x)
    + htons(x)

    Signed-off-by: Vaishali Thakkar
    Signed-off-by: Greg Kroah-Hartman

    Vaishali Thakkar
     

25 May, 2015

1 commit


19 May, 2015

1 commit


11 May, 2015

1 commit

  • when gsmtty_remove put dlci, it will cause memory leak if dlci->port's refcount is zero.
    So we do the cleanup work in .cleanup callback instead.

    dlci will be last put in two call chains.
    1) gsmld_close -> gsm_cleanup_mux -> gsm_dlci_release -> dlci_put
    2) gsmld_remove -> dlci_put
    so there is a race. the memory leak depends on the race.

    In call chain 2. we hit the memory leak. below comment tells.

    release_tty -> tty_driver_remove_tty -> gsmtty_remove -> dlci_put -> tty_port_destructor (WARN_ON(port->itty) and return directly)
    |
    tty->port->itty = NULL;
    |
    tty_kref_put ---> release_one_tty -> gsmtty_cleanup (added by our patch)

    So our patch fix the memory leak by doing the cleanup work after tty core did.

    Signed-off-by: Pan Xinhui
    Fixes: dfabf7ffa30585
    Cc: stable # 3.14+
    Acked-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Pan Xinhui
     

07 May, 2015

1 commit

  • tty_name no longer uses the buf parameter, so remove it along with all
    the 64 byte stack buffers that used to be passed in.

    Mostly generated by the coccinelle script

    @depends on patch@
    identifier buf;
    constant C;
    expression tty;
    @@
    - char buf[C];

    allmodconfig compiles, so I'm fairly confident the stack buffers
    weren't used for other purposes as well.

    Signed-off-by: Rasmus Villemoes
    Reviewed-by: Peter Hurley
    Acked-by: Jesper Nilsson
    Acked-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Rasmus Villemoes
     

10 Apr, 2015

1 commit

  • The result of netdev_priv is already implicitly cast to the type of the
    left side of the assignment.

    The semantic patch that fixes this problem is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    type T;
    T *x;
    @@

    x =
    - (T *)
    netdev_priv(...)
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Greg Kroah-Hartman

    Julia Lawall
     

26 Mar, 2015

1 commit

  • this patch fixes following sparse warning:

    n_gsm.c:2827:22: warning: symbol 'tty_ldisc_packet' was not declared. Should it be static?

    Signed-off-by: Lad, Prabhakar
    Acked-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Lad, Prabhakar
     

07 Aug, 2014

1 commit

  • Pull networking updates from David Miller:
    "Highlights:

    1) Steady transitioning of the BPF instructure to a generic spot so
    all kernel subsystems can make use of it, from Alexei Starovoitov.

    2) SFC driver supports busy polling, from Alexandre Rames.

    3) Take advantage of hash table in UDP multicast delivery, from David
    Held.

    4) Lighten locking, in particular by getting rid of the LRU lists, in
    inet frag handling. From Florian Westphal.

    5) Add support for various RFC6458 control messages in SCTP, from
    Geir Ola Vaagland.

    6) Allow to filter bridge forwarding database dumps by device, from
    Jamal Hadi Salim.

    7) virtio-net also now supports busy polling, from Jason Wang.

    8) Some low level optimization tweaks in pktgen from Jesper Dangaard
    Brouer.

    9) Add support for ipv6 address generation modes, so that userland
    can have some input into the process. From Jiri Pirko.

    10) Consolidate common TCP connection request code in ipv4 and ipv6,
    from Octavian Purdila.

    11) New ARP packet logger in netfilter, from Pablo Neira Ayuso.

    12) Generic resizable RCU hash table, with intial users in netlink and
    nftables. From Thomas Graf.

    13) Maintain a name assignment type so that userspace can see where a
    network device name came from (enumerated by kernel, assigned
    explicitly by userspace, etc.) From Tom Gundersen.

    14) Automatic flow label generation on transmit in ipv6, from Tom
    Herbert.

    15) New packet timestamping facilities from Willem de Bruijn, meant to
    assist in measuring latencies going into/out-of the packet
    scheduler, latency from TCP data transmission to ACK, etc"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1536 commits)
    cxgb4 : Disable recursive mailbox commands when enabling vi
    net: reduce USB network driver config options.
    tg3: Modify tg3_tso_bug() to handle multiple TX rings
    amd-xgbe: Perform phy connect/disconnect at dev open/stop
    amd-xgbe: Use dma_set_mask_and_coherent to set DMA mask
    net: sun4i-emac: fix memory leak on bad packet
    sctp: fix possible seqlock seadlock in sctp_packet_transmit()
    Revert "net: phy: Set the driver when registering an MDIO bus device"
    cxgb4vf: Turn off SGE RX/TX Callback Timers and interrupts in PCI shutdown routine
    team: Simplify return path of team_newlink
    bridge: Update outdated comment on promiscuous mode
    net-timestamp: ACK timestamp for bytestreams
    net-timestamp: TCP timestamping
    net-timestamp: SCHED timestamp on entering packet scheduler
    net-timestamp: add key to disambiguate concurrent datagrams
    net-timestamp: move timestamp flags out of sk_flags
    net-timestamp: extend SCM_TIMESTAMPING ancillary data struct
    cxgb4i : Move stray CPL definitions to cxgb4 driver
    tcp: reduce spurious retransmits due to transient SACK reneging
    qlcnic: Initialize dcbnl_ops before register_netdev
    ...

    Linus Torvalds
     

02 Aug, 2014

2 commits


24 Jul, 2014

1 commit


16 Jul, 2014

1 commit

  • Extend alloc_netdev{,_mq{,s}}() to take name_assign_type as argument, and convert
    all users to pass NET_NAME_UNKNOWN.

    Coccinelle patch:

    @@
    expression sizeof_priv, name, setup, txqs, rxqs, count;
    @@

    (
    -alloc_netdev_mqs(sizeof_priv, name, setup, txqs, rxqs)
    +alloc_netdev_mqs(sizeof_priv, name, NET_NAME_UNKNOWN, setup, txqs, rxqs)
    |
    -alloc_netdev_mq(sizeof_priv, name, setup, count)
    +alloc_netdev_mq(sizeof_priv, name, NET_NAME_UNKNOWN, setup, count)
    |
    -alloc_netdev(sizeof_priv, name, setup)
    +alloc_netdev(sizeof_priv, name, NET_NAME_UNKNOWN, setup)
    )

    v9: move comments here from the wrong commit

    Signed-off-by: Tom Gundersen
    Reviewed-by: David Herrmann
    Signed-off-by: David S. Miller

    Tom Gundersen
     

08 Feb, 2014

1 commit

  • 3GPP TS 07.10 states in section 5.4.6.3.7:
    "The length byte contains the value 2 or 3 ... depending on the break
    signal." The break byte is optional and if it is sent, the length is
    3. In fact the driver was not able to work with modems that send this
    break byte in their modem status control message. If the modem just
    sends the break byte if it is really set, then weird things might
    happen.
    The code for deconding the modem status to the internal linux
    presentation in gsm_process_modem has already a big comment about
    this 2 or 3 byte length thing and it is already able to decode the
    brk, but the code calling the gsm_process_modem function in
    gsm_control_modem does not encode it and hand it over the right way.
    This patch fixes this.
    Without this fix if the modem sends the brk byte in it's modem status
    control message the driver will hang when opening a muxed channel.

    Signed-off-by: Lars Poeschel
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Lars Poeschel
     

19 Dec, 2013

1 commit

  • Commit 4d9b109060f690f5c835(tty: Prevent deadlock in n_gsm driver)
    tried to close all the virtual ports synchronously before closing the
    phycial ports, so the tty_vhangup() is used.

    But the tty_unlock/lock() is wrong:
    tty_release
    tty_ldisc_release
    tty_lock_pair(tty, o_tty) < == Here the tty is for physical port
    tty_ldisc_kill
    gsmld_close
    gsm_cleanup_mux
    gsm_dlci_release
    tty = tty_port_tty_get(&dlci->port)
    < == Here the tty(s) are for virtual port

    They are different ttys, so before tty_vhangup(virtual tty), do not need
    to call the tty_unlock(virtual tty) at all which causes unbalanced unlock
    warning.

    When enabling mutex debugging option, we will hit the below warning also:
    [ 99.276903] =====================================
    [ 99.282172] [ BUG: bad unlock balance detected! ]
    [ 99.287442] 3.10.20-261976-gaec5ba0 #44 Tainted: G O
    [ 99.293972] -------------------------------------
    [ 99.299240] mmgr/152 is trying to release lock (&tty->legacy_mutex) at:
    [ 99.306693] [] mutex_unlock+0xd/0x10
    [ 99.311669] but there are no more locks to release!
    [ 99.317131]
    [ 99.317131] other info that might help us debug this:
    [ 99.324440] 3 locks held by mmgr/152:
    [ 99.328542] #0: (&tty->legacy_mutex/1){......}, at: [] tty_lock_nested+0x40/0x90
    [ 99.338116] #1: (&tty->ldisc_mutex){......}, at: [] tty_ldisc_kill+0x22/0xd0
    [ 99.347284] #2: (&gsm->mutex){......}, at: [] gsm_cleanup_mux+0x73/0x170
    [ 99.356060]
    [ 99.356060] stack backtrace:
    [ 99.360932] CPU: 0 PID: 152 Comm: mmgr Tainted: G O 3.10.20-261976-gaec5ba0 #44
    [ 99.370086] ef4a4de0 ef4a4de0 ef4c1d98 c1b27b91 ef4c1db8 c1292655 c1dd10f5 c1b2dcad
    [ 99.378921] c1b2dcad ef4a4de0 ef4a528c ffffffff ef4c1dfc c12930dd 00000246 00000000
    [ 99.387754] 00000000 00000000 c15e1926 00000000 00000001 ddfa7530 00000003 c1b2dcad
    [ 99.396588] Call Trace:
    [ 99.399326] [] dump_stack+0x16/0x18
    [ 99.404307] [] print_unlock_imbalance_bug+0xe5/0xf0
    [ 99.410840] [] ? mutex_unlock+0xd/0x10
    [ 99.416110] [] ? mutex_unlock+0xd/0x10
    [ 99.421382] [] lock_release_non_nested+0x1cd/0x210
    [ 99.427818] [] ? gsm_destroy_network+0x36/0x130
    [ 99.433964] [] ? mutex_unlock+0xd/0x10
    [ 99.439235] [] lock_release+0x82/0x1c0
    [ 99.444505] [] ? mutex_unlock+0xd/0x10
    [ 99.449776] [] ? mutex_unlock+0xd/0x10
    [ 99.455047] [] __mutex_unlock_slowpath+0x5f/0xd0
    [ 99.461288] [] mutex_unlock+0xd/0x10
    [ 99.466365] [] tty_unlock+0x21/0x50
    [ 99.471345] [] gsm_cleanup_mux+0xc1/0x170
    [ 99.476906] [] gsmld_close+0x52/0x90
    [ 99.481983] [] tty_ldisc_close.isra.1+0x35/0x50
    [ 99.488127] [] tty_ldisc_kill+0x2c/0xd0
    [ 99.493494] [] tty_ldisc_release+0x2f/0x50
    [ 99.499152] [] tty_release+0x37c/0x4b0
    [ 99.504424] [] ? mutex_unlock+0xd/0x10
    [ 99.509695] [] ? mutex_unlock+0xd/0x10
    [ 99.514967] [] ? eventpoll_release_file+0x7e/0x90
    [ 99.521307] [] __fput+0xd9/0x200
    [ 99.525996] [] ____fput+0xd/0x10
    [ 99.530685] [] task_work_run+0x81/0xb0
    [ 99.535957] [] do_notify_resume+0x49/0x70
    [ 99.541520] [] work_notifysig+0x29/0x31
    [ 99.546897] ------------[ cut here ]------------

    So here we can call tty_vhangup() directly which is for virtual port.

    Reviewed-by: Chao Bi
    Signed-off-by: Liu, Chuansheng
    Signed-off-by: Greg Kroah-Hartman

    Chuansheng Liu
     

18 Dec, 2013

1 commit

  • Marks the functions gsm_cleanup_mux(), gsm_activate_mux(),
    gsm_free_mux(), gsm_alloc_mux() and gsm_change_mtu() as static in
    n_gsm.c because they are not used outside this file.

    Also, drop the EXPORT_SYMBOL_GPL for the above mentioned functions
    because nothing else in the kernel calls them.

    This eliminates the following warnings in n_gsm.c:
    drivers/tty/n_gsm.c:2022:6: warning: no previous prototype for ‘gsm_cleanup_mux’ [-Wmissing-prototypes]
    drivers/tty/n_gsm.c:2076:5: warning: no previous prototype for ‘gsm_activate_mux’ [-Wmissing-prototypes]
    drivers/tty/n_gsm.c:2120:6: warning: no previous prototype for ‘gsm_free_mux’ [-Wmissing-prototypes]
    drivers/tty/n_gsm.c:2156:17: warning: no previous prototype for ‘gsm_alloc_mux’ [-Wmissing-prototypes]
    drivers/tty/n_gsm.c:2714:5: warning: no previous prototype for ‘gsm_change_mtu’ [-Wmissing-prototypes]

    Signed-off-by: Rashika Kheria
    Reviewed-by: Josh Triplett
    Signed-off-by: Greg Kroah-Hartman

    Rashika Kheria
     

09 Dec, 2013

2 commits

  • ttyA has ld associated to n_gsm, when ttyA is closing, it triggers
    to release gsmttyB's ld data dlci[B], then race would happen if gsmttyB
    is opening in parallel.

    (Note: This patch set differs from previous set in that it uses mutex
    instead of spin lock to avoid race, so that it avoids sleeping in automic
    context)

    Here are race cases we found recently in test:

    CASE #1
    ====================================================================
    releasing dlci[B] race with gsmtty_install(gsmttyB), then panic
    in gsmtty_open(gsmttyB), as below:

    tty_release(ttyA) tty_open(gsmttyB)
    | |
    ----- gsmtty_install(gsmttyB)
    | |
    ----- gsm_dlci_alloc(gsmttyB) => alloc dlci[B]
    tty_ldisc_release(ttyA) -----
    | |
    gsm_dlci_release(dlci[B]) -----
    | |
    gsm_dlci_free(dlci[B]) -----
    | |
    ----- gsmtty_open(gsmttyB)

    gsmtty_open()
    {
    struct gsm_dlci *dlci = tty->driver_data; => here it uses dlci[B]
    ...
    }

    In gsmtty_open(gsmttyA), it uses dlci[B] which was release, so hit a panic.
    =====================================================================

    CASE #2
    =====================================================================
    releasing dlci[0] race with gsmtty_install(gsmttyB), then panic
    in gsmtty_open(), as below:

    tty_release(ttyA) tty_open(gsmttyB)
    | |
    ----- gsmtty_install(gsmttyB)
    | |
    ----- gsm_dlci_alloc(gsmttyB) => alloc dlci[B]
    | |
    ----- gsmtty_open(gsmttyB) fail
    | |
    ----- tty_release(gsmttyB)
    | |
    ----- gsmtty_close(gsmttyB)
    | |
    ----- gsmtty_detach_dlci(dlci[B])
    | |
    ----- dlci_put(dlci[B])
    | |
    tty_ldisc_release(ttyA) -----
    | |
    gsm_dlci_release(dlci[0]) -----
    | |
    gsm_dlci_free(dlci[0]) -----
    | |
    ----- dlci_put(dlci[0])

    In gsmtty_detach_dlci(dlci[B]), it tries to use dlci[0] which was released,
    then hit panic.
    =====================================================================

    IMHO, n_gsm tty operations would refer released ldisc, as long as
    gsm_dlci_release() has chance to release ldisc data when some gsmtty operations
    are ongoing..

    This patch is try to avoid it by:

    1) in n_gsm driver, use a global gsm mutex lock to avoid gsm_dlci_release() run in
    parallel with gsmtty_install();

    2) Increase dlci's ref count in gsmtty_install() instead of in gsmtty_open(), the
    purpose is to prevent gsm_dlci_release() releasing dlci after gsmtty_install()
    allocats dlci but before gsmtty_open increases dlci's ref count;

    3) Decrease dlci's ref count in gsmtty_remove(), a tty framework API, this is the
    opposite process of step 2).

    Signed-off-by: Chao Bi
    Signed-off-by: Greg Kroah-Hartman

    Chao Bi
     
  • Most line disciplines already handle the undocumented NULL flag
    ptr in their .receive_buf method; however, several don't.

    Document the NULL flag ptr, and correct handling in the
    N_MOUSE, N_GSM0710 and N_R394 line disciplines.

    Signed-off-by: Peter Hurley
    Acked-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Peter Hurley
     

25 Jul, 2013

1 commit

  • Specifically:
    n_gsm.c:810: ERROR: space required before the open parenthesis '('
    n_gsm.c:830: WARNING: line over 80 characters
    n_gsm.c:971: ERROR: trailing whitespace
    n_gsm.c:984: ERROR: code indent should use tabs where possible
    n_gsm.c:984: WARNING: please, no space before tabs
    n_gsm.c:984: WARNING: please, no spaces at the start of a line
    n_gsm.c:1141: WARNING: space prohibited before semicolon
    n_gsm.c:1743: ERROR: space required before the open brace '{'
    n_gsm.c:1744: WARNING: line over 80 characters
    n_gsm.c:1745: ERROR: code indent should use tabs where possible
    n_gsm.c:1746: ERROR: code indent should use tabs where possible
    n_gsm.c:2908: WARNING: line over 80 characters
    n_gsm.c:2912: ERROR: trailing whitespace

    Signed-off-by: Aldo Iljazi
    Signed-off-by: Greg Kroah-Hartman

    Aldo Iljazi
     

19 Mar, 2013

2 commits

  • Move HUPCL handling to port shutdown so that DTR is dropped also on hang
    up (tty_port_close is a noop for hung-up ports).

    Also do not try to drop DTR for uninitialised ports where it has never
    been raised (e.g. after a failed open).

    Note that this is also the current behaviour of serial-core.

    Nine drivers currently call tty_port_close_start directly (rather than
    through tty_port_close) and seven of them lower DTR as part of their
    close (if the port has been initialised). Fixup the remaining two
    drivers so that it continues to be lowered also on normal (non-HUP)
    close. [ Note that most of those other seven drivers did not expect DTR
    to have been dropped by tty_port_close_start in the first place. ]

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • It allows for cleaning up on a considerable amount of places. They did
    port_get, hangup, kref_put. Now the only thing needed is to call
    tty_port_tty_hangup which does exactly that. And they can also decide
    whether to consider CLOCAL or completely ignore that.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     

30 Jan, 2013

1 commit

  • This change fixes a deadlock when the multiplexer is closed while there
    are still client side ports open.

    When the multiplexer is closed and there are active tty's it tries to
    close them with tty_vhangup. This has a problem though, because
    tty_vhangup needs the tty_lock. This patch changes it to unlock the
    tty_lock before attempting the hangup and relocks afterwards. The
    additional call to tty_port_tty_set is needed because otherwise the
    port stays active because of the reference counter.

    This change also exposed another problem that other code paths don't
    expect that the multiplexer could have been closed. This patch also adds
    checks for these cases in the gsmtty_ class of function that could be
    called.

    The documentation explicitly states that "first close all virtual ports
    before closing the physical port" but we've found this to not always
    reality in our field situations. The GPRS / UTMS modem sometimes crashes
    and needs a power cycle in that case which means cleanly shutting down
    everything is not always possible. This change makes it much more robust
    for our situation where at least the system is recoverable with this patch
    and doesn't hang in a deadlock situation inside the kernel.

    The patch is against the long term support kernel (3.4.27) and should
    apply cleanly to more recent branches. Tested with a Telit GE864-QUADV2
    and Telit HE910 modem.

    Signed-off-by: Dirkjan Bussink
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Dirkjan Bussink
     

16 Jan, 2013

5 commits

  • This reverts commit f96f7f7f39af53274d98aa9c29d6fa4d122218a4, at the
    request of Jin.

    Cc: xiaojin
    Cc: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Now, we start converting tty buffer functions to actually use
    tty_port. This will allow us to get rid of the need of tty in many
    call sites. Only tty_port will needed and hence no more
    tty_port_tty_get in those paths.

    Now, the one where most of tty_port_tty_get gets removed:
    tty_flip_buffer_push.

    IOW we also closed all the races in drivers not using tty_port_tty_get
    at all yet.

    Also we move tty_flip_buffer_push declaration from include/linux/tty.h
    to include/linux/tty_flip.h to all others while we are changing it
    anyway.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     
  • Now, we start converting tty buffer functions to actually use
    tty_port. This will allow us to get rid of the need of tty in many
    call sites. Only tty_port will needed and hence no more
    tty_port_tty_get in those paths.

    tty_insert_flip_string this time.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     
  • Now, we start converting tty buffer functions to actually use
    tty_port. This will allow us to get rid of the need of tty in many
    call sites. Only tty_port will needed and hence no more
    tty_port_tty_get in those paths.

    tty_insert_flip_char is the next one to proceed. This one is used all
    over the code, so the patch is huge.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     
  • All the call to gsm->output should be in the tx_lock,
    that could avoid potential race from MUX level. But
    we have no tx_lock in gsm_send.

    This patch is to add tx_lock in gsm_send.

    Signed-off-by: xiaojin
    Acked-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    xiaojin
     

16 Nov, 2012

1 commit

  • After commit "TTY: move tty buffers to tty_port", the tty buffers are
    not freed in some drivers. This is because tty_port_destructor is not
    called whenever a tty_port is freed. This was an assumption I counted
    with but was unfortunately untrue. So fix the drivers to fulfil this
    assumption.

    Here it is enough to switch to refcounting in tty_port.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     

17 Sep, 2012

1 commit


17 Aug, 2012

8 commits

  • Uplink (TX) network data will go through gsm_dlci_data_output_framed
    there is a bug where if memory allocation fails, the skb which
    has already been pulled off the list will be lost.

    In addition TX skbs were being processed in LIFO order

    Fixed the memory leak, and changed to FIFO order processing

    Signed-off-by: Russ Gorby
    Tested-by: Kappel, LaurentX
    Signed-off-by: Alan Cox
    Cc: Showjumping
    Signed-off-by: Greg Kroah-Hartman

    Russ Gorby
     
  • Drivers are supposed to use the dev_* versions of the kfree_skb
    interfaces. In a couple of cases we were called with IRQs
    disabled as well which kfree_skb() does not expect.

    Replaced kfree_skb calls w/ dev_kfree_skb and dev_kfree_skb_any

    Signed-off-by: Russ Gorby
    Tested-by: Yin, Fengwei
    Signed-off-by: Alan Cox
    Cc: Grooming
    Signed-off-by: Greg Kroah-Hartman

    Russ Gorby
     
  • gsm_data_kick was recently modified to allow messages on the
    tx queue bound for DLCI0 to flow even during FCOFF conditions.
    Unfortunately we introduced a bug discovered by code inspection
    where subsequent list traversers can access freed memory if
    the DLCI0 messages were not all at the head of the list.

    Replaced singly linked tx list w/ a list_head and used
    provided interfaces for traversing and deleting members.

    Signed-off-by: Russ Gorby
    Tested-by: Yin, Fengwei
    Signed-off-by: Alan Cox
    Cc: Riding School
    Signed-off-by: Greg Kroah-Hartman

    Russ Gorby
     
  • There were some locking holes in the management of the MUX's
    message queue for 2 code paths:
    1) gsmld_write_wakeup
    2) receipt of CMD_FCON flow-control message
    In both cases gsm_data_kick is called w/o locking so it can collide
    with other other instances of gsm_data_kick (pulling messages tx_tail)
    or potentially other instances of __gsm_data_queu (adding messages to tx_head)

    Changed to take the tx_lock in these 2 cases

    Signed-off-by: Russ Gorby
    Tested-by: Yin, Fengwei
    Signed-off-by: Alan Cox
    Cc: Riding School
    Signed-off-by: Greg Kroah-Hartman

    Russ Gorby
     
  • The design of uplink flow control in the mux driver is
    that for constipated channels data will backup into the
    per-channel fifos, and any messages that make it to the
    outbound message queue will still go out.
    Code was added to also stop messages that were in the outbound
    queue but this requires filtering through all the messages on the
    queue for stopped dlcis and changes some of the mux logic unneccessarily.

    The message fiiltering was removed to be in line w/ the original design
    as the message filtering does not provide any solution.
    Extra debug messages used during investigation were also removed.

    Signed-off-by: samix.lebsir
    Signed-off-by: Alan Cox
    Cc: Dressage
    Signed-off-by: Greg Kroah-Hartman

    samix.lebsir
     
  • - Correcting handling of FCon/FCoff in order to respect 27.010 spec
    - Consider FCon/off will overide all dlci flow control except for
    dlci0 as we must be able to send control frames.
    - Dlci constipated handling according to FC, RTC and RTR values.
    - Modifying gsm_dlci_data_kick and gsm_dlci_data_sweep according
    to dlci constipated value

    Signed-off-by: Frederic Berat
    Signed-off-by: Russ Gorby
    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Frederic Berat
     
  • gsm_dlci_data_kick will not call any output function if tx_bytes > THRESH_LO
    furthermore it will call the output function only once if tx_bytes == 0
    If the size of the IP writes are on the order of THRESH_LO
    we can get into a situation where skbs accumulate on the outbound list
    being starved for events to call the output function.

    gsm_dlci_data_kick now calls the sweep function when tx_bytes==0

    Signed-off-by: Russ Gorby
    Tested-by: Kappel, LaurentX
    Signed-off-by: Alan Cox
    Cc: Hay and Water
    Signed-off-by: Greg Kroah-Hartman

    Russ Gorby
     
  • In 3GPP27.010 5.8.1, it defined:
    The TE multiplexer initiates the establishment of the multiplexer control channel by sending a SABM frame on DLCI 0 using the procedures of clause 5.4.1.
    Once the multiplexer channel is established other DLCs may be established using the procedures of clause 5.4.1.
    This patch implement 5.8.1 in MUX level, it make sure DLC0 is the first channel to be setup.

    [or for those not familiar with the specification: it was possible to try
    and open a data connection while the control channel was not yet fully
    open, which is a spec violation and confuses some modems]

    Signed-off-by: xiaojin
    Tested-by: Yin, Fengwei
    [tweaked the order we check things and error code]
    Signed-off-by: Alan Cox
    Cc: The Horsebox
    Signed-off-by: Greg Kroah-Hartman

    xiaojin
     

11 Aug, 2012

1 commit

  • We need to link a port to a tty in install. And since dlci is
    allocated even in open, we need to create gsmtty_install, allocate
    dlci there and create also the link.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     

17 Jul, 2012

1 commit

  • This will let us sort out a whole pile of tty related races. The
    alternative would be to keep points and refcount the termios objects.
    However
    1. They are tiny anyway
    2. Many devices don't use the stored copies
    3. We can remove a pty special case

    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Alan Cox
     

09 Mar, 2012

1 commit

  • All num, magic and owner are set by alloc_tty_driver. No need to
    re-set them on each allocation site.

    pti driver sets something different to what it passes to
    alloc_tty_driver. It is not a bug, since we don't use the lines
    parameter in any way. Anyway this is fixed, and now we do the right
    thing.

    Signed-off-by: Jiri Slaby
    Acked-by: Tilman Schmidt
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     

09 Nov, 2011

1 commit

  • Alek Du reported that the code erroneously applies time to jiffies
    conversions twice to the t1 and t2 values. In normal use on a modem link
    this cases no visible problem but on a slower link it will break as with
    HZ=1000 as is typical we are running t1/t2 ten times too fast.

    Alek's original patch removed the conversion from the timer setting but we
    in fact have to be more careful as the contents of t1/t2 are visible via
    the device API and we thus need to correct the constants.

    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Alan Cox