Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2599527rda; Wed, 25 Oct 2023 07:21:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHwal5G+8GQRJWgeq1ciWhnEUXnm6/bMllWcbeD/t849M0KCaWIjg4xlP0MlUlvcPTpLLZ5 X-Received: by 2002:a05:6870:4e0b:b0:1e9:f06f:b25 with SMTP id pl11-20020a0568704e0b00b001e9f06f0b25mr20157700oab.8.1698243673680; Wed, 25 Oct 2023 07:21:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698243673; cv=none; d=google.com; s=arc-20160816; b=0KRvphaN6603IwX5Vnq7ZGY7kodbnf4IBLV56B7R7eUaNeIEQE3+GKNqsT2fv1JFzF r4IHLn5QS6KgfEshWwg1mVBvlGa/29nzlORsF5BGIzb/JqLyuKNNTZmUKwZRskXisL5e SZkzrAYZRX/aBZmpO7qwPtTQhjBp5os9bCnDTF4S6wo90WAX4SYPC87KAh0RpVsW/P3d K9P5QJZwhD19hpvoTzcy2qw+/KNZTFd+xDLUmfs61DwIg4WDOxqcnXl59IE4dmqvtNi6 o2xnYATtObmpHFhihTxQ8DmrsyRjZgookiM82I1tS0kN7WYm6PFaH4sd7pBLd/KM2ciW V/5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=KXdFX0UY5tniJLRDcl1ufSs5c/hl+EfLWW5bDdsq8SA=; fh=LaBJfR7Ez4xqjkMm752pGXynylOCU6mXjg4Mr09Lots=; b=nQFGVkJYXs5VqWc7VwNOPdmVsfVXibQO7m1sbo9Gd2BVpLmP/QQA1GzDcqhtYa5WEx wvHNQrXciDdIiIgF6TLifryluBg7d/X0O2fls4X9xB0f+1DdlD6vnLw7NP0gLA1nERpT cyG0PPnePcLbExALUJg4anBe+D4L0AYhD/YuUs+nJnTWHYAfH0sVG5O0rDEQIMohGGEz kyDhCVMeQP+qt3v+maZT0UkdGV9UsgQzAGjgsoLxNBraVMaRBYJvu+R01B2K/5W3Oalv GoqsCc1GiEdbaFS4qCaHneKyvN73LnRNSuyKJen88LCDvXwzRj2zDRp7CyWtqAzCD6CL Ef/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WemKRxkb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id c184-20020a254ec1000000b00d9cd69c8323si11108744ybb.59.2023.10.25.07.21.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 07:21:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WemKRxkb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id B34B2807FD59; Wed, 25 Oct 2023 07:20:33 -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 S1344550AbjJYOUQ (ORCPT + 99 others); Wed, 25 Oct 2023 10:20:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232846AbjJYOUO (ORCPT ); Wed, 25 Oct 2023 10:20:14 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97BB399; Wed, 25 Oct 2023 07:20:12 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-507cee17b00so8441948e87.2; Wed, 25 Oct 2023 07:20:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698243611; x=1698848411; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=KXdFX0UY5tniJLRDcl1ufSs5c/hl+EfLWW5bDdsq8SA=; b=WemKRxkbCgLhSmp6vTOqZfbOnC1Ume8v/AP9mdV6ky5315lfssgVvsk9/O4UA3dtf5 zTIcCvlzFA8+wiB0OzCbzG3bvIkt7tVI0+jamk5iXO30Koup6w2ug0aBcV+66MFmiCpp lny0FiAseXqcw79Na2A8X8QGqr+33mt15gBcajIn+0vcFU392TlGR/Zm7NJWXuaXQSS1 DWcCVyVka/K57VbziPgYxSuLX9zYNt14X3IXKFGp2pNlF7ScGh3ze1i+xySyX6Qk6PtK 2OSb+gH8AeFs53B99+2bdBTekfB05AEBWECnrKzVHQ1RXbR/Qz+mxSeF0Oq6udHzxZJu mtAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698243611; x=1698848411; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KXdFX0UY5tniJLRDcl1ufSs5c/hl+EfLWW5bDdsq8SA=; b=R3ZlUxyD2zh+JpYOB7HMCrAqMHN75z5QCmTCnonkYz9z1Ca702MrExC77psAwRyu6a F98hLgA6uTmvYKIAtmeKyvJ1WX2kWgppmzlHMoP3Emqv1neim51vN0FAMqDU9KYfRNV6 5dIUv4BMq+94pGoQxYfdl+hedgEGgGkAxOATOuDpyV6zrtlepiL3vKWL80DMc5l+FlrG W1+Q0qVBThey78b6Vkt+Iu5LusemWg3/YyCagttIwWnCQV2nb2U0mbNAQURVrobp7vtD poitG53P4qaJCp5MlKjZPDZj6FgYHJDPCE7ZyRa+QeoF/EoDk0BcHT4+Ka+EibCWOtds Rg2w== X-Gm-Message-State: AOJu0Yy52ICEV5JT68A6Ug/MMGDEVLsQaDM5s8NKGr9mOp7z3OkX+oML OE1CjydG7GqeUiHtNb/QyKc= X-Received: by 2002:ac2:5550:0:b0:503:258f:fd1b with SMTP id l16-20020ac25550000000b00503258ffd1bmr11409838lfk.18.1698243610440; Wed, 25 Oct 2023 07:20:10 -0700 (PDT) Received: from [192.168.76.157] (85-76-164-65-nat.elisa-mobile.fi. [85.76.164.65]) by smtp.gmail.com with ESMTPSA id x13-20020ac25dcd000000b005041ce44bbdsm2568600lfq.5.2023.10.25.07.20.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Oct 2023 07:20:09 -0700 (PDT) Message-ID: Date: Wed, 25 Oct 2023 17:21:12 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] ASoC: ti: omap-mcbsp: Ignore errors for getting fck_src To: Andreas Kemnade 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 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> <20231013132503.25d63933@aktux> Content-Language: en-US From: =?UTF-8?Q?P=C3=A9ter_Ujfalusi?= In-Reply-To: <20231013132503.25d63933@aktux> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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]); Wed, 25 Oct 2023 07:20:34 -0700 (PDT) On 13/10/2023 14:25, Andreas Kemnade wrote: >> 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. To be honest I would be happier if we can just remove the whole omap2_mcbsp_set_clks_src() and leave the CLKS source selection outside of the driver. But omap3pandora is selecting external clock as parent (OMAP_MCBSP_SYSCLK_CLKS_EXT - in hw_params, so it actually works) and I don't know what happens if this functionality is removed. Likely going to break Pandora. That is fixable, but what worries me is this comment and code: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/sound/soc/ti/omap-mcbsp.c#n388 Which is added by me a long time ago: e386615c01d37 ("ASoC: omap-mcbsp: When closing the port select PRCM source for CLKS signal") I'm not sure if this is possible to do in any other way. -- Péter