From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6953239FCCC for ; Tue, 18 Aug 2026 15:41:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787067701; cv=none; b=C1i8oIcOql0LwnaWjd22rc+AKvknuS68Mp4RraoXZGO8fJI062D6ydtZBjsCaAB6CypYjSr4R/Q5A7pIpKr/zRo8Qd6ll7AWNkYhl6sxuHdZY1T0hg67GIf3TqrQfJ7HlgiEEoaBn9S/+QIGTvrpO/zLhyosRn4TR+BdAiQOj5M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787067701; c=relaxed/simple; bh=eDFzL+tYtYMYYZGsZcDZMDCJSCuvu2IeifwfVInrCQc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JFUuZgcY/NAeFTVWY9TU0pQ3KNX7vtrvjqY2ceN3TBEy3XcXTl7lRmPeSJNC1sCf2+ItUAkgSFPxx/bcHKj70J2lsRdCzOATPR03SnAl7zepErIMiz55OFwh3Bjn9AbhqebJ2CPWQvGXkjwX4dnse6en+R76fQ82qyVqGj7JIOk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=b4qVpyTr; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="b4qVpyTr" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-496bb7cdf51so59413915e9.2 for ; Tue, 18 Aug 2026 08:41:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787067698; x=1787672498; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=eDFzL+tYtYMYYZGsZcDZMDCJSCuvu2IeifwfVInrCQc=; b=b4qVpyTrnPL3gGNf7HT//GTcirMXv3b9CTB5uIPdevdQMALwi4rPfXU4U9kqwDByU9 0Ob7Uz7TBEY9e4y+89aRaqODd74qIaYhI++NEKkYCvVXFWTrbd6uuc+l5RvB9bbPs8p9 HzFj9arHQchrYYzBYZ1vd8QTavDbu6ZrX6kQkqmPCyEYqTldHCVNCUPouvyrTX7XldhE dVN31qOiekzH10N8BNXRIt0pX33BLzgs4e9Xi80k9riifj7/Y8xvUC0Ab8xU846l8qB/ hyFDGBpvm7YyA5SWgbrSLRS09jSl6z8sry++3q/6mbHVvZFK42k6q9eeYWp50TxGwOeJ 17Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787067698; x=1787672498; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=eDFzL+tYtYMYYZGsZcDZMDCJSCuvu2IeifwfVInrCQc=; b=QUVLvBVXg6ktCtfuIN4SUdZOtf55s2c3JAUUdpAmGRrtFL8Uaxjarg+9WgR3AEcy4v C69iUZ8Gbmsb5D8taKFex7vpl1bi9g0w7YtP0WBgcxeBF+OQIFjsNnMij08MCB/F3W/y GCiWHdmfLtx+1l2RmpNzqDnF5hf1yS84AkOMFdUztw/Vburt8pkiCDbni9y3aUFh/dby JGNFr7LuwNJ8YBOI8T4arepZuGIIPxoBq3T/59fUL+7YcGrP8jtG4hN5RXzZYEXle8kM bN7ZPh3iu7GGee8VvxA8+/kbJyg2udm2hAbrC5byG777BmeOe3B4keItgA3dEIXbtrDC E7Yg== X-Forwarded-Encrypted: i=1; AHgh+RoIaMTCpyMHd1BTrOOjZ5SUdB0lRIaMjmBh7NtVIKQI/b5Hm+4+a1n4ANL9gG3ZUbXIa6iEBUPSd4Eiqus=@vger.kernel.org X-Gm-Message-State: AOJu0Yx6DLD0eHxI6NfPlYmi45T1EFv8XjMGxhZ7um736ZB6Rs5pNZiC r62W0auAgT42aiLegRrvPVCh01ON/jfV4QXzN5LbRcSYYBly7eXmqZg/ X-Gm-Gg: AR+sD13chvLKynWqevb1tHTXwxtbj0I2qD26S/GyzS8fS+FzKCPQHMXiuG+BRFUh1v9 GL3Dixl5uUXmI1k/DMOthA73TtmGTYlK7fndFgb/aslzFRf1Lba7Uh23beugKCzWTHPqCP/Kvg0 9aIvk7QK50JpTVsZTuWgBL8AQDCVJpZ1gPozxSAPqFcb8Z71JwhgDdJj5X+QYTeSB8OZhhCExNl hQIKsGuX/ig0aTi7y/6Mx0HFt9Q9XY8Bwr66+a20ZU2qX/DOei5TxB6pz0H4an/sJxHIRGDeBAF dJr2M/56mVlSMVBXtcia8Qmly0HJRQYN4ZvFKmKwmD0oTTNXT087CQSsQE7LwkRus7iZc02ivzl P8s0TZhar96FC52eHOmFl9JGpwDGeBWqWbWECPuc9cXvzgQdeoUatHypGyTP9AdYBe0UGkEuPJr bspn3t6GJD+VnPtzqpkol7ot39SyoxC9QhRq6VBXf5HtRlCPF2JT6CfcQgfpw1GWZDc5+mFxto2 bi7fO1PJNPTb1e1dATgSLS0WZXySYUahzEAIZEIsB/h X-Received: by 2002:a05:600c:1d0c:b0:493:f140:c3fb with SMTP id 5b1f17b1804b1-4999fb3953emr157757745e9.7.1787067698131; Tue, 18 Aug 2026 08:41:38 -0700 (PDT) Received: from MacBookPro ([2001:8a0:6c97:6700:51db:1c3:6be8:694c]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49996188217sm576560375e9.13.2026.08.18.08.41.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 18 Aug 2026 08:41:37 -0700 (PDT) From: Gabriel Rondon To: Andy Shevchenko Cc: Jonathan Cameron , andy@kernel.org, David Lechner , "Nuno =?utf-8?q?S=C3=A1?=" , Stepan Ionichev , Maxwell Doose , Yash Suthar , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 3/3] iio: accel: bmc150: use guard(mutex) for mutex handling Date: Tue, 18 Aug 2026 16:41:35 +0100 Message-ID: <20260818154135.3324-1-grondon@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Mon, Aug 17, 2026 at 06:39:18PM +0300, Andy Shevchenko wrote: > Not directly related to this change, but even in the original code what is > protected here by the mutex? data->scan.channels? Agreed it is out of scope for this cleanup, so I left the scope unchanged. Honest answer: not much that is obvious. data->scan.channels does not need it, since the triggered handler is the only writer and the core serializes it. The accel one-shot read is already gated with -EBUSY while buffering, so bmc150_accel_get_axis cannot race the handler. What is left sharing data->mutex and still reachable during capture is the temperature read, the bandwidth get/set and scale set, and the event config. But since the handler is a single regmap_bulk_read and regmap already serializes the bus, it is not clear the driver mutex guards a real invariant here, and it may well be vestigial. Dropping it is a behavioral change worth its own patch and testing rather than something to fold into a lock-syntax cleanup. Happy to look into that separately. Thanks, Gabriel