Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3046019pxb; Tue, 12 Jan 2021 05:10:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxMa70MygmlWb9ePX1CdfwWUBXxDWMy3zfwr4J++ZrKBZPjmszUtHRmxy3FULzDPjuJzIpF X-Received: by 2002:a17:907:1009:: with SMTP id ox9mr3227156ejb.37.1610457008902; Tue, 12 Jan 2021 05:10:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610457008; cv=none; d=google.com; s=arc-20160816; b=XFguC6FH1LHcwWoTDiEHoD6wXrvGRcSy9QhaIkhLpgQK2C9bvq2vuHOlAkGcRb+WlO btsLef3zvxQ6HxeqnVlVkSHbhpeXTiQAMuHbWGoWOhM6KiP8eNrx9t5JWSOkfTNhFhTC uOmI8hrhEHxnCLa8SItYAo0ynorRojNyQ43/Cn6KcjVjhqgzoTAMfKyxba8f0kJjXA/A /SQCh7D5VpcAnP5HBMYar/psdescVcrcMGN2FBX7T+xNXQA9eI3BtvLmAUf5ktluOFg1 ik6pIhow2uX2AhmkKA1iCqMLb0UaZM5MMO6hf871BmwuthgL4kaskfx8PqdHHr71ipiq /PtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=vmNMz4c82U9fhl38EDcfbIBTFdzOpA4YaurmgZ3FP8E=; b=UE/gmlqdBft/gbu/LL216iddoePcY4tjrPM+vp0VypB2nDXWpu/hZ4MQjVwK0ERMY0 HYa0boumGjyjUHCrxBf7Gi9liRkKOBUyfJS4qAPamfx9X27OzewGxBHd5rj3Lzf2cYS6 f4VGAQQex18czm4j3kWjN9cRGP6fneEHSSoa8c/E7xGdDMdBaGn+5aMhpESzykO11oM1 N0b7Z7Z1feRq1pGnQ4kaGE3QeQSU52VWQMYH7jGxXexHUNJeO93d+5RxxzkpI3Dncbi4 QFOAT9KvOZBnNtxWy6wYukSRgKbRdH8pwafHqHaIWaxVswNkBLTtR1GKjfHBwNbtpA2g /2WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=llm0EnUk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id si7si1138872ejb.5.2021.01.12.05.09.43; Tue, 12 Jan 2021 05:10:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=llm0EnUk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388706AbhALM77 (ORCPT + 99 others); Tue, 12 Jan 2021 07:59:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405596AbhALM64 (ORCPT ); Tue, 12 Jan 2021 07:58:56 -0500 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0559C061786; Tue, 12 Jan 2021 04:58:15 -0800 (PST) Received: by mail-io1-xd34.google.com with SMTP id p187so3725143iod.4; Tue, 12 Jan 2021 04:58:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=vmNMz4c82U9fhl38EDcfbIBTFdzOpA4YaurmgZ3FP8E=; b=llm0EnUkhX9XjQIBTK80NWvYICcF3bAcLiD6aFyt4r6ZEs/YJ+UTRHjY9PyBEGKAgB BN1481GgjC56jqLRFRvk7rqMyIFJd+2ep0naN3uXopdHCvZV/63IanjQNz4cp8O5SsQy QSsaZtO2YpZsmQdw+08v4XgF/6v8laLk7S1li6g8GGlMhmgGo+YCzaazowoyLsZ7otX4 po05P9W+UbZldABlzAf5rIasuitM4zhIxtyPmDRyNNPna6YyaMxIiqpFpydWqCKOMuSZ 33Y203wBhp3zjuhA4nqygoBomvzsWUUVDR9xTx83aYqjI8fW8lEhNI7uKsS7fIAYO9Pg sq6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=vmNMz4c82U9fhl38EDcfbIBTFdzOpA4YaurmgZ3FP8E=; b=PJPWex4tVf1i8/hzEruFLBLkuHVVsgEoC/efuBc/69+WhIx58YZvvuElzxywJPRMLH Xp/DAz9i48ZOKrI9JhVyt0/8vgwf8kqRP91QDvKQI66bE7p3PPp2ftL+JITxywzHqisO X9Fvro/4BuORKH9UWu9JS3PiT9ZxA6iMoI0KFifcco3620IS0YgAW0kDxOHmY1XepASE 7lnZRdi5hk4b9u0aiKRQ+EKGkddBIFBznKIB9EqYnI8vxIOkbdPZronhw+sawqEJmStH r97w5DRVIjm5qdMS1KI3FDEnkWbIUmsZP7H5TTX9SWMMOJPR+6jrCuVzPDqpJPKmc03u UIJw== X-Gm-Message-State: AOAM533u+vNdbtK/B2ARJPpX/zOXQPTV25k81S8/+FQte7+ZwOQNYL+E KDQskbCLgESHsNdmgg/8CpU= X-Received: by 2002:a02:5148:: with SMTP id s69mr4167726jaa.8.1610456295322; Tue, 12 Jan 2021 04:58:15 -0800 (PST) Received: from localhost ([62.96.65.119]) by smtp.gmail.com with ESMTPSA id 64sm1967959iow.9.2021.01.12.04.58.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jan 2021 04:58:12 -0800 (PST) Date: Tue, 12 Jan 2021 13:58:10 +0100 From: Thierry Reding To: Peter Geis Cc: Michael Turquette , Stephen Boyd , Peter De Schrijver , Prashant Gaikwad , Jonathan Hunter , Jaroslav Kysela , Takashi Iwai , Sameer Pujar , Mohan Kumar , linux-clk@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, Ion Agorria Subject: Re: [PATCH v2 2/2] ALSA: hda/tegra: fix tegra-hda on tegra30 soc Message-ID: References: <20210108135913.2421585-1-pgwipeout@gmail.com> <20210108135913.2421585-3-pgwipeout@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mDB+fc3ahoOZCE0L" Content-Disposition: inline In-Reply-To: <20210108135913.2421585-3-pgwipeout@gmail.com> User-Agent: Mutt/2.0.3 (a51f058f) (2020-12-04) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --mDB+fc3ahoOZCE0L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 08, 2021 at 01:59:13PM +0000, Peter Geis wrote: > Currently hda on tegra30 fails to open a stream with an input/output erro= r. >=20 > For example: > speaker-test -Dhw:0,3 -c 2 >=20 > speaker-test 1.2.2 >=20 > Playback device is hw:0,3 > Stream parameters are 48000Hz, S16_LE, 2 channels > Using 16 octaves of pink noise > Rate set to 48000Hz (requested 48000Hz) > Buffer size range from 64 to 16384 > Period size range from 32 to 8192 > Using max buffer size 16384 > Periods =3D 4 > was set period_size =3D 4096 > was set buffer_size =3D 16384 > 0 - Front Left > Write error: -5,Input/output error > xrun_recovery failed: -5,Input/output error > Transfer failed: Input/output error >=20 > The tegra-hda device was introduced in tegra30 but only utilized in > tegra124 until recent chips. Tegra210/186 work only due to a hardware > change. For this reason it is unknown when this issue first manifested. > Discussions with the hardware team show this applies to all current tegra > chips. It has been resolved in the tegra234, which does not have hda > support at this time. >=20 > The explanation from the hardware team is this: > Below is the striping formula referenced from HD audio spec. > { ((num_channels * bits_per_sample) / number of SDOs) >=3D 8 } >=20 > The current issue is seen because Tegra HW has a problem with boundary > condition (=3D 8) for striping. The reason why it is not seen on > Tegra210/Tegra186 is because it uses max 2SDO lines. Max SDO lines is > read from GCAP register. >=20 > For the given stream (channels =3D 2, bps =3D 16); > ratio =3D (channels * bps) / NSDO =3D 32 / NSDO; >=20 > On Tegra30, ratio =3D 32/4 =3D 8 (FAIL) > On Tegra210/186, ratio =3D 32/2 =3D 16 (PASS) > On Tegra194, ratio =3D 32/4 =3D 8 (FAIL) =3D=3D> Earlier workaround = was > applied for it >=20 > If Tegra210/186 is forced to use 4SDO, it fails there as well. So the > behavior is consistent across all these chips. >=20 > Applying the fix in [1] universally resolves this issue on tegra30-hda. > Tested on the Ouya game console and the tf201 tablet. >=20 > [1] commit 60019d8c650d ("ALSA: hda/tegra: workaround playback failure on > Tegra194") >=20 > Reviewed-by: Jon Hunter > Tested-by: Ion Agorria > Signed-off-by: Peter Geis > --- > sound/pci/hda/hda_tegra.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c > index 70164d1428d4..361cf2041911 100644 > --- a/sound/pci/hda/hda_tegra.c > +++ b/sound/pci/hda/hda_tegra.c > @@ -388,7 +388,7 @@ static int hda_tegra_first_init(struct azx *chip, str= uct platform_device *pdev) > * in powers of 2, next available ratio is 16 which can be > * used as a limiting factor here. > */ > - if (of_device_is_compatible(np, "nvidia,tegra194-hda")) > + if (of_device_is_compatible(np, "nvidia,tegra30-hda")) > chip->bus.core.sdo_limit =3D 16; I think ideally this would be a SoC-specific property derived from the compatible string, but since this preexisting: Acked-by: Thierry Reding --mDB+fc3ahoOZCE0L Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAl/9nN4ACgkQ3SOs138+ s6GmtxAAuykATDSqTibSvd5j+VhWdSgAkDIuCOCRvE8LaBjMs1+GNl1z4dMFsIdX 3XrHJIfRbXQ4msYEEYClBxU0bhI3xqG6jGDXoGRga6IJIR/CZVRMMpnffPl/2igi RGacMeSM2jN5Z1KNV9w4Xr6YRMBdxGZOpq3hv/J4RZGX5QAnUwMEhhcMIeGOJH/T /R3PuVN/B4UeMynK24lZHeXSlTo8Vezw/wxVKDdonJGyTSbxxdKH/Jn2bOK5juP/ k5lebqNyDncQ50JiMj29/Eaj9UB7AUCrdD33BLbzBa00kuaYo3CsMI7jd7sa60LB iooqnIow6P0sT+t+wr7Sw2/gIxfyao+lObqMbJfpBhBKzZh8MgEBDW5W2Pc6rcjs 86iWScjgjPgVzv/SlT91vhdPb8407Bd1MvjynRuAAbwGmDkQEzgS6tFM/ZheklwI Ws3D4J9B+u0dsUHtg8GLgf/cwNj0xlG/8ackWfbxiN37au/tiPNLlJ0u3246jct2 PFGTolFMFmsjamU519JCy0FItFnImIQ+gqd9andZYryDXxKEVCpYp2AobsAkl7sA oEle3UXpSHWv0+/NeXhIkGAULrHntxMCLlxLziURDvylDpjRkc9HHva/VAfcqFM9 LEd3q8nOuk0c+nvmD0R1KpFrE5eNAWcRN3ZD4dodB2UnD1Ca7GI= =2mCN -----END PGP SIGNATURE----- --mDB+fc3ahoOZCE0L--