From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 29E8639B97F for ; Sun, 16 Aug 2026 23:42:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786923762; cv=none; b=fj2HJoE9SPA50FVo5lG22q+nhinMdM6TnqkaUMMBVbH6mjvdUlZGdksKPQ5Oa8kWIjGKV5Nw1z1gls3Tj6CxrzQB9uQmY/DpZvlhLq3T1tupbzOZLFU/28fNzrsPkyCL9CK2GRAgCEkzBfBKjxH1ok15I7jsEBQ99bBQsAOqgTY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786923762; c=relaxed/simple; bh=cuAqpL4pp+pe7/LyhOOuq2paRfSRiNAJg+JRL+ZyChs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Lm+XXCSmmLUrabLdjp4YIZfBgcaLeEU8dUxc003ePrGzc8UNi6iYhM3007/6yjPiLz6weOSz6HsdOvJmW+Psj7hcbRAlBBirkNQqV3MlcrigASLI6Z4syJXv+Y1lOrEETEi9O7NY/kqr/OBjC6Mm2WeJSPHBvK3ehHJRsuQua5Y= 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=j5Nsz8iC; arc=none smtp.client-ip=209.85.128.44 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="j5Nsz8iC" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-495757ccbc1so24968875e9.2 for ; Sun, 16 Aug 2026 16:42:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786923759; x=1787528559; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=5r6hpX1fTPK7zjwiATG/UyXCdz+ikm7jiCTRgU/Pm/0=; b=j5Nsz8iCEVlIGY5bMaGaw96csd28tBrUnE7OjZxDDdYEWe/+NkjT7hJK0kZKnsdVF2 YcO9BT5PH/0YUzCv5c2qiK1HfJIGvY04+0PST6GCTKo1y7DORPcN9DnaZ7F8CiqLwSdX mtyhuqc5C5HfuASr9CFWrmoBTjoq1VMJjFmWsSXbhnYdUzgQFUWEZZB0bgqu8IV2wRV0 h8PiA1iGFXMm2yqeAZZGvjC0nY8Cpru0pt2z9ul2B7x7T55T/r62Ax9bazQHhC7ds84m aRLYPmX2oHLf76AiPudgdOZYpQ9/T3n41v/MhMVMG/jFeX6Mug7sEcNHGC5q2SqXvJ6p GBog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786923759; x=1787528559; h=content-transfer-encoding:mime-version: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=5r6hpX1fTPK7zjwiATG/UyXCdz+ikm7jiCTRgU/Pm/0=; b=aXtyqUD4NiABgnTs8s6jJHLRsNWOrw2xudjEAwiJomkUP0SYi32jVZ6VMfCSlSyoII 0gHQoi6Cu6C6Q06hXEk9a7+zMsgrP/JcaFGqd9EMzXBxpOHHJ7IyOcZvZBPbFtc+o63i lFNMSEAbGIw0Q/tYX26oOx38UxADGsY7SBf1JbWdPbfOIbNWkgIE+kfxJo6FUI78gfxg uqX+3Bu20axsdlokRIrQ92I+9UatcHi8RTjtqeKeJpVa9QkzCmfp4bE/ldgWdTXUB1C0 NFyiHdyDPYGlpYkghpjZnOlOig2XLBVQDyL/2EWa9GVgzB0z9+En/PQdoLrpRVmada2Y z9CA== X-Forwarded-Encrypted: i=1; AHgh+RrzbtykHwB10PXUsmlJu8eEdG6g2+oRlnP72itwWxcoAjh8M8tyKN4ZvKXV/ahkNSaXTOz5hEgnp6usKd8=@vger.kernel.org X-Gm-Message-State: AOJu0YyqpP1Z0Er3BHR/ttMascHB8zuQr2SZQnqbP/hQMqVxykVyiTPM 0TwzYbcyL+MklJUZ3hRROgrBWyI9cT9WZqppaqPnCz+D0T2F6ZeBlK9F X-Gm-Gg: AR+sD12exfROjRLUA6BpY4ycx1YYS9ETsM4urcRM92YdW0tAQOj4c/+EkeJ3+v1i/P3 2BT5DkeS8A5X4S4EuCV/PrnN2v8+GAg6W78y0S3TGwaVFBpAmX2Noz/ydi14oHO1xxTPGPqZ8JB hAo/Ew0szxBdUxpMXJ9vk9BLvhwzShtC6x7lYzIPHnwCvodEIZRWzB6goJEIm7YqSvqfpfK5Kkm u21VAKVVXYRyf2cQSw2yNuYoGo+/LDA6X1ybAPR0a+jBuvKQVCd0e9+X7+NK1nSlRuSa23304pM bxnNlIzCLdpvnbn3aLuI8GmrM8lemefxx4pvIwkK0TKLSjGqCEJKCIYLadxGRckb+rNWtaUQYGH /m772Tt7RAq2TcrNc+xJZWcQae8UFCEXKZIv0rZqsxIubJ0C/JDLUKFGREE6OEk13ZjUWGkZpj7 lE5865ecuoC5pU/goS9tQNXb1kufgvlyfQr0rYZXsexDsy3IvQQ/EOsvNISlESu0A+ZHJQs0zot iaCKm+tH0+iL+pCBE2jKHtmyjtVJbbhb0w= X-Received: by 2002:a05:600c:1f91:b0:492:4e09:9fc1 with SMTP id 5b1f17b1804b1-4998797d111mr281850495e9.15.1786923759174; Sun, 16 Aug 2026 16:42:39 -0700 (PDT) Received: from MacBookPro ([2001:8a0:6c97:6700:ac71:8b16:e755:35c9]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-499960ff072sm112915555e9.3.2026.08.16.16.42.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 16 Aug 2026 16:42:38 -0700 (PDT) From: Gabriel Rondon To: Jonathan Cameron Cc: Andy Shevchenko , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Stepan Ionichev , Maxwell Doose , Yash Suthar , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 0/3] iio: accel: bmc150: fix event-enable race, then use guard(mutex) Date: Mon, 17 Aug 2026 00:42:28 +0100 Message-ID: <20260816234231.14168-1-grondon@gmail.com> X-Mailer: git-send-email 2.50.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series addresses what came out of the v3 review of the guard(mutex) conversion [1]: the pre-existing bugs had to be fixed before the conversion could go in. The unaligned-timestamp / DMA-safety problem in the trigger path is no longer part of this series: it is fixed by Yash Suthar's "iio: accel: bmc150: DMA-safe buffers and use iio_push_to_buffers_with_ts()" v2 series [2], which this series is rebased on top of. Patch 1 sorts the header inclusions (suggested by Andy in the v3 thread) so the cleanup.h include added later lands in order. Patch 2 fixes the event-enable race in write_event_config(), where ev_enable_state was checked outside the lock. Patch 3 is the guard(mutex)/scoped_guard() conversion itself, now applying on top of the fixes. [1] https://lore.kernel.org/linux-iio/20260525110130.61284-1-grondon@gmail.com/ [2] https://lore.kernel.org/linux-iio/20260815175728.99541-1-yashsuthar983@gmail.com/ Changes in v4: - Turned into a series: prep and fix first, conversion last (Jonathan, v3 review) - Sorted header inclusions (Andy) - Fixed the ev_enable_state race under the lock, with Fixes: tag and Cc: stable - The unaligned-timestamp problem raised in the v3 review is fixed by [2] rather than by a patch here; the series is rebased on top of [2] Gabriel Rondon (3): iio: accel: bmc150: sort header inclusions alphabetically iio: accel: bmc150: take the lock before checking ev_enable_state iio: accel: bmc150: use guard(mutex) for mutex handling drivers/iio/accel/bmc150-accel-core.c | 92 ++++++++++----------------- 1 file changed, 33 insertions(+), 59 deletions(-) -- 2.50.1 (Apple Git-155)