From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) (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 D8FC23876D6 for ; Sat, 28 Mar 2026 11:19:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774696784; cv=none; b=JGcmtLehkTTpA0CX54sBiHjjCMMdfLEf6ON/saicTrqrK/egVYIfxkjK6b++pHzySgoeAbDupcNsMJ68SMOsVXERMLkTBlnHvxXHoxya8MdHcIF8FFcLtsqwEWkKIU+mRKD1y7G6w52nGhNm3APwjdWYXQw6JgAOTckzeaqMUKw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774696784; c=relaxed/simple; bh=WsqHrY2UBEjSfgoMPwgaCP0ADaekqgHFCn921u4ltsk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=n1xbI7rHeKhcmdsEzs3o39iJmk4LioPXRyH1weZrnLKVkSfUAqjkOhJcGcNgeBc2cVfff/Vf6Ye8KAGgQ3Jy4QqHx/0zFcIWMkgct6caFaX0RgoHgxjTwSXbzMoNZkYt7vanttOjM6wI3UGr6NhidCily/2P93HfOPNpYJjlWbA= 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=lxjq8swY; arc=none smtp.client-ip=209.85.216.52 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="lxjq8swY" Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-35d9c7bf9a1so41747a91.3 for ; Sat, 28 Mar 2026 04:19:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774696782; x=1775301582; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=65/A/y0tWnd6/1Jr3K1mW/81LhIv9paBXlJpScLz8OM=; b=lxjq8swYgOTzEBC5SVb0CpvtxQkeGi7yOwbrOTnSi7CxgEvyUoRMizPwehdbfZPbAf 6V8dJFSq6YulN6UuxHlVJlE50XJiCO7L50atNbtisfRemMSNofeg06SBFP7F85ctIxgF YKY94Wi1GJKYor7F4WCZg067WuAey6FoZHPG89t7y2e0Powwi3WWZX/7om/yhzulXNaI bQ8rMBpqH4iVA7kcpVYBoTNQpmXeTz0lJTvAhqGd1nvLo7dOepIRS4FL9UfTMNqC5FYD CuMz/J2+jecVf0FHOvU/TuDngF0czE2x4JN3lpvcJRD96isAH0pSLV3o1jfYwBGMSvTt koOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774696782; x=1775301582; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=65/A/y0tWnd6/1Jr3K1mW/81LhIv9paBXlJpScLz8OM=; b=JegdGp6gszzDUAxZYvcJZGKMi7zUmyDloCbaIcz5oZIm15hMSMvW6yygNuJTT/UVAF MKT3pki6mhACfm+hYZ6INB/Iag9CR5Tf2bNBKyc04f9FEN58xJis1HxLPESrLUCYbQ+R cYUpl3/lvoy566d+UmVXckX9GKUTieShC8jWChPNSpcCuRKiNsFrqVHuUQMxnvQ/UxFL yXwKygDPmyI0egbByrL8n8iQ9n13sxvrO8qTyzYtBdBBVAX5rsg5vwg/yw0gya2fvAex /43nbU4sTO/HbsEYS+ulwfGTyWkukPD3phxlDIEzV5c1jsivTUihmvQDA+OhTQO6kYjm p2CQ== X-Forwarded-Encrypted: i=1; AJvYcCWul7KN+7jHR30gPDWCr3c8e7lWWeTlcJr7KYvFs+t7DD1bsndEfZcPjuc1bPQNQ4MfCJxOsrL5NJUESnU=@vger.kernel.org X-Gm-Message-State: AOJu0YyF+Y5KgkNEjzcLAYKREpNHnw+WeammObj/JMQStaeNsIbFH+p2 gtMTLx0xMi3MzMwojBhdgeiD781JIgfZloJAcXy1OxHGwQXiG73JvtGy X-Gm-Gg: ATEYQzzZt66EkV3Xz3cw+7G/8JVEQ7gpPyUqZtwLKnhZFXtYwceTGZxZuXvQWIBgl0h 592+DLdLjaobKuZ2n9XHRQmEYNgvAxcFyLuWloRDLe8vkgF5684n8vFWJPR2G6lWANl19nxq35x re4lTnQTuAHaJIgj0BPFr+nKS//qq9Jaz4rCa8lg423Pv+sV3RS8edhsCwVityG37DYbcD23S1K VCeXWuuPa6B3vKiGrS9abdOW4vR9zuKIvSn99oI/3rvP4Y1/88nHglXK59b8kbznGsPIeeknXHC kP2dNEWBsbVgtXo1i5IBaSv+mEWDzUhdGPAtIyWlaVwiJJotnqKnGUGCSwTBVaHfAdTKSc8zyDF KgsQyBEOpdFDwVizXC4A0ilvG6Rh/rsh83lpTVV6AGd45CqHAY5b4DrWANo8PZd8Q37AWUWgTRu jN891FbhU8Srarb7CKpO0L6JulR8TwAQ== X-Received: by 2002:a17:90a:502:b0:35d:8f3d:c554 with SMTP id 98e67ed59e1d1-35d8f3dcc71mr1989001a91.13.1774696782074; Sat, 28 Mar 2026 04:19:42 -0700 (PDT) Received: from fedora ([122.173.26.34]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35c2db0a951sm1848568a91.5.2026.03.28.04.19.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Mar 2026 04:19:41 -0700 (PDT) Date: Sat, 28 Mar 2026 16:49:05 +0530 From: ShiHao To: Jonathan Cameron Cc: dlechner@baylibre.com, andy@kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, i.shihao.999@gmail.com Subject: Re: [PATCH] iio: accel: bma180: use devm_iio_triggered_buffer_setup() Message-ID: References: <20260321114848.159973-1-i.shihao.999@gmail.com> <20260321130018.5ef955d1@jic23-huawei> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260321130018.5ef955d1@jic23-huawei> On Sat, Mar 21, 2026 at 01:00:18PM +0000, Jonathan Cameron wrote: > This also changes the ordering so that the remove() path no longer > does things in the reverse order of probe() > > Whilst that might not introduce bugs in this case, it makes reasoning > about race conditions much harder so I won't take code that does this. > > The basic 'rule' for devm usage is that there must be only one transition > in the probe() from using it to not using it. You should never go back > to using it after that transition. That way the handling in remove() > and the unwinding of the devm_* happen in reverse order of probe() > and all is easy to reason about > > So to make any devm_ related changes in this driver requires a > more comprehensive approach. Note that even if the change here didn't > suffer this ordering problem I'd be pushing back because of the partial > nature of applying devm in this driver. + a complete solution would > not run into the ordering issue. Thanks for you review. I will make sure to remember it. Best regards Shihao