From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24E27C4332F for ; Mon, 12 Dec 2022 13:27:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232733AbiLLN1f (ORCPT ); Mon, 12 Dec 2022 08:27:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232359AbiLLN10 (ORCPT ); Mon, 12 Dec 2022 08:27:26 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1970613D2E for ; Mon, 12 Dec 2022 05:27:18 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C07E9B80B78 for ; Mon, 12 Dec 2022 13:27:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B42CC433EF; Mon, 12 Dec 2022 13:27:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1670851635; bh=e7RZMR8jkpPuqmVbMV0PGR1OVbAhBbvQrRXJ2OnHq/Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MQ4TEw9xqhXB9tphkGl64qXGoIL1j4F8xAAMnBT4VgErvwNwTPiPCRTpl6gAQI/z2 CGY7Gei/KtBZ/thF7KKDavAhRLLE9JOP4yR47WRDtI8T1bxt4cqJRwBMgXX3Izqmdg mKnMRsHszTwzQaOKMWlqlYCb7xmg1feC5yN2SvIU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sjoerd Simons , Pierre-Louis Bossart , Chao Song , Bard Liao , Vinod Koul Subject: [PATCH 5.15 040/123] soundwire: intel: Initialize clock stop timeout Date: Mon, 12 Dec 2022 14:16:46 +0100 Message-Id: <20221212130928.597470166@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221212130926.811961601@linuxfoundation.org> References: <20221212130926.811961601@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Sjoerd Simons commit 13c30a755847c7e804e1bf755e66e3ff7b7f9367 upstream. The bus->clk_stop_timeout member is only initialized to a non-zero value during the codec driver probe. This can lead to corner cases where this value remains pegged at zero when the bus suspends, which results in an endless loop in sdw_bus_wait_for_clk_prep_deprep(). Corner cases include configurations with no codecs described in the firmware, or delays in probing codec drivers. Initializing the default timeout to the smallest non-zero value avoid this problem and allows for the existing logic to be preserved: the bus->clk_stop_timeout is set as the maximum required by all codecs connected on the bus. Fixes: 1f2dcf3a154ac ("soundwire: intel: set dev_num_ida_min") Signed-off-by: Sjoerd Simons Reviewed-by: Pierre-Louis Bossart Reviewed-by: Chao Song Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20221020015624.1703950-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul Signed-off-by: Pierre-Louis Bossart Signed-off-by: Greg Kroah-Hartman --- drivers/soundwire/intel.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -1285,6 +1285,7 @@ static int intel_link_probe(struct auxil cdns->msg_count = 0; bus->link_id = auxdev->id; + bus->clk_stop_timeout = 1; sdw_cdns_probe(cdns);