28 May, 2014

1 commit

  • 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: kbuild test robot
    Cc: Ludovic Drolez
    Cc: stable
    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     

26 Apr, 2014

1 commit

  • During firmware download the device expects memory addresses in
    big-endian byte order. As the wIndex parameter which hold the address is
    sent in little-endian byte order regardless of host byte order, we need
    to use swab16 rather than cpu_to_be16.

    Also make sure to handle the struct ti_i2c_desc size parameter which is
    returned in little-endian byte order.

    Reported-by: Ludovic Drolez
    Tested-by: Ludovic Drolez
    Cc: stable@vger.kernel.org
    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     

09 Jan, 2014

1 commit


04 Jan, 2014

2 commits


26 Aug, 2013

1 commit

  • Clean up the DEVICE_ATTR usage in the USB serial drivers, making them
    more obvious as to the permissions that the sysfs files should be.

    Note: ftdi_sio.c still has a DEVICE_ATTR() used, that will have to wait
    until after 3.12-rc1 comes out when DEVICE_ATTR_WO() shows up in Linus's
    tree.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

24 Jul, 2013

3 commits


18 Jun, 2013

1 commit

  • 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: Tobias Winter
    Reviewed-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

11 Jun, 2013

1 commit

  • 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: Tobias Winter
    Reviewed-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    --
    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(-)

    Greg Kroah-Hartman
     

17 May, 2013

1 commit

  • Use the new generic usb-serial wait_until_sent implementation to wait
    for hardware buffers to drain.

    This removes the need to check the hardware buffers in chars_in_buffer
    and thus removes the overhead introduced by commit 263e1f9f ("USB:
    io_ti: query hardware-buffer status in chars_in_buffer") without
    breaking tty_wait_until_sent (used by, for example, tcdrain, tcsendbreak
    and close).

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

    Johan Hovold
     

20 Apr, 2013

2 commits


06 Apr, 2013

1 commit


26 Mar, 2013

3 commits

  • Always try to disable the uart on close.

    Since the switch to tty ports, close will be called as part of shutdown
    before disconnect returns. Hence there is no need to check the
    disconnected flag, and we can put devices in disabled states also on
    driver unbind.

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

    Johan Hovold
     
  • Switch to the generic TIOCMIWAIT implementation which does not suffer
    from the races involved when using the deprecated sleep_on functions.

    This also fixes the issue with processes waiting for
    modem-status-changes not being woken up at disconnect.

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

    Johan Hovold
     
  • Switch to the generic get_icount implementation.

    Note that the interrupt counters will no longer be reset at open which
    is in accordance with which how the other drivers work.

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

    Johan Hovold
     

22 Mar, 2013

2 commits

  • Use the port wait queue and make sure to check the serial disconnected
    flag before accessing private port data after waking up.

    This is is needed as the private port data (including the wait queue
    itself) can be gone when waking up after a disconnect.

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

    Johan Hovold
     
  • Add missing get_icount field to two-port driver.

    The two-port driver was not updated when switching to the new icount
    interface in commit 0bca1b913aff ("tty: Convert the USB drivers to the
    new icount interface").

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

    Johan Hovold
     

22 Feb, 2013

1 commit

  • Pull tty/serial patches from Greg Kroah-Hartman:
    "Here's the big tty/serial driver patches for 3.9-rc1.

    More tty port rework and fixes from Jiri here, as well as lots of
    individual serial driver updates and fixes.

    All of these have been in the linux-next tree for a while."

    * tag 'tty-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (140 commits)
    tty: mxser: improve error handling in mxser_probe() and mxser_module_init()
    serial: imx: fix uninitialized variable warning
    serial: tegra: assume CONFIG_OF
    TTY: do not update atime/mtime on read/write
    lguest: select CONFIG_TTY to build properly.
    ARM defconfigs: add missing inclusions of linux/platform_device.h
    fb/exynos: include platform_device.h
    ARM: sa1100/assabet: include platform_device.h directly
    serial: imx: Fix recursive locking bug
    pps: Fix build breakage from decoupling pps from tty
    tty: Remove ancient hardpps()
    pps: Additional cleanups in uart_handle_dcd_change
    pps: Move timestamp read into PPS code proper
    pps: Don't crash the machine when exiting will do
    pps: Fix a use-after free bug when unregistering a source.
    pps: Use pps_lookup_dev to reduce ldisc coupling
    pps: Add pps_lookup_dev() function
    tty: serial: uartlite: Support uartlite on big and little endian systems
    tty: serial: uartlite: Fix sparse and checkpatch warnings
    serial/arc-uart: Miscll DT related updates (Grant's review comments)
    ...

    Fix up trivial conflicts, mostly just due to the TTY config option
    clashing with the EXPERIMENTAL removal.

    Linus Torvalds
     

26 Jan, 2013

1 commit


19 Jan, 2013

4 commits


18 Jan, 2013

1 commit

  • 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: [] _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:[] [] _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] [] ? add_wait_queue+0x12/0x3c
    [ 56.283512] [] ? usb_serial_port_work+0x28/0x28
    [ 56.283512] [] ? chase_port+0x84/0x2d6
    [ 56.283512] [] ? try_to_wake_up+0x199/0x199
    [ 56.283512] [] ? tty_ldisc_hangup+0x222/0x298
    [ 56.283512] [] ? edge_close+0x64/0x129
    [ 56.283512] [] ? __wake_up+0x35/0x46
    [ 56.283512] [] ? should_resched+0x5/0x23
    [ 56.283512] [] ? tty_port_shutdown+0x39/0x44
    [ 56.283512] [] ? usb_serial_port_work+0x28/0x28
    [ 56.283512] [] ? __tty_hangup+0x307/0x351
    [ 56.283512] [] ? usb_hcd_flush_endpoint+0xde/0xed
    [ 56.283512] [] ? _raw_spin_lock_irqsave+0x14/0x35
    [ 56.283512] [] ? usb_serial_disconnect+0x57/0xc2
    [ 56.283512] [] ? usb_unbind_interface+0x5c/0x131
    [ 56.283512] [] ? __device_release_driver+0x7f/0xd5
    [ 56.283512] [] ? device_release_driver+0x1a/0x25
    [ 56.283512] [] ? bus_remove_device+0xd2/0xe7
    [ 56.283512] [] ? device_del+0x119/0x167
    [ 56.283512] [] ? usb_disable_device+0x6a/0x180
    [ 56.283512] [] ? usb_disconnect+0x81/0xe6
    [ 56.283512] [] ? hub_thread+0x577/0xe82
    [ 56.283512] [] ? __schedule+0x490/0x4be
    [ 56.283512] [] ? abort_exclusive_wait+0x79/0x79
    [ 56.283512] [] ? usb_remote_wakeup+0x2f/0x2f
    [ 56.283512] [] ? usb_remote_wakeup+0x2f/0x2f
    [ 56.283512] [] ? kthread+0x81/0x89
    [ 56.283512] [] ? __kthread_parkme+0x5c/0x5c
    [ 56.283512] [] ? ret_from_fork+0x7c/0xb0
    [ 56.283512] [] ? __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
    0f c1 13 48 8b 04 24 89 d1 c1 ea 10 66 39 d1 74 07 f3 90 66
    [ 56.283512] RIP [] _raw_spin_lock_irqsave+0x19/0x35
    [ 56.283512] RSP
    [ 56.283512] CR2: 00000000000001c8
    [ 56.283512] ---[ end trace 49714df27e1679ce ]---

    Signed-off-by: Wolfgang Frisch
    Cc: Johan Hovold
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Wolfgang Frisch
     

16 Jan, 2013

2 commits

  • 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
     

01 Nov, 2012

1 commit

  • Remove all MODULE_VERSION macros and driver-version information (except
    for garmin_gps which uses it in a status reply).

    It is the kernel version that matters and not some private version
    scheme which rarely even gets updated.

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

    Johan Hovold
     

18 Oct, 2012

2 commits

  • Make sure port data is initialised before creating sysfs attributes to
    avoid a race.

    A recent patch ("USB: io_ti: fix port-data memory leak") got the
    sysfs-attribute creation and port-data initialisation ordering wrong.

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

    Johan Hovold
     
  • Fix port-data memory leak by moving port data allocation and
    deallocation to port_probe and port_remove.

    Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no
    driver is bound) the port private data is no longer freed at release as
    it is no longer accessible.

    Compile-only tested.

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

    Johan Hovold
     

02 Oct, 2012

1 commit

  • Pull USB changes from Greg Kroah-Hartman:
    "Here is the big USB pull request for 3.7-rc1

    There are lots of gadget driver changes (including copying a bunch of
    files into the drivers/staging/ccg/ directory so that the other gadget
    drivers can be fixed up properly without breaking that driver), and we
    remove the old obsolete ub.c driver from the tree.

    There are also the usual XHCI set of updates, and other various driver
    changes and updates. We also are trying hard to remove the old dbg()
    macro, but the final bits of that removal will be coming in through
    the networking tree before we can delete it for good.

    All of these patches have been in the linux-next tree.

    Signed-off-by: Greg Kroah-Hartman "

    Fix up several annoying - but fairly mindless - conflicts due to the
    termios structure having moved into the tty device, and often clashing
    with dbg -> dev_dbg conversion.

    * tag 'usb-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (339 commits)
    USB: ezusb: move ezusb.c from drivers/usb/serial to drivers/usb/misc
    USB: uas: fix gcc warning
    USB: uas: fix locking
    USB: Fix race condition when removing host controllers
    USB: uas: add locking
    USB: uas: fix abort
    USB: uas: remove aborted field, replace with status bit.
    USB: uas: fix task management
    USB: uas: keep track of command urbs
    xhci: Intel Panther Point BEI quirk.
    powerpc/usb: remove checking PHY_CLK_VALID for UTMI PHY
    USB: ftdi_sio: add TIAO USB Multi-Protocol Adapter (TUMPA) support
    Revert "usb : Add sysfs files to control port power."
    USB: serial: remove vizzini driver
    usb: host: xhci: Fix Null pointer dereferencing with 71c731a for non-x86 systems
    Increase XHCI suspend timeout to 16ms
    USB: ohci-at91: fix null pointer in ohci_hcd_at91_overcurrent_irq
    USB: sierra_ms: don't keep unused variable
    fsl/usb: Add support for USB controller version 2.4
    USB: qcaux: add Pantech vendor class match
    ...

    Linus Torvalds
     

18 Sep, 2012

3 commits


15 Sep, 2012

1 commit


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 May, 2012

1 commit

  • This reworks the usb_serial_register_drivers() and
    usb_serial_deregister_drivers() to not need a pointer to a struct
    usb_driver anymore. The usb_driver structure is now created dynamically
    and registered and unregistered as needed.

    This saves lines of code in each usb-serial driver. All in-kernel users
    of these functions were also fixed up at this time. The pl2303 driver
    was tested that everything worked properly.

    Thanks for the idea to do this from Alan Stern.

    Cc: Adhir Ramjiawan
    Cc: Alan Stern
    Cc: Al Borchers
    Cc: Aleksey Babahin
    Cc: Andrew Morton
    Cc: Andrew Worsley
    Cc: Bart Hartgers
    Cc: Bill Pemberton
    Cc: Dan Carpenter
    Cc: Dan Williams
    Cc: Donald Lee
    Cc: Eric Dumazet
    Cc: "Eric W. Biederman"
    Cc: Felipe Balbi
    Cc: Gary Brubaker
    Cc: Jesper Juhl
    Cc: Jiri Kosina
    Cc: Johan Hovold
    Cc: Julia Lawall
    Cc: Kautuk Consul
    Cc: Kuninori Morimoto
    Cc: Lonnie Mendez
    Cc: Matthias Bruestle and Harald Welte
    Cc: Matthias Urlichs
    Cc: Mauro Carvalho Chehab
    Cc: Michal Sroczynski
    Cc: "Michał Wróbel"
    Cc: Oliver Neukum
    Cc: Paul Gortmaker
    Cc: Peter Berger
    Cc: Preston Fick
    Cc: "Rafael J. Wysocki"
    Cc: Rigbert Hamisch
    Cc: Rusty Russell
    Cc: Simon Arlott
    Cc: Support Department
    Cc: Thomas Tuttle
    Cc: Uwe Bonnes
    Cc: Wang YanQing
    Cc: William Greathouse
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

08 May, 2012

1 commit

  • This is now set by the usb-serial core, no need for the driver to
    individually set it.

    Thanks to Alan Stern for the idea to get rid of it.

    Cc: William Greathouse
    Cc: Matthias Bruestle and Harald Welte
    Cc: Lonnie Mendez
    Cc: Peter Berger
    Cc: Al Borchers
    Cc: Gary Brubaker
    Cc: Oliver Neukum
    Cc: Matthias Urlichs
    Cc: Support Department
    Cc: Rusty Russell
    Cc: Alan Stern
    Cc: Mauro Carvalho Chehab
    Cc: Kautuk Consul
    Cc: Bill Pemberton
    Cc: Paul Gortmaker
    Cc: Bart Hartgers
    Cc: Johan Hovold
    Cc: Preston Fick
    Cc: Uwe Bonnes
    Cc: Simon Arlott
    Cc: Andrew Worsley
    Cc: "Michał Wróbel"
    Cc: Andrew Morton
    Cc: Eric Dumazet
    Cc: "Eric W. Biederman"
    Cc: Felipe Balbi
    Cc: Aleksey Babahin
    Cc: Dan Carpenter
    Cc: Jiri Kosina
    Cc: Donald Lee
    Cc: Julia Lawall
    Cc: Michal Sroczynski
    Cc: Wang YanQing
    Cc: Dan Williams
    Cc: Thomas Tuttle
    Cc: Rigbert Hamisch
    Cc: "Rafael J. Wysocki"
    Cc: Kuninori Morimoto
    Cc: Jesper Juhl
    Cc: Adhir Ramjiawan
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman