Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751943AbaAXBxH (ORCPT ); Thu, 23 Jan 2014 20:53:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:22813 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751843AbaAXBxE (ORCPT ); Thu, 23 Jan 2014 20:53:04 -0500 Date: Thu, 23 Jan 2014 20:53:02 -0500 (EST) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Tony Luck , Fenghua Yu cc: linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/5] ia64 simserial: fix sleeping with interrupts disabled In-Reply-To: Message-ID: References: User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix sleeping with interrupts disabled warning in simserial.c: BUG: sleeping function called from invalid context at mm/slub.c:925 in_atomic(): 0, irqs_disabled(): 1, pid: 1, name: init Call Trace: [] show_stack+0x40/0x90 sp=e0000000070b7b40 bsp=e0000000070b12c8 [] dump_stack+0x20/0x40 sp=e0000000070b7d10 bsp=e0000000070b12b0 [] __might_sleep+0x1e0/0x200 sp=e0000000070b7d10 bsp=e0000000070b1280 [] kmem_cache_alloc+0x70/0x430 sp=e0000000070b7d10 bsp=e0000000070b1230 [] request_threaded_irq+0x150/0x370 sp=e0000000070b7d20 bsp=e0000000070b11c0 [] activate+0x180/0x350 sp=e0000000070b7d20 bsp=e0000000070b1188 [] tty_port_open+0x1b0/0x280 sp=e0000000070b7d20 bsp=e0000000070b1140 [] rs_open+0x150/0x1a0 sp=e0000000070b7d20 bsp=e0000000070b1118 [] tty_open+0x790/0xb00 sp=e0000000070b7d20 bsp=e0000000070b1038 [] chrdev_open+0x250/0x2d0 sp=e0000000070b7d30 bsp=e0000000070b0ff0 [] do_dentry_open.isra.14+0x3d0/0x650 sp=e0000000070b7d40 bsp=e0000000070b0f80 [] finish_open+0x90/0xc0 sp=e0000000070b7d40 bsp=e0000000070b0f48 [] do_last.isra.41+0x1490/0x18c0 sp=e0000000070b7d40 bsp=e0000000070b0e60 [] path_openat.isra.42+0x160/0xa00 sp=e0000000070b7d60 bsp=e0000000070b0d58 [] do_filp_open+0x30/0xb0 sp=e0000000070b7d90 bsp=e0000000070b0d20 [] do_sys_open+0x200/0x330 sp=e0000000070b7e20 bsp=e0000000070b0cb8 [] sys_open+0x50/0x70 sp=e0000000070b7e30 bsp=e0000000070b0c60 [] ia64_ret_from_syscall+0x0/0x20 sp=e0000000070b7e30 bsp=e0000000070b0c60 [] ia64_ivt+0xffffffff00040720/0x400 sp=e0000000070b8000 bsp=e0000000070b0c60 Signed-off-by: Mikulas Patocka --- arch/ia64/hp/sim/simserial.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) Index: linux-2.6-ia64/arch/ia64/hp/sim/simserial.c =================================================================== --- linux-2.6-ia64.orig/arch/ia64/hp/sim/simserial.c 2014-01-23 23:06:12.000000000 +0100 +++ linux-2.6-ia64/arch/ia64/hp/sim/simserial.c 2014-01-23 23:13:44.000000000 +0100 @@ -365,7 +365,6 @@ static int activate(struct tty_port *por struct serial_state *state = container_of(port, struct serial_state, port); unsigned long flags, page; - int retval = 0; page = get_zeroed_page(GFP_KERNEL); if (!page) @@ -378,13 +377,6 @@ static int activate(struct tty_port *por else state->xmit.buf = (unsigned char *) page; - if (state->irq) { - retval = request_irq(state->irq, rs_interrupt_single, 0, - "simserial", state); - if (retval) - goto errout; - } - state->xmit.head = state->xmit.tail = 0; /* @@ -398,10 +390,16 @@ static int activate(struct tty_port *por tty->alt_speed = 230400; if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) tty->alt_speed = 460800; - -errout: local_irq_restore(flags); - return retval; + + if (state->irq) { + int retval = request_irq(state->irq, rs_interrupt_single, 0, + "simserial", state); + if (retval) + return retval; + } + + return 0; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/