1. 31 7月, 2015 4 次提交
    • P
      USB: io_ti: Add heartbeat to keep idle EP/416 ports from disconnecting · 26c78daa
      Peter E. Berger 提交于
      When using Edgeport/416 models with newer firmware (sometime after
      firmware version 4.80.0), idle ports are automatically bounced
      (disconnected and then reconnected) approximately every 60 seconds.
      This breaks programs (e.g: minicom) where idle periods are common,
      normal and expected.
      
      I confirmed with the manufacturer (Digi International) that Edgeport/416
      models now ship from the factory with firmware that expects periodic
      "heartbeat" queries from the driver to keep idle ports alive.  This
      patch implements heartbeat support using the mechanism Digi suggested
      (periodically requesting an I2C descriptor address) that appears effective
      on Edgeports running the newer firmware (that require it) and benign on
      Edgeport devices running older firmware.  Since we know that Edgeport
      firmware version 4.80 (the version distributed in /lib/firmware/down3.bin
      and used for Edgeports that are either running still older versions or
      have no onboard non-volatile firmware image) does not require heartbeat
      support, this patch schedules heartbeats only on Edgeport/416 devices,
      and only if they are running firmware versions newer than 4.80.
      Signed-off-by: NPeter E. Berger <pberger@brimson.com>
      [johan: minor style changes ]
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      26c78daa
    • P
      USB: io_ti: Add firmware image sanity checks · dcb8e99d
      Peter E. Berger 提交于
      Do what we can to verify that the driver's firmware image is valid
      (before attempting to download it to the Edgeport) by adding a new
      function, check_fw_sanity(), and a call to it in in download_fw().
      
      Note: It looks like some Edgeports (models like the EP/416 with on-board
      E2PROM) may be able to function even if the on-disk firmware image is
      bad or missing, iff their local E2PROM versions are valid.  But most
      Edgeport models (I've tried EP/1 and EP/8) do not appear to have this
      capability and they always rely on the on-disk firmware image.
      
      I tested an implementation that calls the new check_fw_sanity()
      function at the top of download_fw() and, rather than simply returning
      an error if the firmware image is bad or missing, it saves the result
      and defers the decision until later when it may find that it is running
      on a E2PROM-equipped device with a valid image.  But I think this is
      messier than it is worth (adding still more messiness to the already
      very messy download_fw()) for such a marginal possible benefit.  So, at
      least for now, I have chosen the much simpler approach of returning an
      error whenever edge_startup() fails to load an on-disk firmware image, or
      check_fw_sanity() indicates that it is unusable.
      Signed-off-by: NPeter E. Berger <pberger@brimson.com>
      [johan: drop redundant checksum mask ]
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      dcb8e99d
    • P
      USB: io_ti: Fix firmware version handling · c0e34831
      Peter E. Berger 提交于
      The io_ti driver fails to download firmware to Edgeport
      devices such as the EP/416, even when the on-disk firmware image
      (/lib/firmware/edgeport/down3.bin) is more current than the version
      on the EP/416.  The current download code is broken in a few ways.
      Notably it mis-uses global variables OperationalMajorVersion and
      OperationalMinorVersion (reading their values before they've been
      properly initialized and subsequently initializing them multiple times
      without synchronization).  This patch drops the global variables and
      replaces the redundant calls to request_firmware()/release_firmware()
      in download_fw() with a single call pair in edge_startup(); the firmware
      image pointer is then passed to download_fw() and build_i2c_fw_hdr().
      Signed-off-by: NPeter E. Berger <pberger@brimson.com>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      c0e34831
    • P
      USB: io_ti: Increase insufficient timeout for firmware downloads · c3ece7e7
      Peter E. Berger 提交于
      The io_ti driver fails to download firmware to Edgeport devices such as
      the EP/416 and EP/421 (devices with on-board E2PROM).  One of the problems
      is that the default 1 second timeout in ti_vsend_sync() is insufficient
      for download operations.  This patch increases the download timeout to
      10 seconds.
      Signed-off-by: NPeter E. Berger <pberger@brimson.com>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      c3ece7e7
  2. 24 9月, 2014 1 次提交
  3. 28 5月, 2014 1 次提交
    • J
      USB: io_ti: fix firmware download on big-endian machines (part 2) · c03890ff
      Johan Hovold 提交于
      A recent patch that purported to fix firmware download on big-endian
      machines failed to add the corresponding sparse annotation to the
      i2c-header. This was reported by the kbuild test robot.
      
      Adding the appropriate annotation revealed another endianess bug related
      to the i2c-header Size-field in a code path that is exercised when the
      firmware is actually being downloaded (and not just verified and left
      untouched unless older than the firmware at hand).
      
      This patch adds the required sparse annotation to the i2c-header and
      makes sure that the Size-field is sent in little-endian byte order
      during firmware download also on big-endian machines.
      
      Note that this patch is only compile-tested, but that there is no
      functional change for little-endian systems.
      Reported-by: Nkbuild test robot <fengguang.wu@intel.com>
      Cc: Ludovic Drolez <ldrolez@debian.org>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <jhovold@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c03890ff
  4. 26 4月, 2014 1 次提交
  5. 09 1月, 2014 1 次提交
  6. 04 1月, 2014 2 次提交
  7. 26 8月, 2013 1 次提交
  8. 24 7月, 2013 3 次提交
  9. 18 6月, 2013 1 次提交
    • G
      USB: serial: make minor allocation dynamic · e5b1e206
      Greg Kroah-Hartman 提交于
      This moves the allocation of minor device numbers from a static array to
      be dynamic, using the idr interface.  This means that you could
      potentially get "gaps" in a minor number range for a single USB serial
      device with multiple ports, but all should still work properly.
      
      We remove the 'minor' field from the usb_serial structure, as it no
      longer makes any sense for it (use the field in the usb_serial_port
      structure if you really want to know this number), and take the fact
      that we were overloading a number in this field to determine if we had
      initialized the minor numbers or not, and just use a flag variable
      instead.
      
      Note, we still have the limitation of 255 USB to serial devices in the
      system, as that is all we are registering with the TTY layer at this
      point in time.
      Tested-by: NTobias Winter <tobias@linuxdingsda.de>
      Reviewed-by: NJohan Hovold <jhovold@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e5b1e206
  10. 11 6月, 2013 1 次提交
    • G
      USB: serial: ports: add minor and port number · 1143832e
      Greg Kroah-Hartman 提交于
      The usb_serial_port structure had the number field, which was the minor
      number for the port, which almost no one really cared about.  They
      really wanted the number of the port within the device, which you had to
      subtract from the minor of the parent usb_serial_device structure.  To
      clean this up, provide the real minor number of the port, and the number
      of the port within the serial device separately, as these numbers might
      not be related in the future.
      
      Bonus is that this cleans up a lot of logic in the drivers, and saves
      lines overall.
      Tested-by: NTobias Winter <tobias@linuxdingsda.de>
      Reviewed-by: NJohan Hovold <jhovold@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      --
       drivers/staging/serqt_usb2/serqt_usb2.c |   21 +++--------
       drivers/usb/serial/ark3116.c            |    2 -
       drivers/usb/serial/bus.c                |    6 +--
       drivers/usb/serial/console.c            |    2 -
       drivers/usb/serial/cp210x.c             |    2 -
       drivers/usb/serial/cypress_m8.c         |    4 +-
       drivers/usb/serial/digi_acceleport.c    |    6 ---
       drivers/usb/serial/f81232.c             |    5 +-
       drivers/usb/serial/garmin_gps.c         |    6 +--
       drivers/usb/serial/io_edgeport.c        |   58 ++++++++++++--------------------
       drivers/usb/serial/io_ti.c              |   21 ++++-------
       drivers/usb/serial/keyspan.c            |   29 +++++++---------
       drivers/usb/serial/metro-usb.c          |    4 +-
       drivers/usb/serial/mos7720.c            |   37 +++++++++-----------
       drivers/usb/serial/mos7840.c            |   52 +++++++++-------------------
       drivers/usb/serial/opticon.c            |    2 -
       drivers/usb/serial/pl2303.c             |    2 -
       drivers/usb/serial/quatech2.c           |    7 +--
       drivers/usb/serial/sierra.c             |    2 -
       drivers/usb/serial/ti_usb_3410_5052.c   |   10 ++---
       drivers/usb/serial/usb-serial.c         |    7 ++-
       drivers/usb/serial/usb_wwan.c           |    2 -
       drivers/usb/serial/whiteheat.c          |   20 +++++------
       include/linux/usb/serial.h              |    6 ++-
       24 files changed, 133 insertions(+), 180 deletions(-)
      1143832e
  11. 17 5月, 2013 1 次提交
  12. 20 4月, 2013 2 次提交
  13. 06 4月, 2013 1 次提交
  14. 26 3月, 2013 3 次提交
  15. 22 3月, 2013 2 次提交
  16. 19 1月, 2013 4 次提交
  17. 18 1月, 2013 1 次提交
    • W
      USB: io_ti: Fix NULL dereference in chase_port() · 1ee0a224
      Wolfgang Frisch 提交于
      The tty is NULL when the port is hanging up.
      chase_port() needs to check for this.
      
      This patch is intended for stable series.
      The behavior was observed and tested in Linux 3.2 and 3.7.1.
      
      Johan Hovold submitted a more elaborate patch for the mainline kernel.
      
      [   56.277883] usb 1-1: edge_bulk_in_callback - nonzero read bulk status received: -84
      [   56.278811] usb 1-1: USB disconnect, device number 3
      [   56.278856] usb 1-1: edge_bulk_in_callback - stopping read!
      [   56.279562] BUG: unable to handle kernel NULL pointer dereference at 00000000000001c8
      [   56.280536] IP: [<ffffffff8144e62a>] _raw_spin_lock_irqsave+0x19/0x35
      [   56.281212] PGD 1dc1b067 PUD 1e0f7067 PMD 0
      [   56.282085] Oops: 0002 [#1] SMP
      [   56.282744] Modules linked in:
      [   56.283512] CPU 1
      [   56.283512] Pid: 25, comm: khubd Not tainted 3.7.1 #1 innotek GmbH VirtualBox/VirtualBox
      [   56.283512] RIP: 0010:[<ffffffff8144e62a>]  [<ffffffff8144e62a>] _raw_spin_lock_irqsave+0x19/0x35
      [   56.283512] RSP: 0018:ffff88001fa99ab0  EFLAGS: 00010046
      [   56.283512] RAX: 0000000000000046 RBX: 00000000000001c8 RCX: 0000000000640064
      [   56.283512] RDX: 0000000000010000 RSI: ffff88001fa99b20 RDI: 00000000000001c8
      [   56.283512] RBP: ffff88001fa99b20 R08: 0000000000000000 R09: 0000000000000000
      [   56.283512] R10: 0000000000000000 R11: ffffffff812fcb4c R12: ffff88001ddf53c0
      [   56.283512] R13: 0000000000000000 R14: 00000000000001c8 R15: ffff88001e19b9f4
      [   56.283512] FS:  0000000000000000(0000) GS:ffff88001fd00000(0000) knlGS:0000000000000000
      [   56.283512] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      [   56.283512] CR2: 00000000000001c8 CR3: 000000001dc51000 CR4: 00000000000006e0
      [   56.283512] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [   56.283512] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      [   56.283512] Process khubd (pid: 25, threadinfo ffff88001fa98000, task ffff88001fa94f80)
      [   56.283512] Stack:
      [   56.283512]  0000000000000046 00000000000001c8 ffffffff810578ec ffffffff812fcb4c
      [   56.283512]  ffff88001e19b980 0000000000002710 ffffffff812ffe81 0000000000000001
      [   56.283512]  ffff88001fa94f80 0000000000000202 ffffffff00000001 0000000000000296
      [   56.283512] Call Trace:
      [   56.283512]  [<ffffffff810578ec>] ? add_wait_queue+0x12/0x3c
      [   56.283512]  [<ffffffff812fcb4c>] ? usb_serial_port_work+0x28/0x28
      [   56.283512]  [<ffffffff812ffe81>] ? chase_port+0x84/0x2d6
      [   56.283512]  [<ffffffff81063f27>] ? try_to_wake_up+0x199/0x199
      [   56.283512]  [<ffffffff81263a5c>] ? tty_ldisc_hangup+0x222/0x298
      [   56.283512]  [<ffffffff81300171>] ? edge_close+0x64/0x129
      [   56.283512]  [<ffffffff810612f7>] ? __wake_up+0x35/0x46
      [   56.283512]  [<ffffffff8106135b>] ? should_resched+0x5/0x23
      [   56.283512]  [<ffffffff81264916>] ? tty_port_shutdown+0x39/0x44
      [   56.283512]  [<ffffffff812fcb4c>] ? usb_serial_port_work+0x28/0x28
      [   56.283512]  [<ffffffff8125d38c>] ? __tty_hangup+0x307/0x351
      [   56.283512]  [<ffffffff812e6ddc>] ? usb_hcd_flush_endpoint+0xde/0xed
      [   56.283512]  [<ffffffff8144e625>] ? _raw_spin_lock_irqsave+0x14/0x35
      [   56.283512]  [<ffffffff812fd361>] ? usb_serial_disconnect+0x57/0xc2
      [   56.283512]  [<ffffffff812ea99b>] ? usb_unbind_interface+0x5c/0x131
      [   56.283512]  [<ffffffff8128d738>] ? __device_release_driver+0x7f/0xd5
      [   56.283512]  [<ffffffff8128d9cd>] ? device_release_driver+0x1a/0x25
      [   56.283512]  [<ffffffff8128d393>] ? bus_remove_device+0xd2/0xe7
      [   56.283512]  [<ffffffff8128b7a3>] ? device_del+0x119/0x167
      [   56.283512]  [<ffffffff812e8d9d>] ? usb_disable_device+0x6a/0x180
      [   56.283512]  [<ffffffff812e2ae0>] ? usb_disconnect+0x81/0xe6
      [   56.283512]  [<ffffffff812e4435>] ? hub_thread+0x577/0xe82
      [   56.283512]  [<ffffffff8144daa7>] ? __schedule+0x490/0x4be
      [   56.283512]  [<ffffffff8105798f>] ? abort_exclusive_wait+0x79/0x79
      [   56.283512]  [<ffffffff812e3ebe>] ? usb_remote_wakeup+0x2f/0x2f
      [   56.283512]  [<ffffffff812e3ebe>] ? usb_remote_wakeup+0x2f/0x2f
      [   56.283512]  [<ffffffff810570b4>] ? kthread+0x81/0x89
      [   56.283512]  [<ffffffff81057033>] ? __kthread_parkme+0x5c/0x5c
      [   56.283512]  [<ffffffff8145387c>] ? ret_from_fork+0x7c/0xb0
      [   56.283512]  [<ffffffff81057033>] ? __kthread_parkme+0x5c/0x5c
      [   56.283512] Code: 8b 7c 24 08 e8 17 0b c3 ff 48 8b 04 24 48 83 c4 10 c3 53 48 89 fb 41 50 e8 e0 0a c3 ff 48 89 04 24 e8 e7 0a c3 ff ba 00 00 01 00
      <f0> 0f c1 13 48 8b 04 24 89 d1 c1 ea 10 66 39 d1 74 07 f3 90 66
      [   56.283512] RIP  [<ffffffff8144e62a>] _raw_spin_lock_irqsave+0x19/0x35
      [   56.283512]  RSP <ffff88001fa99ab0>
      [   56.283512] CR2: 00000000000001c8
      [   56.283512] ---[ end trace 49714df27e1679ce ]---
      Signed-off-by: NWolfgang Frisch <wfpub@roembden.net>
      Cc: Johan Hovold <jhovold@gmail.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1ee0a224
  18. 16 1月, 2013 2 次提交
    • J
      TTY: switch tty_flip_buffer_push · 2e124b4a
      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.
      
      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: NJiri Slaby <jslaby@suse.cz>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2e124b4a
    • J
      TTY: switch tty_insert_flip_string · 05c7cd39
      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: NJiri Slaby <jslaby@suse.cz>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      05c7cd39
  19. 01 11月, 2012 1 次提交
  20. 18 10月, 2012 2 次提交
  21. 18 9月, 2012 3 次提交
  22. 15 9月, 2012 1 次提交
  23. 17 7月, 2012 1 次提交