platform/kernel/linux-rpi.git
15 years agosparc: unify ipcbuf.h
Sam Ravnborg [Sun, 4 Jan 2009 23:44:22 +0000 (15:44 -0800)]
sparc: unify ipcbuf.h

The ony difference is the size of the mode.
sparc has extra padding to compensate for this.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc: Update 64-bit defconfig.
David S. Miller [Sat, 3 Jan 2009 05:54:25 +0000 (21:54 -0800)]
sparc: Update 64-bit defconfig.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc: remove NO_PROC_ID - it is no longer used
Sam Ravnborg [Sat, 3 Jan 2009 05:33:54 +0000 (21:33 -0800)]
sparc: remove NO_PROC_ID - it is no longer used

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc: drop get_tbr() in traps.h
Sam Ravnborg [Sat, 3 Jan 2009 05:33:05 +0000 (21:33 -0800)]
sparc: drop get_tbr() in traps.h

get_tbr() has no users in the whole tree -drop it.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc: fix warning in userspace header traps.h
Sam Ravnborg [Sat, 3 Jan 2009 05:32:34 +0000 (21:32 -0800)]
sparc: fix warning in userspace header traps.h

Fix following warning:
traps.h:23: extern's make no sense in userspace

Add an ifdef __KERNEL__ block that cover the
extern definition and a few related things that neither
is for userspace.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc: fix warnings in userspace header byteorder.h
Sam Ravnborg [Sat, 3 Jan 2009 05:31:58 +0000 (21:31 -0800)]
sparc: fix warnings in userspace header byteorder.h

Fix following warnings in byteorder.h:

byteorder.h:4: include of <linux/types.h> is preferred over <asm/types.h>
byteorder.h:9: leaks CONFIG_SPARC32 to userspace where it is not valid
byteorder.h:13: leaks CONFIG_SPARC64 to userspace where it is not valid
byteorder.h:14: found __[us]{8,16,32,64} type without #include <linux/types.h>
byteorder.h:47: leaks CONFIG_SPARC64 to userspace where it is not valid

- changed to use include <linux/types.h> as suggested
- use preprocessor defined symbols to distingush between 32 and 64 bit

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc: fix warning in userspace header jsflash.h
Sam Ravnborg [Sat, 3 Jan 2009 05:31:13 +0000 (21:31 -0800)]
sparc: fix warning in userspace header jsflash.h

Fix following warnings in jsflash.h:

jsflash.h:11: include of <linux/types.h> is preferred over <asm/types.h>
jsflash.h:24: found __[us]{8,16,32,64} type without #include <linux/types.h>

Fixed by changing the include to <linux/types.h>

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc: unify openprom.h
Sam Ravnborg [Sat, 3 Jan 2009 05:15:25 +0000 (21:15 -0800)]
sparc: unify openprom.h

After the preparational steps the unification was simple.

The linux_prom_pci_registers definition did not look like
it could be unified at first look since the structure is assigned
using prop_getproperty() / of_get_property() so the structure
is assumed to come direct form the prom.

The LINUX_OPPROM_MAGIC was kept even if it is not used by the kernel
on the assumption that userspace may require it.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc64: delete unused linux_prom64_ranges from openprom_64.h
Sam Ravnborg [Sat, 3 Jan 2009 05:14:35 +0000 (21:14 -0800)]
sparc64: delete unused linux_prom64_ranges from openprom_64.h

It was not used over the whole tree - so drop it.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc: prepare openprom for unification
Sam Ravnborg [Sat, 3 Jan 2009 05:13:52 +0000 (21:13 -0800)]
sparc: prepare openprom for unification

Align the sparc and sparc64 versions so differences are minimal.
A few data types are changed to better reflect there actual usage.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc: remove linux_prom_pci_assigned_addresses from openprom_32.h
Sam Ravnborg [Sat, 3 Jan 2009 05:12:40 +0000 (21:12 -0800)]
sparc: remove linux_prom_pci_assigned_addresses from openprom_32.h

It is not used anywhere in the tree so drop it.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc: remove ebus definitions from openprom*.h
Sam Ravnborg [Sat, 3 Jan 2009 05:10:48 +0000 (21:10 -0800)]
sparc: remove ebus definitions from openprom*.h

Looks like leftovers from the removal of the special ebus layer.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc: unify siginfo.h
Sam Ravnborg [Sat, 3 Jan 2009 05:10:04 +0000 (21:10 -0800)]
sparc: unify siginfo.h

Trivial unification where the sparc64 specific
parts are protected using a signle ifdef/endif pair.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc: unify ptrace.h
Sam Ravnborg [Sat, 3 Jan 2009 03:42:12 +0000 (19:42 -0800)]
sparc: unify ptrace.h

The two ptrace.h implementations are very alike but
the small differences required two set of ifdef/else/endif pairs.

The definition of reg_window32 could have been shared but
that would have required several updates in sparc32 code as
all printk formatting for example assume it is longs.

sparc_stackf looked like anohter candidate to share if the 32
bit was renamed to sparc_stackf32.
But it contains two pointers in the sparc32 version which would
have been 64 bit in the sparc64 version so it was non-trivial.
Using a set of accessor macros could do the trick if pursued later.

The sparc64 specific definitions are not protected by
ifdef - as it should not be required to do so.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc: unify sigcontext.h
Sam Ravnborg [Sat, 3 Jan 2009 03:34:46 +0000 (19:34 -0800)]
sparc: unify sigcontext.h

With the renamed types in place the unification was straightforward.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc: add '32' suffix to reg_window, sigcontext, __siginfo_t
Sam Ravnborg [Sat, 3 Jan 2009 03:32:59 +0000 (19:32 -0800)]
sparc: add '32' suffix to reg_window, sigcontext, __siginfo_t

Renaming a few types to contain a 32 suffix makes the
type names compatible with sparc64 and thus makes sharing
between the two a lot easier.

Note: None of these definitions are expected part of the
stable ABI towards userspace.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc: unify signal.h
Sam Ravnborg [Sat, 3 Jan 2009 03:21:06 +0000 (19:21 -0800)]
sparc: unify signal.h

They were almost identical and with the preapration
patch nothing was needed to be added.

The unified version contains a few sparc64 only definitions
but they are kept as is and not protected by ifdef/endif.
The unified version exports a bit more to userspace then the
32 bit version did.
This is not considered fatal.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc64: prepare signal_64 for unification
Sam Ravnborg [Sat, 3 Jan 2009 03:17:47 +0000 (19:17 -0800)]
sparc64: prepare signal_64 for unification

o add a sparc32 only definition
o fix a few style issues (white space errors etc).
o include compiler.h (for __user)

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc: Kill bogus comment about IRQF_SHARED in pci_psycho.c
David S. Miller [Sat, 3 Jan 2009 03:12:46 +0000 (19:12 -0800)]
sparc: Kill bogus comment about IRQF_SHARED in pci_psycho.c

Noticed by Geert Uytterhoeven.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc: unify stat.h
Sam Ravnborg [Sat, 3 Jan 2009 02:48:21 +0000 (18:48 -0800)]
sparc: unify stat.h

To my suprise struct stat64 was not equal on sparc 32 and sparc64,
so there was really nothing to share here.
Unify the files by adding their respective content to stat.h.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc32: use proper types in struct stat
Sam Ravnborg [Sat, 3 Jan 2009 02:47:34 +0000 (18:47 -0800)]
sparc32: use proper types in struct stat

Like sparc64 use proper types in struct stat

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc32: drop __old_kernel_stat
Sam Ravnborg [Sat, 3 Jan 2009 02:39:10 +0000 (18:39 -0800)]
sparc32: drop __old_kernel_stat

sparc32 does not define __ARCH_WANT_OLD_STAT so
we do not use this structure neither do we support it.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc: unify posix_types.h
Sam Ravnborg [Sat, 3 Jan 2009 02:34:50 +0000 (18:34 -0800)]
sparc: unify posix_types.h

The posix types differed so much in their definition
that they are kept in separate blocks.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosparc: delete unused config symbols
Sam Ravnborg [Sat, 3 Jan 2009 02:14:04 +0000 (18:14 -0800)]
sparc: delete unused config symbols

There is no need to define a config symbol if
it is never set to any value. Undefined symbols equal
to 'n'.

GENERIC_GPIO looks like it is similar but
it is set using select in some other file so
it must be kept.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoDisallow gcc versions 3.{0,1}
Ingo Molnar [Fri, 2 Jan 2009 17:53:14 +0000 (18:53 +0100)]
Disallow gcc versions 3.{0,1}

GCC 3.0 and 3.1 are too old to build a working kernel.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
[ This check got dropped as obsolete when I simplified the gcc header
  inclusion mess in f153b82121b0366fe0e5f9553545cce237335175, but Willy
  Tarreau reports actually having those old versions still..  -Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMerge branch 'cpus4096-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Fri, 2 Jan 2009 19:44:09 +0000 (11:44 -0800)]
Merge branch 'cpus4096-for-linus-2' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'cpus4096-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (66 commits)
  x86: export vector_used_by_percpu_irq
  x86: use logical apicid in x2apic_cluster's x2apic_cpu_mask_to_apicid_and()
  sched: nominate preferred wakeup cpu, fix
  x86: fix lguest used_vectors breakage, -v2
  x86: fix warning in arch/x86/kernel/io_apic.c
  sched: fix warning in kernel/sched.c
  sched: move test_sd_parent() to an SMP section of sched.h
  sched: add SD_BALANCE_NEWIDLE at MC and CPU level for sched_mc>0
  sched: activate active load balancing in new idle cpus
  sched: bias task wakeups to preferred semi-idle packages
  sched: nominate preferred wakeup cpu
  sched: favour lower logical cpu number for sched_mc balance
  sched: framework for sched_mc/smt_power_savings=N
  sched: convert BALANCE_FOR_xx_POWER to inline functions
  x86: use possible_cpus=NUM to extend the possible cpus allowed
  x86: fix cpu_mask_to_apicid_and to include cpu_online_mask
  x86: update io_apic.c to the new cpumask code
  x86: Introduce topology_core_cpumask()/topology_thread_cpumask()
  x86: xen: use smp_call_function_many()
  x86: use work_on_cpu in x86/kernel/cpu/mcheck/mce_amd_64.c
  ...

Fixed up trivial conflict in kernel/time/tick-sched.c manually

15 years agoMerge branch 'kvm-updates/2.6.29' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 2 Jan 2009 19:41:11 +0000 (11:41 -0800)]
Merge branch 'kvm-updates/2.6.29' of git://git./linux/kernel/git/avi/kvm

* 'kvm-updates/2.6.29' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm: (140 commits)
  KVM: MMU: handle large host sptes on invlpg/resync
  KVM: Add locking to virtual i8259 interrupt controller
  KVM: MMU: Don't treat a global pte as such if cr4.pge is cleared
  MAINTAINERS: Maintainership changes for kvm/ia64
  KVM: ia64: Fix kvm_arch_vcpu_ioctl_[gs]et_regs()
  KVM: x86: Rework user space NMI injection as KVM_CAP_USER_NMI
  KVM: VMX: Fix pending NMI-vs.-IRQ race for user space irqchip
  KVM: fix handling of ACK from shared guest IRQ
  KVM: MMU: check for present pdptr shadow page in walk_shadow
  KVM: Consolidate userspace memory capability reporting into common code
  KVM: Advertise the bug in memory region destruction as fixed
  KVM: use cpumask_var_t for cpus_hardware_enabled
  KVM: use modern cpumask primitives, no cpumask_t on stack
  KVM: Extract core of kvm_flush_remote_tlbs/kvm_reload_remote_mmus
  KVM: set owner of cpu and vm file operations
  anon_inodes: use fops->owner for module refcount
  x86: KVM guest: kvm_get_tsc_khz: return khz, not lpj
  KVM: MMU: prepopulate the shadow on invlpg
  KVM: MMU: skip global pgtables on sync due to cr3 switch
  KVM: MMU: collapse remote TLB flushes on root sync
  ...

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
Linus Torvalds [Fri, 2 Jan 2009 18:32:18 +0000 (10:32 -0800)]
Merge git://git./linux/kernel/git/bart/ide-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (32 commits)
  ide-atapi: start dma in a drive-specific way
  ide-atapi: put the rest of non-ide-cd code into the else-clause of ide_transfer_pc
  ide-atapi: remove timeout arg to ide_issue_pc
  ide-cd: remove handler wrappers
  ide-cd: remove xferlen arg to cdrom_start_packet_command
  ide-atapi: split drive-specific functionality in ide_issue_pc
  ide-atapi: assign expiry and timeout based on device type
  ide-atapi: compute cmd_len based on device type in ide_transfer_pc
  ide: remove the last ide-scsi remnants
  ide-atapi: remove ide-scsi remnants from ide_pc_intr()
  ide-atapi: remove ide-scsi remnants from ide_transfer_pc()
  ide-atapi: remove ide-scsi remnants from ide_issue_pc
  ide-cd: move cdrom_timer_expiry to ide-atapi.c
  ide-atapi: teach ide atapi about drive->waiting_for_dma
  ide-atapi: accomodate transfer length calculation for ide-cd
  ide-atapi: setup dma for ide-cd
  ide-atapi: combine drive-specific assignments
  ide-atapi: add a dev_is_idecd-inline
  remove ide-scsi
  ide-floppy: allocate only toplevel packet commands
  ...

15 years agoMerge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/dvrabel/uwb
Linus Torvalds [Fri, 2 Jan 2009 18:31:04 +0000 (10:31 -0800)]
Merge branch 'for-upstream' of git://git./linux/kernel/git/dvrabel/uwb

* 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/dvrabel/uwb: (31 commits)
  uwb: remove beacon cache entry after calling uwb_notify()
  uwb: remove unused include/linux/uwb/debug.h
  uwb: use print_hex_dump()
  uwb: use dev_dbg() for debug messages
  uwb: fix memory leak in uwb_rc_notif()
  wusb: fix oops when terminating a non-existant reservation
  uwb: fix oops when terminating an already terminated reservation
  uwb: improved MAS allocator and reservation conflict handling
  wusb: add debug files for ASL, PZL and DI to the whci-hcd driver
  uwb: fix oops in debug PAL's reservation callback
  uwb: clean up whci_wait_for() timeout error message
  wusb: whci-hcd shouldn't do ASL/PZL updates while channel is inactive
  uwb: remove unused beacon group join/leave events
  wlp: start/stop radio on network interface up/down
  uwb: add basic radio manager
  uwb: add pal parameter to new reservation callback
  uwb: fix races between events and neh timers
  uwb: don't unbind the radio controller driver when resetting
  uwb: per-radio controller event thread and beacon cache
  uwb: add commands to add/remove IEs to the debug interface
  ...

15 years agoUpdate powerpc maintainers
Paul Mackerras [Fri, 2 Jan 2009 04:40:55 +0000 (15:40 +1100)]
Update powerpc maintainers

Ben Herrenschmidt is taking over as the primary powerpc architecture
maintainer.  I'll still be around as his backup/deputy.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMerge branch 'i8k-updates' from Alan
Linus Torvalds [Fri, 2 Jan 2009 18:28:41 +0000 (10:28 -0800)]
Merge branch 'i8k-updates' from Alan

* i8k-updates:
  i8k: Add Dell Vostro systems
  i8k: Enable i8k on Dell Precision Systems

15 years agoi8k: Add Dell Vostro systems
Federico Heinz [Fri, 2 Jan 2009 16:19:23 +0000 (16:19 +0000)]
i8k: Add Dell Vostro systems

This trivial patch adds support for i8k on the new Dell Vostro models.
I tested it on my Vostro 1400, and it works. It does print a warning
when loading the module:

i8k: unable to get SMM BIOS version

But I couldn't figure out how to fix that. The module seems to work fine,
anyway...

Signed-off-by: Federico Heinz <fheinz@vialibre.org.ar>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoi8k: Enable i8k on Dell Precision Systems
Andy Spencer [Fri, 2 Jan 2009 16:19:13 +0000 (16:19 +0000)]
i8k: Enable i8k on Dell Precision Systems

Patch to enable i8k on Dell Precisions.

Signed-off-by: Andy Spencer <spenceal@rose-hulman.edu>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoFix compiler warning in arch/x86/mm/init_32.c
Ingo Brueckl [Fri, 2 Jan 2009 13:42:00 +0000 (14:42 +0100)]
Fix compiler warning in arch/x86/mm/init_32.c

Signed-off-by: Ingo Brueckl <ib@wupperonline.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMerge branch 'tty-updates' from Alan
Linus Torvalds [Fri, 2 Jan 2009 18:25:51 +0000 (10:25 -0800)]
Merge branch 'tty-updates' from Alan

* tty-updates: (75 commits)
  serial_8250: support for Sealevel Systems Model 7803 COMM+8
  hso maintainers update patch
  hso modem detect fix patch against Alan Cox'es tty tree
  tty: Fix an ircomm warning and note another bug
  drivers/char/cyclades.c: cy_pci_probe: fix error path
  Serial: UART driver changes for Cavium OCTEON.
  Serial: Allow port type to be specified when calling serial8250_register_port.
  8250: Serial driver changes to support future Cavium OCTEON serial patches.
  8250: Don't clobber spinlocks.
  fix for tty-serial-move-port
  tty: We want the port object to be persistent
  __FUNCTION__ is gcc-specific, use __func__
  serial: RS485 ioctl structure uses __u32 include linux/types.h
  tty: Drop the lock_kernel in the private ioctl hook
  synclink_cs: Convert to tty_port
  tty: use port methods for the rocket driver
  tty: kref the rocket driver
  tty: make rocketport use standard port->flags
  tty: Redo the rocket driver locking
  tty: Make epca use the port helpers
  ...

15 years agoserial_8250: support for Sealevel Systems Model 7803 COMM+8
Flavio Leitner [Fri, 2 Jan 2009 13:50:43 +0000 (13:50 +0000)]
serial_8250: support for Sealevel Systems Model 7803 COMM+8

Add support for Sealevel Systems Model 7803 COMM+8

Signed-off-by: Flavio Leitner <fleitner@redhat.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agohso maintainers update patch
Denis Joseph Barrow [Fri, 2 Jan 2009 13:50:36 +0000 (13:50 +0000)]
hso maintainers update patch

Added D.J. Barrow as maintainer of hso driver.

Signed-off-by: Denis Joseph Barrow <D.Barow@option.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agohso modem detect fix patch against Alan Cox'es tty tree
Denis Joseph Barrow [Fri, 2 Jan 2009 13:50:29 +0000 (13:50 +0000)]
hso modem detect fix patch against Alan Cox'es tty tree

Fixed incorrect check for the modem port, this prevents
crashes caused by issueing a tiocmget_submit_urb
on endpoints which don't exist for non modem devices.

Signed-off-by: Denis Joseph Barrow <D.Barow@option.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: Fix an ircomm warning and note another bug
Alan Cox [Fri, 2 Jan 2009 13:50:20 +0000 (13:50 +0000)]
tty: Fix an ircomm warning and note another bug

Roel Kluin noted that line is unsigned so one test is unneccessary. Also
add a warning for another flaw I noticed while making this change.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agodrivers/char/cyclades.c: cy_pci_probe: fix error path
Andrew Morton [Fri, 2 Jan 2009 13:50:07 +0000 (13:50 +0000)]
drivers/char/cyclades.c: cy_pci_probe: fix error path

We forgot to release resources in one case.

Addresses http://bugzilla.kernel.org/show_bug.cgi?id=12137

Reported-by: Florian Lohoff <flo@rfc822.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoSerial: UART driver changes for Cavium OCTEON.
David Daney [Fri, 2 Jan 2009 13:50:00 +0000 (13:50 +0000)]
Serial: UART driver changes for Cavium OCTEON.

Cavium UART implementation is not covered by existing uart_configS.
Define a new uart_config (PORT_OCTEON) which is specified by OCTEON
platform device registration code.

Signed-off-by: Tomaso Paoletti <tpaoletti@caviumnetworks.com>
Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoSerial: Allow port type to be specified when calling serial8250_register_port.
David Daney [Fri, 2 Jan 2009 13:49:54 +0000 (13:49 +0000)]
Serial: Allow port type to be specified when calling serial8250_register_port.

Add flag value UPF_FIXED_TYPE which specifies that the UART type is
known and should not be probed.  For this case the UARTs properties
are just copied out of the uart_config entry.

This allows us to keep SOC specific 8250 probe code out of 8250.c.  In
this case we know the serial hardware will not be changing as it is on
the same silicon as the CPU, and we can specify it with certainty in
the board/cpu setup code.

The alternative is to load up 8250.c with a bunch of OCTEON specific
special cases in the probing code.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years ago8250: Serial driver changes to support future Cavium OCTEON serial patches.
David Daney [Fri, 2 Jan 2009 13:49:47 +0000 (13:49 +0000)]
8250: Serial driver changes to support future Cavium OCTEON serial patches.

In order to use Cavium OCTEON specific serial i/o drivers, we first
patch the 8250 driver to use replaceable I/O functions.  Compatible
I/O functions are added for existing iotypeS.

An added benefit of this change is that it makes it easy to factor
some of the existing special cases out to board/SOC specific support
code.

The alternative is to load up 8250.c with a bunch of OCTEON specific
iotype code and bug work-arounds.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Tomaso Paoletti <tpaoletti@caviumnetworks.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years ago8250: Don't clobber spinlocks.
David Daney [Fri, 2 Jan 2009 13:49:41 +0000 (13:49 +0000)]
8250: Don't clobber spinlocks.

In serial8250_isa_init_ports(), the port's lock is initialized.  We
should not overwrite it.  In early_serial_setup(), only copy in the
fields we need.  Since the early console code only uses a subset of
the fields, these are sufficient.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Tomaso Paoletti <tpaoletti@caviumnetworks.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agofix for tty-serial-move-port
Alexander Beregalov [Fri, 2 Jan 2009 13:49:32 +0000 (13:49 +0000)]
fix for tty-serial-move-port

Hi Alan

next-20081204 crashes with the following message:

BUG: unable to handle kernel paging request at ffff88007d320248
IP: [<ffffffff803de934>] uart_remove_one_port+0xef/0x111
                kfree(info);
     393:       49 8d 7d 10             lea    0x10(%r13),%rdi
     397:       e8 00 00 00 00          callq  39c <uart_remove_one_port+0xef>

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: We want the port object to be persistent
Alan Cox [Fri, 2 Jan 2009 13:49:21 +0000 (13:49 +0000)]
tty: We want the port object to be persistent

Move the tty_port and uart_info bits around a little. By embedding the uart_info
into the uart_port we get rid of lots of corner case testing and also get the
ability to go port<->state<->info which is a bit more elegant than the current
data structures.

Downsides - we allocate a tiny bit more memory for unused ports, upside we've
removed as much code as it saved for most users..

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years ago__FUNCTION__ is gcc-specific, use __func__
Harvey Harrison [Fri, 2 Jan 2009 13:49:13 +0000 (13:49 +0000)]
__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoserial: RS485 ioctl structure uses __u32 include linux/types.h
Andy Whitcroft [Fri, 2 Jan 2009 13:49:04 +0000 (13:49 +0000)]
serial: RS485 ioctl structure uses __u32 include linux/types.h

In the commit below a new struct serial_rs485 was introduced for a new
ioctl:

    commit c26c56c0f40e200e61d1390629c806f6adaffbcc
    Author: Alan Cox <alan@redhat.com>
    Date:   Mon Oct 13 10:37:48 2008 +0100

tty: Cris has a nice RS485 ioctl so we should steal it

This structure uses the __u32 types for some of its members, which leads
to the following compile error:

    $ cc -I.../include -c X.c
    In file included from X.c:2: .../include/linux/serial.h:185:
error: expected specifier-qualifier-list before â€˜__u32’
    $

It seems that these types are appropriate for this structure as it is
to be exposed to userspace.  These types are available via linux/types.h
so move the include of that outside the __KERNEL__ section.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: Drop the lock_kernel in the private ioctl hook
Alan Cox [Fri, 2 Jan 2009 13:48:56 +0000 (13:48 +0000)]
tty: Drop the lock_kernel in the private ioctl hook

We don't need the BKL here any more so it can go. In a couple of spots the
driver requirements are not clear so push the lock down into the driver.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosynclink_cs: Convert to tty_port
Alan Cox [Fri, 2 Jan 2009 13:48:47 +0000 (13:48 +0000)]
synclink_cs: Convert to tty_port

Use the tty port operations, add refcounting, and refactor a bit to make the
refcounting work cleanly.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: use port methods for the rocket driver
Alan Cox [Fri, 2 Jan 2009 13:48:39 +0000 (13:48 +0000)]
tty: use port methods for the rocket driver

Now we have our ducks in order we can begin switching to the port
operations

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: kref the rocket driver
Alan Cox [Fri, 2 Jan 2009 13:48:30 +0000 (13:48 +0000)]
tty: kref the rocket driver

We will need this kref fitted to make full use of the port operations.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: make rocketport use standard port->flags
Alan Cox [Fri, 2 Jan 2009 13:48:23 +0000 (13:48 +0000)]
tty: make rocketport use standard port->flags

We need to this ready for using the standard helpers

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: Redo the rocket driver locking
Alan Cox [Fri, 2 Jan 2009 13:48:17 +0000 (13:48 +0000)]
tty: Redo the rocket driver locking

Bring this driver into the port locking model

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: Make epca use the port helpers
Alan Cox [Fri, 2 Jan 2009 13:48:11 +0000 (13:48 +0000)]
tty: Make epca use the port helpers

Now the locking is straight and the port kref usage is straight we can
replace lots of chunks of code with the standard port helpers

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: refcount the epca driver
Alan Cox [Fri, 2 Jan 2009 13:48:04 +0000 (13:48 +0000)]
tty: refcount the epca driver

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: relock epca
Alan Cox [Fri, 2 Jan 2009 13:47:58 +0000 (13:47 +0000)]
tty: relock epca

Bring epca into line with the port locking.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: Modem functions for the HSO driver
Denis Joseph Barrow [Fri, 2 Jan 2009 13:47:52 +0000 (13:47 +0000)]
tty: Modem functions for the HSO driver

Makes TIOCM ioctls for Data Carrier Detect & related functions
work like /drivers/serial/serial-core.c potentially needed
for pppd & similar user programs.

Signed-off-by: Denis Joseph Barrow <D.Barow@option.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: Fix the HSO termios handling a bit
Alan Cox [Fri, 2 Jan 2009 13:47:45 +0000 (13:47 +0000)]
tty: Fix the HSO termios handling a bit

Init the tty structure once
Don't set ->low_latency twice in a row
Don't force bits we should be leaving to the user
Don't allocate termios arrays as these are in fact allocated by the tty layer
for you and just overwrite the ones allocated in the driver

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agohso: net driver using tty without locking
Alan Cox [Fri, 2 Jan 2009 13:47:39 +0000 (13:47 +0000)]
hso: net driver using tty without locking

Checking tty == NULL doesn't help us unless we have a clear semantic for
the locking of the tty object in the driver. Use the tty kref objects so that
we can take references to the tty in the USB event handling paths.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: kref nozomi
Alan Cox [Fri, 2 Jan 2009 13:47:32 +0000 (13:47 +0000)]
tty: kref nozomi

Update the nozomi driver to use krefs

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: Remove some pointless casts
Alan Cox [Fri, 2 Jan 2009 13:47:26 +0000 (13:47 +0000)]
tty: Remove some pointless casts

disc_data and driver_data are void *

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: PTYs set TTY_DO_WRITE_WAKEUP when they don't need to
Alan Cox [Fri, 2 Jan 2009 13:47:20 +0000 (13:47 +0000)]
tty: PTYs set TTY_DO_WRITE_WAKEUP when they don't need to

The write wakeup is done anyway for the poll while DO_WRITE_WAKUP is
cleared, set and managed by the ldisc layer and is no business of the pty
code.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: N_TTY SIGIO only works for read
Thomas Pfaff [Fri, 2 Jan 2009 13:47:13 +0000 (13:47 +0000)]
tty: N_TTY SIGIO only works for read

The N_TTY ldisc layer does not send SIGIO POLL_OUTs correctly when output is
possible due to flawed handling of the TTY_DO_WRITE_WAKEUP bit. It will
either send no SIGIOs at all or on every tty wakeup.

The fix is to set the bit when the tty driver write would block and test
and clear it on write wakeup.

[Merged with existing N_TTY patches and a small buglet fixed -- Alan]

Signed-off-by: Thomas Pfaff <tpfaff@pcs.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: USB tty devices can block in tcdrain when unplugged
Alan Cox [Fri, 2 Jan 2009 13:47:06 +0000 (13:47 +0000)]
tty: USB tty devices can block in tcdrain when unplugged

The underlying problem is that the device methods don't all correctly
handle disconnected status and some keep reporting bytes pending which
causes tcdrain to stall.

When the cable is unplugged they are definitely gone, and as this is true
for all USB cables we can fix it in the core usb serial code.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoserial: set correct baud_base for Oxford Semiconductor Ltd EXSYS EX-41092 Dual 16950...
Niels de Vos [Fri, 2 Jan 2009 13:46:58 +0000 (13:46 +0000)]
serial: set correct baud_base for Oxford Semiconductor Ltd EXSYS EX-41092 Dual 16950 Serial adapter

The PCI-card identified as "Oxford Semiconductor Ltd EXSYS EX-41092 Dual
16950 Serial adapter" is only usable with other devices (i.e. not the same
card) after doing a "setserial /dev/ttyS<n> baud_base 115200".  This
baud_base should be default for this card.

Signed-off-by: Niels de Vos <niels.devos@wincor-nixdorf.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: Introduce some close helpers for ports
Alan Cox [Fri, 2 Jan 2009 13:46:50 +0000 (13:46 +0000)]
tty: Introduce some close helpers for ports

Again this is a lot of common code we can unify

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: tty port zero baud open
Alan Cox [Fri, 2 Jan 2009 13:46:43 +0000 (13:46 +0000)]
tty: tty port zero baud open

If we have no speed set at some point then we should not raise DTR/RTS at
that point when opening as the tty is not ready

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: ESP has been broken for locking etc forver
Alan Cox [Fri, 2 Jan 2009 13:46:34 +0000 (13:46 +0000)]
tty: ESP has been broken for locking etc forver

Mark it broken

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: rework stallion to use the tty_port bits
Alan Cox [Fri, 2 Jan 2009 13:46:24 +0000 (13:46 +0000)]
tty: rework stallion to use the tty_port bits

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: Rework istallion to use the tty port changes
Alan Cox [Fri, 2 Jan 2009 13:46:18 +0000 (13:46 +0000)]
tty: Rework istallion to use the tty port changes

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: Introduce a tty_port generic block_til_ready
Alan Cox [Fri, 2 Jan 2009 13:46:10 +0000 (13:46 +0000)]
tty: Introduce a tty_port generic block_til_ready

Start sucking more commonality out of the drivers into a single piece of
core code.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: relock the mxser driver
Alan Cox [Fri, 2 Jan 2009 13:45:58 +0000 (13:45 +0000)]
tty: relock the mxser driver

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: relock riscom8 using port locks
Alan Cox [Fri, 2 Jan 2009 13:45:50 +0000 (13:45 +0000)]
tty: relock riscom8 using port locks

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: rocketport uses different port flags to everyone else
Alan Cox [Fri, 2 Jan 2009 13:45:44 +0000 (13:45 +0000)]
tty: rocketport uses different port flags to everyone else

Normalise them so we can use the common helpers later on

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: relock generic_serial
Alan Cox [Fri, 2 Jan 2009 13:45:36 +0000 (13:45 +0000)]
tty: relock generic_serial

Switch generic_serial to do port count locking via the tty_port structure
ready for moving to a common port wait routine. Keep the old driver lock for
internal calling so we don't risk messing up the drivers below until we
are ready.

Still needs kref conversions

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoisicom: redo locking to use tty port locks
Alan Cox [Fri, 2 Jan 2009 13:45:26 +0000 (13:45 +0000)]
isicom: redo locking to use tty port locks

This helps set the basis for moving block_til_ready into common code. We also
introduce a tty_port_hangup helper as this will also be generally needed.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: Pull the dtr raise into tty port
Alan Cox [Fri, 2 Jan 2009 13:45:19 +0000 (13:45 +0000)]
tty: Pull the dtr raise into tty port

This moves another per device special out of what should be shared open
wait paths into private methods

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agorio: Kill off ckmalloc
Alan Cox [Fri, 2 Jan 2009 13:45:12 +0000 (13:45 +0000)]
rio: Kill off ckmalloc

This was an alloc/clear wrapper but makes even less sense now it uses
kzalloc. Kill it off.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty_port: Add a port level carrier detect operation
Alan Cox [Fri, 2 Jan 2009 13:45:05 +0000 (13:45 +0000)]
tty_port: Add a port level carrier detect operation

This is the first step to generalising the various pieces of waiting logic
duplicated in all sorts of serial drivers.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: Fix PPP hang under load
Alan Cox [Fri, 2 Jan 2009 13:44:56 +0000 (13:44 +0000)]
tty: Fix PPP hang under load

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoCRED: Wrap task credential accesses in the devpts filesystem
David Howells [Fri, 2 Jan 2009 13:44:49 +0000 (13:44 +0000)]
CRED: Wrap task credential accesses in the devpts filesystem

Wrap access to task credentials so that they can be separated more easily from
the task_struct during the introduction of COW creds.

Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id().

Change some task->e?[ug]id to task_e?[ug]id().  In some places it makes more
sense to use RCU directly rather than a convenient wrapper; these will be
addressed by later patches.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoAdd device function for USB serial console
Kevin Hao [Fri, 2 Jan 2009 13:44:34 +0000 (13:44 +0000)]
Add device function for USB serial console

Add device funtion for usb serial console, so we can open /dev/console
when we use a usb serial device as console.

(Typecast removed as noted by Sergei Shtylyov)

Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoAnd here's a patch (to be applied on top of the last) which prevents
Russell King [Fri, 2 Jan 2009 13:44:27 +0000 (13:44 +0000)]
And here's a patch (to be applied on top of the last) which prevents

this happening again by making use of 'const'.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoConvert the oxsemi tornado special cases to use the quirk interface and not
Russell King [Fri, 2 Jan 2009 13:44:20 +0000 (13:44 +0000)]
Convert the oxsemi tornado special cases to use the quirk interface and not

scribble on its own reference structures.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agodevpts: fix unused function warning
Andrew Morton [Fri, 2 Jan 2009 13:44:12 +0000 (13:44 +0000)]
devpts: fix unused function warning

fs/devpts/inode.c:324: warning: 'compare_init_pts_sb' defined but not used

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: Fix close races in USB serial
Alan Cox [Fri, 2 Jan 2009 13:44:04 +0000 (13:44 +0000)]
tty: Fix close races in USB serial

USB serial has always had races where the tty port usage count can hit zero
during a receive event. The internal locking is a mutex so we can't use
that in the IRQ handlers.

With krefs we can tackle this differently but we still need to be careful.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agon_tty: Output bells immediately on a full buffer
Joe Peterson [Fri, 2 Jan 2009 13:43:40 +0000 (13:43 +0000)]
n_tty: Output bells immediately on a full buffer

This patch causes "bell" (^G) characters (invoked when the input buffer
is full) to be immediately output rather than filling the echo buffer.

This is especially a problem when the tty is stopped and buffers fill, since
the bells do not serve their purpose of immediate notification that the
buffer cannot take further input, and they will flush all at once when the
tty is restarted.

Signed-off-by: Joe Peterson <joe@skyrush.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agon_tty: Fix hanfling of buffer full corner cases
Joe Peterson [Fri, 2 Jan 2009 13:43:32 +0000 (13:43 +0000)]
n_tty: Fix hanfling of buffer full corner cases

Fix the handling of input characters when the tty buffer is full or nearly
full.  This includes tests that are done in n_tty_receive_char() and handling
of PARMRK.

Problems with the buffer-full tests done in receive_char() caused characters to
be lost at times when the buffer(s) filled.  Also, these full conditions
would often only be detected with echo on, and PARMRK was not accounted for
properly in all cases.  One symptom of these problems, in addition to lost
characters, was early termination from unix commands like tr and cat when
^Q was used to break from a stopped tty with full buffers (note that breaking
out was often previously not possible, due to the pty getting in "gridlock",
which will be addressed in another patch).  Note space is always reserved
at the end of the buffer for a newline (or EOF/EOL) in canonical mode.

Signed-off-by: Joe Peterson <joe@skyrush.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agon_tty: Fix handling of control characters and continuations
Joe Peterson [Fri, 2 Jan 2009 13:43:25 +0000 (13:43 +0000)]
n_tty: Fix handling of control characters and continuations

Fix process_output_block to detect continuation characters correctly
and to handle control characters even when O_OLCUC is enabled.  Make
similar change to do_output_char().

Signed-off-by: Joe Peterson <joe@skyrush.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agopty: simplify resize
Alan Cox [Fri, 2 Jan 2009 13:43:17 +0000 (13:43 +0000)]
pty: simplify resize

We have special case logic for resizing pty/tty pairs. We also have a per
driver resize method so for the pty case we should use it.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agotty: Fix sparse static warning for tty_driver_lookup_tty
Jason Wessel [Fri, 2 Jan 2009 13:43:04 +0000 (13:43 +0000)]
tty: Fix sparse static warning for tty_driver_lookup_tty

Fixed sparse warning:
drivers/char/tty_io.c:1216:19: warning: symbol 'tty_driver_lookup_tty' was not declared. Should it be static?

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosierra: Fix formatting
Alan Cox [Fri, 2 Jan 2009 13:42:56 +0000 (13:42 +0000)]
sierra: Fix formatting

Andrew Morton wrote:

in drivers/usb/serial/sierra.c:

        } else {
                if (urb->actual_length) {
+               tty = tty_port_tty_get(&port->port);
                        tty_buffer_request_room(tty, urb->actual_length);

it's missing a tab.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agodevpts: Coding style clean up
Alan Cox [Fri, 2 Jan 2009 13:42:48 +0000 (13:42 +0000)]
devpts: Coding style clean up

Just nail the oddments now while this code is being touched

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoDocument usage of multiple-instances of devpts
Sukadev Bhattiprolu [Fri, 2 Jan 2009 13:42:34 +0000 (13:42 +0000)]
Document usage of multiple-instances of devpts

Changelog [v2]:
- Add note indicating strict isolation is not possible unless all
  mounts of devpts use the 'newinstance' mount option.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoEnable multiple instances of devpts
Sukadev Bhattiprolu [Fri, 2 Jan 2009 13:42:27 +0000 (13:42 +0000)]
Enable multiple instances of devpts

To support containers, allow multiple instances of devpts filesystem, such
that indices of ptys allocated in one instance are independent of ptys
allocated in other instances of devpts.

But to preserve backward compatibility, enable this support for multiple
instances only if:

- CONFIG_DEVPTS_MULTIPLE_INSTANCES is set to Y, and
- '-o newinstance' mount option is specified while mounting devpts

To use multi-instance mount, a container startup script could:

$ ns_exec -cm /bin/bash
$ umount /dev/pts
$ mount -t devpts -o newinstance lxcpts /dev/pts
$ mount -o bind /dev/pts/ptmx /dev/ptmx
$ /usr/sbin/sshd -p 1234

where 'ns_exec -cm /bin/bash' is calls clone() with CLONE_NEWNS flag and execs
/bin/bash in the child process. A pty created by the sshd is not visible in
the original mount of /dev/pts.

USER-SPACE-IMPACT:
- See Documentation/fs/devpts.txt (included in next patch) for user-
  space impact in multi-instance and mixed-mode operation.
TODO:
- Update mount(8), pts(4) man pages. Highlight impact of not
  redirecting /dev/ptmx to /dev/pts/ptmx after a multi-instance mount.

Changelog[v6]:
- [Dave Hansen] Use new get_init_pts_sb() interface
- [Serge Hallyn] Don't bother displaying 'newinstance' in show_options
- [Serge Hallyn] Use macros (PARSE_REMOUNT/PARSE_MOUNT) instead of 0/1.
- [Serge Hallyn] Check error return from get_sb_single() (now
  get_init_pts_sb())
- devpts_pty_kill(): don't dput error dentries

Changelog[v5]:
- Move get_sb_ref() definition to earlier patch
- Move usage info to Documentation/filesystems/devpts.txt (next patch)
- Make ptmx node even in init_pts_ns, now that default mode is 0000
  (defined in earlier patch, enabled here).
- Cache ptmx dentry and use to update mode during remount
  (defined in earlier patch, enabled here).
- Bugfix: explicitly ignore newinstance on remount (if newinstance was
  specified on remount of initial mount, it would be ignored but
  /proc/mounts would imply that the option was set)

Changelog[v4]:

- Update patch description to address H. Peter Anvin's comments
- Consolidate multi-instance mode code under new config token,
  CONFIG_DEVPTS_MULTIPLE_INSTANCE.
- Move usage-details from patch description to
  Documentation/fs/devpts.txt

Changelog[v3]:
- Rename new mount option to 'newinstance'
- Create ptmx nodes only in 'newinstance' mounts
- Bugfix: parse_mount_options() modifies @data but since we need to
  parse the @data twice (once in devpts_get_sb() and once during
  do_remount_sb()), parse a local copy of @data in devpts_get_sb().
  (restructured code in devpts_get_sb() to fix this)

Changelog[v2]:
- Support both single-mount and multiple-mount semantics and
  provide '-onewmnt' option to select the semantics.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoDefine get_init_pts_sb()
Sukadev Bhattiprolu [Fri, 2 Jan 2009 13:42:19 +0000 (13:42 +0000)]
Define get_init_pts_sb()

See comments in the function header for details. The new interface will
be used in a follow-on patch.

Changelog [v2]:
[Dave Hansen] Replace get_sb_ref() in fs/super.c with get_init_pts_sb()
and make the new interface private to devpts

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoDefine mknod_ptmx()
Sukadev Bhattiprolu [Fri, 2 Jan 2009 13:42:02 +0000 (13:42 +0000)]
Define mknod_ptmx()

/dev/ptmx is closely tied to the devpts filesystem. An open of /dev/ptmx,
allocates the next pty index and the associated device shows up in the
devpts fs as /dev/pts/n.

Wih multiple instancs of devpts filesystem, during an open of /dev/ptmx
we would be unable to determine which instance of the devpts is being
accessed.

So we move the 'ptmx' node into /dev/pts and use the inode of the 'ptmx'
node to identify the superblock and hence the devpts instance.  This patch
adds ability for the kernel to internally create the [ptmx, c, 5:2] device
when mounting devpts filesystem.  Since the ptmx node in devpts is new and
may surprise some userspace scripts, the default permissions for the new
node is 0000.  These permissions can be changed either using chmod or by
remounting with the new '-o ptmxmode=0666' mount option.

Changelog[v5]:
- [Serge Hallyn bugfix]: Letting new_inode() assign inode number to
  ptmx can collide with hand-assigning inode numbers to ptys. So,
  hand-assign specific inode number to ptmx node also.
- [Serge Hallyn]: Maybe safer to grab root dentry mutex while creating
  ptmx node
- [Bugfix with Serge Hallyn] Replace lookup_one_len() in mknod_ptmx()
  wih d_alloc_name() (lookup during ->get_sb() locks up system). To
  simplify patchset, fold the ptmx_dentry patch into this.

Changelog[v4]:
- Change default permissions of pts/ptmx node to 0000.
- Move code for ptmxmode under #ifdef CONFIG_DEVPTS_MULTIPLE_INSTANCES.

Changelog[v3]:
- Rename ptmx_mode to ptmxmode (for consistency with 'newinstance')

Changelog[v2]:
- [H. Peter Anvin] Remove mknod() system call support and create the
  ptmx node internally.

Changelog[v1]:
- Earlier version of this patch enabled creating /dev/pts/tty as
  well. As pointed out by Al Viro and H. Peter Anvin, that is not
  really necessary.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoAdd DEVPTS_MULTIPLE_INSTANCES config token
Sukadev Bhattiprolu [Fri, 2 Jan 2009 13:41:54 +0000 (13:41 +0000)]
Add DEVPTS_MULTIPLE_INSTANCES config token

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoExtract option parsing to new function
Sukadev Bhattiprolu [Fri, 2 Jan 2009 13:41:47 +0000 (13:41 +0000)]
Extract option parsing to new function

Move code to parse mount options into a separate function so it can
(later) be shared between mount and remount operations.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>