From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796410657; b=uprc9oG5zSluMLF7jPXgyeY/LyypkrKx7ukq+ZYaUI2J/hxem735xp5wN0CrJZVYV0/m 7CIEK5jyEB4LpC/FNRDdmVf8k2PFDzN8j8+Zgc6YpuqKMuCZgNyextsZqOWqHQQQeVXZ2 udir25Qd57bUQ90maE+ExoPFATwNcXw9y44n9cXEqyHdQDf4BisIq7S7LfnzmHvHZto/3 lMGt64swuGS/vQmrjaMnBxYiFDOXEy5KPSSPtP9Mr4u3TINM4OpeFVczMaZT0ET1mz0nt 1cOxoPBpeRN4e+u32FHuQ+IxDkeeZzISVqQP5H3ohi+gpwowse1Mm8DYylcwbHZdANA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796410657; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=ijnl5++btlpSdAJyS0bNyjNwUKEl+CmI2lGJV/6afNs=; b=S+xlz2ATY2NrkWWtCYztwSbr/wgwkDKgF6CN/RDPDgkJmixI4u+CsR7JNHgCo1DinlAb HtU7/s5TSjnsRxXI6w5yfBq6VtdyL8DVz/Brzo0+QK/FNXPRJGoeAEy+OgeKTTNSdiqVs wAqK3rtW1YGa/GdXFphwxq3SroBkO0eT5NXM43ialDLzJeebLOPpWtCDdEGaARRBp9odR ngR8tvxcDSh8CQwRRfhYc3f0pcW/k04z38mnj3Vc/+IPbTyJCef7KeaxQIqe+ASVbFNP2 tjPYciDBnTwG7+iQe+Us73UO+5Rjm7kuZ6H3I+USB2WJZaqIGJBk916dlwjUemF5cZA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jxjvOZec; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4FE01606A322 for ; Fri, 4 Dec 2026 18:57:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jxjvOZec Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF4821F00936; Fri, 4 Dec 2026 18:57:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796410656; bh=ijnl5++btlpSdAJyS0bNyjNwUKEl+CmI2lGJV/6afNs=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=jxjvOZeclE5Mf78YPd1t6HBL1aYMYFits7xUw0tdGmFx4kTGxOix1kg1t41d6rtA6 Id3hlewHdnrMt1Sm6m3NTEsZhMsTAvFY+twMoQjJgDOVBgPpSWq81C5QykJaxeVJ9P o5j7c3r1y3r/+rDR5qzmBSLi+AgH6/ciAIv9vzrvIegV2uybbRU+bI/bLSPpweeAC6 95Wqt93JMHACLmywkesKDE1hBlL018hd/kDUEDz8EGrvGPK0dfWU1POW9PDdi/auRY GzfRnIgMrS9oFiDH7Hl0UNU4HZL8b7HnMyAJthGTC+L+0tVYX9htIuNfo3Dkvh7yNr KCh4GDQMpzSDA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] hwmon: (it87) Lock the device while reading the temperature sensor type Reply-To: sashiko-reviews@lists.linux.dev To: "Praneeth Balasubramanian" Cc: linux-hwmon@vger.kernel.org In-Reply-To: <20261204184447.1685572-1-praneethb2002@gmail.com> References: <20261204184447.1685572-1-praneethb2002@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 18:57:36 +0000 X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] hwmon: (it87) redundant it87_update_device() in show_temp_type() -- commit 1ff8697a4a76a81f49f4fdc1383612abf09626c6 Author: Praneeth Balasubramanian hwmon: (it87) Lock the device while reading the temperature sensor type This commit acquires it87_lock() around get_temp_type() in show_temp_type() so direct chip register reads are serialized with other accesses and run with SMBus disabled. > diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c > index fa4fcd5f685f9..210927a50cd8f 100644 > --- a/drivers/hwmon/it87.c > +++ b/drivers/hwmon/it87.c > @@ -1411,11 +1411,18 @@ static ssize_t show_temp_type(struct device *dev,= struct device_attribute *attr, > { > struct sensor_device_attribute *sensor_attr =3D to_sensor_dev_attr(attr= ); > struct it87_data *data =3D it87_update_device(dev); > + int type, err; > =20 > if (IS_ERR(data)) > return PTR_ERR(data); > =20 > - return sprintf(buf, "%d\n", get_temp_type(data, sensor_attr->index)); > + err =3D it87_lock(data); > + if (err) > + return err; > + type =3D get_temp_type(data, sensor_attr->index); > + it87_unlock(data); > + > + return sprintf(buf, "%d\n", type); > } [Severity: Low] Does show_temp_type() still need to call it87_update_device()? get_temp_type() reads the hardware registers directly and does not use any cached fields from it87_update_device(). Keeping it takes data->update_lock twice on every read and, when the cache is stale, does an unused full-chip refresh and an extra smbus_disable()/smbus_enable(). Using dev_get_drvdata(dev) directly, as set_temp_type() does, avoids the redundant refresh and lock round-trip. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204184447.1685= 572-1-praneethb2002@gmail.com?part=3D1