From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Kirsher Subject: Re: [PATCH] e1000: Avoid that e1000_netpoll() triggers a kernel warning Date: Thu, 9 Apr 2015 17:16:00 -0700 Message-ID: References: <55266885.6010905@sandisk.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: "David S. Miller" , Thomas Gleixner , Peter Zijlstra , netdev To: Bart Van Assche Return-path: Received: from mail-vn0-f48.google.com ([209.85.216.48]:45345 "EHLO mail-vn0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751321AbbDJAQC (ORCPT ); Thu, 9 Apr 2015 20:16:02 -0400 Received: by vnbg190 with SMTP id g190so941516vnb.12 for ; Thu, 09 Apr 2015 17:16:00 -0700 (PDT) In-Reply-To: <55266885.6010905@sandisk.com> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, Apr 9, 2015 at 4:54 AM, Bart Van Assche wrote: > console_cont_flush(), which is called by console_unlock(), calls > call_console_drivers() and hence also the netconsole function > write_msg() with local interrupts disabled. This means that it is > not allowed to call disable_irq() from inside a netpoll callback > function. Hence eliminate the disable_irq() / enable_irq() pair > from the e1000 netpoll function. This patch avoids that the e1000 > networking driver triggers the following complaint: > > BUG: sleeping function called from invalid context at kernel/irq/manage.c:104 > > Call Trace: > [] dump_stack+0x4c/0x65 > [] ___might_sleep+0x175/0x230 > [] __might_sleep+0x3a/0xa0 > [] synchronize_irq+0x38/0xa0 > [] disable_irq+0x20/0x30 > [] e1000_netpoll+0x102/0x130 [e1000e] > [] netpoll_poll_dev+0x72/0x350 > [] netpoll_send_skb_on_dev+0x1b9/0x2b0 > [] netpoll_send_udp+0x2c2/0x430 > [] write_msg+0xcf/0x120 [netconsole] > [] call_console_drivers.constprop.25+0xc2/0x250 > [] console_unlock+0x328/0x4c0 > [] vprintk_emit+0x2d0/0x570 > [] vprintk_default+0x1f/0x30 > [] printk+0x46/0x48 > > See also "[RFC PATCH net-next 00/11] net: remove disable_irq() from > ->ndo_poll_controller" (http://thread.gmane.org/gmane.linux.network/342096). > > See also patch "sched/wait: Add might_sleep() checks" (kernel v3.19-rc1; > commit e22b886a8a43). > > Reported-by: Sabrina Dubroca > Signed-off-by: Bart Van Assche > Cc: Thomas Gleixner > Cc: David S. Miller > Cc: Peter Zijlstra > Cc: > --- > drivers/net/ethernet/intel/e1000/e1000.h | 5 +++++ > drivers/net/ethernet/intel/e1000/e1000_main.c | 27 ++++++++++++++++++++++----- > 2 files changed, 27 insertions(+), 5 deletions(-) Any particular reason you did not CC the e1000 maintainer (me)?