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 63AC11DD0D4; Tue, 26 Aug 2025 12:54:38 +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=1756212878; cv=none; b=Mx10/DllSkgazG375s0TyAqr3uNVaR8IwMtNq7Svtka7BLW4Z/fmlz/3ikrjBQeQIhYlRcJ4DLrhLSaq7mVEckgMNCmeyqNKzc1yAbR1vOwt3sgkBd4DCZypbXIhigRlpZSGUQxyIrFr7msY8Hz7H4U8NgDrZcnqIhGkx5TBmWY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756212878; c=relaxed/simple; bh=AEFTlktuC6q61b1IL3+c6ImwUlzakuDHaOTp1fe+RDo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pibEqIjGRXLirO5Dn+daCW0C9x0G1KvjxSDWqJhJQxiNW6id3RamZXkLATRHok/DXGF2Mvy0jvz9IDqcggdV8o7kswPxIEyIbjxw4kNBtOxv4qQ/0RShVtIMwFg8TnJywMuI4CYNuMiBYwkkqMZv0zOwQRqQlN806BClKxRmihg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=13YuhUGb; 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="13YuhUGb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E910BC4CEF1; Tue, 26 Aug 2025 12:54:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756212878; bh=AEFTlktuC6q61b1IL3+c6ImwUlzakuDHaOTp1fe+RDo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=13YuhUGbvdNCAGrLuWrcz6dOWb3AC/yU9JcT0YwqC6RHuoPy+lvSk93zUF2zpWfy6 FV8PBNzKPrRHtHn4SWSei0zP674XEBRAY7j6QWtbvvvuRfN4pwFGH359ffQyyipGT6 u4Z+Ai1lJyUqp+3crWrBuIxNhd4xut9F76p6o5tA= 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.6 137/587] ASoC: codecs: rt5640: Retry DEVICE_ID verification Date: Tue, 26 Aug 2025 13:04:46 +0200 Message-ID: <20250826110956.436875343@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110952.942403671@linuxfoundation.org> References: <20250826110952.942403671@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.6-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 1955d77cffd9..0f250e8e216a 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c @@ -3016,6 +3016,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