1. 02 Feb, 2015 2 commits
  2. 01 Feb, 2015 15 commits
    • David S. Miller's avatar
      Merge branch 'hso-next' · 2caabb3d
      David S. Miller authored
      Olivier Sobrie says:
      
      ====================
      hso: fix some problems in the disconnect path
      
      These patches attempt to fix some problems I observed when the hso
      device is disconnected.
      Several patches of this serie are fixing crashes or memleaks when a
      hso device is disconnected.
      This serie of patches is based on v3.18.
      
      changes in v2:
       - Last patch of the serie dropped since another patch fix the issue.
         See http://marc.info/?l=linux-usb&m=142186699418489 for more info.
      
       - Added an extra patch avoiding name conflicts for the rfkill interface.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2caabb3d
    • Olivier Sobrie's avatar
      hso: fix rfkill name conflicts · 38121067
      Olivier Sobrie authored
      By using only the usb interface number for the rfkill name, we might
      have a name conflicts in case two similar hso devices are connected.
      
      In this patch, the name of the hso rfkill interface embed the value
      of a counter that is incremented each time a new rfkill interface is
      added.
      Suggested-by: default avatarDan Williams <dcbw@redhat.com>
      Signed-off-by: default avatarOlivier Sobrie <olivier@sobrie.be>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      38121067
    • Olivier Sobrie's avatar
      hso: add missing cancel_work_sync in disconnect() · cc491970
      Olivier Sobrie authored
      For hso serial devices, two cancel_work_sync were missing in the
      disconnect method.
      Signed-off-by: default avatarOlivier Sobrie <olivier@sobrie.be>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cc491970
    • Olivier Sobrie's avatar
      hso: update serial_table in usb disconnect method · 301d3b7e
      Olivier Sobrie authored
      The serial_table is used to map the minor number of the usb serial device
      to its associated context. The table is updated in the probe method and
      in hso_serial_ref_free() which is called either from the tty cleanup
      method or from the usb disconnect method.
      This patch ensures that the serial_table is updated in the disconnect
      method and no more from the cleanup method to avoid the following
      potential race condition.
      
       - hso_disconnect() is called for usb interface "x". Because the serial
         port was open and because the cleanup method of the tty_port hasn't
         been called yet, hso_serial_ref_free() is not run.
       - hso_probe() is called and fails for a new hso serial usb interface
         "y". The function hso_free_interface() is called and iterates
         over the element of serial_table to find the device associated to
         the usb interface context.
         If the usb interface context of usb interface "y" has been created
         at the same place as for usb interface "x", then the cleanup
         functions are called for usb interfaces "x" and "y" and
         hso_serial_ref_free() is called for both interfaces.
       - release_tty() is called for serial port linked to usb interface "x"
         and possibly crash because the tty_port structure contained in the
         hso_device structure has been freed.
      Signed-off-by: default avatarOlivier Sobrie <olivier@sobrie.be>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      301d3b7e
    • Olivier Sobrie's avatar
      hso: move tty_unregister outside hso_serial_common_free() · 69b377b3
      Olivier Sobrie authored
      The function hso_serial_common_free() is called either by the cleanup
      method of the tty or by the usb disconnect method.
      In the former case, the usb_disconnect() has been already called
      and the sysfs group associated to the device has been removed.
      By calling tty_unregister directly from the usb_disconnect() method,
      we avoid a warning due to the removal of the sysfs group of the usb
      device.
      
      Example of warning:
      ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 778 at fs/sysfs/group.c:225 sysfs_remove_group+0x50/0x94()
      sysfs group c0645a88 not found for kobject 'ttyHS5'
      Modules linked in:
      CPU: 0 PID: 778 Comm: kworker/0:3 Tainted: G        W      3.18.0+ #105
      Workqueue: events release_one_tty
      [<c000dfe4>] (unwind_backtrace) from [<c000c014>] (show_stack+0x14/0x1c)
      [<c000c014>] (show_stack) from [<c0016bac>] (warn_slowpath_common+0x5c/0x7c)
      [<c0016bac>] (warn_slowpath_common) from [<c0016c60>] (warn_slowpath_fmt+0x30/0x40)
      [<c0016c60>] (warn_slowpath_fmt) from [<c00ddd14>] (sysfs_remove_group+0x50/0x94)
      [<c00ddd14>] (sysfs_remove_group) from [<c0221e44>] (device_del+0x30/0x190)
      [<c0221e44>] (device_del) from [<c0221fb0>] (device_unregister+0xc/0x18)
      [<c0221fb0>] (device_unregister) from [<c0221fec>] (device_destroy+0x30/0x3c)
      [<c0221fec>] (device_destroy) from [<c01fe1dc>] (tty_unregister_device+0x2c/0x5c)
      [<c01fe1dc>] (tty_unregister_device) from [<c029a428>] (hso_serial_common_free+0x2c/0x88)
      [<c029a428>] (hso_serial_common_free) from [<c029a4c0>] (hso_serial_ref_free+0x3c/0xb8)
      [<c029a4c0>] (hso_serial_ref_free) from [<c01ff430>] (release_one_tty+0x30/0x84)
      [<c01ff430>] (release_one_tty) from [<c00271d4>] (process_one_work+0x21c/0x3c8)
      [<c00271d4>] (process_one_work) from [<c0027758>] (worker_thread+0x3d8/0x560)
      [<c0027758>] (worker_thread) from [<c002be4c>] (kthread+0xc0/0xcc)
      [<c002be4c>] (kthread) from [<c0009630>] (ret_from_fork+0x14/0x24)
      ---[ end trace cb88537fdc8fa208 ]---
      Signed-off-by: default avatarOlivier Sobrie <olivier@sobrie.be>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      69b377b3
    • Olivier Sobrie's avatar
      hso: replace reset_device work by usb_queue_reset_device() · 26c1f1f5
      Olivier Sobrie authored
      There is no need for a dedicated reset work in the hso driver since
      there is already a reset work foreseen in usb_interface that does
      the same.
      Signed-off-by: default avatarOlivier Sobrie <olivier@sobrie.be>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      26c1f1f5
    • Olivier Sobrie's avatar
      hso: rename hso_dev into serial in hso_free_interface() · f6516b69
      Olivier Sobrie authored
      In other functions of the driver, variables of type "struct hso_serial"
      are denoted by "serial" and variables of type "struct hso_device" are
      denoted by "hso_dev". This patch makes the hso_free_interface()
      consistent with these notations.
      Signed-off-by: default avatarOlivier Sobrie <olivier@sobrie.be>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f6516b69
    • Olivier Sobrie's avatar
      hso: fix small indentation error · 79927679
      Olivier Sobrie authored
      Simply remove the useless extra tab.
      Signed-off-by: default avatarOlivier Sobrie <olivier@sobrie.be>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      79927679
    • Olivier Sobrie's avatar
      hso: fix memory leak in hso_create_rfkill() · 2e6d01ff
      Olivier Sobrie authored
      When the rfkill interface was created, a buffer containing the name
      of the rfkill node was allocated. This buffer was never freed when the
      device disappears.
      
      To fix the problem, we put the name given to rfkill_alloc() in
      the hso_net structure.
      Signed-off-by: default avatarOlivier Sobrie <olivier@sobrie.be>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2e6d01ff
    • Olivier Sobrie's avatar
      hso: fix memory leak when device disconnects · 295fc56f
      Olivier Sobrie authored
      In the disconnect path, tx_buffer should freed like tx_data to avoid
      a memory leak when the device disconnects.
      Signed-off-by: default avatarOlivier Sobrie <olivier@sobrie.be>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      295fc56f
    • Olivier Sobrie's avatar
      hso: fix crash when device disappears while serial port is open · 29bd3bc1
      Olivier Sobrie authored
      When the device disappear, the function hso_disconnect() is called to
      perform cleanup. In the cleanup function, hso_free_interface() calls
      tty_port_tty_hangup() in view of scheduling a work to hang up the tty if
      needed. If the port was not open then hso_serial_ref_free() is called
      directly to cleanup everything. Otherwise, hso_serial_ref_free() is called
      when the last fd associated to the port is closed.
      
      For each open port, tty_release() will call the close method,
      hso_serial_close(), which drops the last kref and call
      hso_serial_ref_free() which unregisters, destroys the tty port
      and finally frees the structure in which the tty_port structure
      is included. Later, in tty_release(), more precisely when release_tty()
      is called, the tty_port previously freed is accessed to cancel
      the tty buf workqueue and it leads to a crash.
      
      In view of avoiding this crash, we add a cleanup method that is called
      at the end of the hangup process and we drop the last kref in this
      function when all the ports have been closed, when tty_port is no
      more needed and when it is safe to free the structure containing the
      tty_port structure.
      Signed-off-by: default avatarOlivier Sobrie <olivier@sobrie.be>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      29bd3bc1
    • Olivier Sobrie's avatar
      hso: remove useless header file timer.h · 3ac856c1
      Olivier Sobrie authored
      No timer related function is used in this driver.
      Signed-off-by: default avatarOlivier Sobrie <olivier@sobrie.be>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3ac856c1
    • Eric Dumazet's avatar
      ipv4: icmp: use percpu allocation · 349c9e3c
      Eric Dumazet authored
      Get rid of nr_cpu_ids and use modern percpu allocation.
      
      Note that the sockets themselves are not yet allocated
      using NUMA affinity.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      349c9e3c
    • Karicheri, Muralidharan's avatar
      drivers: net: cpsw: make cpsw_ale.c a module to allow re-use on Keystone · 58c11b5f
      Karicheri, Muralidharan authored
      NetCP on Keystone has cpsw ale function similar to other TI SoCs
      and this driver is re-used. To allow both ti cpsw and keystone netcp
      to re-use the driver, convert the cpsw ale to a module and configure
      it through Kconfig option CONFIG_TI_CPSW_ALE. Currently it is statically
      linked to both TI CPSW and NetCP and this causes issues when the above
      drivers are built as dynamic modules. This patch addresses this issue
      
      While at it, fix the Makefile and code to build both netcp_core and
      netcp_ethss as dynamic modules. This is needed to support arm allmodconfig.
      This also requires exporting of API calls provided by netcp_core so that
      both the above can be dynamic modules.
      Signed-off-by: default avatarMurali Karicheri <m-karicheri2@ti.com>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
      Acked-by: default avatarMugunthan V N <mugunthanvnm@ti.com>
      Tested-by: default avatarMugunthan V N <mugunthanvnm@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      58c11b5f
    • Kenneth Klette Jonassen's avatar
      tcp: use SACK RTTs for CC · 932eb763
      Kenneth Klette Jonassen authored
      Current behavior only passes RTTs from sequentially acked data to CC.
      
      If sender gets a combined ACK for segment 1 and SACK for segment 3, then the
      computed RTT for CC is the time between sending segment 1 and receiving SACK
      for segment 3.
      
      Pass the minimum computed RTT from any acked data to CC, i.e. time between
      sending segment 3 and receiving SACK for segment 3.
      Signed-off-by: default avatarKenneth Klette Jonassen <kennetkl@ifi.uio.no>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      932eb763
  3. 31 Jan, 2015 7 commits
  4. 29 Jan, 2015 10 commits
  5. 28 Jan, 2015 6 commits