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 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 D18ABC433FE for ; Fri, 21 Oct 2022 16:38:40 +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 303807045; Fri, 21 Oct 2022 18:37:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 303807045 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1666370318; bh=1WmcIR8LQUdwWI92mwL+lEDUUMAxr+M2w9pm5h8V3XA=; h=Date:Subject:To:References:From:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=QggOGJIQi12WLzoo8nwd4SAzjyOy6k+/ldHIXv/vZX9yYF4UdCmXqzSYYNf+AJxX7 tU6Fe1JLVCQ6xIJi3ZQSdH2BNSVCRnPs/DaFS6ZQ6nkwnuILEox04UwYTQ/+ZhJ0BM emqsCZ3VHYfdOlBfmoF0em2o1jYhHoksD2jrtZf4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D5047F80134; Fri, 21 Oct 2022 18:37:47 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0DD21F80134; Fri, 21 Oct 2022 18:37:47 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 97DF3F800B5 for ; Fri, 21 Oct 2022 18:37:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 97DF3F800B5 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Xd0jNJ2s" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666370261; x=1697906261; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=1WmcIR8LQUdwWI92mwL+lEDUUMAxr+M2w9pm5h8V3XA=; b=Xd0jNJ2s1kC92Vf5QoXJr5Ux7KxhfPA8Y8m2fHVlDyuIMGcyUYFukG+C /DeJmfnir+fWNJgE25kVid7cfjD0s4ZSQ4h3uzKXooYlj7FO9ZJUdQRRV ++ITpRK4rVzI0ko0XF7uJ20+W7gQnxR2gHBMbzsRUlgYGNzwaH1uBhWXS 6IJzCOitzKJw/IZzMTmloBti2wnde+CJ3MQT2rYSux73mSO3ActVRjL9D 4xmSYKkN2nIy0pZ/DmeP+1Kk9+ASgncZAIl3ZQZbvE2depOOinBwP31YG Ur0Jm1+Y+LAF/oTD/6m7wSsSD+XzWA7cqH/kunOfJeEp/gI5PaVh0qNSz Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10507"; a="333622388" X-IronPort-AV: E=Sophos;i="5.95,202,1661842800"; d="scan'208";a="333622388" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2022 09:37:07 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10507"; a="755874415" X-IronPort-AV: E=Sophos;i="5.95,202,1661842800"; d="scan'208";a="755874415" Received: from legomezl-mobl1.amr.corp.intel.com (HELO [10.213.170.111]) ([10.213.170.111]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2022 09:37:06 -0700 Message-ID: Date: Fri, 21 Oct 2022 11:37:05 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.2.2 Subject: Re: [PATCH] soundwire: intel: Initialize clock stop timeout Content-Language: en-US To: Bard Liao , alsa-devel@alsa-project.org, vkoul@kernel.org References: <20221020015624.1703950-1-yung-chuan.liao@linux.intel.com> From: Pierre-Louis Bossart In-Reply-To: <20221020015624.1703950-1-yung-chuan.liao@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: bard.liao@intel.com, vinod.koul@linaro.org, stable@vger.kernel.org, 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" On 10/19/22 20:56, Bard Liao wrote: > 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 this patch should be sent to GregKH/Linus as a 6.1-rcx fix, it does seem to make the life of Arch/Debian users less miserable - for some reason very large delays on driver probe seem to trigger this corner case and make things even worse. see https://github.com/thesofproject/linux/issues/3777 for details. Thanks Vinod. > --- > 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); >