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 6691F194145; Tue, 10 Sep 2024 10:24:32 +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=1725963872; cv=none; b=V5/bRQLbD7WTFDzHVqkNIWnkUKM7phwE5pdIstQhL6XXQ9O4Der6VSAT4bp2aDqpEMT62huDhipLg/6Uh4NEA70OOK3y3Y4VM18YnQiK0jqrLoHo4Do/ZBbnum/hqxZdIohXKq9FIGnpdpJNnh8PmTH2xMFXSylM13mXz9YI+/I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725963872; c=relaxed/simple; bh=ihxk9Kgd08p/zf121g9OuLaoqz5elB9zCXXgi+ORU6A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g8a0e8qPmhRNy+KlX2Q+drWTOR6mA76+9FayKYiirlvRgExKLtccURB5fPiOKN3rnF1i3sMLGTvUGCmn78lPfhj6yoaWjQRSLt5JhGuQpb64shBazag1zzE/g85fFUp/UhNYc0I2XzKXRJa3e+s5U5it17OB3aL46vUiixFGW2Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=KtQyqTXm; 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="KtQyqTXm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1482C4CEC3; Tue, 10 Sep 2024 10:24:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725963872; bh=ihxk9Kgd08p/zf121g9OuLaoqz5elB9zCXXgi+ORU6A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KtQyqTXm/8UCQA9dt/0ZCXhGi9zgd2X6RjASGYhv6rPyqA0o22VLDOaZrNT5z1Wu0 78UlzoKkV1R1wx6sKkNSkDNzSLDr0mbuDxjVh0o2luvobB+E2g+0ZdxDtAPOeHWTnB 4gJbh0K9rHPIDJTpXGpj3jEstQwyBlkYz7mzB+iE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dumitru Ceclan , Nuno Sa , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 5.15 179/214] iio: adc: ad7124: fix chip ID mismatch Date: Tue, 10 Sep 2024 11:33:21 +0200 Message-ID: <20240910092606.007496723@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240910092558.714365667@linuxfoundation.org> References: <20240910092558.714365667@linuxfoundation.org> User-Agent: quilt/0.67 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 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dumitru Ceclan commit 96f9ab0d5933c1c00142dd052f259fce0bc3ced2 upstream. The ad7124_soft_reset() function has the assumption that the chip will assert the "power-on reset" bit in the STATUS register after a software reset without any delay. The POR bit =0 is used to check if the chip initialization is done. A chip ID mismatch probe error appears intermittently when the probe continues too soon and the ID register does not contain the expected value. Fix by adding a 200us delay after the software reset command is issued. Fixes: b3af341bbd96 ("iio: adc: Add ad7124 support") Signed-off-by: Dumitru Ceclan Reviewed-by: Nuno Sa Link: https://patch.msgid.link/20240731-ad7124-fix-v1-1-46a76aa4b9be@analog.com Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/adc/ad7124.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/iio/adc/ad7124.c +++ b/drivers/iio/adc/ad7124.c @@ -690,6 +690,7 @@ static int ad7124_soft_reset(struct ad71 if (ret < 0) return ret; + fsleep(200); timeout = 100; do { ret = ad_sd_read_reg(&st->sd, AD7124_STATUS, 1, &readval);