]> git.proxmox.com Git - mirror_ubuntu-kernels.git/log
mirror_ubuntu-kernels.git
15 years agoMerge branch 'linux-next' of git://git.infradead.org/ubi-2.6
Linus Torvalds [Mon, 21 Sep 2009 15:13:55 +0000 (08:13 -0700)]
Merge branch 'linux-next' of git://git.infradead.org/ubi-2.6

* 'linux-next' of git://git.infradead.org/ubi-2.6:
  UBI: improve NOR flash erasure quirk
  UBI: introduce flash dump helper
  UBI: eliminate possible undefined behaviour
  UBI: print a warning if too many PEBs are corrupted
  UBI: amend NOR flash pre-erase quirk
  UBI: print a message if ECH is corrupted and VIDH is ok

15 years agoMerge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Mon, 21 Sep 2009 15:10:09 +0000 (08:10 -0700)]
Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6

* 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (133 commits)
  drm/vgaarb: add VGA arbitration support to the drm and kms.
  drm/radeon: some r420s have a CP race with the DMA engine.
  drm/radeon/r600/kms: rv670 is not DCE3
  drm/radeon/kms: r420 idle after programming GA_ENHANCE
  drm/radeon/kms: more fixes to rv770 suspend/resume path.
  drm/radeon/kms: more alignment for rv770.c with r600.c
  drm/radeon/kms: rv770 blit init called too late.
  drm/radeon/kms: move around new init path code to avoid posting at init
  drm/radeon/r600: fix some issues with suspend/resume.
  drm/radeon/kms: disable VGA rendering engine before taking over VRAM
  drm/radeon/kms: Move radeon_get_clock_info() call out of radeon_clocks_init().
  drm/radeon/kms: add initial connector properties
  drm/radeon/kms: Use surfaces for scanout / cursor byte swapping on big endian.
  drm/radeon/kms: don't fail if we fail to init GPU acceleration
  drm/r600/kms: fixup number of loops per blit calculation.
  drm/radeon/kms: reprogram format in set base.
  drm/radeon: avivo chips have no separate int bit for display
  drm/radeon/r600: don't do interrupts
  drm: fix _DRM_GEM addmap error message
  drm: update crtc x/y when only fb changes
  ...

Fixed up trivial conflicts in firmware/Makefile due to network driver
(cxgb3) and drm (mga/r128/radeon) firmware being listed next to each
other.

15 years agoDriver-Core: fix devnode callbacks for dabusb and industrialio
Ingo Molnar [Mon, 21 Sep 2009 06:56:58 +0000 (08:56 +0200)]
Driver-Core: fix devnode callbacks for dabusb and industrialio

The build of the dabusb driver broke:

  drivers/media/video/dabusb.c:758: error: unknown field 'nodename' specified in initializer
  drivers/media/video/dabusb.c:758: warning: initialization from incompatible pointer type
  make[3]: *** wait: No child processes.  Stop.

Due to this commit:

  e454cea: Driver-Core: extend devnode callbacks to provide permissions

Missing the dabusb driver's dabusb_nodename() callback.

Similar issues with the iio/industrialio driver in staging, pointed out
and patched by Jean Delvare.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Industrialio-parts-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agodrm/vgaarb: add VGA arbitration support to the drm and kms.
Dave Airlie [Mon, 21 Sep 2009 04:33:58 +0000 (14:33 +1000)]
drm/vgaarb: add VGA arbitration support to the drm and kms.

VGA arb requires DRM support for non-kms drivers, to turn on/off
irqs when disabling the mem/io regions.

VGA arb requires KMS support for GPUs where we can turn off VGA
decoding. Currently we know how to do this for intel and radeon
kms drivers, which allows them to be removed from the arbiter.

This patch comes from Fedora rawhide kernel.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/radeon: some r420s have a CP race with the DMA engine.
Alex Deucher [Mon, 21 Sep 2009 04:48:45 +0000 (14:48 +1000)]
drm/radeon: some r420s have a CP race with the DMA engine.

This patch makes sure the CP doesn't DMA do VRAM while 2D
is active by inserting a CP resync token.

todo: port to kms.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/radeon/r600/kms: rv670 is not DCE3
Alex Deucher [Fri, 18 Sep 2009 15:30:30 +0000 (11:30 -0400)]
drm/radeon/r600/kms: rv670 is not DCE3

RV670 was using the wrong modesetting code.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/radeon/kms: r420 idle after programming GA_ENHANCE
Dave Airlie [Mon, 21 Sep 2009 04:15:10 +0000 (14:15 +1000)]
drm/radeon/kms: r420 idle after programming GA_ENHANCE

https://bugs.freedesktop.org/show_bug.cgi?id=24041

The idle allows rs690 to startup properly.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agodrm/radeon/kms: more fixes to rv770 suspend/resume path.
Dave Airlie [Mon, 21 Sep 2009 04:06:30 +0000 (14:06 +1000)]
drm/radeon/kms: more fixes to rv770 suspend/resume path.

This resumes my
RV730PRO (4650)
RV770 (4850)
fine.

Still researching the RV4550 (RV710), resumes without X fine.

Signed-off-by: Dave Airlie <airlied@redhat.com>
15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6
Linus Torvalds [Sun, 20 Sep 2009 23:02:06 +0000 (16:02 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6:
  includecheck fix: x86, cpu/common.c
  includecheck fix: kernel/trace, ring_buffer.c
  includecheck fix: include/linux, ftrace.h
  includecheck fix: include/linux, page_cgroup.h
  includecheck fix: include/linux, aio.h
  includecheck fix: include/drm, drm_memory.h
  includecheck fix: include/acpi, acpi_bus.h
  includecheck fix: drivers/xen, evtchn.c
  includecheck fix: drivers/video, vgacon.c
  includecheck fix: drivers/scsi, ibmvscsi.c
  includecheck fix: drivers/scsi, libfcoe.c
  includecheck fix: x86, shadow.c
  includecheck fix: x86, traps.c
  includecheck fix: um, helper.c
  includecheck fix: s390, sys_s390.c

15 years agoloongson: fix cut-and-paste mis-merge
Linus Torvalds [Sun, 20 Sep 2009 22:57:28 +0000 (15:57 -0700)]
loongson: fix cut-and-paste mis-merge

Ingo points out that I screwed up when merging the 'timers-for-linus'
branch in commit a03fdb7612874834d6847107198712d18b5242c7.

A bit too much copy-and-pasting caused the end result to have an
extraneous 'return' in the middle of an expression.  That was obviously
bogus.  Blush.

Reported-by-with-patch: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMerge branch 'next-i2c' of git://aeryn.fluff.org.uk/bjdooks/linux
Linus Torvalds [Sun, 20 Sep 2009 22:55:56 +0000 (15:55 -0700)]
Merge branch 'next-i2c' of git://aeryn.fluff.org.uk/bjdooks/linux

* 'next-i2c' of git://aeryn.fluff.org.uk/bjdooks/linux:
  [PATCH] i2c-imx: make bus available early
  i2c-mv64xxx: correct mv64xxx_i2c_intr() return type

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
Linus Torvalds [Sun, 20 Sep 2009 22:55:39 +0000 (15:55 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6:
  Driver-Core: extend devnode callbacks to provide permissions

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6
Linus Torvalds [Sun, 20 Sep 2009 22:55:17 +0000 (15:55 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (79 commits)
  USB serial: update the console driver
  usb-serial: straighten out serial_open
  usb-serial: add missing tests and debug lines
  usb-serial: rename subroutines
  usb-serial: fix termios initialization logic
  usb-serial: acquire references when a new tty is installed
  usb-serial: change logic of serial lookups
  usb-serial: put subroutines in logical order
  usb-serial: change referencing of port and serial structures
  tty: Char: mxser, use THRE for ASPP_OQUEUE ioctl
  tty: Char: mxser, add support for CP112UL
  uartlite: support shared interrupt lines
  tty: USB: serial/mct_u232, fix tty refcnt
  tty: riscom8, fix tty refcnt
  tty: riscom8, fix shutdown declaration
  TTY: fix typos
  tty: Power: fix suspend vt regression
  tty: vt: use printk_once
  tty: handle VT specific compat ioctls in vt driver
  n_tty: move echoctl check and clean up logic
  ...

15 years agoMerge branch 'perfcounters-core-for-linus' of git://git.kernel.org/pub/scm/linux...
Linus Torvalds [Sun, 20 Sep 2009 22:54:37 +0000 (15:54 -0700)]
Merge branch 'perfcounters-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'perfcounters-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (58 commits)
  perf_counter: Fix perf_copy_attr() pointer arithmetic
  perf utils: Use a define for the maximum length of a trace event
  perf: Add timechart help text and add timechart to "perf help"
  tracing, x86, cpuidle: Move the end point of a C state in the power tracer
  perf utils: Be consistent about minimum text size in the svghelper
  perf timechart: Add "perf timechart record"
  perf: Add the timechart tool
  perf: Add a SVG helper library file
  tracing, perf: Convert the power tracer into an event tracer
  perf: Add a sample_event type to the event_union
  perf: Allow perf utilities to have "callback" options without arguments
  perf: Store trace event name/id pairs in perf.data
  perf: Add a timestamp to fork events
  sched_clock: Make it NMI safe
  perf_counter: Fix up swcounter throttling
  x86, perf_counter, bts: Optimize BTS overflow handling
  perf sched: Add --input=file option to builtin-sched.c
  perf trace: Sample timestamp and cpu when using record flag
  perf tools: Increase MAX_EVENT_LENGTH
  perf tools: Fix memory leak in read_ftrace_printk()
  ...

15 years agoincludecheck fix: x86, cpu/common.c
Jaswinder Singh Rajput [Sun, 20 Sep 2009 11:04:24 +0000 (16:34 +0530)]
includecheck fix: x86, cpu/common.c

fix the following 'make includecheck' warning:

  arch/x86/kernel/cpu/common.c: linux/smp.h is included more than once.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
LKML-Reference: <1252087783.6385.10.camel@ht.satnam>

15 years agoincludecheck fix: kernel/trace, ring_buffer.c
Jaswinder Singh Rajput [Sun, 20 Sep 2009 11:01:16 +0000 (16:31 +0530)]
includecheck fix: kernel/trace, ring_buffer.c

fix the following 'make includecheck' warning:

  kernel/trace/ring_buffer.c: trace.h is included more than once.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Sam Ravnborg <sam@ravnborg.org>
LKML-Reference: <1247068617.4382.107.camel@ht.satnam>

15 years agoincludecheck fix: include/linux, ftrace.h
Jaswinder Singh Rajput [Sun, 20 Sep 2009 10:54:00 +0000 (16:24 +0530)]
includecheck fix: include/linux, ftrace.h

fix the following 'make includecheck' warning:

  include/linux/ftrace.h: linux/sched.h is included more than once.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Sam Ravnborg <sam@ravnborg.org>
LKML-Reference: <1247068321.4382.102.camel@ht.satnam>

15 years agoincludecheck fix: include/linux, page_cgroup.h
Jaswinder Singh Rajput [Sun, 20 Sep 2009 10:50:44 +0000 (16:20 +0530)]
includecheck fix: include/linux, page_cgroup.h

fix the following 'make includecheck' warning:

  include/linux/page_cgroup.h: linux/swap.h is included more than once.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Paul Menage <menage@google.com>
15 years agoincludecheck fix: include/linux, aio.h
Jaswinder Singh Rajput [Sun, 20 Sep 2009 10:39:20 +0000 (16:09 +0530)]
includecheck fix: include/linux, aio.h

fix the following 'make includecheck' warning:

  include/linux/aio.h: linux/aio_abi.h is included more than once.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Cc: bcrl@kvack.org
Cc: Sam Ravnborg <sam@ravnborg.org>
LKML-Reference: <1247068254.4382.101.camel@ht.satnam>

15 years agoincludecheck fix: include/drm, drm_memory.h
Jaswinder Singh Rajput [Sun, 20 Sep 2009 10:23:25 +0000 (15:53 +0530)]
includecheck fix: include/drm, drm_memory.h

fix the following 'make includecheck' warning:

  include/drm/drm_memory.h: linux/vmalloc.h is included more than once.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
LKML-Reference: <1247068169.4382.99.camel@ht.satnam>
Acked-by: Dave Airlie <airlied@redhat.com>
15 years agoincludecheck fix: include/acpi, acpi_bus.h
Jaswinder Singh Rajput [Sun, 20 Sep 2009 10:18:42 +0000 (15:48 +0530)]
includecheck fix: include/acpi, acpi_bus.h

fix the following 'make includecheck' warning:

  include/acpi/acpi_bus.h: linux/device.h is included more than once.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
LKML-Reference: <1247068058.4382.96.camel@ht.satnam>
Acked-by: Len Brown <len.brown@intel.com>
15 years agoincludecheck fix: drivers/xen, evtchn.c
Jaswinder Singh Rajput [Sun, 20 Sep 2009 10:11:10 +0000 (15:41 +0530)]
includecheck fix: drivers/xen, evtchn.c

fix the following 'make includecheck' warning:

  drivers/xen/evtchn.c: linux/errno.h is included more than once.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Cc: chrisw@sous-sol.org
Cc: Sam Ravnborg <sam@ravnborg.org>
LKML-Reference: <1247067749.4382.90.camel@ht.satnam>
Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
15 years agoincludecheck fix: drivers/video, vgacon.c
Jaswinder Singh Rajput [Sun, 20 Sep 2009 09:58:01 +0000 (15:28 +0530)]
includecheck fix: drivers/video, vgacon.c

fix the following 'make includecheck' warning:

  drivers/video/console/vgacon.c: linux/slab.h is included more than once.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Cc: Martin Mares <mj@ucw.cz>
Cc: mchehab@infradead.org
Cc: Sam Ravnborg <sam@ravnborg.org>
LKML-Reference: <1247067624.4382.88.camel@ht.satnam>

15 years agoincludecheck fix: drivers/scsi, ibmvscsi.c
Jaswinder Singh Rajput [Sun, 20 Sep 2009 09:53:00 +0000 (15:23 +0530)]
includecheck fix: drivers/scsi, ibmvscsi.c

fix the following 'make includecheck' warning:

  drivers/scsi/ibmvscsi/ibmvscsi.c: asm/firmware.h is included more than once.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
LKML-Reference: <1247067016.4382.78.camel@ht.satnam>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
15 years agoincludecheck fix: drivers/scsi, libfcoe.c
Jaswinder Singh Rajput [Sun, 20 Sep 2009 09:50:55 +0000 (15:20 +0530)]
includecheck fix: drivers/scsi, libfcoe.c

fix the following 'make includecheck' warning:

  drivers/scsi/fcoe/libfcoe.c: linux/netdevice.h is included more than once.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
LKML-Reference: <1247066936.4382.76.camel@ht.satnam>

15 years agoincludecheck fix: x86, shadow.c
Jaswinder Singh Rajput [Sun, 20 Sep 2009 09:43:18 +0000 (15:13 +0530)]
includecheck fix: x86, shadow.c

fix the following 'make includecheck' warning:

  arch/x86/mm/kmemcheck/shadow.c: linux/module.h is included more than once.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Sam Ravnborg <sam@ravnborg.org>
LKML-Reference: <1247065179.4382.51.camel@ht.satnam>

15 years agoincludecheck fix: x86, traps.c
Jaswinder Singh Rajput [Sun, 20 Sep 2009 09:39:26 +0000 (15:09 +0530)]
includecheck fix: x86, traps.c

fix the following 'make includecheck' warning:

  arch/x86/kernel/traps.c: asm/traps.h is included more than once.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Sam Ravnborg <sam@ravnborg.org>
LKML-Reference: <1247065094.4382.49.camel@ht.satnam>

15 years agoincludecheck fix: um, helper.c
Jaswinder Singh Rajput [Sun, 20 Sep 2009 09:11:40 +0000 (14:41 +0530)]
includecheck fix: um, helper.c

fix the following 'make includecheck' warning:

  arch/um/os-Linux/helper.c: linux/limits.h is included more than once.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Cc: jdike@addtoit.com
Cc: Sam Ravnborg <sam@ravnborg.org>
LKML-Reference: <1247064950.4382.45.camel@ht.satnam>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
15 years agoincludecheck fix: s390, sys_s390.c
Jaswinder Singh Rajput [Sun, 20 Sep 2009 09:08:09 +0000 (14:38 +0530)]
includecheck fix: s390, sys_s390.c

fix the following 'make includecheck' warning:

  arch/s390/kernel/sys_s390.c: linux/syscalls.h is included more than once.

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Cc: schwidefsky@de.ibm.com
Cc: heiko.carstens@de.ibm.com
Cc: Sam Ravnborg <sam@ravnborg.org>
LKML-Reference: <1247068809.4382.111.camel@ht.satnam>

15 years ago[PATCH] i2c-imx: make bus available early
Wolfram Sang [Sat, 19 Sep 2009 07:09:50 +0000 (09:09 +0200)]
[PATCH] i2c-imx: make bus available early

As I2C is used by PMICs also, make the busses available early via
subsys_initcall().

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
15 years agoi2c-mv64xxx: correct mv64xxx_i2c_intr() return type
Mikael Pettersson [Mon, 7 Sep 2009 10:00:13 +0000 (12:00 +0200)]
i2c-mv64xxx: correct mv64xxx_i2c_intr() return type

The mv64xxx_i2c_intr() irq handler in drivers/i2c/busses/i2c-mv64xxx.c
is declared as returning 'int', resulting in this compile-time warning:

drivers/i2c/busses/i2c-mv64xxx.c: In function 'mv64xxx_i2c_probe':
drivers/i2c/busses/i2c-mv64xxx.c:540: warning: passing argument 2 of 'request_irq' from incompatible pointer type

Fix: correct the return type to 'irqreturn_t'.

Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
15 years agoUSB serial: update the console driver
Alan Stern [Fri, 4 Sep 2009 19:29:59 +0000 (15:29 -0400)]
USB serial: update the console driver

This patch (as1292) modifies the USB serial console driver, to make it
compatible with the recent changes to the USB serial core.  The most
important change is that serial->disc_mutex now has to be unlocked
following a successful call to usb_serial_get_by_index().

Other less notable changes include:

Use the requested port number instead of port 0 always.

Prevent the serial device from being autosuspended.

Use the ASYNCB_INITIALIZED flag bit to indicate when the
port hardware has been initialized.

In spite of these changes, there's no question that the USB serial
console code is still a big hack.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-serial: straighten out serial_open
Alan Stern [Tue, 1 Sep 2009 15:39:59 +0000 (11:39 -0400)]
usb-serial: straighten out serial_open

This patch (as1291) removes a bunch of code from serial_open(), things
that were rendered unnecessary by earlier patches.  A missing spinlock
is added to protect port->port.count, which needs to be incremented
even if the open fails but not if the tty has gotten a hangup.  The
test for whether the hardware has been initialized, based on the use
count, is replaced by a more transparent test of the
ASYNCB_INITIALIZED bit in the port flags.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-serial: add missing tests and debug lines
Alan Stern [Tue, 1 Sep 2009 15:39:51 +0000 (11:39 -0400)]
usb-serial: add missing tests and debug lines

This patch (as1290) adds some missing tests.  serial_down() isn't
supposed to do anything if the hardware hasn't been initialized, and
serial_close() isn't supposed to do anything if the tty has gotten a
hangup (because serial_hangup() takes care of shutting down the
hardware).

The patch also updates and adds a few debugging lines.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-serial: rename subroutines
Alan Stern [Tue, 1 Sep 2009 15:39:40 +0000 (11:39 -0400)]
usb-serial: rename subroutines

This patch (as1289) renames serial_do_down() to serial_down() and
serial_do_free() to serial_release().  It also adds a missing call to
tty_shutdown() in serial_release().

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-serial: fix termios initialization logic
Alan Stern [Tue, 1 Sep 2009 15:39:22 +0000 (11:39 -0400)]
usb-serial: fix termios initialization logic

This patch (as1288) fixes the initialization logic in
serial_install().  A new tty always needs to have a termios
initialized no matter what, not just in the case where the lower
driver will override the termios settings.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-serial: acquire references when a new tty is installed
Alan Stern [Tue, 1 Sep 2009 15:39:13 +0000 (11:39 -0400)]
usb-serial: acquire references when a new tty is installed

This patch (as1287) makes serial_install() be reponsible for acquiring
references to the usb_serial structure and the driver module when a
tty is first used.  This is more sensible than having serial_open() do
it, because a tty can be opened many times whereas it is installed
only once, when it is created.  (Not to mention that these actions are
reversed when the tty is released, not when it is closed.)  Finally,
it is at install time that the TTY core takes its own reference to the
usb_serial module, so it is only fitting that we should act the same
way in regard to the lower-level serial driver.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-serial: change logic of serial lookups
Alan Stern [Tue, 1 Sep 2009 15:38:59 +0000 (11:38 -0400)]
usb-serial: change logic of serial lookups

This patch (as1286) changes usb_serial_get_by_index().  Now the
routine will check whether the serial device has been disconnected; if
it has then the return value will be NULL.  If the device hasn't been
disconnected then the routine will return with serial->disc_mutex
held, so that the caller can use the structure without fear of racing
against driver unloads.

This permits the scope of table_mutex in destroy_serial() to be
reduced.  Instead of protecting the entire function, it suffices to
protect the part that actually uses serial_table[], i.e., the call to
return_serial().  There's no longer any danger of the refcount being
incremented after it reaches 0 (which was the reason for having the
large scope previously), because it can't reach 0 until the serial
device has been disconnected.

Also, the patch makes serial_install() check that serial is non-NULL
before attempting to use it.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-serial: put subroutines in logical order
Alan Stern [Tue, 1 Sep 2009 15:38:44 +0000 (11:38 -0400)]
usb-serial: put subroutines in logical order

This patch (as1285) rearranges the subroutines in usb-serial.c
concerned with tty lifetimes into a more logical order: install, open,
hangup, close, release.  It also updates the formatting of the
kerneldoc comments.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agousb-serial: change referencing of port and serial structures
Alan Stern [Tue, 1 Sep 2009 15:38:34 +0000 (11:38 -0400)]
usb-serial: change referencing of port and serial structures

This patch (as1284) changes the referencing of the usb_serial and
usb_serial_port structures in usb-serial.c.  It's not feasible to make
the port structures keep a reference to the serial structure, because
the ports need to remain in existence when serial is released -- quite
a few of the drivers expect this.  Consequently taking a reference
to the port when the device file is open is insufficient; such a
reference would not pin serial.

To fix this, we now take a reference to serial when the device file is
opened.  The final put_device() for the ports occurs in
destroy_serial(), so that the ports will last as long as they are
needed.

The patch initializes all the port devices, including those in the
unused "fake" ports.  This makes the code more uniform because they
can all be released in the same way.  The error handling code in
usb_serial_probe() is much simplified by this approach; instead of
freeing everything by hand we can use a single usb_serial_put() call.

Also simplified is the port-release mechanism.  Instead of being two
separate routines, port_release() and port_free() can be combined into
one.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agotty: Char: mxser, use THRE for ASPP_OQUEUE ioctl
Jiri Slaby [Thu, 10 Sep 2009 10:20:08 +0000 (12:20 +0200)]
tty: Char: mxser, use THRE for ASPP_OQUEUE ioctl

In moxa specific ASPP_OQUEUE ioctl command, they apparently want
only know whether there is space in transmitter hold register.

So switch UART_LSR_TEMT to UART_LSR_THRE in that specific case
according to the change in 1.14 moxa drivers.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agotty: Char: mxser, add support for CP112UL
Jiri Slaby [Thu, 10 Sep 2009 10:20:07 +0000 (12:20 +0200)]
tty: Char: mxser, add support for CP112UL

Add support for MOXA:0x1120 pci device. It's a 2-port device and differs
in no way from the others. So this turns out to be a trivial
pci_device_id change.

Increase also the version number.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agouartlite: support shared interrupt lines
Peter Korsgaard [Wed, 9 Sep 2009 14:54:04 +0000 (16:54 +0200)]
uartlite: support shared interrupt lines

Adapt isr to work with shared interrupt lines.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agotty: USB: serial/mct_u232, fix tty refcnt
Jiri Slaby [Sun, 6 Sep 2009 21:10:10 +0000 (23:10 +0200)]
tty: USB: serial/mct_u232, fix tty refcnt

Stanse found a tty refcnt leak in read_int_callback. In fact
it's handled wrong altogether. tty_port_tty_get can return NULL
and it's not checked in that manner.

Fix that by checking the tty_port_tty_get retval and put tty kref
properly.

http://stanse.fi.muni.cz/

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agotty: riscom8, fix tty refcnt
Jiri Slaby [Sun, 6 Sep 2009 21:10:09 +0000 (23:10 +0200)]
tty: riscom8, fix tty refcnt

Stanse found a tty refcnt leak on one fail path in rc_transmit.
Fix that by jumping to the 'out' label.

http://stanse.fi.muni.cz/

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agotty: riscom8, fix shutdown declaration
Jiri Slaby [Sat, 22 Aug 2009 07:04:42 +0000 (09:04 +0200)]
tty: riscom8, fix shutdown declaration

tty_port_ops.shutdown takes only one parameter: tty port. Remove
the second one and use port->tty where needed instead.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoTTY: fix typos
Alan Stern [Thu, 20 Aug 2009 19:23:47 +0000 (15:23 -0400)]
TTY: fix typos

This patch (as1282) fixes some obvious typos in the TTY core.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agotty: Power: fix suspend vt regression
Jiri Slaby [Tue, 11 Aug 2009 21:20:41 +0000 (23:20 +0200)]
tty: Power: fix suspend vt regression

vt_waitactive no longer accepts console parameter as console-1
since commit "vt: add an event interface". It expects console
number directly (as viewed by userspace -- counting from 1).

Fix a deadlock suspend regression by redefining adding one
to vt in vt_move_to_console.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agotty: vt: use printk_once
Marcin Slusarz [Sun, 9 Aug 2009 19:54:03 +0000 (21:54 +0200)]
tty: vt: use printk_once

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agotty: handle VT specific compat ioctls in vt driver
Arnd Bergmann [Thu, 6 Aug 2009 13:09:28 +0000 (15:09 +0200)]
tty: handle VT specific compat ioctls in vt driver

The VT specific compat_ioctl handlers are the only ones
in common code that require the BKL. Moving them into
the vt driver lets us remove the BKL from the other handlers
and cleans up the code.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agon_tty: move echoctl check and clean up logic
Joe Peterson [Wed, 9 Sep 2009 21:03:47 +0000 (15:03 -0600)]
n_tty: move echoctl check and clean up logic

Check L_ECHOCTL before insertting a character in the echo buffer
(rather than as the buffer is processed), to be more consistent with
when all other L_ flags are checked.  Also cleaned up the related logic.

Note that this and the previous patch ("n_tty: honor opost flag for echoes")
were verified together by the reporters of the bug that patch addresses
(http://bugs.linuxbase.org/show_bug.cgi?id=2692), and the test now passes.

Signed-off-by: Joe Peterson <joe@skyrush.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agon_tty: honor opost flag for echoes
Joe Peterson [Wed, 9 Sep 2009 21:03:13 +0000 (15:03 -0600)]
n_tty: honor opost flag for echoes

Fixes the following bug:

      http://bugs.linuxbase.org/show_bug.cgi?id=2692

Causes processing of echoed characters (output from the echo buffer) to
honor the O_OPOST flag, which is consistent with the old behavior.

Note that this and the next patch ("n_tty: move echoctl check and
clean up logic") were verified together by the bug reporters, and
the test now passes.

Signed-off-by: Joe Peterson <joe@skyrush.com>
Cc: Linux Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agotty: USB serial termios bits
Alan Cox [Sat, 19 Sep 2009 20:13:33 +0000 (13:13 -0700)]
tty: USB serial termios bits

Various drivers have hacks to mangle termios structures. This stems from
the fact there is no nice setup hook for configuring the termios settings
when the port is created

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoSet proper console speed on resume if console suspend is disabled
Deepak Saxena [Sat, 19 Sep 2009 20:13:33 +0000 (13:13 -0700)]
Set proper console speed on resume if console suspend is disabled

Commit b5b82df6, from May 2007, breaks no_console_suspend on the OLPC
XO laptop. Basically what happens is that upon returning from resume,
serial8250_resume_port() will reconfigure the port for high speed
mode and all console output will be garbled, making debug of the
resume path painful. This patch modifies uart_resume_port() to
reset the port to the state it was in before we suspended.

Original patch by Marcelo Tosatti

Second patch by Deepak then reworked by Alan to fit with the tty changes
before it got submitted. Also fixed the console path to set c_i/ospeed as
some drivers require the termios fields are valid

Signed-off-by: Deepak Saxena <dsaxena@laptop.org>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoserial: introduce tty krefs
Alan Cox [Sat, 19 Sep 2009 20:13:33 +0000 (13:13 -0700)]
serial: introduce tty krefs

Initially just use the helper and thus krefs when we set and clear the
port values.

Signed-off-by: Alan Cox <alan@linux.intel.com>
15 years agoserial: kill USF_CLOSING_* definitions
Alan Cox [Sat, 19 Sep 2009 20:13:32 +0000 (13:13 -0700)]
serial: kill USF_CLOSING_* definitions

The serial layer for some reason uses different defines for the special
case close delays and then conditionally switches to/from the normal ones
in the ioctls.

Remove this rather pointless abstraction

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoserial: move port users helper
Alan Cox [Sat, 19 Sep 2009 20:13:32 +0000 (13:13 -0700)]
serial: move port users helper

This little helper is now tty_port specific and useful generally so move it

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoserial: move delta_msr_wait into the tty_port
Alan Cox [Sat, 19 Sep 2009 20:13:31 +0000 (13:13 -0700)]
serial: move delta_msr_wait into the tty_port

This is used by various drivers not just serial and can be extracted
as commonality

Signed-off-by: Alan Cox <alan@linux.intel.com>
15 years agoserial: replace the state mutex with the tty port mutex
Alan Cox [Sat, 19 Sep 2009 20:13:31 +0000 (13:13 -0700)]
serial: replace the state mutex with the tty port mutex

They cover essentially the same stuff and we can therefore fold it into the
tty_port one.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoserial: kill off uif_t
Alan Cox [Sat, 19 Sep 2009 20:13:30 +0000 (13:13 -0700)]
serial: kill off uif_t

This typedef is now extinct

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoserial: move the flags into the tty_port field
Alan Cox [Sat, 19 Sep 2009 20:13:30 +0000 (13:13 -0700)]
serial: move the flags into the tty_port field

Fortunately the serial layer was designed to use the same flag values but
with different names. It has its own SUSPENDED flag which is a free slot in
the ASYNC flags so we allocate it in the ASYNC flags instead.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoserial: move count into the tty_port version
Alan Cox [Sat, 19 Sep 2009 20:13:29 +0000 (13:13 -0700)]
serial: move count into the tty_port version

Remove more stuff from the serial special case code

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoserial: use tty_port pointers in the core code
Alan Cox [Sat, 19 Sep 2009 20:13:29 +0000 (13:13 -0700)]
serial: use tty_port pointers in the core code

Extract out a lot of the x.port. uses and also show up where there are
things left to be isolated that prevent use using the port helpers in the
serial layer at this point

Signed-off-by: Alan Cox <alan@linux.intel.com>
15 years agoserial: Fold closing_* fields into the tty_port ones
Alan Cox [Sat, 19 Sep 2009 20:13:28 +0000 (13:13 -0700)]
serial: Fold closing_* fields into the tty_port ones

Remove some more serial specific use

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoserial: kill off uart_info
Alan Cox [Sat, 19 Sep 2009 20:13:28 +0000 (13:13 -0700)]
serial: kill off uart_info

We moved this into uart_state, now move the fields out of the separate
structure and kill it off.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoisicom: split the open method for the isicom device
Alan Cox [Sat, 19 Sep 2009 20:13:27 +0000 (13:13 -0700)]
isicom: split the open method for the isicom device

Again moving towards being able to add a common open method

Signed-off-by: Alan Cox <alan@linux.intel.com>
15 years agotty: USB does not need the filp argument in the drivers
Alan Cox [Sat, 19 Sep 2009 20:13:26 +0000 (13:13 -0700)]
tty: USB does not need the filp argument in the drivers

And indeed none of them use it. Clean this up as it will make moving to a
standard open method rather easier.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agovt: add an activate and lock
Alan Cox [Sat, 19 Sep 2009 20:13:26 +0000 (13:13 -0700)]
vt: add an activate and lock

X and other graphical interfaces need to be able to flip to a console
and lock it into graphics mode without races.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agovt: move kernel stuff out of vt.h
Alan Cox [Sat, 19 Sep 2009 20:13:25 +0000 (13:13 -0700)]
vt: move kernel stuff out of vt.h

We have vt_kern.h for this

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agovt: remove power stuff from kernel/power
Alan Cox [Sat, 19 Sep 2009 20:13:25 +0000 (13:13 -0700)]
vt: remove power stuff from kernel/power

In the past someone gratuitiously borrowed chunks of kernel internal vt
code and dumped them in kernel/power. They have all sorts of deep relations
with the vt code so put them in the vt tree instead

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agovt: add an event interface
Alan Cox [Sat, 19 Sep 2009 20:13:24 +0000 (13:13 -0700)]
vt: add an event interface

This is needed and requested in various forms for ConsoleKit, screenblank
handling and the like so do the job with a single interface. Also build the
interface so that unlike VT_WAITACTIVE and friends it won't miss events.

FIXME: Should this be a waitactive ioctl or a new device file you can poll
and read events from. We need the code anyway to fix up the existing broken
wait for console switch logic but the ConsoleKit people would prefer the
new device to the ioctl we have here

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agotty: USB can now use the shutdown method for kref based freeing of ports
Alan Cox [Sat, 19 Sep 2009 20:13:24 +0000 (13:13 -0700)]
tty: USB can now use the shutdown method for kref based freeing of ports

Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agotty: remove dtr/rts use from the driver open methods
Alan Cox [Sat, 19 Sep 2009 20:13:24 +0000 (13:13 -0700)]
tty: remove dtr/rts use from the driver open methods

These are handled by the tty_port core code which will raise and lower the
carrier correctly in tty_wait_until_ready

Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agotty: USB hangup is racy
Alan Cox [Sat, 19 Sep 2009 20:13:23 +0000 (13:13 -0700)]
tty: USB hangup is racy

The USB layer uses tty_hangup to deal with unplugs of the physical hardware
(analogous to loss of carrier) and then frees the resources. However the
tty_hangup is asynchronous. As the hangup can sleep we can use tty_vhangup
which is the non async version to avoid freeing resources too early.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agocdc_acm: Fix to use modern speed interfaces
Alan Cox [Sat, 19 Sep 2009 20:13:23 +0000 (13:13 -0700)]
cdc_acm: Fix to use modern speed interfaces

This changed in 2006 so its about time the ACM driver caught up

Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agotty: make the kref destructor occur asynchronously
Alan Cox [Sat, 19 Sep 2009 20:13:22 +0000 (13:13 -0700)]
tty: make the kref destructor occur asynchronously

We want to be able to sleep in the destructor for USB at least. It isn't a
hot path so just pushing it to a work queue doesn't really cause any
difficulty.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agocyclades: use the full port_close function
Alan Cox [Sat, 19 Sep 2009 20:13:22 +0000 (13:13 -0700)]
cyclades: use the full port_close function

Convert cyclades to use the full tty_port_close helper

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agotty: riscom8 kref and tty_port_close
Alan Cox [Sat, 19 Sep 2009 20:13:22 +0000 (13:13 -0700)]
tty: riscom8 kref and tty_port_close

We need to kref this driver in order to use port_close

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoisicom: Split the close hardware bits out
Alan Cox [Sat, 19 Sep 2009 20:13:21 +0000 (13:13 -0700)]
isicom: Split the close hardware bits out

Start to extract and build a model for a common tty_port_close()

Signed-off-by: Alan Cox <alan@linux.intel.com>
15 years agomxser: Split close ready for a standard tty_port_close method
Alan Cox [Sat, 19 Sep 2009 20:13:21 +0000 (13:13 -0700)]
mxser: Split close ready for a standard tty_port_close method

Prepare for the tty_port_close function by splitting out methods

Signed-off-by: Alan Cox <alan@linux.intel.com>
15 years agoriscom8: split open and close methods up
Alan Cox [Sat, 19 Sep 2009 20:13:21 +0000 (13:13 -0700)]
riscom8: split open and close methods up

Moving towards a tty_port method for open/close

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agotty: Add a full port_close function
Alan Cox [Sat, 19 Sep 2009 20:13:20 +0000 (13:13 -0700)]
tty: Add a full port_close function

Now we are extracting out methods for shutdown and the like we can add a
proper tty_port_close method that knows all the innards of the tty closing
process and hides the lot from the caller.

At some point in the future this will be paired with a similar open()
helper and the drivers can stick to hardware management.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years ago8250: Now honours baud rate lower bounds
Anton Vorontsov [Sat, 19 Sep 2009 20:13:20 +0000 (13:13 -0700)]
8250: Now honours baud rate lower bounds

A platform clock drives 8250 ports in most SOC systems, the clock
might run at high frequencies, and so it's not always possible to
downscale uart clock to a desired value.

Currently the 8250 uart driver accepts not supported baud rates, and
what is worse, it is doing this silently, and then passes not accepted
values to a new termios, so userspace has no chance to catch this kind
of errors (userspace verifies that settings were accepted by reading
back and comparing the settings).

This patch fixes the issue by passing minimum baud rate to the
uart_get_baud_rate() call, the call should take care of all bounds,
so userspace should now report:

  # stty -F /dev/ttyS0 speed 300
  115200
  stty: /dev/ttyS0: unable to perform all requested operations

p.s. uart_get_baud_rate() falls back to 9600, which still might be too
     low for some 10 GHz platforms, but that's a separate issue, and
     we can wait with fixing this till we find such a platform.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoserial: 8250: add IRQ trigger support
Vikram Pandita [Sat, 19 Sep 2009 20:13:19 +0000 (13:13 -0700)]
serial: 8250: add IRQ trigger support

There is currently no provision for passing IRQ trigger flags for
serial IRQs with triggering requirements (such as GPIO IRQs)

This patch adds irqflags to plat_serial8250_port that can be passed
from board file to reqest_irq() of 8250 driver

Changes are backward compatible with boards passing UPF_SHARE_IRQ flag

Tested on Zoom2 board that has IRQF_TRIGGER_RISING requirement for 8250 irq

[Moved new flag to end to fix bugs in the original with the old_serial array
-- Alan]

Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agomos7840: remove old dead modem logic
Alan Cox [Sat, 19 Sep 2009 20:13:19 +0000 (13:13 -0700)]
mos7840: remove old dead modem logic

The modem ioctls are not routed via the ioctl method so kill the old dead
code. The correct code is also already present and hooked in.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agotty: Fix a typo noted in passing
Alan Cox [Sat, 19 Sep 2009 20:13:19 +0000 (13:13 -0700)]
tty: Fix a typo noted in passing

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agotty: usb_serial_mos7720: Fix get_lsr_info
Kees Schoenmakers [Sat, 19 Sep 2009 20:13:18 +0000 (13:13 -0700)]
tty: usb_serial_mos7720: Fix get_lsr_info

I made a correction for get_lsr_info, now it returns some meaningful
information. I tested it with two simultaneous simplex modem channels.

it is attached

Signed-off-by: Kees Schoenmakers <k.schoenmakers@sigmae.nl>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoMOS7720 has no tiocmget method
Kees Schoenmakers [Sat, 19 Sep 2009 20:13:18 +0000 (13:13 -0700)]
MOS7720 has no tiocmget method

Fix the tiocmget/mset handling on the mos7720 USB serial port.

[Minor space reformatting for coding style - Alan]

Signed-off-by: Kees Schoenmakers <k.schoenmakers@sigmae.nl>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agokfifo: Use "const" definitions
Alan Cox [Sat, 19 Sep 2009 20:13:17 +0000 (13:13 -0700)]
kfifo: Use "const" definitions

Currently kfifo cannot be used by parts of the kernel that use "const"
properly as kfifo itself does not use const for passed data blocks which
are indeed const.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoslip: Clean up create and destroy
Alan Cox [Sat, 19 Sep 2009 20:13:17 +0000 (13:13 -0700)]
slip: Clean up create and destroy

The network layer now has a destructor we can hook to clean up the slip
devices array. That needs us to initiate unregister events in the right
places which with the current tty layer we can do, and with network
refcounting is safe to do.

Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agocyclades: remove more duplicated code
Jiri Slaby [Sat, 19 Sep 2009 20:13:17 +0000 (13:13 -0700)]
cyclades: remove more duplicated code

Remove duplicated code from cy_set_line_char. There were 2 if
branches with same contents except flags.

Branch only for the flags computation and use them in the only copy
of the code.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agocyclades: introduce cyy_readb/writeb
Jiri Slaby [Sat, 19 Sep 2009 20:13:16 +0000 (13:13 -0700)]
cyclades: introduce cyy_readb/writeb

Add helpers for io operations, so that we can eliminate huge
amount of supporting code. It is now centralized in those
helpers and used values are precomputed in the init phase.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agocyclades: tiocm cleanup
Jiri Slaby [Sat, 19 Sep 2009 20:13:16 +0000 (13:13 -0700)]
cyclades: tiocm cleanup

- save one indent level by inverting !fw_loaded condition
- read rs_status on Z and write it after we change all the flags,
  don't do that separately
- remove Y inverted rts/dtr branching, precompute registers and use
  them

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agocyclades: ioctls cleanup
Jiri Slaby [Sat, 19 Sep 2009 20:13:15 +0000 (13:13 -0700)]
cyclades: ioctls cleanup

- add a cy_ prefix to functions with changed prototypes
- cy_get_serial_info: initialize serial_struct by initializer,
  save a memset
- inline simple functions (get_mon_info, {s,g}et_default_threshold,
  {s,g}et_default_timeout) directly in the ioctl handler
- add a cy_cflags_changed helper to not copy its code by
  wait_event_interruptible
- remove some ret_val = 0 assignments, it's preset to 0
- TIOCGICOUNT: don't do many put_user's, do one copy_to_user

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agocyclades: merge cy_startup tails
Jiri Slaby [Sat, 19 Sep 2009 20:13:15 +0000 (13:13 -0700)]
cyclades: merge cy_startup tails

There is a duplicated code for Y and Z in cy_startup, merge the paths.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agocyclades: use dtr_rts helpers
Jiri Slaby [Sat, 19 Sep 2009 20:13:15 +0000 (13:13 -0700)]
cyclades: use dtr_rts helpers

For Z cards, use tty helpers for dtr_rts.

If we did the same for Y cards, it will cause a deadlock, because
cyy_dtr_rts takes a lock which we already hold.

Instead, we introduce a Y helper expecting card lock to be held.
It may then be called with set/clear masks from other places.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agocyclades: sleep instead busy-wait
Jiri Slaby [Sat, 19 Sep 2009 20:13:14 +0000 (13:13 -0700)]
cyclades: sleep instead busy-wait

Avoid long busy loops (5 ms) which may be replaced by sleeps.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agocyclades: overall cleanup
Jiri Slaby [Sat, 19 Sep 2009 20:13:14 +0000 (13:13 -0700)]
cyclades: overall cleanup

- remove changelog from the file. we don't care about ancient
  history
- update copyright year
- update version
- constify some stuff
- empty lines removal
- unused variables and macros removal
- remove some asm/ includes, they are sucked by linux/ variants

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agocyclades: close cleanup
Jiri Slaby [Sat, 19 Sep 2009 20:13:13 +0000 (13:13 -0700)]
cyclades: close cleanup

Use new tty helpers for close, which allows much code removal.

The only real change is locking. card_lock for protecting was
used inappropriately (just to have a critical section, no matter
which lock is used), so the change to port->lock is fine.

Remove also useless debug printks while being there.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agocyclades: switch to tty_port_hangup
Jiri Slaby [Sat, 19 Sep 2009 20:13:13 +0000 (13:13 -0700)]
cyclades: switch to tty_port_hangup

Do not duplicate common tty_port_hangup code. Use it instead.

Also do not unset ASYNC_NORMAL_ACTIVE and wake up from the
tty_hangup() caller. It makes no sense since we don't check that
flag in sleepers. tty_port_hangup() performed later will do the
right job.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>