From patchwork Thu Oct 20 01:56:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bard Liao X-Patchwork-Id: 13012544 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7A889C4332F for ; Thu, 20 Oct 2022 01:54:06 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A59768DCD; Thu, 20 Oct 2022 03:53:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A59768DCD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1666230843; bh=hfWjYaVPC1jR2bOcPd6wO2+FVIEpJFXHmpCSZH0ayOk=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=lcpYiDnY019ZlUfan9v5lDsCiixOuyS4Q4sRCDm+ti7IWAy6FWVYoZ6EmExSh8dXt KOtNEWGo4hc6ZMV7WEdA044TUbdAMOkVFBelAdJRx/4n9bdVIjR9Pfz5QtU5WzWOJM iyxyrSWQq/cYNKfQ5lG7BO/MwaRS5XS94YaXXJjk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 502B3F8032B; Thu, 20 Oct 2022 03:53:13 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 34469F804D8; Thu, 20 Oct 2022 03:53:11 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5AE6AF80137 for ; Thu, 20 Oct 2022 03:53:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5AE6AF80137 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ahupwzKn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666230786; x=1697766786; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=hfWjYaVPC1jR2bOcPd6wO2+FVIEpJFXHmpCSZH0ayOk=; b=ahupwzKnyoQoQ3e9G9G4StATOlHKCp0Hqy7TE5DXZuPcy0evBKpEN2pp C7NoszeXwHXEC4/xGk8eL+0Woogwc7lxw//C9qnnZAYY+1jLOvAUucgBh 2f6ni/qxdne0rEt97qp8XzyRDLBRjJZcyoH7AoLAR3Vi5KEsZaSGq1Cn9 bK7kx9Bg/gS1ZsCWpH7XRuHbO7i0n948SSp0sr053ptPVKAi6wcm3qo6U NO/QprVPEA4P2JWsUyML6+jfFYAbwY6moAe/lZQ1TfrVyd7DfH3p4aKzx X37GjXWA0oOTpyGXV1Mthx4O2TYk6lK+yIB0jBBVQO3833C9UXjnwNxcX w==; X-IronPort-AV: E=McAfee;i="6500,9779,10505"; a="306569692" X-IronPort-AV: E=Sophos;i="5.95,196,1661842800"; d="scan'208";a="306569692" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2022 18:52:51 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10505"; a="662755519" X-IronPort-AV: E=Sophos;i="5.95,196,1661842800"; d="scan'208";a="662755519" Received: from bard-ubuntu.sh.intel.com ([10.239.185.57]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Oct 2022 18:52:49 -0700 From: Bard Liao To: alsa-devel@alsa-project.org, vkoul@kernel.org Subject: [PATCH] soundwire: intel: Initialize clock stop timeout Date: Thu, 20 Oct 2022 09:56:24 +0800 Message-Id: <20221020015624.1703950-1-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Cc: pierre-louis.bossart@linux.intel.com, stable@vger.kernel.org, vinod.koul@linaro.org, bard.liao@intel.com, linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Sjoerd Simons 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 --- drivers/soundwire/intel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index 25ec9c272239..78d35bb4852c 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -1311,6 +1311,7 @@ static int intel_link_probe(struct auxiliary_device *auxdev, bus->link_id = auxdev->id; bus->dev_num_ida_min = INTEL_DEV_NUM_IDA_MIN; + bus->clk_stop_timeout = 1; sdw_cdns_probe(cdns);