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 X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8ED29C4724C for ; Thu, 30 Apr 2020 17:02:18 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 171A920661 for ; Thu, 30 Apr 2020 17:02:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="K0QibOBV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 171A920661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org 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 7461D1671; Thu, 30 Apr 2020 19:01:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7461D1671 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1588266136; bh=FnyYQIEpNHRv2m8J83uwrLHLuKfWbP/m/mjXX4yMG6Q=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=K0QibOBVg/lqTv2IZ/CrznZ0TeiisW9Pq/VwOYXZr2GBCedN1XDB2SJZmXvIis9Gz TINQSXCzwz0qLCABO2GuNcu3v7nRo1zA4LfCVmS1FlKyHELoDDgvaSyLIncZPDE8/f UC+NbTuIoWICl2GtWF1fMn+dd8iLlnh4M2rDW/rA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id EBCAFF80123; Thu, 30 Apr 2020 19:01:25 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3707FF801DB; Thu, 30 Apr 2020 19:01:24 +0200 (CEST) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B4C90F80123 for ; Thu, 30 Apr 2020 19:01:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B4C90F80123 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 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 Cc: "Zhou, David\(ChunMing\)" , "alsa-devel@alsa-project.org" , "linux-kernel@vger.kernel.org" , "amd-gfx@lists.freedesktop.org" , Takashi Iwai , "Deucher, Alexander" , Lukas Wunner , Alex Deucher , "Koenig, Christian" 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 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