From owner-cvs-src@FreeBSD.ORG Sun Sep 18 13:23:20 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D5C9C16A41F; Sun, 18 Sep 2005 13:23:20 +0000 (GMT) (envelope-from marius@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A738D43D45; Sun, 18 Sep 2005 13:23:20 +0000 (GMT) (envelope-from marius@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j8IDNKZb035250; Sun, 18 Sep 2005 13:23:20 GMT (envelope-from marius@repoman.freebsd.org) Received: (from marius@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j8IDNKXZ035249; Sun, 18 Sep 2005 13:23:20 GMT (envelope-from marius) Message-Id: <200509181323.j8IDNKXZ035249@repoman.freebsd.org> From: Marius Strobl Date: Sun, 18 Sep 2005 13:23:20 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/dev/gem if_gem.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Sep 2005 13:23:21 -0000 marius 2005-09-18 13:23:20 UTC FreeBSD src repository Modified files: sys/dev/gem if_gem.c Log: - In gem_ioctl() move the call to ether_ioctl() to the default case of the switch statement in order to make this driver more like other Ethernet NIC drivers. - In gem_attach() call gem_stop() in addition to gem_reset() to make sure the chip actually is stopped and not just reset. - In gem_stop() also stop the gem_rint_timeout() callout in case the driver is compiled with GEM_RINT_TIMEOUT defined. Merge some locking improvements from hme(4): - Use callout_init_mtx() to close races between gem_stop() and gem_tick() as weel as gem_stop() and gem_rint() in case the driver is compiled with GEM_RINT_TIMEOUT defined. - Use the driver lock instead of Giant in a bus dma callback. - Lock the driver lock around mii operations. - Cleanup locking in gem_ioctl(). - Remove redundant assertions that the driver lock is not held in gem_attach() and gem_detach() since mtx_lock() will assert that already since the driver lock is not recursive. - Add callout_drain()'s to gem_detach() after calling gem_stop() to make sure that if softclock is running on another CPU and is blocked on our driver lock, we will wait until it has acquired the lock, seen that it was cancelled, dropped the lock, and awakened us so that we can safely destroy the mutex. Revision Changes Path 1.35 +29 -47 src/sys/dev/gem/if_gem.c