From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B51BB2135B8; Tue, 26 Aug 2025 11:30:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756207851; cv=none; b=kytu74Qmi0Gy/rMi/iITnTJGagUs4tYWG3PpDp7xhT+bO2gK83pZWeeI8ibu3Np5ukHMLW/nras//Xy7YgClN2IhH2mHK9Qyb92MB4Q8/JN4opHtzLZtZ+yVch+1nLYk7Luwjja/dLWvcsAlkAjz8veD+FL+ix7prZPLF/Gz9Q8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756207851; c=relaxed/simple; bh=oECuGxCD+SUJAAWIukqhtvp23tmTXMDYNKEQbZmL7Pg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sSFOAoDg/1RFKD9KtZvMLrdhri1uw2Nil81qfHwvlMPQdEiEJ1wu0sXFfA8occa88VZciAG8NrkhQ7su0CEtXXGStFvopsay2gNFWPVsPxes3FU39/D7RihS0EDCdfsC+gsdF0D9xJkzQfBl5Jt79gXcLvlhnLMq0KjJQQl0E8g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=szTGFyuN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="szTGFyuN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47887C4CEF1; Tue, 26 Aug 2025 11:30:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756207851; bh=oECuGxCD+SUJAAWIukqhtvp23tmTXMDYNKEQbZmL7Pg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=szTGFyuNvoAVX0vrslK9z/L2yO9yCorfbI1xNVVAZAIaOBvC73vwqSPBeIX/HQwZE 6DE9yZyJ4gC1A3M4UM+82180tmU2GW1F09b7ESECLYvkTszLS99KTEDoQ8NF1BAwOj GyOEG9aMJ+iLJ31DgZFdv2lH9aSX9MIycr9nE5/M= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jean-Baptiste Maneyrol , Andy Shevchenko , Sean Nyekjaer , Jonathan Cameron , Sasha Levin Subject: [PATCH 6.16 341/457] iio: imu: inv_icm42600: change invalid data error to -EBUSY Date: Tue, 26 Aug 2025 13:10:25 +0200 Message-ID: <20250826110945.760600053@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110937.289866482@linuxfoundation.org> References: <20250826110937.289866482@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jean-Baptiste Maneyrol [ Upstream commit dfdc31e7ccf3ac1d5ec01d5120c71e14745e3dd8 ] Temperature sensor returns the temperature of the mechanical parts of the chip. If both accel and gyro are off, the temperature sensor is also automatically turned off and returns invalid data. In this case, returning -EBUSY error code is better then -EINVAL and indicates userspace that it needs to retry reading temperature in another context. Fixes: bc3eb0207fb5 ("iio: imu: inv_icm42600: add temperature sensor support") Signed-off-by: Jean-Baptiste Maneyrol Cc: stable@vger.kernel.org Reviewed-by: Andy Shevchenko Reviewed-by: Sean Nyekjaer Link: https://patch.msgid.link/20250808-inv-icm42600-change-temperature-error-code-v1-1-986fbf63b77d@tdk.com Signed-off-by: Jonathan Cameron Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/iio/imu/inv_icm42600/inv_icm42600_temp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_temp.c +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_temp.c @@ -32,8 +32,12 @@ static int inv_icm42600_temp_read(struct goto exit; *temp = (s16)be16_to_cpup(raw); + /* + * Temperature data is invalid if both accel and gyro are off. + * Return -EBUSY in this case. + */ if (*temp == INV_ICM42600_DATA_INVALID) - ret = -EINVAL; + ret = -EBUSY; exit: mutex_unlock(&st->lock);