lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 06 Aug 2008 09:10:46 -0700
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	Yinghai Lu <yhlu.kernel@...il.com>, Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	Dhaval Giani <dhaval@...ux.vnet.ibm.com>,
	Mike Travis <travis@....com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] serial: Remove NR_IRQS usage

Alan Cox <alan@...rguk.ukuu.org.uk> writes:

> Works on my test box with a quick test.
>
> 8250: Remove NR_IRQ usage
>
> From: Alan Cox <alan@...hat.com>
>
> Signed-off-by: Alan Cox <alan@...hat.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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ