Messages in this thread |  | | | From | (Eric W. Biederman) | | Date | Wed, 06 Aug 2008 09:10:46 -0700 | | Subject | Re: [PATCH] serial: Remove NR_IRQS usage |
| |
Alan Cox <alan@lxorguk.ukuu.org.uk> writes:
> Works on my test box with a quick test. > > 8250: Remove NR_IRQ usage > > From: Alan Cox <alan@redhat.com> > > Signed-off-by: Alan Cox <alan@redhat.com>
This looks good.
Two final nits.
> -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 */
> 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); > + .... > + mutex_unlock(&hash_mutex);
Could you move the unlock down to the end of serial_link_irq_chain? So that it covers serial_do_unlink on the error cleanup path? > + > spin_lock_irq(&i->lock); > > if (i->head) { > @@ -1567,14 +1599,28 @@ static int serial_link_irq_chain(struct uart_8250_port > *up) > > static void serial_unlink_irq_chain(struct uart_8250_port *up) ... > - if (list_empty(i->head)) ... > + > + if (list_empty(i->head)) { > free_irq(up->port.irq, i); > - > + }
Adding the braces here just appears to be extra noise.
> serial_do_unlink(i, up); > + mutex_unlock(&hash_mutex); > }
Eric
|  |