Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2303959ybe; Tue, 3 Sep 2019 10:49:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqz07eGGaar6uDG9Z9sN7lMTWl6hQf12JXdGGcpHFhIIfQExRUQThFY4ZX7zxWpzzBY7Dt5W X-Received: by 2002:a63:b64:: with SMTP id a36mr32050441pgl.215.1567532956418; Tue, 03 Sep 2019 10:49:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567532956; cv=none; d=google.com; s=arc-20160816; b=w2KQGSL3pEmf1YqIk7vo/ImdOrxS8hvvnleNAm4TShzNZrx+3kMD8gT+oc8lJb7McC fektmOp0JcvSyhlxKqXqosvbcqMvCmWYC04j3GzEGPaddZtWaK9P8jiuM4TpIP9pnKGf pQKkyOaqNHMXO5EP9tE0VyJVY7Xg95Cyjwcgg5l1F46jEYEw2eOBTDXF1pcWGZIYxyHO CntRq+rfgmJOPG78Jio0wWTh6PfItgBM295ADCyVa1amWIj9uvjdR3C8PQvdYxnb/fAe aiBHd7li+jMmR3+3bmBuyd2mccQxOdYyFnYKiCIP7Ze/CzsCDezY0ECV4znAJ6VLlLWJ 1KZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Zvy0cmcCS2UqHRB6ROv3+py+lgL7vtVDSDbGP6ppS/Q=; b=0Pjvt1ea1da3A7WJ9AkHyg5tk5hrt9zJRQjH+VvAcqHHICJL1kpkK/0T17XdGY4320 U503NQOanjBN3fP+BdaAlSFFUGNDmB03SoEB8zPBC9U4gWCutCT7nIVCR0pcZ6YM2/Kc znO+B1WH5p/etQYd3G+Z5ZhqP9SxmwoG1wPeO2uoDmSHUkeZ2Nrfctzy/nFHgnEj0wOC pmLqVpr8o/95bGk8PEf8l0qm8U2hAnO02eINAKwRls9koB7G7sbyh5yl0sc3hnA8jp/b k87if0JZAOiMNNXNDNmgMCE0xB3xAJdIGT9Po/WNDLtWeV8Kgbx6tSHHAUdo0Td2tSUU eDDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=oJ1NeYUe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y7si15137577plr.408.2019.09.03.10.49.00; Tue, 03 Sep 2019 10:49:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=oJ1NeYUe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729736AbfICRsM (ORCPT + 99 others); Tue, 3 Sep 2019 13:48:12 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:48438 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727069AbfICRsL (ORCPT ); Tue, 3 Sep 2019 13:48:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Zvy0cmcCS2UqHRB6ROv3+py+lgL7vtVDSDbGP6ppS/Q=; b=oJ1NeYUe3QPF59vT/aorPVMR+ JYiFvXyF5mjFZEqRUjNCtIKJpxwQ2Fy1ty/ow3ho0KrzoqLyw7xPWsahEk8nCno2KOau9dYfA4lHr 9zKk7LlbJA+6oisS5wm8o9S8PBsvFclpl684Ji+hRyPHd5gweZvwNoMvwOGm7oxpb0tyA=; Received: from ypsilon.sirena.org.uk ([2001:470:1f1d:6b5::7]) by heliosphere.sirena.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1i5CuQ-0000uI-0y; Tue, 03 Sep 2019 17:48:02 +0000 Received: by ypsilon.sirena.org.uk (Postfix, from userid 1000) id 294862740A97; Tue, 3 Sep 2019 18:48:01 +0100 (BST) Date: Tue, 3 Sep 2019 18:48:01 +0100 From: Mark Brown To: Katsuhiro Suzuki Cc: David Yang , Daniel Drake , Hans de Goede , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/4] ASoC: es8316: judge PCM rate at later timing Message-ID: <20190903174801.GD7916@sirena.co.uk> References: <20190903165322.20791-1-katsuhiro@katsuster.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="rqzD5py0kzyFAOWN" Content-Disposition: inline In-Reply-To: <20190903165322.20791-1-katsuhiro@katsuster.net> X-Cookie: You will pass away very quickly. User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --rqzD5py0kzyFAOWN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Sep 04, 2019 at 01:53:19AM +0900, Katsuhiro Suzuki wrote: > Root cause of this strange behavior is changing constraints list at > set_sysclk timing. It seems that is too early to determine. So this > patch does not use constraints list and check PCM rate limit more > later timing at hw_params. hw_params is a bit late to impose constraints, you want them to be available to be available to the application before it gets as far as picking the parameters it wants so that you don't get hw_params failing due to an invalid configuration. That makes everything run more smoothly, applications should be able to trust the constraints they got and some will not handle failures well. The way this works with the variable MCLKs is that you end up in one of two cases (wm8731 and wm8741 do this): 1. The system is idle, MCLK is set to 0. In this case no constraints are set and we just set MCLK to whatever is required in hw_params() in the machine driver. 2. One direction is active, MCLK is set to whatever that needed. In this case startup() sets constraints derived from the MCLK. There are races in this if streams are being started and torn down simultaneously, there's not much we can do about them with the API the way it is so we do have to validate in hw_params() anyway but it should be validation not constraint imposition. If the system has a fixed MCLK it just sets that on probe then we always get the constraints applied on startup through the same code that handles case 2. --rqzD5py0kzyFAOWN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl1up1AACgkQJNaLcl1U h9BQogf+P2FPf4VyCSSMUsxKQIRYcVqySrIM/8U5LYf3W/Ti2KizQbw7G/N19kU5 Q1USsYI+BktP4bDUdRukW6qnNYp4kQTzVlhdS+JWz8s5sBDrErcKA0gOfBTDzfX2 jtM/LGASFQUhHV7i23g3FYyfmYkLR6fw6As3XI1gTWwZWpwb8L07XWZpy1YPs/ca 4m6Tnt1qb12CSzV1sclwRovoVWpwnDL7XYyTjRV3d2ywl9nyrKjke8TZP+PBKXlB n+6Q+uBSHmxKBaBOlHkymNojgXP5pNrd2Dsq/Ngf/VBMnHOEAUNh1kWlHZAhqTPq THnfPYSffJSt83BF5PwCEeRdv66pSg== =QPbn -----END PGP SIGNATURE----- --rqzD5py0kzyFAOWN--