Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 May 2015 18:58:17 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Michael Gmelin <grembo@FreeBSD.org>
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>
In-Reply-To: <201505301217.t4UCHJtI056026@svn.freebsd.org>
References:  <201505301217.t4UCHJtI056026@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 ?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150530155817.GK2499>