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=1796367584; b=t+mXneuqVtq5+WcjzjSfPfEyunoh4RN+k3vStdycnHaVw+i77oSUaNeXUUCMGLWVVnCt 9E5HpGtgw487cChWdC4yNJRNwPrJRov8zfAsspJykoXRvqjguccmp6T27mpPtDrjBkNYh KLXJzYzTPFdAWKM2/AOLMvCjt3PNFIc+mjtG1OuctflG7crDyHe+3ZE/zN8PRsp3rSzUH HflYYo3BZdV8uonMLv505o76sqzx/yz4vTiQb/qXtd/CFeRRc/M3UMwaOP4OFJhNnIbfr /xzDO5UDekZfoC9Wds8Md3a8sfqpe6LRX7+VyRp3maKmFMYq/ZJBmMxMnY3aABHM+gA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796367584; h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:Cc: References:Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=RFXzO2XDa/6NndQsH50KUqC6N6Tho7HwhuFKgRtEkf0=; b=KaLMlXDbrU9f/vLQyP4waR5VWWEYNUHLNI6pyxkMkEZPLRZa+BjQAa6ArTe5RkoUzw2e C7outWPDo07vjf3DlJGnT3n+rtyQiz5W54ZXOObEfVLcnRe0VGBJvWkHsl5NtGsYq4dKJ MDPbYlLl9P7Lalvwo+zs6cynzfYiA5yDBcg/UqB4wYzkuJa6Wd7/AZEhBc5KuD4FO5Ya5 De74a1I1jRtuqoahvFN1CEsDfG+sGnKHuEHlLSu9d3yDYOQZlmR3xKZENa5qosNITJ7oz q1BCCJD79CNS8aIjnkDJQ88qQFav6qxI14PlR368yIzKASW1OOVYrc4tFCQlwoEmwLw== 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=ac78ZkoH; 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 2F07D606A33E; Fri, 4 Dec 2026 06:59:44 +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=ac78ZkoH Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C42D1F000C2; Fri, 4 Dec 2026 06:59:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796367584; bh=RFXzO2XDa/6NndQsH50KUqC6N6Tho7HwhuFKgRtEkf0=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=ac78ZkoHRhklrfI4VTrdb652pXpTu9O2T7GeXHlKSk/Tu7do7YDheAlh2t6M11On5 nj+FtPnTkTRXKdOUiiZlPx6HjQa5/tJ7eZ9BQ9PrUpjLV5kY/xJjBkXPyjnOdQyFeo F1omkcPUTrDZR0VHStitYQVLv5/fuqSoLspHubE5PcAkiUBDKBfP+PVHiBXBXVb884 OZ8lyPgNcXBMxq714dClbvBlgRKskfXXHk3ot5whqH9LNXfp1l/u+iStitr3MDAbLi 7nv9/SorpZi1QO15p19tOfl/E+vZ+i+nS3AiWFC22UUfHcZ+/ECMgab8Bh6KW3nQCX fkrH7yyUl7Y0A== Message-ID: <41347cd3-0a85-4342-937c-c6c292199e1b@kernel.org> Date: Fri, 4 Dec 2026 07:59:39 +0100 X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Subject: Re: [PATCH 1/3] iio: light: cm3232: unregister the device before powering it down To: Vineet Thakran , Jonathan Cameron Cc: linux-iio@vger.kernel.org, Kevin Tsai , David Lechner , =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko , stable@vger.kernel.org References: <20261203165254.135545-1-vineet789thakran@gmail.com> <20261203165254.135545-2-vineet789thakran@gmail.com> Content-Language: en-US From: Joshua Crofts In-Reply-To: <20261203165254.135545-2-vineet789thakran@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 03-Dec-26 17:52, Vineet Thakran wrote: > cm3232_remove() shuts the sensor down before calling > iio_device_unregister(), so the sysfs attributes stay live for a > window after shutdown. A read of in_illuminance_input in that window > reads the ALS register of a sensor that is shut down, and a write to > in_illuminance_integration_time rewrites the command register from the > cached regs_cmd, which does not have CM3232_CMD_ALS_DISABLE set, and so > turns the sensor back on after remove has shut it down. > > Unregister the IIO device first. Once iio_device_unregister() returns, > the sysfs attributes are removed and no IIO callback can run, so the > sensor stays shut down. > > Fixes: b84894c7f088 ("iio: Added Capella cm3232 ambient light sensor driver.") > Cc: stable@vger.kernel.org > Signed-off-by: Vineet Thakran > --- Reviewed-by: Joshua Crofts -- Kind regards, Joshua Crofts