Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2055278ybz; Thu, 30 Apr 2020 10:03:46 -0700 (PDT) X-Google-Smtp-Source: APiQypIWCDELzGo4TWUe/dEwjVpdAZy12Fp+i4/7vnspyNYCQ0fIJxAXrm+tY7Pkd66lxitvOLS3 X-Received: by 2002:a17:906:2410:: with SMTP id z16mr3744011eja.1.1588266226601; Thu, 30 Apr 2020 10:03:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588266226; cv=none; d=google.com; s=arc-20160816; b=ZpusVpArqsUUNsj8jN+giufepDuG/fJjRFNmiiJAGU9G3lSFZmB1OKXird0bNdLDYW Pb0x7Tdr6E99o8ZSJXJVhnCvujJhstF7kBktxgyHDwsttlpxIibUBX6punhazR01UBXT khsduUVXaeZNYf+lxWPGyjwevtVy3zb/FzzAUEGQf48Z/q/QCq/kXN2lVcIDldKlOVpI iXnll/IcEPWdHeGsZP6bcz7Ymqc/3zaS/pZi5ZRF5NTacBmk4Ag1oVCQnAgJn2bIV+c4 eiel1cwMKmdvBprb2oQEurfdttBw5/nO0JoLlQ6qPEiVvHZAy3yVj/KYhDz26p+Xt+FT fuKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date; bh=h7vPNQMlF9OYilbmJ+OBRqSI4FUGTNiwcWfMPnpOI0Q=; b=nX+reCVWmbiutk6eXN32lkvu3i8FDcOBFHNHiXTKdZ2hcL4KdMarrznEbf8dFsGqFI oZ/4qro4+lZI6mefXq+ltjAqgCHppWtCeYrj3t0ldKWy7Cu4tm5nuwAXinRhFI55pYP3 L/xsLxGMSnnhYTWgnOFpAgujm+Po348Cw/0B59iLTUObnhxWivmW4zAxhIbcqWKpfzhD HU2vwUx2w+Jc+hu5rR3gJU7Pss/Lv0afUqoTl8AvNvWs/zDHN5R2DXY1lGF9ucQckT10 SioB7fPqKLGJpxphAsfH1DA2agVfgG6La58Pk5lTpDfjY8CFG+2TKBsjfoZ9Q6juoGja GAvQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g15si129134eds.159.2020.04.30.10.03.14; Thu, 30 Apr 2020 10:03:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726517AbgD3RBN (ORCPT + 99 others); Thu, 30 Apr 2020 13:01:13 -0400 Received: from mx2.suse.de ([195.135.220.15]:47252 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726333AbgD3RBM (ORCPT ); Thu, 30 Apr 2020 13:01:12 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CC24DABC7; Thu, 30 Apr 2020 17:01:08 +0000 (UTC) Date: Thu, 30 Apr 2020 19:01:08 +0200 Message-ID: From: Takashi Iwai To: Nicholas Johnson Cc: Alex Deucher , "Zhou, David(ChunMing)" , "alsa-devel@alsa-project.org" , "linux-kernel@vger.kernel.org" , "amd-gfx@lists.freedesktop.org" , Takashi Iwai , Lukas Wunner , "Deucher, Alexander" , "Koenig, Christian" Subject: Re: [PATCH 0/1] Fiji GPU audio register timeout when in BACO state In-Reply-To: References: 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 30 Apr 2020 18:52:20 +0200, Nicholas Johnson wrote: > > On Thu, Apr 30, 2020 at 05:14:56PM +0200, Takashi Iwai wrote: > > On Wed, 29 Apr 2020 18:19:57 +0200, > > Alex Deucher wrote: > > > > > > On Wed, Apr 29, 2020 at 12:05 PM Takashi Iwai wrote: > > > > Well, but the code path there is the runtime PM resume of the audio > > > > device and it means that GPU must have been runtime-resumed again > > > > beforehand via the device link. So, it should have worked from the > > > > beginning but in reality not -- that is, apparently some inconsistency > > > > is found in the initial attempt of the runtime resume... > > > > > > Yeah, it should be covered, but I wonder if there is something in the > > > ELD update sequence that needs to call pm_runtime_get_sync()? The ELD > > > sequence on AMD GPUs doesn't work the same as on other vendors. The > > > GPU driver has a backdoor into the HDA device's verbs to set update > > > the audio state rather than doing it via an ELD buffer update. We > > > still update the ELD buffer for consistency. Maybe when the GPU > > > driver sets the audio state at monitor detection time that triggers an > > > interrupt or something on the HDA side which races with the CPU and > > > the power down of the GPU. That still seems unlikely though since the > > > runtime pm on the GPU side defaults to a 5 second suspend timer. > > > > I'm not sure whether it's the race between runtime suspend of GPU vs > > runtime resume of audio. My wild guess is rather that it's the timing > > GPU notifies to the audio; then the audio driver notifies to > > user-space and user-space opens the stream, which in turn invokes the > > runtime resume of GPU. But in GPU side, it's still under processing, > > so it proceeds before the GPU finishes its initialization job. > > > > Nicholas, could you try the patch below and see whether the problem > > still appears? The patch artificially delays the notification and ELD > > update for 300msec. If this works, it means the timing problem. > The bug still occurred after applying the patch. > > But you were absolutely correct - it just needed to be increased to > 3000ms - then the bug stopped. Interesting. 3 seconds are too long, but I guess 1 second would work as well? In anyway, the success with a long delay means that the sound setup after the full runtime resume of GPU seems working. > Now the question is, what do we do now that we know this? > > Also, are you still interested in the contents of the ELD# files? I can > dump them all into a file at some specific moment in time which you > request, if needed. Yes, please take the snapshot before plugging, right after plugging and right after enabling. I'm not sure whether your monitor supports the audio, and ELD contents should show that, at least. thanks, Takashi