05 Dec, 2013

1 commit

  • The tty core provides an interface for flushing the driver's
    write buffer: tty_driver_flush_buffer(); prefer the provided
    interface over open-coded. Open-coding can lead to errors
    such as the duplicated call in the st_kim driver.

    Signed-off-by: Peter Hurley
    Signed-off-by: Greg Kroah-Hartman

    Peter Hurley
     

15 Nov, 2013

1 commit


31 Aug, 2013

1 commit

  • If st_kim_start() fails registered protocols should be removed. This is
    done by calling st_reg_complete(), which as comment states is called
    with spin lock held. But in st_register() when st_kim_start fails it
    is called without holding spin lock, creating possibility of concurrent
    access to st_gdata data members.
    Hold spin lock while calling st_reg_complete if st_kim_start() fails.

    Signed-off-by: Oleksandr Kozaruk
    Signed-off-by: Greg Kroah-Hartman

    Oleksandr Kozaruk
     

30 May, 2013

1 commit

  • Use the wrapper functions for getting and setting the driver data using
    platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
    so we can directly pass a struct platform_device.

    Signed-off-by: Jingoo Han
    Signed-off-by: Greg Kroah-Hartman

    Jingoo Han
     

22 Feb, 2013

1 commit

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

    Nothing major here, just lots of different driver updates (mei,
    hyperv, ipack, extcon, vmci, etc.).

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

    * tag 'char-misc-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (209 commits)
    w1: w1_therm: Add force-pullup option for "broken" sensors
    w1: ds2482: Added 1-Wire pull-up support to the driver
    vme: add missing put_device() after device_register() fails
    extcon: max8997: Use workqueue to check cable state after completing boot of platform
    extcon: max8997: Set default UART/USB path on probe
    extcon: max8997: Consolidate duplicate code for checking ADC/CHG cable type
    extcon: max8997: Set default of ADC debounce time during initialization
    extcon: max8997: Remove duplicate code related to set H/W line path
    extcon: max8997: Move defined constant to header file
    extcon: max77693: Make max77693_extcon_cable static
    extcon: max8997: Remove unreachable code
    extcon: max8997: Make max8997_extcon_cable static
    extcon: max77693: Remove unnecessary goto statement to improve readability
    extcon: max77693: Convert to devm_input_allocate_device()
    extcon: gpio: Rename filename of extcon-gpio.c according to kernel naming style
    CREDITS: update email and address of Harald Hoyer
    extcon: arizona: Use MICDET for final microphone identification
    extcon: arizona: Always take the first HPDET reading as the final one
    extcon: arizona: Clear _trig_sts bits after jack detection
    extcon: arizona: Don't HPDET magic when headphones are enabled
    ...

    Linus Torvalds
     

26 Jan, 2013

1 commit


23 Jan, 2013

1 commit

  • This reverts commit eccf2979b2c034b516e01b8a104c3739f7ef07d1.

    The reason is that it broke TI WiLink shared transport on Panda.
    Also, callback functions should not be added to board files anymore,
    so revert to implementing the power functions in the driver itself.

    Additionally, changed a variable name ('status' to 'err') so that this
    revert compiles properly.

    Cc: stable [3.7]
    Acked-by: Tony Lindgren
    Signed-off-by: Luciano Coelho
    Signed-off-by: Greg Kroah-Hartman

    Luciano Coelho
     

22 Jan, 2013

1 commit

  • This reverts commit eccf2979b2c034b516e01b8a104c3739f7ef07d1.

    The reason is that it broke TI WiLink shared transport on Panda.
    Also, callback functions should not be added to board files anymore,
    so revert to implementing the power functions in the driver itself.

    Additionally, changed a variable name ('status' to 'err') so that this
    revert compiles properly.

    Cc: stable [3.7]
    Signed-off-by: Luciano Coelho
    Signed-off-by: Greg Kroah-Hartman

    Luciano Coelho
     

19 Jan, 2013

1 commit

  • The option allows you to remove TTY and compile without errors. This
    saves space on systems that won't support TTY interfaces anyway.
    bloat-o-meter output is below.

    The bulk of this patch consists of Kconfig changes adding "depends on
    TTY" to various serial devices and similar drivers that require the TTY
    layer. Ideally, these dependencies would occur on a common intermediate
    symbol such as SERIO, but most drivers "select SERIO" rather than
    "depends on SERIO", and "select" does not respect dependencies.

    bloat-o-meter output comparing our previous minimal to new minimal by
    removing TTY. The list is filtered to not show removed entries with awk
    '$3 != "-"' as the list was very long.

    add/remove: 0/226 grow/shrink: 2/14 up/down: 6/-35356 (-35350)
    function old new delta
    chr_dev_init 166 170 +4
    allow_signal 80 82 +2
    static.__warned 143 142 -1
    disallow_signal 63 62 -1
    __set_special_pids 95 94 -1
    unregister_console 126 121 -5
    start_kernel 546 541 -5
    register_console 593 588 -5
    copy_from_user 45 40 -5
    sys_setsid 128 120 -8
    sys_vhangup 32 19 -13
    do_exit 1543 1526 -17
    bitmap_zero 60 40 -20
    arch_local_irq_save 137 117 -20
    release_task 674 652 -22
    static.spin_unlock_irqrestore 308 260 -48

    Signed-off-by: Joe Millenbach
    Reviewed-by: Jamey Sharp
    Reviewed-by: Josh Triplett
    Signed-off-by: Greg Kroah-Hartman

    Joe Millenbach
     

18 Jan, 2013

1 commit

  • When st driver decodes protocol index received from raw data,
    it does a value convert from "char" to "int". Because it's sign
    extension from bit8 to bit32, the "int" value maybe minus, in
    another word, the protocol index might be minus, but driver doesn't
    filter such case and may continue access memory pointed by this
    minus index.

    This patch is to change the variable type of index from "int"
    to "unsigned char", so that it avoids do such kind of type
    conversion.

    cc: liu chuansheng
    Signed-off-by: channing
    Signed-off-by: Greg Kroah-Hartman

    channing
     

27 Nov, 2012

1 commit


25 Oct, 2012

1 commit


17 Aug, 2012

6 commits

  • Before calling on any of the platform hooks, shared transport driver checks
    for the validity of the platform hooks as to whether it is provided or not.
    A wrong function was being checked for, before the chip_awake hook was called
    by the HCI-LL sleep logic handler. This patch corrects the check.

    Signed-off-by: Pavan Savoy
    Signed-off-by: Matthias Kaehlcke
    Signed-off-by: Greg Kroah-Hartman

    Matthias Kaehlcke
     
  • If the read firmware version response from the chip is split into multiple
    frames of UART buffer being received by the host, the TI-ST driver as of today
    is unable to put the pieces of response together unlike other responses.

    Signed-off-by: Pavan Savoy
    Signed-off-by: Greg Kroah-Hartman

    Pavan Savoy
     
  • Be nice to CPU and don't hog the resources, use a nice wait_for_interruptible
    timeout for completions instead of wait_for_timeout which is
    non-interruptible.

    Signed-off-by: Pavan Savoy
    Signed-off-by: Greg Kroah-Hartman

    Pavan Savoy
     
  • If the communication with the WiLink breaks down for whatever reasons & the
    ti-st driver is unable to un-install the line-discipline during clean-up in
    st_kim_stop, the GPIO should be held low (BT_EN=0) & the platform's chip
    disable hook shall also be called.

    Signed-off-by: Pavan Savoy
    Signed-off-by: Greg Kroah-Hartman

    Pavan Savoy
     
  • remove sparse warnings by assigning right storage specifiers to functions and
    also clean-up the declarations in the include/linux/ti_wilink_st.h

    Signed-off-by: Pavan Savoy
    Signed-off-by: Greg Kroah-Hartman

    Pavan Savoy
     
  • A platform hook to enable/disable the chip was introduced to perform specific
    activities to power-up and power-down the WL chip.
    Moving the power-up/down sequence also there makes more sense, since different
    platforms have begun to have their own ways to power-up/down the chip.
    This patch removes all of the gpio handling done by the driver in
    st_kim_start/st_kim_stop & any of the gpio request done in the probe function.

    Signed-off-by: Pavan Savoy
    Signed-off-by: Greg Kroah-Hartman

    Pavan Savoy
     

31 Jul, 2012

1 commit


25 Jan, 2012

1 commit

  • This patch converts the drivers in drivers/misc/* to use the
    module_platform_driver() macro which makes the code smaller and a bit
    simpler.

    Signed-off-by: Axel Lin
    Acked-by: Ira W. Snyder
    Cc: Pavan Savoy
    Cc: Donggeun Kim
    Acked-By: Pratyush Anand
    Acked-by: Arnd Bergmann
    Acked-by: Pratyush Anand
    Signed-off-by: Greg Kroah-Hartman

    Axel Lin
     

05 Jan, 2012

3 commits

  • To debug different UARTs at different baud-rates connected to the WiLink
    connectivity combo-chipset, this patch enables the debugging code so that upon
    boot different UARTs at different baud-rates can be tried out to verify the
    interface with WiLink.

    Signed-off-by: Pavan Savoy
    Signed-off-by: Greg Kroah-Hartman

    Pavan Savoy
     
  • Upon failure to read firmware version from chip or upon failure in responses
    to firmware download the UART needs to be flushed of its existing buffers so
    that the UIM can restart UART properly.

    Signed-off-by: Pavan Savoy
    Signed-off-by: Greg Kroah-Hartman

    Pavan Savoy
     
  • Concurrent access to UART2/combo-interface by multiple protocol drivers such
    as BT, FM and GPS caused issues during firmware download failure cases or
    cases when the firmware download took longer than usual.

    This was because of un-safe access to protos_registered & st_states.
    Protecting this will also make the registration complete callback un-safe for
    sleep.

    Signed-off-by: Pavan Savoy
    Signed-off-by: Greg Kroah-Hartman

    Pavan Savoy
     

01 Nov, 2011

1 commit


23 Aug, 2011

8 commits

  • If suppose the UIM were to die and hence UART were to close when the
    Bluetooth/FM or GPS is turned on, prep the ST for a state where-in if
    the UIM comes back up, Bluetooth/FM/GPS can be turned on.

    Signed-off-by: Pavan Savoy
    Signed-off-by: Greg Kroah-Hartman

    Pavan Savoy
     
  • If during validation of the firmware download the data doesn't match what is
    expected out of the chip, this calls for a firmware download failure and a
    retry.
    Free the SKB which collects response during such scenarios.

    Signed-off-by: Pavan Savoy
    Signed-off-by: Greg Kroah-Hartman

    Pavan Savoy
     
  • When the line discipline install fails for reasons such as missing user-space
    UIM or broken communication between UIM and ST driver, then the ST
    attempts/retries to request for ldisc installation again.

    Signed-off-by: Pavan Savoy
    Signed-off-by: Greg Kroah-Hartman

    Pavan Savoy
     
  • download firmware behaves differently at different times, when logs are
    enabled and the system is loaded, the wait_for_completion is able to wait for
    every send, However during other times the wait does not happen.

    So, for reliability reinitializing the completion before every send, makes
    sure the wait happens for every send.

    Signed-off-by: Pavan Savoy
    Signed-off-by: Greg Kroah-Hartman

    Pavan Savoy
     
  • Texas Instrument's shared transport driver interpret incoming data from the
    UART based on the various protocol drivers registered to the driver such as
    btwilink driver or FM or GPS driver which provide logical channel IDs.

    In case of bad-behavior from chip such as HCI Event response for a GPS command
    or a HCI Event (h/w error event) for a FM response & In case of bad-behavior
    from UART driver such as dropping data bytes a fail-safe is required to avoid
    kernel panic.

    Signed-off-by: Pavan Savoy
    Signed-off-by: Vijay Badawadagi
    Signed-off-by: Greg Kroah-Hartman

    Vijay Badawadagi
     
  • After the version information has been read, the completion which assists in
    wait_for_completion during the firmware send/wait sequence is being re-used
    and hence this needs to be re-initialised for fool proof firmware download
    retries.

    Signed-off-by: Pavan Savoy
    Signed-off-by: Greg Kroah-Hartman

    Pavan Savoy
     
  • Certain platform specific or Host-WiLink Interface specific actions would be
    required to be taken when the chip is being enabled and after the chip is
    disabled such as configuration of the mux modes for the GPIO of host connected
    to the nshutdown of the chip or relinquishing UART after the chip is disabled.

    Similar actions can also be taken when the chip is in deep sleep or when the
    chip is awake. Performance enhancements such as configuring the host to run
    faster when chip is awake and slower when chip is asleep can also be made
    here.

    Signed-off-by: Pavan Savoy
    Signed-off-by: Greg Kroah-Hartman

    Pavan Savoy
     
  • Previously the private data of each protocol registered to use ST was
    used to determine whether the protocol was registered to use shared
    transport or otherwise.
    However, now a flag is_registered is maintained to identify whether a
    protocol intends to use ST.
    Upon closing of the UART the error message relevant to this lack of
    un-registration was misleading and this patch fixes that.

    Signed-off-by: Pavan Savoy
    Signed-off-by: Greg Kroah-Hartman

    Pavan Savoy
     

08 Jun, 2011

2 commits

  • Before the incrementing of ptr in skip_change_remote_baud,
    it points to cur_action, but the increment is done by
    the size of nxt_action instead. This could cause ptr
    to not point to a bts_action structure, which is
    harmful for the increment of ptr done in download_firmware.
    Therefore, the skipping is first done for cur_action.

    Signed-off-by: Shahar Lev
    Signed-off-by: Greg Kroah-Hartman

    Shahar Lev
     
  • Running ktest.pl, I hit this bug:

    [ 19.780654] BUG: unable to handle kernel NULL pointer dereference at 0000000c
    [ 19.780660] IP: [] dev_get_drvdata+0xc/0x46
    [ 19.780669] *pdpt = 0000000031daf001 *pde = 0000000000000000
    [ 19.780673] Oops: 0000 [#1] SMP
    [ 19.780680] Dumping ftrace buffer:^M
    [ 19.780685] (ftrace buffer empty)
    [ 19.780687] Modules linked in: ide_pci_generic firewire_ohci firewire_core evbug crc_itu_t e1000 ide_core i2c_i801 iTCO_wdt
    [ 19.780697]
    [ 19.780700] Pid: 346, comm: v4l_id Not tainted 2.6.39-test-02740-gcaebc16-dirty #4 /DG965MQ
    [ 19.780706] EIP: 0060:[] EFLAGS: 00010202 CPU: 0
    [ 19.780709] EIP is at dev_get_drvdata+0xc/0x46
    [ 19.780712] EAX: 00000008 EBX: f1e37da4 ECX: 00000000 EDX: 00000000
    [ 19.780715] ESI: f1c3f200 EDI: c33ec95c EBP: f1e37d80 ESP: f1e37d80
    [ 19.780718] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
    [ 19.780721] Process v4l_id (pid: 346, ti=f1e36000 task=f2bc2a60 task.ti=f1e36000)
    [ 19.780723] Stack:
    [ 19.780725] f1e37d8c c117d395 c33ec93c f1e37db4 c117a0f9 00000002 00000000 c1725e54
    [ 19.780732] 00000001 00000007 f2918c90 f1c3f200 c33ec95c f1e37dd4 c1789d3d 22222222
    [ 19.780740] 22222222 22222222 f2918c90 f1c3f200 f29194f4 f1e37de8 c178d5c4 c1725e54
    [ 19.780747] Call Trace:
    [ 19.780752] [] st_kim_ref+0x28/0x41
    [ 19.780756] [] st_register+0x29/0x562
    [ 19.780761] [] ? v4l2_open+0x111/0x1e3
    [ 19.780766] [] fmc_prepare+0x97/0x424
    [ 19.780770] [] fm_v4l2_fops_open+0x70/0x106
    [ 19.780773] [] ? v4l2_open+0x111/0x1e3
    [ 19.780777] [] v4l2_open+0x158/0x1e3
    [ 19.780782] [] chrdev_open+0x22c/0x276
    [ 19.780787] [] __dentry_open+0x35c/0x581
    [ 19.780792] [] nameidata_to_filp+0x7c/0x96
    [ 19.780795] [] ? cdev_put+0x57/0x57
    [ 19.780800] [] do_last+0x743/0x9d4
    [ 19.780804] [] ? path_init+0x1ee/0x596
    [ 19.780808] [] path_openat+0x10c/0x597
    [ 19.780813] [] ? trace_hardirqs_off+0x27/0x37
    [ 19.780817] [] ? local_clock+0x78/0xc7
    [ 19.780821] [] do_filp_open+0x39/0xc2
    [ 19.780827] [] ? _raw_spin_unlock+0x4c/0x5d^M
    [ 19.780831] [] ? alloc_fd+0x19e/0x1b7
    [ 19.780836] [] do_sys_open+0xb7/0x1bd
    [ 19.780840] [] ? sys_munmap+0x78/0x8d
    [ 19.780844] [] sys_open+0x36/0x58
    [ 19.780849] [] sysenter_do_call+0x12/0x38
    [ 19.780852] Code: d8 2f 20 c3 01 83 15 dc 2f 20 c3 00 f0 ff 00 83 05 e0 2f 20 c3 01 83 15 e4 2f 20 c3 00 5d c3 55 89 e5 3e 8d 74 26 00 85 c0 74 28 40 04 83 05 e8 2f 20 c3 01 83 15 ec 2f 20 c3 00 85 c0 74 13 ^M
    [ 19.780889] EIP: [] dev_get_drvdata+0xc/0x46 SS:ESP 0068:f1e37d80
    [ 19.780894] CR2: 000000000000000c
    [ 19.780898] ---[ end trace e7d1d0f6a2d1d390 ]---

    The id of 0 passed to st_kim_ref() found no device, keeping pdev null,
    and causing pdev->dev cause a NULL pointer dereference. After having
    st_kim_ref() check for NULL, the st_unregister() function needed to be
    updated to handle the case that st_gdata was not set by the
    st_kim_ref().

    Signed-off-by: Steven Rostedt
    Signed-off-by: Greg Kroah-Hartman

    Steven Rostedt
     

04 Jun, 2011

1 commit

  • This reverts commit b1c43f82c5aa265442f82dba31ce985ebb7aa71c.

    It was broken in so many ways, and results in random odd pty issues.

    It re-introduced the buggy schedule_work() in flush_to_ldisc() that can
    cause endless work-loops (see commit a5660b41af6a: "tty: fix endless
    work loop when the buffer fills up").

    It also used an "unsigned int" return value fo the ->receive_buf()
    function, but then made multiple functions return a negative error code,
    and didn't actually check for the error in the caller.

    And it didn't actually work at all. BenH bisected down odd tty behavior
    to it:
    "It looks like the patch is causing some major malfunctions of the X
    server for me, possibly related to PTYs. For example, cat'ing a
    large file in a gnome terminal hangs the kernel for -minutes- in a
    loop of what looks like flush_to_ldisc/workqueue code, (some ftrace
    data in the quoted bits further down).

    ...

    Some more data: It -looks- like what happens is that the
    flush_to_ldisc work queue entry constantly re-queues itself (because
    the PTY is full ?) and the workqueue thread will basically loop
    forver calling it without ever scheduling, thus starving the consumer
    process that could have emptied the PTY."

    which is pretty much exactly the problem we fixed in a5660b41af6a.

    Milton Miller pointed out the 'unsigned int' issue.

    Reported-by: Benjamin Herrenschmidt
    Reported-by: Milton Miller
    Cc: Stefan Bigler
    Cc: Toby Gray
    Cc: Felipe Balbi
    Cc: Greg Kroah-Hartman
    Cc: Alan Cox
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

24 May, 2011

1 commit

  • * 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (48 commits)
    serial: 8250_pci: add support for Cronyx Omega PCI multiserial board.
    tty/serial: Fix break handling for PORT_TEGRA
    tty/serial: Add explicit PORT_TEGRA type
    n_tracerouter and n_tracesink ldisc additions.
    Intel PTI implementaiton of MIPI 1149.7.
    Kernel documentation for the PTI feature.
    export kernel call get_task_comm().
    tty: Remove to support serial for S5P6442
    pch_phub: Support new device ML7223
    8250_pci: Add support for the Digi/IBM PCIe 2-port Adapter
    ASoC: Update cx20442 for TTY API change
    pch_uart: Support new device ML7223 IOH
    parport: Use request_muxed_region for IT87 probe and lock
    tty/serial: add support for Xilinx PS UART
    n_gsm: Use print_hex_dump_bytes
    drivers/tty/moxa.c: Put correct tty value
    TTY: tty_io, annotate locking functions
    TTY: serial_core, remove superfluous set_task_state
    TTY: serial_core, remove invalid test
    Char: moxa, fix locking in moxa_write
    ...

    Fix up trivial conflicts in drivers/bluetooth/hci_ldisc.c and
    drivers/tty/serial/Makefile.

    I did the hci_ldisc thing as an evil merge, cleaning things up.

    Linus Torvalds
     

30 Apr, 2011

1 commit

  • st_drv uses skb*() interfaces, so it should depend on NET.
    It also uses GPIO interfaces, so it should depend on GPIOLIB.

    st_kim.c uses syss_*() calls, so it should #include
    .

    Fixes these observed build errors:
    ERROR: "skb_queue_purge" [drivers/misc/ti-st/st_drv.ko] undefined!
    ERROR: "skb_pull" [drivers/misc/ti-st/st_drv.ko] undefined!
    ERROR: "skb_queue_tail" [drivers/misc/ti-st/st_drv.ko] undefined!
    ERROR: "__alloc_skb" [drivers/misc/ti-st/st_drv.ko] undefined!
    ERROR: "kfree_skb" [drivers/misc/ti-st/st_drv.ko] undefined!
    ERROR: "skb_dequeue" [drivers/misc/ti-st/st_drv.ko] undefined!
    ERROR: "skb_put" [drivers/misc/ti-st/st_drv.ko] undefined!

    Signed-off-by: Randy Dunlap
    Cc: Pavan Savoy
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     

23 Apr, 2011

3 commits

  • it makes it simpler to keep track of the amount of
    bytes received and simplifies how flush_to_ldisc counts
    the remaining bytes. It also fixes a bug of lost bytes
    on n_tty when flushing too many bytes via the USB
    serial gadget driver.

    Tested-by: Stefan Bigler
    Tested-by: Toby Gray
    Signed-off-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    Felipe Balbi
     
  • rfkill is no longer used by Texas Instruments shared transport driver to
    communicate with user-space.
    This patch removes the dependency of rfkill to be enabled to build
    shared transport driver in the Kconfig.

    Signed-off-by: Pavan Savoy
    Signed-off-by: Greg Kroah-Hartman

    Pavan Savoy
     
  • When certain technologies shutdown their interface without waiting for
    the acknowledgement from the chip. The receive_buf from the TTY would be
    invoked a while after the relevant technology is unregistered.

    This patch introduces a new flag "is_registered" which maintains the
    state of protocols BT, FM or GPS and thereby removes the need to clear
    the protocol data from ST when protocols gets unregistered.

    This fixes corner cases when HCI RESET is sent down from bluetooth stack
    and the receive_buf is called from tty after 250ms before which
    bluetooth would have unregistered from the system.
    OR - when FM application decides to close down the device without
    sending a power-off FM command resulting in some RDS data or interrupt
    data coming in after the driver is unregistered.

    Signed-off-by: Pavan Savoy
    Signed-off-by: Greg Kroah-Hartman

    Pavan Savoy