Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1689430pxk; Tue, 1 Sep 2020 05:31:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhAooYUcORp7bq5nVim6M8MZixebt1n75tPuXG+NfPhfPZrB9kT1Hq/E0c+7Senex+rkvs X-Received: by 2002:a17:907:20a3:: with SMTP id pw3mr1329189ejb.314.1598963494752; Tue, 01 Sep 2020 05:31:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598963494; cv=none; d=google.com; s=arc-20160816; b=GxNqygOjdLGlHwprpaca54EXRmSUW6KhxByjCF5CBP7y142e26fkmZRn2HIVdSxXde GMuefTPSzjuuzcJRRiXTjdumrsZXTtH6U5hqR8QWR+4n6DzAtf8EfWSeFGEAq2Rxf5da V+/yHNco5QduAQv5rKs4BDfQlOb+o605dX3yp/frlhHkr5iosCVaDSzSsw9SvAKoRyBu FEqYtb7EeDc+S6OcpA9UpUDxiO62Khyr0MItHqCzUb92J1Sn3UbczBVTpUhMZkP01TEX NKLxETIAvy4mv8SapfT2oNb2va7/8vjB6vklnKKEDajxKMzwfK81bgO+QCM8SahR6pFP RubQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=4Pmoy0HGoWPu5i3CX6SUTWGNbRy8Dqk2zvjfkjNEhkI=; b=BXgQxZV7VkENZ/AjvchMroNOrtROkar8AD5WgsKo9xbdCdvGBjhUxCpB3D4/UpeAOB 1263bnt9MSGrY9KFlqHZFWQrweM+NFSQ/zXUN3FHtHLaKg5JVdq5YJNMPeaGCTEahLWW iFFRy8AGKWfjhMt9sIEblukhQKqe0YErtS9OeunjSKrdlRhJimy3WFJZjtON6BA70XT+ IXwGo97Bn9O3Q+JPm8jvEniUA3O98F29KsFA9+QQm75slcL7ombYJqdA068PpWWf0NRW a5p6I0vfGq3NVN+rcydOnBwFjIcH3qL2/JYpdE/7FRl7xwlkeo7r0bCZ++iUwH2JlnBs 9j2g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u59si475417edc.226.2020.09.01.05.31.10; Tue, 01 Sep 2020 05:31:34 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728115AbgIAM3z (ORCPT + 99 others); Tue, 1 Sep 2020 08:29:55 -0400 Received: from foss.arm.com ([217.140.110.172]:41118 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727906AbgIAMZK (ORCPT ); Tue, 1 Sep 2020 08:25:10 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 671891FB; Tue, 1 Sep 2020 05:25:07 -0700 (PDT) Received: from [10.57.40.122] (unknown [10.57.40.122]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5D0D03F68F; Tue, 1 Sep 2020 05:25:06 -0700 (PDT) Subject: Re: [PATCH v2] arm64: dts: rockchip: enable HDMI sound nodes for rk3328-rock64 To: Katsuhiro Suzuki , Heiko Stuebner Cc: linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20200802154231.2639186-1-katsuhiro@katsuster.net> <7880329.2VsnZ9RgxX@phil> <0e1c3467-0ba0-6b82-4227-40959f0c4b0e@katsuster.net> From: Robin Murphy Message-ID: Date: Tue, 1 Sep 2020 13:25:04 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <0e1c3467-0ba0-6b82-4227-40959f0c4b0e@katsuster.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-08-31 02:26, Katsuhiro Suzuki wrote: > On 2020/08/31 4:16, Heiko Stuebner wrote: >> Hi, >> >> Am Sonntag, 2. August 2020, 17:42:31 CEST schrieb Katsuhiro Suzuki: >>> This patch enables HDMI sound (I2S0) and Analog sound (I2S1) which >>> are defined in rk3328.dtsi, and replace SPDIF nodes. >>> >>> We can use SPDIF pass-through with suitable ALSA settings and on >>> mpv or other media players. >>>    - Settings: >>> https://github.com/LibreELEC/LibreELEC.tv/blob/master/projects/Rockchip/filesystem/usr/share/alsa/cards/SPDIF.conf >>> >>>    - Ex.: mpv foo.ac3 --audio-spdif=ac3 >>> --audio-device='alsa/SPDIF.pcm.iec958.0:SPDIF' >>> >>> [Why use simple-audio-card for SPDIF?] >>> >>> For newly adding nodes, ASoC guys recommend to use audio-graph-card. >>> But all other sound nodes for rk3328 have already been defined by >>> simple-audio-card. In this time, I chose for consistent sound nodes. >>> >>> [DMA allocation problem] >>> >>> After this patch is applied, UART2 will fail to allocate DMA resources >>> but UART driver can work fine without DMA. >>> >>> This error is related to the DMAC of rk3328 (pl330 or compatible). >>> DMAC connected to 16 DMA sources. Each sources have ID number that is >>> called 'Req number' in rk3328 TRM. After this patch is applied total 7 >>> of DMA sources will be activated as follows: >>> >>> | Req number | Source | Required  | >>> |            |        | channels  | >>> |------------+--------+-----------| >>> |  8,  9     | SPI0   | 2ch       | >>> | 11, 12     | I2S0   | 2ch       | >>> | 14, 15     | I2S1   | 2ch       | >>> |     10     | SPDIF  | 1ch       | >>> |------------+--------+-----------| >>> |            | Total  | 7ch       | >>> |------------+--------+-----------| >>> |  6,  7     | UART2  | 2ch       | -> cannot get DMA channels >>> >>> Due to rk3328 DMAC specification we can use max 8 channels at same >>> time. If SPI0/I2S0/I2S1/SPDIF will be activated by this patch, >>> required DMAC channels reach to 7. So the last two channels (for >>> UART2) cannot get DMA resources. >> >> Wouldn't the dma allocation depend on the probe ordering? >> Or is this predetermined, so that always uart2 looses its dmas? >> > > Ah, it's depends on probe ordering when users use kernel modules... > > It's better to disable DMA channels for UART2 for avoiding problem. > I'll fix and resend patch. FWIW it seems that since 089b6d365491, DMA is effectively disabled for UART2 anyway (unless the user goes out of their way to repurpose it), so maybe this is no longer such an immediate concern? Robin.