From owner-freebsd-current@FreeBSD.ORG Tue Feb 27 13:32:56 2007 Return-Path: X-Original-To: freebsd-current@mx1.freebsd.org Delivered-To: freebsd-current@mx1.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7C5C616A403 for ; Tue, 27 Feb 2007 13:32:56 +0000 (UTC) (envelope-from ggajic@afrodita.rcub.bg.ac.yu) Received: from afrodita.rcub.bg.ac.yu (afrodita.rcub.bg.ac.yu [147.91.1.120]) by mx1.freebsd.org (Postfix) with ESMTP id 4B6FA13C4AC for ; Tue, 27 Feb 2007 13:32:52 +0000 (UTC) (envelope-from ggajic@afrodita.rcub.bg.ac.yu) Received: by afrodita.rcub.bg.ac.yu (Postfix, from userid 2055) id 22FD6117BAA; Tue, 27 Feb 2007 14:32:27 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by afrodita.rcub.bg.ac.yu (Postfix) with ESMTP id 1D7C311FB81 for ; Tue, 27 Feb 2007 14:32:27 +0100 (CET) Date: Tue, 27 Feb 2007 14:32:26 +0100 (CET) From: Goran Gajic To: freebsd-current@mx1.freebsd.org In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-RCUB-MailScanner-Information: Please contact the RCUB if you have problem with mail X-RCUB-MailScanner: Found to be clean X-RCUB-MailScanner-From: ggajic@afrodita.rcub.bg.ac.yu X-Mailman-Approved-At: Tue, 27 Feb 2007 14:32:17 +0000 Cc: Subject: Re: em0+msi related panic X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Feb 2007 13:32:56 -0000 Hi, Looking through source and diff of sys/dev/em/if_em.c I have noticed that @@ -275,7 +275,7 @@ static void em_add_int_delay_sysctl(stru static poll_handler_t em_poll; static void em_intr(void *); #else -static void em_intr_fast(void *); +static int em_intr_fast(void *); static void em_add_int_process_limit(struct adapter *, const char *, const char *, int *, int); static void em_handle_rxtx(void *context, int pending); @@ -1307,7 +1307,7 @@ em_handle_rxtx(void *context, int pendin * Fast Interrupt Service routine * *********************************************************************/ -static void +static int em_intr_fast(void *arg) { struct adapter *adapter = arg; @@ -2173,8 +2174,8 @@ em_allocate_intr(struct adapter *adapter #ifdef DEVICE_POLLING if (adapter->int_handler_tag == NULL && (error = bus_setup_intr(dev, - adapter->res_interrupt, INTR_TYPE_NET | INTR_MPSAFE, em_intr, adapter, - &adapter->int_handler_tag)) != 0) { + adapter->res_interrupt, INTR_TYPE_NET | INTR_MPSAFE, NULL, em_intr, + adapter, &adapter->int_handler_tag)) != 0) { device_printf(dev, "Failed to register interrupt handler"); return (error); } between revision 1.168 and 1.169 that causes panic. I have switched em_intr_fast to be static void and order in bus_setup_intr is incorrect. It should be: if ((error = bus_setup_intr(dev, adapter->res_interrupt, INTR_TYPE_NET,NULL, em_intr_fast, adapter, &adapter->int_handler_tag)) != 0) { not if ((error = bus_setup_intr(dev, adapter->res_interrupt, INTR_TYPE_NET, em_intr_fast,NULL adapter, &adapter->int_handler_tag)) != 0) { which causes panic when: /boot/loader contains: hw.pci.enable_msi=0 hw.pci.enable_msix=0 Btw. I'm using this since msi=1 cases watchdog timeouts with em0. Regards, gg.