From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfram Sang Subject: Re: [PATCH v7 16/24] i2c: allow adapter drivers to override the adapter locking Date: Thu, 28 Apr 2016 22:50:26 +0200 Message-ID: <20160428205018.GA3553@katana> References: <1461165484-2314-1-git-send-email-peda@axentia.se> <1461165484-2314-17-git-send-email-peda@axentia.se> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gBBFr7Ir9EOA20Yy" Return-path: Content-Disposition: inline In-Reply-To: <1461165484-2314-17-git-send-email-peda@axentia.se> Sender: linux-kernel-owner@vger.kernel.org To: Peter Rosin Cc: linux-kernel@vger.kernel.org, Jonathan Corbet , Peter Korsgaard , Guenter Roeck , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald , Antti Palosaari , Mauro Carvalho Chehab , Rob Herring , Frank Rowand , Grant Likely , Andrew Morton , "David S. Miller" , Greg Kroah-Hartman , Kalle Valo , Jiri Slaby , Daniel Baluta , Lucas De Marchi , Adriana Reus , Matt Ranostay , Krzysztof Kozlowski List-Id: linux-i2c@vger.kernel.org --gBBFr7Ir9EOA20Yy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 20, 2016 at 05:17:56PM +0200, Peter Rosin wrote: > Add i2c_lock_bus() and i2c_unlock_bus(), which call the new lock_bus and > unlock_bus ops in the adapter. These funcs/ops take an additional flags > argument that indicates for what purpose the adapter is locked. >=20 > There are two flags, I2C_LOCK_ADAPTER and I2C_LOCK_SEGMENT, but they are > both implemented the same. For now. Locking the adapter means that the > whole bus is locked, locking the segment means that only the current bus > segment is locked (i.e. i2c traffic on the parent side of mux is still > allowed even if the child side of the mux is locked. >=20 > Also support a trylock_bus op (but no function to call it, as it is not > expected to be needed outside of the i2c core). >=20 > Implement i2c_lock_adapter/i2c_unlock_adapter in terms of the new locking > scheme (i.e. lock with the I2C_LOCK_ADAPTER flag). >=20 > Annotate some of the locking with explicit I2C_LOCK_SEGMENT flags. >=20 > Signed-off-by: Peter Rosin Letting you know that I start reviewing the 2nd part of your series. Did the first glimpse today. Will hopefully do the in-depth part this weekend. One thing already: > +static void i2c_adapter_lock_bus(struct i2c_adapter *adapter, int flags) Shouldn't flags be unsigned? --gBBFr7Ir9EOA20Yy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXIneKAAoJEBQN5MwUoCm2FRAP/0xqKvNG6PKzooja0h+oXlg/ KBYBC56fJQkwEQRL80huZaBLGsXFOc8Jllxiz1y0iXfWP9EiyaOfNyngi1bt5YY3 M29BL8wZzxHFE3iMaCcMPTsgkqLTw0+CaQ9MkNl86qtBoHy+vVp/h7xGl0o2h65a UISpfvdN+wPnWty1EPfXjVdwlz4DVCk9KGJMB6EaRzqYUrGRynkTnv2mrQn9PDeS KhphipVSSX7ay81wdb/ttVTZ0WyVTwKJiga8k1ntMBiqMCRslzVWT9YlcxSanHh0 aZKJ28Kp81ptTh63aK0XIdHc4cgEFECzR2ZI0P1koSICsjXg4MOnJGmIvHaen+AI AGqQJq1EmveMMucJOHYaHUcJHUeV/cYicQSrdE9Xt8CFrXmZzTo7y3S3M0HpOguW xCVouwKg20orkPCH43XQyH+rWMfJEugy05OAs4ZB1PK5DChtpjckFYGfV8v35lx6 iBJVcl1ZP0JATIu45qHv93brTgS8Qu2LeCAgEJDQOnbQOA4UDVrKUnIsN/usBpxe 714LkDFbCq4nF+jEaRcJcIl3S1368fdL2T2lxBXctBzNiuVeToIa0IlwQvwtBYyo O4XhpD6nbPSXO3AleprLukGGlltBGnJ8AbEN/sQ5cyLYYZD7EhLNAtDnwlSkL2Cj D133ZEu3VvqGwDKH+Q5H =qGk7 -----END PGP SIGNATURE----- --gBBFr7Ir9EOA20Yy--