From owner-cvs-src@FreeBSD.ORG Mon Aug 4 21:03:19 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9529106570F; Mon, 4 Aug 2008 21:03:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id A84848FC1B; Mon, 4 Aug 2008 21:03:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m74L3JED056296; Mon, 4 Aug 2008 21:03:19 GMT (envelope-from jhb@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m74L3JSH056295; Mon, 4 Aug 2008 21:03:19 GMT (envelope-from jhb@repoman.freebsd.org) Message-Id: <200808042103.m74L3JSH056295@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to jhb@repoman.freebsd.org using -f From: John Baldwin Date: Mon, 4 Aug 2008 21:03:06 +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/iicbus iic.c iicbus.c iicbus.h iiconf.c iicsmb.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: Mon, 04 Aug 2008 21:03:19 -0000 jhb 2008-08-04 21:03:06 UTC FreeBSD src repository Modified files: sys/dev/iicbus iic.c iicbus.c iicbus.h iiconf.c iicsmb.c Log: SVN rev 181304 on 2008-08-04 21:03:06Z by jhb Add locking to the core iicbus(4) drivers: - Add an sx lock to the iic(4) driver to serialize open(), close(), read(), and write and to protect sc_addr and sc_count in the softc. - Use cdev->si_drv1 instead of using the minor number of the cdev to lookup the softc via newbus in iic(4). - Store the device_t in the softc to avoid a similar detour via minor numbers in iic(4). - Only add at most one instance of iic(4) and iicsmb(4) to each iicbus(4) instance, and do it in the child driver. - Add a mutex to the iicbus(4) softc to synchronize the request/release bus stuff. - Use __BUS_ACCESSOR() for IICBUS_ACCESSOR() instead of rolling our own. - Add a mutex to the iicsmb(4) softc to protect softc state updated in the interrupt handler. - Remove Giant from all the smbus methods in iicsmb(4) now that all the iicbus(4) backend is locked. Revision Changes Path 1.40 +81 -40 src/sys/dev/iicbus/iic.c 1.25 +6 -8 src/sys/dev/iicbus/iicbus.c 1.8 +9 -6 src/sys/dev/iicbus/iicbus.h 1.18 +19 -15 src/sys/dev/iicbus/iiconf.c 1.16 +13 -37 src/sys/dev/iicbus/iicsmb.c