Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp886271rdg; Fri, 13 Oct 2023 04:25:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbeU0lakLAH22eazctBD0S64PPU8haZ70LI09CTi51f7eD1NftNSZXuJlZswxmLbvqwpoI X-Received: by 2002:a05:6808:1694:b0:3a8:791d:9ce5 with SMTP id bb20-20020a056808169400b003a8791d9ce5mr31837563oib.19.1697196335600; Fri, 13 Oct 2023 04:25:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697196335; cv=none; d=google.com; s=arc-20160816; b=H+Uy4OEoZhRIpbjLHvu5EPRq2i5SWfhs24CVip4Z47w5mGzJ84UXhSLu+hvS9DpxJe KGhI+vHVarym89ZGxHebAxFGp7fLpO6EmLx3JTbR0n+LUGEvk+SFhchBrbXfv/jtuaxB 2l/uIHLZU8IA3DJBVSBATp0bEz9QWCHIdtk8wlzyKAOrhYc3HoeUVgNdV6VDIcAmqbtZ r6lFJ0TSN7SpO1l4d8M4yXgpO/qQpEIoqGAcWIBAnB+qAgg9HC63PeqpxyPlDcARxFX5 fL2btuQP/qguZ8WymBe8QzAxoVKtDQpYhEzl3zkzzKJcw0I5Tgu2Iu/67agh1WpNlwHO 1Ygg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=mAGFH/+/8TIGwjew4b7LlRMn8pFrmHpP4AO/YdOX27Y=; fh=AsaKMoF8BDDeWSK+7OCvdUU9vflGMMc8oofrJaL0r1w=; b=XNpsO9R+VP3hQvtOEWRMvCtn4R3xBt8XhU2Z/8TeDA6qpBu11CFOWibWaHMg5Xrw8h INPEEY1Lxxhujm5rnkaC/hO9uha7re3ukwhnuBkgRMQdPYIwjyCwyEQ6W2C2jQfHcIG4 xL9vSwVSG/hLGAH0R9D3Ys7/8Sh4Qa09lqIeZfufVTKfvyKmjbRtBz6hkA3wvWb2Z+8o Q8RCEQeiTATjNSVFFeyYQ9VZ34LlY46100i2VJRV2wGpirz2qGQSDGVHiL7b9rLBQAfB aqb9UUg908jw63KEqZfygZ0CytBKgZ44sWH5foIp+6pSahyf3i4956n/IYT1ZA7WPKHx 34xg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id 26-20020a63195a000000b00565e386ff44si4269517pgz.702.2023.10.13.04.25.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 04:25:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id E330781F3932; Fri, 13 Oct 2023 04:25:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229921AbjJMLZT convert rfc822-to-8bit (ORCPT + 99 others); Fri, 13 Oct 2023 07:25:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229704AbjJMLZS (ORCPT ); Fri, 13 Oct 2023 07:25:18 -0400 Received: from mail.andi.de1.cc (unknown [IPv6:2a02:c205:3004:2154::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E76691; Fri, 13 Oct 2023 04:25:16 -0700 (PDT) Received: from p5dc58bc7.dip0.t-ipconnect.de ([93.197.139.199] helo=aktux) by mail.andi.de1.cc with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qrGHx-004ueB-FE; Fri, 13 Oct 2023 13:25:05 +0200 Date: Fri, 13 Oct 2023 13:25:03 +0200 From: Andreas Kemnade To: =?UTF-8?B?UMOpdGVy?= Ujfalusi Cc: Tony Lindgren , bcousson@baylibre.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, jarkko.nikula@bitmer.com, dmitry.torokhov@gmail.com, linux-omap@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: Re: [PATCH 1/3] ASoC: ti: omap-mcbsp: Ignore errors for getting fck_src Message-ID: <20231013132503.25d63933@aktux> In-Reply-To: References: <20230705190324.355282-1-andreas@kemnade.info> <20230705190324.355282-2-andreas@kemnade.info> <7d58d52d-2087-45af-b29e-2515b63ead13@gmail.com> <20230920063353.GQ5285@atomide.com> <20230921121626.GT5285@atomide.com> <20231006102348.GK34982@atomide.com> <20231006213003.0fbac87a@aktux> <20231007062518.GM34982@atomide.com> <20231007091156.588d7ba1@aktux> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 13 Oct 2023 04:25:32 -0700 (PDT) On Thu, 12 Oct 2023 17:41:34 +0300 Péter Ujfalusi wrote: > On 07/10/2023 10:11, Andreas Kemnade wrote: > >> OK good to hear it works, I'll send out fixes for omap4 and 5, seems > >> the runtime PM warning is something different. > >> > >>> omap-mcbsp 40124000.mcbsp: Runtime PM usage count underflow! > >>> # cat /sys/bus/platform/devices/40124000.mcbsp/power/runtime_status > >>> active > >>> > >>> even with no sound. > >> > > Well, it is a regression caused by your fix. Without it (and not reverting > > the already applied ignore patch), runtime is properly suspended. Don't know > > why yet. > > I guess it is because of the pm_runtime_put_sync() in the > omap2_mcbsp_set_clks_src() around the fclk re-parenting. > That is a bit dubious thing for sure. We need to disable the device to > be able to re-parent the fclk but if we disable the device it is going > to be powered down, right? I think we have appropriate context handling, > so it might work, but it is certainly not a rock solid code... If you > have a stream running already, you don't really want to kill the McBSP. > Ok, so if the device is powered of at omap2_mcbsp_set_clks_src() we get the usage count underflow, and the counter is incremented immediately again in the runtime put function. So things get out of balance... I'll check Tony's fix here. > The problem is that this mux is outside of the McBSP IP, so we need a > system level (iow, clk API) way to change it runtime. > > What is the machine driver where this happens? If you set the sysclk in > hw_params of the machine driver, it will be OK, but if you do that in > probe time then it is likely going to fail as you experienced > As you see in the other patches of this series, it is a simple-audio-card with a tlv320aic3x codec in combination with the mcbsp. Regards, Andreas