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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 A8E12C433F5 for ; Tue, 8 Mar 2022 16:37:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 43C7310E5F9; Tue, 8 Mar 2022 16:37:14 +0000 (UTC) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6188910E5F9 for ; Tue, 8 Mar 2022 16:37:12 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id EAAF71F380; Tue, 8 Mar 2022 16:37:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1646757430; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3ytMcxkl5rVXnIBT170qKVaoWbVrPhS2eIcRmsGf2RY=; b=KN/03Ia+QxkrEphwcjFHWBez157im/9zOEPFKQEacQFY/5Ha/lAu2QREqM7iU4nUwgKJNu 5QAZuwWUok9eqORyAPrvwYdl7zQq8TuV3FrnkNn3esNpWHQWVdLgS8KC2smsm37Zv9GBYg TYePPZr959a2hEEEmPVadwgkHCTMNAc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1646757430; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3ytMcxkl5rVXnIBT170qKVaoWbVrPhS2eIcRmsGf2RY=; b=Ht1rJbroVo0wLGnAz0WOVEX0Cqerv2ANeM9sHLRAUH+qWjsAShzy8K3DsjU49eqRCM4OCE d5VbMWZSp09PBqDg== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id E297BA3B81; Tue, 8 Mar 2022 16:37:10 +0000 (UTC) Date: Tue, 08 Mar 2022 17:37:10 +0100 Message-ID: From: Takashi Iwai To: Amadeusz SX2awiX4ski In-Reply-To: References: <20220308141112.880662-1-kai.vehmanen@linux.intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Intel-gfx] [PATCH] ALSA: hda/i915 - avoid hung task timeout in i915 wait X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, Lucas De Marchi , intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue, 08 Mar 2022 17:29:21 +0100, Amadeusz SX2awiX4ski wrote: > > On 3/8/2022 3:11 PM, Kai Vehmanen wrote: > > If kernel is built with hung task detection enabled and > > CONFIG_DEFAULT_HUNG_TASK_TIMEOUT set to less than 60 seconds, > > snd_hdac_i915_init() will trigger the hung task timeout in case i915 is > > not available and taint the kernel. > > > > Split the 60sec wait into a loop of smaller waits to avoid this. > > > > Cc: Lucas De Marchi > > Co-developed-by: Ramalingam C > > Signed-off-by: Ramalingam C > > Signed-off-by: Kai Vehmanen > > --- > > sound/hda/hdac_i915.c | 10 ++++++---- > > 1 file changed, 6 insertions(+), 4 deletions(-) > > > > diff --git a/sound/hda/hdac_i915.c b/sound/hda/hdac_i915.c > > index 454474ac5716..6219de739b56 100644 > > --- a/sound/hda/hdac_i915.c > > +++ b/sound/hda/hdac_i915.c > > @@ -143,7 +143,8 @@ static bool i915_gfx_present(void) > > int snd_hdac_i915_init(struct hdac_bus *bus) > > { > > struct drm_audio_component *acomp; > > - int err; > > + unsigned long wait = 0; > > I'm not sure if it is best name for variable that is set to 0 > ("false"), maybe `done` would be better? Especially looking at > condition in the following for loop. Or, more simply some thing like /* max 60s timeout */ for (i = 0; i < 60; i++) { if (wait_for_completion_timeout(&acomp->master_bind_complete, msecs_to_jiffies(1000))) break; } Takashi