From owner-svn-src-head@FreeBSD.ORG Sat May 30 15:58:28 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F8569EB; Sat, 30 May 2015 15:58:28 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1E501220; Sat, 30 May 2015 15:58:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t4UFwHob092183 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 30 May 2015 18:58:17 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t4UFwHob092183 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t4UFwH28092182; Sat, 30 May 2015 18:58:17 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 30 May 2015 18:58:17 +0300 From: Konstantin Belousov To: Michael Gmelin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283766 - in head: share/man/man4 sys/conf sys/dev/ichiic sys/modules/i2c/controllers sys/modules/i2c/controllers/ichiic Message-ID: <20150530155817.GK2499@kib.kiev.ua> References: <201505301217.t4UCHJtI056026@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201505301217.t4UCHJtI056026@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2015 15:58:28 -0000 On Sat, May 30, 2015 at 12:17:19PM +0000, Michael Gmelin wrote: > + if ((op & SMB_TRANS_NOCMD) == 0) { > + error = wait_status(sc, IG4_STATUS_TX_NOTFULL); > + if (error) > + goto done; > + last |= (u_char)cmd; > + if (wcount == 0 && rcount == 0 && (op & SMB_TRANS_NOSTOP) == 0) > + last |= IG4_DATA_STOP; > + reg_write(sc, IG4_REG_DATA_CMD, last); > + last = 0; > + } I asked this question in the review, but it was seemingly ignored. What is the purpose of the sc->mutex lock ? What kinds of the parallel execution does it prevent ? The mutex is dropped when doing a transfer, in the wait_status(). Is there something external which prevents parallel transfer initiation ? If yes, why is the sc->mutex needed ? If not, what prevents the parallel transfers to stomp on each other ?