Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp328242yba; Thu, 18 Apr 2019 01:52:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMgkn3oijJLygt/bsWOLMpxU6eLjz8pO4Uq+7pun1FhrA/prYmoSxL7Sk5Pd6anb0+FT1q X-Received: by 2002:a17:902:382:: with SMTP id d2mr33340815pld.253.1555577523444; Thu, 18 Apr 2019 01:52:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555577523; cv=none; d=google.com; s=arc-20160816; b=H6nBn1Qfjjn2i5OWOYiZ3XdxneE5B1wWwUsBQRTYahItfxITNvQ0PiIhuLbYppPwI0 vOA7z+BTR0J1r+F6r7Y0royOs7kMZO559vPQOkbbtUk5p2z9e+c3Z2j6/MH2+ox6Abu7 CSZM3ibyiHV/8eSMY1gfOiL183XAcXkGrb52hE40RSdN+CwovukypTK/oUd+puVbfxxb A5Be+sN2rA4FIx0KqLRVgYfHXh9R1KnYVw0XyFdhIaKlMvY+4+oTTPW6HhlhI2HioJV/ UtC4zytvLLy3VHh5rA212TgS++pkqCn7aao+douarIWW0OvVDlutrcyjmKY57jnDGOOn xY3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=oDH8Gs9gOI6Nt3wZaAXnUE98uF9FNVdZ2DMPgSDXiJk=; b=sfFz4jYHdjHF1vbDLbT0UjXzexEcee+3Fkq0Pkhl+oFdVRi8ZnivxoEpFc5sJReXoR 5c69Z7zsr0BiezeZvjjmQl8znt7aA20nNmuG/52XxKD7Nqe37DDlERazY0rNtbvLLn6u B4ULO8FqiyV11KXF4YsvAhsL6tS8PhTJw45zcBe7jSBd607wPsZEKvnIlp8rq5arDo2+ 4gT2wLT9RqKzp7pjI3gtlBMRHFg/WpP9DbUwD0/6qyjLqk9ccHh7FvFjN8PISuBaIGD+ 3doXW71+79rl2xwR7vz2CfqFgNfPe10U1hnvtTIuFZgi3TNfpeGITyGALSn0WAokxwwq mJhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=B82lOyt4; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x2si1317324pgh.231.2019.04.18.01.51.48; Thu, 18 Apr 2019 01:52:03 -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=pass header.i=@nxp.com header.s=selector1 header.b=B82lOyt4; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388263AbfDRIux (ORCPT + 99 others); Thu, 18 Apr 2019 04:50:53 -0400 Received: from mail-eopbgr00060.outbound.protection.outlook.com ([40.107.0.60]:26607 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728074AbfDRIux (ORCPT ); Thu, 18 Apr 2019 04:50:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oDH8Gs9gOI6Nt3wZaAXnUE98uF9FNVdZ2DMPgSDXiJk=; b=B82lOyt4rFgDQuakCtiMFvTVE1f5JHMwBMa+V1Xy/OKEkGyCruAldKQ90uzpCgK/QIsqNUZeOWTzrFcmWSavTZwZ7vt0DBlXb1mfBBN3OnwFNa0q2ycK8NpE+lOmQC0dPcIwZuSNvfiKY4PsvchKvMlcgxx33tdNj5klh2mCgao= Received: from VE1PR04MB6479.eurprd04.prod.outlook.com (20.179.233.80) by VE1PR04MB6717.eurprd04.prod.outlook.com (20.179.235.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1813.12; Thu, 18 Apr 2019 08:50:49 +0000 Received: from VE1PR04MB6479.eurprd04.prod.outlook.com ([fe80::6c03:86ad:729d:e311]) by VE1PR04MB6479.eurprd04.prod.outlook.com ([fe80::6c03:86ad:729d:e311%7]) with mapi id 15.20.1813.013; Thu, 18 Apr 2019 08:50:49 +0000 From: "S.j. Wang" To: Nicolin Chen CC: "timur@kernel.org" , "Xiubo.Lee@gmail.com" , "festevam@gmail.com" , "broonie@kernel.org" , "alsa-devel@alsa-project.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH V3 1/2] ASoC: fsl_asrc: replace the process_option table with function Thread-Topic: [PATCH V3 1/2] ASoC: fsl_asrc: replace the process_option table with function Thread-Index: AdT1wt4f0LfTMAkAQai/jI2p7SWJLw== Date: Thu, 18 Apr 2019 08:50:48 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shengjiu.wang@nxp.com; x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 081fec1e-0255-40e5-2686-08d6c3daf470 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020);SRVR:VE1PR04MB6717; x-ms-traffictypediagnostic: VE1PR04MB6717: x-microsoft-antispam-prvs: x-forefront-prvs: 0011612A55 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(136003)(39860400002)(376002)(346002)(396003)(189003)(199004)(51444003)(55016002)(9686003)(53936002)(68736007)(1411001)(476003)(486006)(186003)(6916009)(97736004)(54906003)(99286004)(7696005)(6436002)(316002)(2906002)(3846002)(6116002)(33656002)(86362001)(102836004)(6506007)(26005)(81166006)(8936002)(81156014)(8676002)(229853002)(4326008)(5660300002)(66066001)(52536014)(305945005)(14444005)(74316002)(478600001)(25786009)(7736002)(14454004)(256004)(71200400001)(71190400001)(6246003);DIR:OUT;SFP:1101;SCL:1;SRVR:VE1PR04MB6717;H:VE1PR04MB6479.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: LZOk+NPwfNw5giji0Rstr12bzxoDrqDfFRE2vHjppUSx4llq/zsim0YpkhMthMRmVFR5qbvLGutHhS6HlZH+8FKAJecxww5hb62uQ71N+guf8MxNQl95LJw0js385uDf2on0toMsHVtmsSf5YGYl7JwDaXIssorwho9yz25n6RBPXTH76lUFMqkhz4JQihLjspmEX5FiU24S6mB46T/BqQUJfBMMD95aep1ZetFWRsq1pFzl0TQ4oea59X+ASm4ayK2WUlufrxqtocRyHBYyH+xA5NRK8YUzgt9toJ+pxZm4KzB8OF8aR4dkMcQi2cjUgG5+4MSfV3LIHcZWWObAK1ap0YxZWDEFEZygopykccNfRuM9StZvjHnhAHX+pzC/7hamHU7ub+v72kNE0C4yZjipMobH9XI78MetiibYEwU= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 081fec1e-0255-40e5-2686-08d6c3daf470 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2019 08:50:48.9570 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6717 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi >=20 >=20 > On Thu, Apr 18, 2019 at 02:37:03AM +0000, S.j. Wang wrote: > > > Here: > > > > + /* Does not support cases: Tsout > 8.125 * Tsin */ > > > > + if (inrate * 8 > 65 * outrate) >=20 > Though it might not matter any more (see my last comments), it should be > "inrate > 8.125 * outrate" in the comments. >=20 > > > > + return -EINVAL; > > > And here: > > > > + ret =3D fsl_asrc_sel_proc(inrate, outrate, &pre_proc, &post_p= roc); > > > > + if (ret) { > > > > + pair_err("No supported pre-processing options\n"); > > > > + return ret; > > > > + } > > > > > > Instead of a general message, I was thinking of a more specific one > > > by telling users that the ratio between the two rates isn't > > > supported -- something similar to what I suggested previously: > > > > > > pair_err("Does not support %d (input) > 8.125 * %d (output)\n= ", > > > outrate, inrate); > > > >=20 > > In fsl_asrc_sel_proc, we can't call the pair_err for there is no > > struct fsl_asrc_pair *pair in the argument. Do you think we need to > > add this argument? >=20 > I's thinking of adding it to the top of fsl_asrc_config_pair() as a part = of > inrate-outrate-validation, however, I found that actually we already have= a > similar check in the early routine: > if ((outrate > 8000 && outrate < 30000) && > (outrate/inrate > 24 || inrate/outrate > 8)) { > pair_err("exceed supported ratio range [1/24, 8] for \ > inrate/outrate: %d/%d\n", inrate, outrate); > return -EINVAL; > } >=20 > And this is according to IMX6DQRM: > Limited support for the case when output sampling rates is > between 8kHz and 30kHz. The limitation is the supported ratio > (Fsin/Fsout) range as between 1/24 to 8 >=20 > This should cover your 8.125 condition already, even if having an outrate > range between [8KHz, 30KHz] check, since an outrate above 30KHz will not > have an inrate bigger than 8.125 times of it, given the maximum input rat= e > is 192KHz. >=20 > So I think that we can just drop that 8.125 condition from your change an= d > there's no need to error out any more. >=20 No, if outrate=3D8kHz, inrate > 88.2kHz, these cases are not supported.=20 This is not covered by if ((outrate > 8000 && outrate < 30000) && (outrate/inrate > 24 || inrate/outrate > 8)) { > However, we do need a patch to fix a potential rounding issue: > - (outrate/inrate > 24 || inrate/outrate > 8)) { > + (outrate > 24 * inrate || inrate > 8 * outrate)) { >=20 > Should fix the missing whitespace also. And it will be needed to send to > stable kernel too. Will you help submit a change? >=20 > Thanks