1. 18 Oct, 2011 7 commits
    • Jiri Slaby's avatar
      TTY: make tty_add_file non-failing · fa90e1c9
      Jiri Slaby authored
      If tty_add_file fails at the point it is now, we have to revert all
      the changes we did to the tty. It means either decrease all refcounts
      if this was a tty reopen or delete the tty if it was newly allocated.
      
      There was a try to fix this in v3.0-rc2 using tty_release in 0259894c
      (TTY: fix fail path in tty_open). But instead it introduced a NULL
      dereference. It's because tty_release dereferences
      filp->private_data, but that one is set even in our tty_add_file. And
      when tty_add_file fails, it's still NULL/garbage. Hence tty_release
      cannot be called there.
      
      To circumvent the original leak (and the current NULL deref) we split
      tty_add_file into two functions, making the latter non-failing. In
      that case we may do the former early in open, where handling failures
      is easy. The latter stays as it is now. So there is no change in
      functionality.
      
      The original bug (leak) was introduced by f573bd17 (tty: Remove
      __GFP_NOFAIL from tty_add_file()). Thanks Dan for reporting this.
      
      Later, we may split tty_release into more functions and call only some
      of them in this fail path instead. (If at all possible.)
      
      Introduced-in: v2.6.37-rc2
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Cc: stable <stable@vger.kernel.org>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Pekka Enberg <penberg@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      fa90e1c9
    • Jiri Slaby's avatar
      TTY: drop driver reference in tty_open fail path · c290f835
      Jiri Slaby authored
      When tty_driver_lookup_tty fails in tty_open, we forget to drop a
      reference to the tty driver. This was added by commit 4a2b5fdd (Move
      tty lookup/reopen to caller).
      
      Fix that by adding tty_driver_kref_put to the fail path.
      
      I will refactor the code later. This is for the ease of backporting to
      stable.
      
      Introduced-in: v2.6.28-rc2
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: stable <stable@vger.kernel.org>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Acked-by: default avatarSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      c290f835
    • Tomoya MORINAGA's avatar
      8250_pci: Fix kernel panic when pch_uart is disabled · 64d91cfa
      Tomoya MORINAGA authored
      Currently, ".setup" function is not set.
      As a result, when detecting our IOH's uart device without pch_uart, kernel panic
      occurs at the following of pciserial_init_ports().
      
      	for (i = 0; i < nr_ports; i++) {
      		if (quirk->setup(priv, board, &serial_port, i))
      			break;
      
      So, this patch adds the ".setup" function.
      We can use pci_default_setup because our IOH's uart is compatible with 16550.
      Signed-off-by: default avatarTomoya MORINAGA <tomoya-linux@dsn.lapis-semi.com>
      Acked-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      64d91cfa
    • Paul Bolle's avatar
      h8300: drivers/serial/Kconfig was moved · a4a77b1a
      Paul Bolle authored
      commit ab4382d2 moved
      drivers/serial/Kconfig to drivers/tty/serial/Kconfig, so we need to
      source the latter file.
      Signed-off-by: default avatarPaul Bolle <pebolle@tiscali.nl>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      a4a77b1a
    • Jiri Kosina's avatar
      parport_pc: release IO region properly if unsupported ITE887x card is found · 9fdbdd06
      Jiri Kosina authored
      sio_ite_8872_probe() bails out if it detects no-parallel (1S, 2S) or
      unknown card.
      
      It doesn't call release_region() on the previously allocated resource
      though.  This causes
      
        (a) leak of the resource
        (b) kernel oops when parport module is removed and /proc/ioports is read. This
            is because the string that has been associated to the IO port region
            is a static char array inside the already removed module.
      
      Let's call release_region() properly before baling out.
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Acked-by: default avatarNiels de Vos <ndevos@redhat.com>
      Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
      Cc: Alan Cox <alan@linux.intel.com>
      Cc: Joe Krahn <krahn@niehs.nih.gov>
      Signed-off-by: default avatarAndrew Morton <akpm@google.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      9fdbdd06
    • Thomas Meyer's avatar
      tty: Support compat_ioctl get/set termios_locked · 8193c429
      Thomas Meyer authored
      When running a Fedora 15 (x86) on an x86_64 kernel, in the boot process
      plymouthd complains about those two missing ioctls:
      [    2.581783] ioctl32(plymouthd:186): Unknown cmd fd(10) cmd(00005457){t:'T';sz:0} arg(ffb6a5d0) on /dev/tty1
      [    2.581803] ioctl32(plymouthd:186): Unknown cmd fd(10) cmd(00005456){t:'T';sz:0} arg(ffb6a680) on /dev/tty1
      
      both ioctl functions work on the 'struct termios' resp. 'struct termios2',
      which has the same size (36 bytes resp. 44 bytes) on x86 and x86_64,
      so it's just a matter of converting the pointer from userland.
      Signed-off-by: default avatarThomas Meyer <thomas@m3y3r.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@google.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      8193c429
    • Miche Baker-Harvey's avatar
      hvc_console: display printk messages on console. · 36116245
      Miche Baker-Harvey authored
      printk only works for "registered consoles."  Currently, the hvc_console
      code calls register_console() from hvc_instantiate(), but that's only
      used in the early console case.  In hvc_alloc(), register_console() was
      not called.
      
      Add a call to register_console() in hvc_alloc(), set up the index in
      the hvc_console, and set up the necessary vtermnos[] and cons_op[]
      entries so that printk functions work.
      Signed-off-by: default avatarMiche Baker-Harvey <miche@google.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      36116245
  2. 29 Sep, 2011 1 commit
  3. 26 Sep, 2011 5 commits
  4. 22 Sep, 2011 12 commits
    • Yong Zhang's avatar
      TTY: irq: Remove IRQF_DISABLED · 9cfb5c05
      Yong Zhang authored
      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: default avatarYong Zhang <yong.zhang0@gmail.com>
      Acked-by: default avatarTobias Klauser <tklauser@distanz.ch>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      9cfb5c05
    • Ning Jiang's avatar
      serial-core: power up uart port early before we do set_termios when resuming · 94abc56f
      Ning Jiang authored
      The following patch removed uart_change_pm() in uart_resume_port():
      
      commit 5933a161
      Author: Yin Kangkai <kangkai.yin@linux.intel.com>
          serial-core: reset the console speed on resume
      
      It will break the pxa serial driver when the system resumes from suspend mode
      as it will try to set baud rate divider register in set_termios but with
      clock off. The register value can not be set correctly on some platform if
      the clock is disabled. The pxa driver will check the value and report the
      following warning:
      
      ------------[ cut here ]------------
      WARNING: at drivers/tty/serial/pxa.c:545 serial_pxa_set_termios+0x1dc/0x250()
      Modules linked in:
      [<c0281f30>] (unwind_backtrace+0x0/0xf0) from [<c029341c>] (warn_slowpath_common+0x4c/0x64)
      [<c029341c>] (warn_slowpath_common+0x4c/0x64) from [<c029344c>] (warn_slowpath_null+0x18/0x1c)
      [<c029344c>] (warn_slowpath_null+0x18/0x1c) from [<c044b1e4>] (serial_pxa_set_termios+0x1dc/0x250)
      [<c044b1e4>] (serial_pxa_set_termios+0x1dc/0x250) from [<c044a840>] (uart_resume_port+0x128/0x2dc)
      [<c044a840>] (uart_resume_port+0x128/0x2dc) from [<c044bbe0>] (serial_pxa_resume+0x18/0x24)
      [<c044bbe0>] (serial_pxa_resume+0x18/0x24) from [<c0454d34>] (platform_pm_resume+0x40/0x4c)
      [<c0454d34>] (platform_pm_resume+0x40/0x4c) from [<c0457ebc>] (pm_op+0x68/0xb4)
      [<c0457ebc>] (pm_op+0x68/0xb4) from [<c0458368>] (device_resume+0xb0/0xec)
      [<c0458368>] (device_resume+0xb0/0xec) from [<c04584c8>] (dpm_resume+0xe0/0x194)
      [<c04584c8>] (dpm_resume+0xe0/0x194) from [<c0458588>] (dpm_resume_end+0xc/0x18)
      [<c0458588>] (dpm_resume_end+0xc/0x18) from [<c02c518c>] (suspend_devices_and_enter+0x16c/0x1ac)
      [<c02c518c>] (suspend_devices_and_enter+0x16c/0x1ac) from [<c02c5278>] (enter_state+0xac/0xdc)
      [<c02c5278>] (enter_state+0xac/0xdc) from [<c02c48ec>] (state_store+0xa0/0xbc)
      [<c02c48ec>] (state_store+0xa0/0xbc) from [<c0408f7c>] (kobj_attr_store+0x18/0x1c)
      [<c0408f7c>] (kobj_attr_store+0x18/0x1c) from [<c034a6a4>] (sysfs_write_file+0x108/0x140)
      [<c034a6a4>] (sysfs_write_file+0x108/0x140) from [<c02fb798>] (vfs_write+0xac/0x134)
      [<c02fb798>] (vfs_write+0xac/0x134) from [<c02fb8cc>] (sys_write+0x3c/0x68)
      [<c02fb8cc>] (sys_write+0x3c/0x68) from [<c027c700>] (ret_fast_syscall+0x0/0x2c)
      ---[ end trace 88289eceb4675b04 ]---
      
      This patch fix the problem by adding the power on opertion back for uart
      console when console_suspend_enabled is true.
      Signed-off-by: default avatarNing Jiang <ning.jiang@marvell.com>
      Tested-by: default avatarMayank Rana <mrana@codeaurora.org>
      Cc: stable <stable@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      94abc56f
    • Andi Kleen's avatar
      serial: mfd: Initconst section fixes · 153d3d9b
      Andi Kleen authored
      Cc: gregkh@suse.de
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      153d3d9b
    • Geert Uytterhoeven's avatar
      keyboard: Do not include <linux/irq.> · 98c2b373
      Geert Uytterhoeven authored
      The top of <linux/irq.h> has this comment:
      
       * Please do not include this file in generic code.  There is currently
       * no requirement for any architecture to implement anything held
       * within this file.
       *
       * Thanks. --rmk
      
      Remove inclusion of <linux/irq.>, to prevent the following compile error
      from happening soon:
      
      | include/linux/irq.h:132: error: redefinition of ‘struct irq_data’
      | include/linux/irq.h:286: error: redefinition of ‘struct irq_chip’
      
      drivers/tty/vt/keyboard.c needs to include <asm/irq_regs.h> for get_irq_regs():
      
      | drivers/tty/vt/keyboard.c:497: error: implicit declaration of function ‘get_irq_regs’
      | drivers/tty/vt/keyboard.c:497: warning: initialization makes pointer from integer without a cast
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      98c2b373
    • Jiri Slaby's avatar
      TTY: serial, move 68360 driver to staging · 3a0db721
      Jiri Slaby authored
      This driver has been broken at least since 2008. At that time,
      a88487c7 (Fix compile errors in SGI console drivers) broke this
      driver completely.
      
      And since nobody noticed for the past 3 years, move it into staging. I
      think this will rot there and we will throw it away completely after
      some time. Or maybe someone will volunteer to fix it ;).
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Alan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      3a0db721
    • WANG Cong's avatar
      cris: lower the printk level in cris serial driver · 3d43b7d5
      WANG Cong authored
      KERN_CRIT is too high, replace those KERN_CRIT with KERN_ERR or KERN_WARNING.
      
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: Jesper Nilsson <jesper.nilsson@axis.com>
      Signed-off-by: default avatarWANG Cong <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      3d43b7d5
    • Søren Holm's avatar
      serial: Support the EFR-register of XR1715x uarts. · 06315348
      Søren Holm authored
      The EFR (Enhenced-Features-Register) is located at a different offset
      than the other devices supporting UART_CAP_EFR. This change add a special
      setup quick to set UPF_EXAR_EFR on the port. UPF_EXAR_EFR is then used to
      the port type to PORT_XR17D15X since it is for sure a XR17D15X uart.
      Signed-off-by: default avatarSøren Holm <sgh@sgh.dk>
      Acked-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      06315348
    • WANG Cong's avatar
      cris: fix a build error in drivers/tty/serial/crisv10.c · 2f7861de
      WANG Cong authored
      This patch fixes the following build error:
      
      drivers/tty/serial/crisv10.c:4453: error: 'if_ser0' undeclared (first use in this function): 2 errors in 2 logs
              v3.1-rc4/cris/cris-allmodconfig v3.1-rc4/cris/cris-allyesconfig
      drivers/tty/serial/crisv10.c:4453: error: (Each undeclared identifier is reported only once: 2 errors in 2 logs
              v3.1-rc4/cris/cris-allmodconfig v3.1-rc4/cris/cris-allyesconfig
      drivers/tty/serial/crisv10.c:4453: error: for each function it appears in.): 2 errors in 2 logs
              v3.1-rc4/cris/cris-allmodconfig v3.1-rc4/cris/cris-allyesconfig
      
      "if_ser0" is a typo, it should be "if_serial_0".
      
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: Jesper Nilsson <jesper.nilsson@axis.com>
      Signed-off-by: default avatarWANG Cong <xiyou.wangcong@gmail.com>
      Cc: stable <stable@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      2f7861de
    • Jiri Slaby's avatar
      TTY: serial, fix includes in some drivers · ee160a38
      Jiri Slaby authored
      linux/tty_flip.h is included in linux/serial_core.h. But this may (and
      will) change in the future. Then we would get build errors such as:
      .../tty/serial/max3107.c: In function ‘put_data_to_circ_buf’:
      .../tty/serial/max3107.c:149:2: error: implicit declaration of function ‘tty_insert_flip_string’
      
      So fix all the drviers which call tty flip buffer helpers to really
      include linux/tty_flip.h. And also make sure that those include
      linux/tty.h when operating with struct tty_struct.
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: Alan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      ee160a38
    • Jiri Slaby's avatar
      TTY: serial, remove dead code from 68328 · 2c16a353
      Jiri Slaby authored
      The code is dead at least since 2002. So remove it to not distort git
      grep output (about port.tty usage).
      
      Remove the whole do_softirq tasklet as it's noop now.
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Alan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      2c16a353
    • Nobuhiro Iwamatsu's avatar
      TTY: serial: Move mutex_unlock in uart_close function · 55956216
      Nobuhiro Iwamatsu authored
      When mutex_lock is not called, mutex_unlock is sometimes called.
      This deletes unnecessary goto and makes modifications so that
      mutex_unlock is called.
      
      [    8.304000] WARNING: at kernel/muex-debug.c:78
      [    8.304000] Modules linked in:
      [    8.304000]
      [    8.304000] Pid : 114, Comm:                 modprobe
      [    8.304000] CPU : 0                  Not tainted  (3.1.0-rc3-next-20110826 #810)
      [    8.304000]
      [    8.304000] PC is at debug_mutex_unlock+0xf4/0x120
      [    8.304000] PR is at debug_mutex_unlock+0xe6/0x120
      [    8.304000] PC  : 80051114 SP  : 9f02de58 SR  : 400081f1 TEA : 295cf4f2
      [    8.304000] R0  : 00000001 R1  : 00000000 R2  : 0000000f R3  : 00000000
      [    8.304000] R4  : 9fc63158 R5  : 00000000 R6  : 00000001 R7  : 9fe1de78
      [    8.304000] R8  : 805c6b2c R9  : 80003920 R10 : 00000000 R11 : 805c6b2c
      [    8.304000] R12 : 80425ca0 R13 : 00000000 R14 : 9f02de58
      [    8.304000] MACH: 00000003 MACL: 00000000 GBR : 296e1678 PR  : 80051106
      [    8.304000]
      [    8.304000] Call trace:
      [    8.304000]  [<804236c6>] __mutex_unlock_slowpath+0x46/0x120
      [    8.304000]  [<804237aa>] mutex_unlock+0xa/0x20
      [    8.304000]  [<80240ed6>] uart_close+0x76/0x2c0
      [    8.304000]  [<80223b98>] tty_release+0xf8/0x5c0
      [    8.304000]  [<800a93a6>] lookup_object+0x26/0xa0
      [    8.304000]  [<80063f6a>] call_rcu+0x8a/0xc0
      [    8.304000]  [<800a944a>] put_object+0x2a/0x60
      [    8.304000]  [<80003920>] arch_local_irq_restore+0x0/0x40
      [    8.304000]  [<800af320>] fput+0x180/0x2c0
      [    8.304000]  [<800af248>] fput+0xa8/0x2c0
      [    8.304000]  [<800ab1a8>] filp_close+0x48/0xc0
      [    8.304000]  [<800ab29a>] sys_close+0x7a/0x100
      [    8.304000]  [<8000825a>] syscall_call+0xc/0x10
      [    8.304000]  [<800ab220>] sys_close+0x0/0x100
      [    8.304000]
      [    8.304000] Code:
      [    8.304000]   8005110e:  mov.l     @r1, r1
      [    8.304000]   80051110:  tst       r1, r1
      [    8.304000]   80051112:  bf        80051116
      [    8.304000] ->80051114:  trapa     #62
      [    8.304000]   80051116:  mov.l     @r8, r1
      [    8.304000]   80051118:  tst       r1, r1
      [    8.304000]   8005111a:  bt.s      8005104c
      [    8.304000]   8005111c:  mov       #0, r1
      [    8.304000]   8005111e:  bra       80051056
      [    8.304000]
      [    8.304000] ---[ end trace e8f8e04c313f429b ]---
      Signed-off-by: default avatarNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      55956216
    • Marcus Folkesson's avatar
      serial: pxa: work around for errata #20 · e44aabd6
      Marcus Folkesson authored
      Errata E20: UART: Character Timeout interrupt remains set under certain
      software conditions.
      
      Implication: The software servicing the UART can be trapped in an infinite loop.
      Signed-off-by: default avatarMarcus Folkesson <marcus.folkesson@gmail.com>
      Cc: stable <stable@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      e44aabd6
  5. 26 Aug, 2011 10 commits
  6. 25 Aug, 2011 5 commits