From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfram Sang Subject: Re: [PATCH] hwmon: pmbus: protect read-modify-write with lock Date: Sat, 8 Jun 2019 00:32:18 +0200 Message-ID: <20190607223217.GE869@kunai> References: <20190528090746.GA31184@localhost.localdomain> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="HnQK338I3UIa/qiP" Return-path: Content-Disposition: inline In-Reply-To: <20190528090746.GA31184@localhost.localdomain> Sender: linux-kernel-owner@vger.kernel.org To: "Adamski, Krzysztof (Nokia - PL/Wroclaw)" Cc: "linux-kernel@vger.kernel.org" , "linux-i2c@vger.kernel.org" List-Id: linux-i2c@vger.kernel.org --HnQK338I3UIa/qiP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 28, 2019 at 09:08:21AM +0000, Adamski, Krzysztof (Nokia - PL/Wr= oclaw) wrote: > The operation done in the pmbus_update_fan() function is a > read-modify-write operation but it lacks any kind of lock protection > which may cause problems if run more than once simultaneously. This > patch uses an existing update_lock mutex to fix this problem. >=20 > Signed-off-by: Krzysztof Adamski Please use get_maintainer to find the people responsible for this file. It is not my realm. > +out: > + mutex_lock(&data->update_lock); Despite the above, have you tested the code? This likely should be mutex_unlock? --HnQK338I3UIa/qiP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAlz65fEACgkQFA3kzBSg KbYJ0w//UZ891A5ERJxc0KfiTONdubv82Tq6XlgvMzF6NBLXovXj4QGY/Cai1j+u d4yIv6YReQoS4Zsd5hNKoQk2vTtI7TF2yCTWjffQWRvXyOppQ8vmoAOlxUsCV4lU UJAotgCnlwo4KZKjKEAYMv0X5cbwByWcswyz8W3ZAKEVfVePw3EiAj37EO2bfRXw QG66Y8jBPzphQU0BzxZxq5xlv+tYJnE804uXnOrqqxDaKA2jo8lyEO7iRPrTSOP0 UvA19GIA5Tgw5wLLfHxRR+Ewday9+hcAr1pWhpqYKrZvJadXJgZ4wVVOql9RNkMe PEJe5aGxPCvgvc1nRe3lN49iGE/lKAOA6zA5RJPfmXf46S4lQGi+tDX46hWzxNh7 SKM5Fkc+ieWs1Z1BidMlDmYvXwdeCALFcbMo6/HBdeXkOob4Y1j4PrOysCd936u3 Kv8zSvw2z0qbd/2mdqjanFzIGABXPZAuS65cs8yci9P6pLdyu2siBIEDIKUf2HDm OI8TBwu6y1DwER2EW8l07njzo5CzvTWanYwBi2sh7pJsCxGKGaszFni82C+pNPOh pvdmoKp9RI+nWZ5fLDIiq7TQk5mPmVspw4zKlqB48MgVAUrH163NPWyoJSeGyBd5 om4tv4lmJTWx5no5UPg1oj7U6hJojFoFpyg0tE48bfIFCUE+uLM= =6s6f -----END PGP SIGNATURE----- --HnQK338I3UIa/qiP--