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 3674332A3D2; Mon, 18 Aug 2025 13:25:47 +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=1755523548; cv=none; b=JnWJdpzTE2P0gtJnLY8FwWUuf4eYHG04j9h+cs0DvnZpV/gxQcqoSyIdGZOx2xmndKLcGtlnGH5zz8k2s13IEb7k2Gu5ociVRvDLpQEHF7+RhjupXb0LjNswxUNpSp3+0DIu2YUMaDFpRG+k51dycWN21HLVbHH9gDvVN92jwDw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755523548; c=relaxed/simple; bh=Q5yZKlhjlEsBgTHwnsYmG3UDS8krdExq4ES16ds3CqU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QSE4x+fG28ufF/Iyzg8C9vecDnDxYwxn71R1w0yOlD5ppexdRLArB3aDerxi6Z5/2zBOjDXkBGBZ2h+ZmNg1hB1kgZNOOb8bk0c+r2cdQTEJQri3dA+y9j+paQUjxnuKR+XlGa0BdowumqvoRk3wMl1Aez/E4hdtZaVeOJwlNNA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JmDIbJDi; 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="JmDIbJDi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 204A8C4CEEB; Mon, 18 Aug 2025 13:25:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755523547; bh=Q5yZKlhjlEsBgTHwnsYmG3UDS8krdExq4ES16ds3CqU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JmDIbJDiHWMKH1rDVIQMHoS05U1fVczTM/NX0w+wHQiZT+8sxphBwpj5yH0Xo18Qf xrJ8qUljlFTfTI85+sbuChOiy7eibUUOWaPioNP5k43gdhdTcgIVAMv0KuXEEjR/ts TaN2jyzKoktaVeYoURpevGBlU/qDMb5fv7sKtrDU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= , Cezary Rojewski , Xinxin Wan , Mark Brown , Sasha Levin Subject: [PATCH 6.15 187/515] ASoC: codecs: rt5640: Retry DEVICE_ID verification Date: Mon, 18 Aug 2025 14:42:53 +0200 Message-ID: <20250818124505.569776257@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250818124458.334548733@linuxfoundation.org> References: <20250818124458.334548733@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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xinxin Wan [ Upstream commit 19f971057b2d7b99c80530ec1052b45de236a8da ] To be more resilient to codec-detection failures when the hardware powers on slowly, add retry mechanism to the device verification check. Similar pattern is found throughout a number of Realtek codecs. Our tests show that 60ms delay is sufficient to address readiness issues on rt5640 chip. Reviewed-by: Amadeusz Sławiński Reviewed-by: Cezary Rojewski Signed-off-by: Xinxin Wan Signed-off-by: Cezary Rojewski Link: https://patch.msgid.link/20250530142120.2944095-3-cezary.rojewski@intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/rt5640.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index 21a18012b4c0..55881a5669e2 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c @@ -3013,6 +3013,11 @@ static int rt5640_i2c_probe(struct i2c_client *i2c) } regmap_read(rt5640->regmap, RT5640_VENDOR_ID2, &val); + if (val != RT5640_DEVICE_ID) { + usleep_range(60000, 100000); + regmap_read(rt5640->regmap, RT5640_VENDOR_ID2, &val); + } + if (val != RT5640_DEVICE_ID) { dev_err(&i2c->dev, "Device with ID register %#x is not rt5640/39\n", val); -- 2.39.5