mirror of
https://github.com/genesi/linux-legacy.git
synced 2026-05-21 03:57:40 +00:00
Merge branch 'genirq-v28-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
This merges branches irq/genirq, irq/sparseirq-v4, timers/hpet-percpu and x86/uv. The sparseirq branch is just preliminary groundwork: no sparse IRQs are actually implemented by this tree anymore - just the new APIs are added while keeping the old way intact as well (the new APIs map 1:1 to irq_desc[]). The 'real' sparse IRQ support will then be a relatively small patch ontop of this - with a v2.6.29 merge target. * 'genirq-v28-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (178 commits) genirq: improve include files intr_remapping: fix typo io_apic: make irq_mis_count available on 64-bit too genirq: fix name space collisions of nr_irqs in arch/* genirq: fix name space collision of nr_irqs in autoprobe.c genirq: use iterators for irq_desc loops proc: fixup irq iterator genirq: add reverse iterator for irq_desc x86: move ack_bad_irq() to irq.c x86: unify show_interrupts() and proc helpers x86: cleanup show_interrupts genirq: cleanup the sparseirq modifications genirq: remove artifacts from sparseirq removal genirq: revert dynarray genirq: remove irq_to_desc_alloc genirq: remove sparse irq code genirq: use inline function for irq_to_desc genirq: consolidate nr_irqs and for_each_irq_desc() x86: remove sparse irq from Kconfig genirq: define nr_irqs for architectures with GENERIC_HARDIRQS=n ...
This commit is contained in:
@@ -66,7 +66,6 @@
|
||||
#endif
|
||||
|
||||
static struct m68k_serial m68k_soft[NR_PORTS];
|
||||
struct m68k_serial *IRQ_ports[NR_IRQS];
|
||||
|
||||
static unsigned int uart_irqs[NR_PORTS] = UART_IRQ_DEFNS;
|
||||
|
||||
@@ -375,15 +374,11 @@ clear_and_return:
|
||||
*/
|
||||
irqreturn_t rs_interrupt(int irq, void *dev_id)
|
||||
{
|
||||
struct m68k_serial * info;
|
||||
struct m68k_serial *info = dev_id;
|
||||
m68328_uart *uart;
|
||||
unsigned short rx;
|
||||
unsigned short tx;
|
||||
|
||||
info = IRQ_ports[irq];
|
||||
if(!info)
|
||||
return IRQ_NONE;
|
||||
|
||||
uart = &uart_addr[info->line];
|
||||
rx = uart->urx.w;
|
||||
|
||||
@@ -1383,8 +1378,6 @@ rs68328_init(void)
|
||||
info->port, info->irq);
|
||||
printk(" is a builtin MC68328 UART\n");
|
||||
|
||||
IRQ_ports[info->irq] = info; /* waste of space */
|
||||
|
||||
#ifdef CONFIG_M68VZ328
|
||||
if (i > 0 )
|
||||
PJSEL &= 0xCF; /* PSW enable second port output */
|
||||
@@ -1393,7 +1386,7 @@ rs68328_init(void)
|
||||
if (request_irq(uart_irqs[i],
|
||||
rs_interrupt,
|
||||
IRQF_DISABLED,
|
||||
"M68328_UART", NULL))
|
||||
"M68328_UART", info))
|
||||
panic("Unable to attach 68328 serial interrupt\n");
|
||||
}
|
||||
local_irq_restore(flags);
|
||||
|
||||
@@ -156,11 +156,15 @@ struct uart_8250_port {
|
||||
};
|
||||
|
||||
struct irq_info {
|
||||
spinlock_t lock;
|
||||
struct hlist_node node;
|
||||
int irq;
|
||||
spinlock_t lock; /* Protects list not the hash */
|
||||
struct list_head *head;
|
||||
};
|
||||
|
||||
static struct irq_info irq_lists[NR_IRQS];
|
||||
#define NR_IRQ_HASH 32 /* Can be adjusted later */
|
||||
static struct hlist_head irq_lists[NR_IRQ_HASH];
|
||||
static DEFINE_MUTEX(hash_mutex); /* Used to walk the hash */
|
||||
|
||||
/*
|
||||
* Here we define the default xmit fifo size used for each type of UART.
|
||||
@@ -1545,15 +1549,43 @@ static void serial_do_unlink(struct irq_info *i, struct uart_8250_port *up)
|
||||
BUG_ON(i->head != &up->list);
|
||||
i->head = NULL;
|
||||
}
|
||||
|
||||
spin_unlock_irq(&i->lock);
|
||||
/* List empty so throw away the hash node */
|
||||
if (i->head == NULL) {
|
||||
hlist_del(&i->node);
|
||||
kfree(i);
|
||||
}
|
||||
}
|
||||
|
||||
static int serial_link_irq_chain(struct uart_8250_port *up)
|
||||
{
|
||||
struct irq_info *i = irq_lists + up->port.irq;
|
||||
struct hlist_head *h;
|
||||
struct hlist_node *n;
|
||||
struct irq_info *i;
|
||||
int ret, irq_flags = up->port.flags & UPF_SHARE_IRQ ? IRQF_SHARED : 0;
|
||||
|
||||
mutex_lock(&hash_mutex);
|
||||
|
||||
h = &irq_lists[up->port.irq % NR_IRQ_HASH];
|
||||
|
||||
hlist_for_each(n, h) {
|
||||
i = hlist_entry(n, struct irq_info, node);
|
||||
if (i->irq == up->port.irq)
|
||||
break;
|
||||
}
|
||||
|
||||
if (n == NULL) {
|
||||
i = kzalloc(sizeof(struct irq_info), GFP_KERNEL);
|
||||
if (i == NULL) {
|
||||
mutex_unlock(&hash_mutex);
|
||||
return -ENOMEM;
|
||||
}
|
||||
spin_lock_init(&i->lock);
|
||||
i->irq = up->port.irq;
|
||||
hlist_add_head(&i->node, h);
|
||||
}
|
||||
mutex_unlock(&hash_mutex);
|
||||
|
||||
spin_lock_irq(&i->lock);
|
||||
|
||||
if (i->head) {
|
||||
@@ -1577,14 +1609,28 @@ static int serial_link_irq_chain(struct uart_8250_port *up)
|
||||
|
||||
static void serial_unlink_irq_chain(struct uart_8250_port *up)
|
||||
{
|
||||
struct irq_info *i = irq_lists + up->port.irq;
|
||||
struct irq_info *i;
|
||||
struct hlist_node *n;
|
||||
struct hlist_head *h;
|
||||
|
||||
mutex_lock(&hash_mutex);
|
||||
|
||||
h = &irq_lists[up->port.irq % NR_IRQ_HASH];
|
||||
|
||||
hlist_for_each(n, h) {
|
||||
i = hlist_entry(n, struct irq_info, node);
|
||||
if (i->irq == up->port.irq)
|
||||
break;
|
||||
}
|
||||
|
||||
BUG_ON(n == NULL);
|
||||
BUG_ON(i->head == NULL);
|
||||
|
||||
if (list_empty(i->head))
|
||||
free_irq(up->port.irq, i);
|
||||
|
||||
serial_do_unlink(i, up);
|
||||
mutex_unlock(&hash_mutex);
|
||||
}
|
||||
|
||||
/* Base timer interval for polling */
|
||||
@@ -2447,7 +2493,7 @@ static void serial8250_config_port(struct uart_port *port, int flags)
|
||||
static int
|
||||
serial8250_verify_port(struct uart_port *port, struct serial_struct *ser)
|
||||
{
|
||||
if (ser->irq >= NR_IRQS || ser->irq < 0 ||
|
||||
if (ser->irq >= nr_irqs || ser->irq < 0 ||
|
||||
ser->baud_base < 9600 || ser->type < PORT_UNKNOWN ||
|
||||
ser->type >= ARRAY_SIZE(uart_config) || ser->type == PORT_CIRRUS ||
|
||||
ser->type == PORT_STARTECH)
|
||||
@@ -2967,7 +3013,7 @@ EXPORT_SYMBOL(serial8250_unregister_port);
|
||||
|
||||
static int __init serial8250_init(void)
|
||||
{
|
||||
int ret, i;
|
||||
int ret;
|
||||
|
||||
if (nr_uarts > UART_NR)
|
||||
nr_uarts = UART_NR;
|
||||
@@ -2976,9 +3022,6 @@ static int __init serial8250_init(void)
|
||||
"%d ports, IRQ sharing %sabled\n", nr_uarts,
|
||||
share_irqs ? "en" : "dis");
|
||||
|
||||
for (i = 0; i < NR_IRQS; i++)
|
||||
spin_lock_init(&irq_lists[i].lock);
|
||||
|
||||
#ifdef CONFIG_SPARC
|
||||
ret = sunserial_register_minors(&serial8250_reg, UART_NR);
|
||||
#else
|
||||
@@ -3006,15 +3049,15 @@ static int __init serial8250_init(void)
|
||||
goto out;
|
||||
|
||||
platform_device_del(serial8250_isa_devs);
|
||||
put_dev:
|
||||
put_dev:
|
||||
platform_device_put(serial8250_isa_devs);
|
||||
unreg_uart_drv:
|
||||
unreg_uart_drv:
|
||||
#ifdef CONFIG_SPARC
|
||||
sunserial_unregister_minors(&serial8250_reg, UART_NR);
|
||||
#else
|
||||
uart_unregister_driver(&serial8250_reg);
|
||||
#endif
|
||||
out:
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -512,7 +512,7 @@ static int pl010_verify_port(struct uart_port *port, struct serial_struct *ser)
|
||||
int ret = 0;
|
||||
if (ser->type != PORT_UNKNOWN && ser->type != PORT_AMBA)
|
||||
ret = -EINVAL;
|
||||
if (ser->irq < 0 || ser->irq >= NR_IRQS)
|
||||
if (ser->irq < 0 || ser->irq >= nr_irqs)
|
||||
ret = -EINVAL;
|
||||
if (ser->baud_base < 9600)
|
||||
ret = -EINVAL;
|
||||
|
||||
@@ -572,7 +572,7 @@ static int pl010_verify_port(struct uart_port *port, struct serial_struct *ser)
|
||||
int ret = 0;
|
||||
if (ser->type != PORT_UNKNOWN && ser->type != PORT_AMBA)
|
||||
ret = -EINVAL;
|
||||
if (ser->irq < 0 || ser->irq >= NR_IRQS)
|
||||
if (ser->irq < 0 || ser->irq >= nr_irqs)
|
||||
ret = -EINVAL;
|
||||
if (ser->baud_base < 9600)
|
||||
ret = -EINVAL;
|
||||
|
||||
@@ -623,7 +623,7 @@ static int cpm_uart_verify_port(struct uart_port *port,
|
||||
|
||||
if (ser->type != PORT_UNKNOWN && ser->type != PORT_CPM)
|
||||
ret = -EINVAL;
|
||||
if (ser->irq < 0 || ser->irq >= NR_IRQS)
|
||||
if (ser->irq < 0 || ser->irq >= nr_irqs)
|
||||
ret = -EINVAL;
|
||||
if (ser->baud_base < 9600)
|
||||
ret = -EINVAL;
|
||||
|
||||
@@ -922,7 +922,7 @@ static void m32r_sio_config_port(struct uart_port *port, int flags)
|
||||
static int
|
||||
m32r_sio_verify_port(struct uart_port *port, struct serial_struct *ser)
|
||||
{
|
||||
if (ser->irq >= NR_IRQS || ser->irq < 0 ||
|
||||
if (ser->irq >= nr_irqs || ser->irq < 0 ||
|
||||
ser->baud_base < 9600 || ser->type < PORT_UNKNOWN ||
|
||||
ser->type >= ARRAY_SIZE(uart_config))
|
||||
return -EINVAL;
|
||||
@@ -1162,7 +1162,7 @@ static int __init m32r_sio_init(void)
|
||||
|
||||
printk(KERN_INFO "Serial: M32R SIO driver\n");
|
||||
|
||||
for (i = 0; i < NR_IRQS; i++)
|
||||
for (i = 0; i < nr_irqs; i++)
|
||||
spin_lock_init(&irq_lists[i].lock);
|
||||
|
||||
ret = uart_register_driver(&m32r_sio_reg);
|
||||
|
||||
@@ -741,7 +741,7 @@ static int uart_set_info(struct uart_state *state,
|
||||
if (port->ops->verify_port)
|
||||
retval = port->ops->verify_port(port, &new_serial);
|
||||
|
||||
if ((new_serial.irq >= NR_IRQS) || (new_serial.irq < 0) ||
|
||||
if ((new_serial.irq >= nr_irqs) || (new_serial.irq < 0) ||
|
||||
(new_serial.baud_base < 9600))
|
||||
retval = -EINVAL;
|
||||
|
||||
|
||||
@@ -460,7 +460,7 @@ static int lh7a40xuart_verify_port (struct uart_port* port,
|
||||
|
||||
if (ser->type != PORT_UNKNOWN && ser->type != PORT_LH7A40X)
|
||||
ret = -EINVAL;
|
||||
if (ser->irq < 0 || ser->irq >= NR_IRQS)
|
||||
if (ser->irq < 0 || ser->irq >= nr_irqs)
|
||||
ret = -EINVAL;
|
||||
if (ser->baud_base < 9600) /* *** FIXME: is this true? */
|
||||
ret = -EINVAL;
|
||||
|
||||
@@ -1149,7 +1149,7 @@ static int sci_verify_port(struct uart_port *port, struct serial_struct *ser)
|
||||
{
|
||||
struct sci_port *s = &sci_ports[port->line];
|
||||
|
||||
if (ser->irq != s->irqs[SCIx_TXI_IRQ] || ser->irq > NR_IRQS)
|
||||
if (ser->irq != s->irqs[SCIx_TXI_IRQ] || ser->irq > nr_irqs)
|
||||
return -EINVAL;
|
||||
if (ser->baud_base < 2400)
|
||||
/* No paper tape reader for Mitch.. */
|
||||
|
||||
@@ -1066,7 +1066,7 @@ static int qe_uart_verify_port(struct uart_port *port,
|
||||
if (ser->type != PORT_UNKNOWN && ser->type != PORT_CPM)
|
||||
return -EINVAL;
|
||||
|
||||
if (ser->irq < 0 || ser->irq >= NR_IRQS)
|
||||
if (ser->irq < 0 || ser->irq >= nr_irqs)
|
||||
return -EINVAL;
|
||||
|
||||
if (ser->baud_base < 9600)
|
||||
|
||||
Reference in New Issue
Block a user