Skip to content

Commit

Permalink
Merge tag 'tty-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/…
Browse files Browse the repository at this point in the history
…gregkh/tty

Pull TTY/serial patches from Greg KH:
 "tty and serial merge for 3.4-rc1

  Here's the big serial and tty merge for the 3.4-rc1 tree.

  There's loads of fixes and reworks in here from Jiri for the tty
  layer, and a number of patches from Alan to help try to wrestle the vt
  layer into a sane model.

  Other than that, lots of driver updates and fixes, and other minor
  stuff, all detailed in the shortlog."

* tag 'tty-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (132 commits)
  serial: pxa: add clk_prepare/clk_unprepare calls
  TTY: Wrong unicode value copied in con_set_unimap()
  serial: PL011: clear pending interrupts
  serial: bfin-uart: Don't access tty circular buffer in TX DMA interrupt after it is reset.
  vt: NULL dereference in vt_do_kdsk_ioctl()
  tty: serial: vt8500: fix annotations for probe/remove
  serial: remove back and forth conversions in serial_out_sync
  serial: use serial_port_in/out vs serial_in/out in 8250
  serial: introduce generic port in/out helpers
  serial: reduce number of indirections in 8250 code
  serial: delete useless void casts in 8250.c
  serial: make 8250's serial_in shareable to other drivers.
  serial: delete last unused traces of pausing I/O in 8250
  pch_uart: Add module parameter descriptions
  pch_uart: Use existing default_baud in setup_console
  pch_uart: Add user_uartclk parameter
  pch_uart: Add Fish River Island II uart clock quirks
  pch_uart: Use uartclk instead of base_baud
  mpc5200b/uart: select more tolerant uart prescaler on low baudrates
  tty: moxa: fix bit test in moxa_start()
  ...
  • Loading branch information
Linus Torvalds committed Mar 20, 2012
2 parents 71e7ff2 + fb8ebec commit 843ec55
Show file tree
Hide file tree
Showing 117 changed files with 3,207 additions and 3,139 deletions.
14 changes: 14 additions & 0 deletions Documentation/devicetree/bindings/tty/serial/efm32-uart.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
* Energymicro efm32 UART

Required properties:
- compatible : Should be "efm32,uart"
- reg : Address and length of the register set
- interrupts : Should contain uart interrupt

Example:

uart@0x4000c400 {
compatible = "efm32,uart";
reg = <0x4000c400 0x400>;
interrupts = <15>;
};
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -6212,8 +6212,8 @@ L: sparclinux@vger.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6.git
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6.git
S: Maintained
F: include/linux/sunserialcore.h
F: drivers/tty/serial/suncore.c
F: drivers/tty/serial/suncore.h
F: drivers/tty/serial/sunhv.c
F: drivers/tty/serial/sunsab.c
F: drivers/tty/serial/sunsab.h
Expand Down
78 changes: 23 additions & 55 deletions arch/alpha/kernel/srmcons.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ static int srm_is_registered_console = 0;
#define MAX_SRM_CONSOLE_DEVICES 1 /* only support 1 console device */

struct srmcons_private {
struct tty_struct *tty;
struct tty_port port;
struct timer_list timer;
spinlock_t lock;
};
} srmcons_singleton;

typedef union _srmcons_result {
struct {
Expand Down Expand Up @@ -68,22 +67,21 @@ static void
srmcons_receive_chars(unsigned long data)
{
struct srmcons_private *srmconsp = (struct srmcons_private *)data;
struct tty_port *port = &srmconsp->port;
unsigned long flags;
int incr = 10;

local_irq_save(flags);
if (spin_trylock(&srmcons_callback_lock)) {
if (!srmcons_do_receive_chars(srmconsp->tty))
if (!srmcons_do_receive_chars(port->tty))
incr = 100;
spin_unlock(&srmcons_callback_lock);
}

spin_lock(&srmconsp->lock);
if (srmconsp->tty) {
srmconsp->timer.expires = jiffies + incr;
add_timer(&srmconsp->timer);
}
spin_unlock(&srmconsp->lock);
spin_lock(&port->lock);
if (port->tty)
mod_timer(&srmconsp->timer, jiffies + incr);
spin_unlock(&port->lock);

local_irq_restore(flags);
}
Expand Down Expand Up @@ -155,57 +153,23 @@ srmcons_chars_in_buffer(struct tty_struct *tty)
return 0;
}

static int
srmcons_get_private_struct(struct srmcons_private **ps)
{
static struct srmcons_private *srmconsp = NULL;
static DEFINE_SPINLOCK(srmconsp_lock);
unsigned long flags;
int retval = 0;

if (srmconsp == NULL) {
srmconsp = kmalloc(sizeof(*srmconsp), GFP_KERNEL);
spin_lock_irqsave(&srmconsp_lock, flags);

if (srmconsp == NULL)
retval = -ENOMEM;
else {
srmconsp->tty = NULL;
spin_lock_init(&srmconsp->lock);
init_timer(&srmconsp->timer);
}

spin_unlock_irqrestore(&srmconsp_lock, flags);
}

*ps = srmconsp;
return retval;
}

static int
srmcons_open(struct tty_struct *tty, struct file *filp)
{
struct srmcons_private *srmconsp;
struct srmcons_private *srmconsp = &srmcons_singleton;
struct tty_port *port = &srmconsp->port;
unsigned long flags;
int retval;

retval = srmcons_get_private_struct(&srmconsp);
if (retval)
return retval;

spin_lock_irqsave(&srmconsp->lock, flags);
spin_lock_irqsave(&port->lock, flags);

if (!srmconsp->tty) {
if (!port->tty) {
tty->driver_data = srmconsp;

srmconsp->tty = tty;
srmconsp->timer.function = srmcons_receive_chars;
srmconsp->timer.data = (unsigned long)srmconsp;
srmconsp->timer.expires = jiffies + 10;
add_timer(&srmconsp->timer);
tty->port = port;
port->tty = tty; /* XXX proper refcounting */
mod_timer(&srmconsp->timer, jiffies + 10);
}

spin_unlock_irqrestore(&srmconsp->lock, flags);
spin_unlock_irqrestore(&port->lock, flags);

return 0;
}
Expand All @@ -214,16 +178,17 @@ static void
srmcons_close(struct tty_struct *tty, struct file *filp)
{
struct srmcons_private *srmconsp = tty->driver_data;
struct tty_port *port = &srmconsp->port;
unsigned long flags;

spin_lock_irqsave(&srmconsp->lock, flags);
spin_lock_irqsave(&port->lock, flags);

if (tty->count == 1) {
srmconsp->tty = NULL;
port->tty = NULL;
del_timer(&srmconsp->timer);
}

spin_unlock_irqrestore(&srmconsp->lock, flags);
spin_unlock_irqrestore(&port->lock, flags);
}


Expand All @@ -240,6 +205,9 @@ static const struct tty_operations srmcons_ops = {
static int __init
srmcons_init(void)
{
tty_port_init(&srmcons_singleton.port);
setup_timer(&srmcons_singleton.timer, srmcons_receive_chars,
(unsigned long)&srmcons_singleton);
if (srm_is_registered_console) {
struct tty_driver *driver;
int err;
Expand Down
17 changes: 4 additions & 13 deletions arch/ia64/hp/sim/boot/fw-emu.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,28 +160,19 @@ sal_emulator (long index, unsigned long in1, unsigned long in2,
*/
status = 0;
if (index == SAL_FREQ_BASE) {
switch (in1) {
case SAL_FREQ_BASE_PLATFORM:
if (in1 == SAL_FREQ_BASE_PLATFORM)
r9 = 200000000;
break;

case SAL_FREQ_BASE_INTERVAL_TIMER:
else if (in1 == SAL_FREQ_BASE_INTERVAL_TIMER) {
/*
* Is this supposed to be the cr.itc frequency
* or something platform specific? The SAL
* doc ain't exactly clear on this...
*/
r9 = 700000000;
break;

case SAL_FREQ_BASE_REALTIME_CLOCK:
} else if (in1 == SAL_FREQ_BASE_REALTIME_CLOCK)
r9 = 1;
break;

default:
else
status = -1;
break;
}
} else if (index == SAL_SET_VECTORS) {
;
} else if (index == SAL_GET_STATE_INFO) {
Expand Down
36 changes: 30 additions & 6 deletions arch/ia64/hp/sim/hpsim_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <linux/sched.h>
#include <linux/irq.h>

#include "hpsim_ssc.h"

static unsigned int
hpsim_irq_startup(struct irq_data *data)
{
Expand Down Expand Up @@ -37,15 +39,37 @@ static struct irq_chip irq_type_hp_sim = {
.irq_set_affinity = hpsim_set_affinity_noop,
};

static void hpsim_irq_set_chip(int irq)
{
struct irq_chip *chip = irq_get_chip(irq);

if (chip == &no_irq_chip)
irq_set_chip(irq, &irq_type_hp_sim);
}

static void hpsim_connect_irq(int intr, int irq)
{
ia64_ssc(intr, irq, 0, 0, SSC_CONNECT_INTERRUPT);
}

int hpsim_get_irq(int intr)
{
int irq = assign_irq_vector(AUTO_ASSIGN);

if (irq >= 0) {
hpsim_irq_set_chip(irq);
irq_set_handler(irq, handle_simple_irq);
hpsim_connect_irq(intr, irq);
}

return irq;
}

void __init
hpsim_irq_init (void)
{
int i;

for_each_active_irq(i) {
struct irq_chip *chip = irq_get_chip(i);

if (chip == &no_irq_chip)
irq_set_chip(i, &irq_type_hp_sim);
}
for_each_active_irq(i)
hpsim_irq_set_chip(i);
}
6 changes: 0 additions & 6 deletions arch/ia64/hp/sim/hpsim_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@

#include "hpsim_ssc.h"

void
ia64_ssc_connect_irq (long intr, long irq)
{
ia64_ssc(intr, irq, 0, 0, SSC_CONNECT_INTERRUPT);
}

void
ia64_ctl_trace (long on)
{
Expand Down
19 changes: 3 additions & 16 deletions arch/ia64/hp/sim/simeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,6 @@ netdev_probe(char *name, unsigned char *ether)
}


static inline int
netdev_connect(int irq)
{
/* XXX Fix me
* this does not support multiple cards
* also no return value
*/
ia64_ssc_connect_irq(NETWORK_INTR, irq);
return 0;
}

static inline int
netdev_attach(int fd, int irq, unsigned int ipaddr)
{
Expand Down Expand Up @@ -226,15 +215,13 @@ simeth_probe1(void)
return err;
}

if ((rc = assign_irq_vector(AUTO_ASSIGN)) < 0)
panic("%s: out of interrupt vectors!\n", __func__);
dev->irq = rc;

/*
* attach the interrupt in the simulator, this does enable interrupts
* until a netdev_attach() is called
*/
netdev_connect(dev->irq);
if ((rc = hpsim_get_irq(NETWORK_INTR)) < 0)
panic("%s: out of interrupt vectors!\n", __func__);
dev->irq = rc;

printk(KERN_INFO "%s: hosteth=%s simfd=%d, HwAddr",
dev->name, simeth_device, local->simfd);
Expand Down
Loading

0 comments on commit 843ec55

Please sign in to comment.