Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 843ec558 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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()
  ...
parents 71e7ff25 fb8ebec0
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
* 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>;
};
+1 −1
Original line number Diff line number Diff line
@@ -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
+23 −55
Original line number Diff line number Diff line
@@ -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 {
@@ -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);
}
@@ -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;
}
@@ -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);
}


@@ -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;
+4 −13
Original line number Diff line number Diff line
@@ -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) {
+30 −6
Original line number Diff line number Diff line
@@ -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)
{
@@ -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);
}
Loading