Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2705559rwo; Thu, 3 Aug 2023 13:39:50 -0700 (PDT) X-Google-Smtp-Source: APBJJlEJNoC8V76ZCWWuO3lMxS34k+BHYV52zVXtu9ptBGTaBPjoHw94zXBL1SifOesTmWi9uZgE X-Received: by 2002:a05:6a00:148b:b0:67b:2eba:bed4 with SMTP id v11-20020a056a00148b00b0067b2ebabed4mr26517182pfu.14.1691095189872; Thu, 03 Aug 2023 13:39:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691095189; cv=none; d=google.com; s=arc-20160816; b=tLY6CZw3sADc6F/Mg3n8xKIe1sS9nRjV/6Mv6mdp7AWNRVJb7NLNQrRY+Bc+qB1WQc RbaxfMtzWsfxGi8DXZEOKVxlaIPB6nJQcQrHPssFxKaRs0ZeG/9FB6LveHOw8G/nVp2q 3QiGbZlQcq390pKa8SUKIv7uc9REDPF/7ImBIQSsuSjIaAkq6zGLypSJEPP2JmO5Ie5k FsWhTXSm9EHpdgVC+UbMzE1OGfWwYqPpKEzrmUId+iqpyG4xGYmaoLR750d2txi7KwMc 3laEVnoxyGwXOfYfNgJDe+CGcrdSUT9axEFxKNTak/B4HXx04oYtzCPZqcxEGiHXmZNq mQcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to :dkim-signature:from; bh=P0M+BMtHtIHMTuHkmOp7SS8Q1e715kFf0lQ1SHEGD/A=; fh=AhUuUwGtN7iwrEy0NoMtqmi/7XPLQFcvFYXaeTxst+E=; b=XboZhM/glyvVVzkVfTwvUmQNlT/NtFf2JZO9H3k8Y+k/nFES42wGhkcnUVQb7VfBeL jZhc+bSCFMwogKQJKl3nGSLi7/KIfbvDyvb/rh6zfiIslFG/ro4ex+BHM8zCotPBajWm 9zCcSivN8QYfKL7urf2xE1+mxU3UhwXfLvDt/SskQ9jviRg+IMbFOqz+dFDP8WYFvfz0 a8pq2CRT+PReghqlOq9pIqcbYQNk90yQ/gvkFa8TwpmItPB83iYmDNZm2r4iDzsD18hT uggpRCqGwcxrDlI93NF5toBytmNookZgkPlVtkI1qtPpGMzlLfVcQDGTNp98bC8WsI4C KBXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mutex.one header.s=default header.b=DeJRxVk1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f22-20020a63dc56000000b0055b7171f86asi577137pgj.185.2023.08.03.13.39.36; Thu, 03 Aug 2023 13:39:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mutex.one header.s=default header.b=DeJRxVk1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231553AbjHCT6D (ORCPT + 99 others); Thu, 3 Aug 2023 15:58:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231593AbjHCT5z (ORCPT ); Thu, 3 Aug 2023 15:57:55 -0400 X-Greylist: delayed 1218 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 03 Aug 2023 12:57:51 PDT Received: from mail.mutex.one (mail.mutex.one [62.77.152.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC8E3420F for ; Thu, 3 Aug 2023 12:57:51 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.mutex.one (Postfix) with ESMTP id 6A3EE16C004D; Thu, 3 Aug 2023 22:37:31 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at mail.mutex.one Received: from mail.mutex.one ([127.0.0.1]) by localhost (mail.mutex.one [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UkDLHQPYQ4Tw; Thu, 3 Aug 2023 22:37:30 +0300 (EEST) From: Marian Postevca DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mutex.one; s=default; t=1691091450; bh=P0M+BMtHtIHMTuHkmOp7SS8Q1e715kFf0lQ1SHEGD/A=; h=From:To:Cc:Subject:Date:From; b=DeJRxVk1ZC1H6H36SbSolINpFMff0D0HNnOJOnV7f77SvoX+rdzSvN3Fjt49cXuVi lLA0fOSEYKKHoudZdYDTKy5343qvDRS4eqLjgyoP6N6E4G00cISMVV9gBmzF/57s64 1pEbpn9nRl+AxkIXxCAbUNwe6r4iQA0S2AiClGFE= To: Syed Saba Kareem Cc: , , , , , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Yang Yingliang , Venkata Prasad Potturu , V sujith kumar Reddy , ye xingchen , Subject: Regression apparently caused by commit 088a40980efbc2c449b72f0f2c7ebd82f71d08e2 "ASoC: amd: acp: add pm ops support for acp pci driver" Date: Thu, 03 Aug 2023 22:22:07 +0300 Message-ID: <87a5v8szhc.fsf@mutex.one> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I'm trying to develop a sound machine driver based on the acp legacy driver. The first version of the driver was sent for review on the alsa mailing list this spring: https://lore.kernel.org/all/20230320203519.20137-1-posteuca@mutex.one I'm trying to fix some of the issues that were brought up during the review back then, but when I ported the patches to the latest commit on the for-next branch, I noticed a regression where I couldn't hear any sound at all. So I started a bisect session and found that the first bad commit is: ASoC: amd: acp: add pm ops support for acp pci driver commit 088a40980efbc2c449b72f0f2c7ebd82f71d08e2 https://lore.kernel.org/lkml/20230622152406.3709231-11-Syed.SabaKareem@amd.com If I revert this commit sound works as expected. So I started tinkering a little bit with it and I believe that what happens is that the acp pci driver enters the autosuspend state and never leaves this state at all. I noticed this because if I increase the autosuspend delay to a much larger value, then the sound works until that delay passes. I added traces and I can see that when the delay expires the suspend callback snd_acp_suspend() gets called, but the resume callback snd_acp_resume() never gets called. I'm no expert in runtime power management (though I did read a bit on it), so I don't understand all the things that happen underneath, but one thing that is not clear to me is who's supposed to mark activity on this device and keep it from entering autosuspend if the user wants to play some sound? Shouldn't there be some counterpart that calls pm_runtime_mark_last_busy() ? I looked through the code and can't find who's calling pm_runtime_mark_last_busy(). Some help here would be welcome. Is there something missing in my machine driver code, or is the runtime pm handling in acp pci driver wrong?