From owner-cvs-all@FreeBSD.ORG Wed Dec 28 05:35:41 2005 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0E56516A41F; Wed, 28 Dec 2005 05:35:41 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9124143D55; Wed, 28 Dec 2005 05:35:40 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.3/8.13.3) with ESMTP id jBS5XoWE024247; Tue, 27 Dec 2005 22:33:51 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 27 Dec 2005 22:34:01 -0700 (MST) Message-Id: <20051227.223401.73653853.imp@bsdimp.com> To: nate@root.org From: "M. Warner Losh" In-Reply-To: <43B1CE9E.1060602@root.org> References: <20051222090955.E621416A4D5@hub.freebsd.org> <43B1CE9E.1060602@root.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Tue, 27 Dec 2005 22:33:51 -0700 (MST) Cc: cvs-src@FreeBSD.org, glebius@FreeBSD.org, cvs-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/em if_em.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2005 05:35:41 -0000 In message: <43B1CE9E.1060602@root.org> Nate Lawson writes: : Gleb Smirnoff wrote: : > glebius 2005-12-22 09:09:39 UTC : > : > FreeBSD src repository : > : > Modified files: : > sys/dev/em if_em.c : > Log: : > Add a quirk to fix resume on some laptops. : > : > Reported by: joe : > Reported by: Huang wen hui : > Reported by: Jacques Garrigue : > PR: kern/89825 : > : > Revision Changes Path : > 1.94 +9 -0 src/sys/dev/em/if_em.c : > : > : > Index: src/sys/dev/em/if_em.c : > diff -u src/sys/dev/em/if_em.c:1.93 src/sys/dev/em/if_em.c:1.94 : > --- src/sys/dev/em/if_em.c:1.93 Sun Dec 18 18:24:26 2005 : > +++ src/sys/dev/em/if_em.c Thu Dec 22 09:09:39 2005 : > @@ -1048,6 +1048,15 @@ : > else if (reg_icr == 0) : > break; : > : > + /* : > + * XXX: some laptops trigger several spurious interrupts : > + * on em(4) when in the resume cycle. The ICR register : > + * reports all-ones value in this case. Processing such : > + * interrupts would lead to a freeze. I don't know why. : > + */ : > + if (reg_icr == 0xffffffff) : > + break; : > + : > if (ifp->if_drv_flags & IFF_DRV_RUNNING) { : > em_process_receive_interrupts(adapter, -1); : > em_clean_transmit_interrupts(adapter); : : This probably means that the PCI memory space isn't fully initialized : but an interrupt has been triggered. If you then go and try to poke the : hardware, then you can hang the system. Most of the other drivers explicitly turn off their interrupt handler or mark their softc as 'suspended' until the resume code gets to run. Those that mark the softc as suspended exit the ISR immediately w/o touching the hardware. The em driver doesn't seem to do either of these things. Warner