From owner-cvs-src@FreeBSD.ORG Tue Apr 8 08:55:44 2003 Return-Path: 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 873A137B401; Tue, 8 Apr 2003 08:55:44 -0700 (PDT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 210A443FAF; Tue, 8 Apr 2003 08:55:44 -0700 (PDT) (envelope-from mux@freebsd.org) Received: by elvis.mu.org (Postfix, from userid 1920) id 100C62ED40E; Tue, 8 Apr 2003 08:55:44 -0700 (PDT) Date: Tue, 8 Apr 2003 17:55:44 +0200 From: Maxime Henrion To: Guido van Rooij Message-ID: <20030408155544.GE1750@elvis.mu.org> References: <200304081305.h38D5CGH038749@repoman.freebsd.org> <20030408153625.GA78927@gvr.gvr.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030408153625.GA78927@gvr.gvr.org> User-Agent: Mutt/1.4.1i cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/fxp if_fxp.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 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: Tue, 08 Apr 2003 15:55:44 -0000 Guido van Rooij wrote: > On Tue, Apr 08, 2003 at 06:05:12AM -0700, Maxime Henrion wrote: > > mux 2003/04/08 06:05:12 PDT > > > > FreeBSD src repository > > > > Modified files: > > sys/dev/fxp if_fxp.c > > Log: > > Fix the hangs people have been seeing. For some reason, the > > atomic operation change caused this, so backout it until I > > can figure out what's wrong with it. > > FRom the look of it, it seems you have an error in your patch. > Shouldn't: > atomic_clear_32((u_int32_t *)&last->tx_cb->cb_status, > htobe32(bswap16(FXP_CB_COMMAND_S))); > > be: > > atomic_clear_32((u_int32_t *)&last->tx_cb->cb_command, > htobe32(bswap16(FXP_CB_COMMAND_S))); No, that would cause an unaligned access. I'm really modifying cd_command, which is a 16-bit integer. However, for this to be portable, I need to use a 32-bit atomic operation. I can't do this trick on cb_command's adress because it's 16-bit aligned, so I'm doing the atomic operation on the 32-bit integer at cb_status's address which is a 16-bit integer too. Moreover, if I was doing this on cb_command, which I can't, the htobe32(bswap16(FXP_CB_COMMAND_S)) wouldn't be good anymore. Cheers, Maxime