01 May, 2016

3 commits

  • Replace ASYNC_INITIALIZED bit in the tty_port::flags field with
    TTY_PORT_INITIALIZED bit in the tty_port::iflags field. Introduce helpers
    tty_port_set_initialized() and tty_port_initialized() to abstract
    atomic bit ops.

    Note: the transforms for test_and_set_bit() and test_and_clear_bit()
    are unnecessary as the state transitions are already mutually exclusive;
    the tty lock prevents concurrent open/close/hangup.

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

    Peter Hurley
     
  • Replace ASYNC_CHECK_CD bit in the tty_port::flags field with
    TTY_PORT_CHECK_CD bit in the tty_port::iflags field. Introduce helpers
    tty_port_set_check_carrier() and tty_port_check_carrier() to abstract
    the atomic bit ops.

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

    Peter Hurley
     
  • Replace ASYNC_CTS_FLOW bit in the tty_port::flags field with
    TTY_PORT_CTS_FLOW bit in the tty_port::iflags field. Add
    tty_port_set_cts_flow() helper to abstract the atomic bit ops.

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

    Peter Hurley
     

29 Jan, 2016

1 commit

  • Expressions of the form "tty->termios.c_*flag & FLAG"
    are more clearly expressed with the termios flags macros,
    I_FLAG(), C_FLAG(), O_FLAG(), and L_FLAG().

    Convert treewide.

    Signed-off-by: Peter Hurley
    Acked-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Peter Hurley
     

14 Dec, 2015

2 commits


03 Feb, 2015

1 commit

  • Building an arm allmodconfig kernel triggers a lengthy but harmless
    warning in the isicom driver:

    drvers/tty/isicom.c: In function 'isicom_send_break':
    uapi/linux/swab.h:13:15: warning: integer overflow in expression [-Woverflow]
    (((__u16)(x) & (__u16)0x00ffU) << 8) | \
    ^
    uapi/linux/swab.h:107:2: note: in expansion of macro '___constant_swab16'
    ___constant_swab16(x) : \
    ^
    uapi/linux/byteorder/big_endian.h:34:43: note: in expansion of macro '__swab16'
    #define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
    ^
    linux/byteorder/generic.h:89:21: note: in expansion of macro '__cpu_to_le16'
    #define cpu_to_le16 __cpu_to_le16
    ^
    include/asm/io.h:270:6: note: in expansion of macro 'cpu_to_le16'
    cpu_to_le16(v),__io(p)); })
    ^
    drivers/tty/isicom.c:1058:2: note: in expansion of macro 'outw'
    outw((length & 0xff00), base);
    ^

    Apparently, the problem is related to the fact that the value 0xff00,
    when used as a 16-bit number, is negative and passed into bitwise
    operands of the generic byte swapping code.

    Marking the input argument as unsigned in both technically correct
    and avoids the warning.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     

26 Nov, 2014

1 commit

  • Convert the pr_warning to the more common pr_warn.

    Other miscellanea:

    o Convert unusual PR_FMT define and uses to pr_fmt
    o Remove unnecessary OOM message
    o Fix grammar in an error message
    o Convert a pr_warning with a KERN_ERR to pr_err

    Signed-off-by: Joe Perches
    Signed-off-by: Greg Kroah-Hartman

    Joe Perches
     

16 Jan, 2013

3 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_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
     
  • Now, we start converting tty buffer functions to actually use
    tty_port. This will allow us to get rid of the need of tty pointer in
    many call sites. Only tty_port will be needed and hence no more
    tty_port_tty_get calls in those paths.

    Now 4 string flipping ones are on turn:
    * tty_insert_flip_string_flags
    * tty_insert_flip_string_fixed_flag
    * tty_prepare_flip_string
    * tty_prepare_flip_string_flags

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

    Jiri Slaby
     

22 Nov, 2012

3 commits

  • CONFIG_HOTPLUG is going away as an option so __devexit is no
    longer needed.

    Signed-off-by: Bill Pemberton
    Cc: Jiri Slaby
    Cc: Alan Cox
    Acked-by: Tobias Klauser
    Cc: Lucas Tavares
    Cc: Daniel Walker
    Cc: Bryan Huntsman
    Cc: "David S. Miller"
    Cc: Peter Korsgaard
    Cc: Tony Prisk
    Acked-by: David Brown
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     
  • CONFIG_HOTPLUG is going away as an option so __devinit is no longer
    needed.

    Signed-off-by: Bill Pemberton
    Cc: Jiri Slaby
    Cc: Alan Cox
    Cc: Lucas Tavares
    Cc: "David S. Miller"
    Cc: Peter Korsgaard
    Cc: Tony Prisk
    Acked-by: Tobias Klauser
    Acked-by: Nicolas Ferre
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     
  • CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
    needed.

    Signed-off-by: Bill Pemberton
    Cc: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     

16 Nov, 2012

2 commits

  • 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.

    This one is special as we need more work to be done. Previously,
    the tty_port was initialized at module load time, but to be able to
    destroy the port and init it again, we now do the initialization in
    probe and destroy in remove. I.e. at more appropriate places for that.

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

    Jiri Slaby
     
  • Do not access unsafe port->tty pointer when we have a safe tty
    already. Use the safe one.

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

    Jiri Slaby
     

06 Sep, 2012

1 commit

  • In most of the time, the driver needs to check if the cts flow control
    is enabled. But now, the driver checks the ASYNC_CTS_FLOW flag manually,
    which is not a grace way. So add a new wraper function to make the code
    tidy and clean.

    Signed-off-by: Huang Shijie
    Signed-off-by: Greg Kroah-Hartman

    Huang Shijie
     

14 Aug, 2012

1 commit

  • Currently we have no way to assign tty->port while performing tty
    installation. There are two ways to provide the link tty_struct =>
    tty_port. Either by calling tty_port_install from tty->ops->install or
    tty_port_register_device called instead of tty_register_device when
    the device is being set up after connected.

    In this patch we modify most of the drivers to do the latter. When the
    drivers use tty_register_device and we have tty_port already, we
    switch to tty_port_register_device. So we have the tty_struct =>
    tty_port link for free for those.

    Signed-off-by: Jiri Slaby
    Acked-by: Alan Cox
    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
     

31 Mar, 2012

1 commit

  • Usage of /etc/modprobe.conf file was deprecated by module-init-tools and
    is no longer parsed by new kmod tool. References to this file are
    replaced in Documentation, comments and Kconfig according to the
    context.

    There are also some references to the old /etc/modules.conf from 2.4
    kernels that are being removed.

    Signed-off-by: Lucas De Marchi
    Acked-by: Takashi Iwai
    Acked-by: Mauro Carvalho Chehab
    Signed-off-by: Randy Dunlap
    Signed-off-by: Linus Torvalds

    Lucas De Marchi
     

29 Mar, 2012

1 commit


09 Mar, 2012

2 commits

  • Checking if tty->index is in bounds is not needed. The tty has the
    index set in the initial open. This is done in get_tty_driver. And it
    can be only in interval num).

    So remove the tests which check exactly this interval. Some are
    left untouched as they check against the current backing device count.
    (Leaving apart that the check is racy in most of the cases.)

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

    Jiri Slaby
     
  • 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
     

23 Sep, 2011

1 commit

  • Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
    We run all interrupt handlers with interrupts disabled
    and we even check and yell when an interrupt handler
    returns with interrupts enabled (see commit [b738a50a:
    genirq: Warn when handler enables interrupts]).

    So now this flag is a NOOP and can be removed.

    Signed-off-by: Yong Zhang
    Acked-by: Tobias Klauser
    Signed-off-by: Greg Kroah-Hartman

    Yong Zhang
     

23 Feb, 2011

1 commit