From owner-p4-projects@FreeBSD.ORG Tue Nov 7 21:48:29 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7DBE516A415; Tue, 7 Nov 2006 21:48:29 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3A5CF16A407 for ; Tue, 7 Nov 2006 21:48:29 +0000 (UTC) (envelope-from cognet@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DB19C43D5C for ; Tue, 7 Nov 2006 21:48:28 +0000 (GMT) (envelope-from cognet@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kA7LmS3i061528 for ; Tue, 7 Nov 2006 21:48:28 GMT (envelope-from cognet@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kA7LmSRk061525 for perforce@freebsd.org; Tue, 7 Nov 2006 21:48:28 GMT (envelope-from cognet@freebsd.org) Date: Tue, 7 Nov 2006 21:48:28 GMT Message-Id: <200611072148.kA7LmSRk061525@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to cognet@freebsd.org using -f From: Olivier Houchard To: Perforce Change Reviews Cc: Subject: PERFORCE change 109485 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Nov 2006 21:48:29 -0000 http://perforce.freebsd.org/chv.cgi?CH=109485 Change 109485 by cognet@cognet on 2006/11/07 21:47:39 Introduce ixpnpe_sendandrecvmsg_locked(), to avoid having to drop then re-lock the softc mutex in the tick method. Affected files ... .. //depot/projects/arm/src/sys/arm/xscale/ixp425/if_npe.c#11 edit .. //depot/projects/arm/src/sys/arm/xscale/ixp425/ixp425_npe.c#5 edit .. //depot/projects/arm/src/sys/arm/xscale/ixp425/ixp425_npevar.h#4 edit Differences ... ==== //depot/projects/arm/src/sys/arm/xscale/ixp425/if_npe.c#11 (text+ko) ==== @@ -655,9 +655,7 @@ NPE_ASSERT_LOCKED(sc); - NPE_UNLOCK(sc); /* XXX */ npe_updatestats(sc); /* update + clear stats */ - NPE_LOCK(sc); bus_dmamap_sync(sc->sc_stats_tag, sc->sc_stats_map, BUS_DMASYNC_POSTREAD); @@ -1238,7 +1236,7 @@ msg[0] = NPE_RESETSTATS << NPE_MAC_MSGID_SHL; msg[1] = sc->sc_stats_phys; /* physical address of stat block */ - return ixpnpe_sendandrecvmsg(sc->sc_npe, msg, msg); + return ixpnpe_sendandrecvmsg_locked(sc->sc_npe, msg, msg); } #if 0 ==== //depot/projects/arm/src/sys/arm/xscale/ixp425/ixp425_npe.c#5 (text+ko) ==== @@ -1352,16 +1352,26 @@ * make other locking confusing. */ int -ixpnpe_sendandrecvmsg(struct ixpnpe_softc *sc, +ixpnpe_sendandrecvmsg_locked(struct ixpnpe_softc *sc, const uint32_t send[2], uint32_t recv[2]) { int error; - mtx_lock(&sc->sc_mtx); error = ixpnpe_sendmsg_locked(sc, send); if (error == 0) error = ixpnpe_recvmsg_locked(sc, recv); - mtx_unlock(&sc->sc_mtx); return error; } + +int +ixpnpe_sendandrecvmsg(struct ixpnpe_softc *sc, + const uint32_t send[2], uint32_t recv[2]) +{ + int error; + + mtx_lock(&sc->sc_mtx); + error = ixpnpe_sendandrecvmsg_locked(sc, send, recv); + mtx_unlock(&sc->sc_mtx); + return (error); +} ==== //depot/projects/arm/src/sys/arm/xscale/ixp425/ixp425_npevar.h#4 (text+ko) ==== @@ -89,4 +89,6 @@ int ixpnpe_sendandrecvmsg(struct ixpnpe_softc *, const uint32_t send[2], uint32_t recv[2]); +int ixpnpe_sendandrecvmsg_locked(struct ixpnpe_softc *, + const uint32_t send[2], uint32_t recv[2]); #endif /* _IXP425_NPEVAR_H_ */