From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40B38C433EF for ; Sat, 16 Oct 2021 15:51:35 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1169D61027 for ; Sat, 16 Oct 2021 15:51:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1169D61027 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 40CC017D5; Sat, 16 Oct 2021 17:50:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 40CC017D5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1634399492; bh=nt8SLksBvMwsI1uJpLhRXVo72AmQPuul/KbHjb+HJkw=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=BEBew34kbTZmtDU2OzaTuAZQ+61OuSbNIsIjqF1kh1Mdbka26jifNwOtlQNeXb6HP obn2UXLC2ouAcPIAj09cXkJd4CQURAKtbpv4ZY6nXMLjUGHnxXoXc4T1yaMWDuEd+I /33sFTaHSXKXQlVXpb2cTHUChmYvV6dtAotvz5Lg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D5DE0F801F7; Sat, 16 Oct 2021 17:50:41 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 99433F80212; Sat, 16 Oct 2021 17:50:39 +0200 (CEST) Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 84640F80167 for ; Sat, 16 Oct 2021 17:50:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 84640F80167 Received: from p508fce7c.dip0.t-ipconnect.de ([80.143.206.124] helo=phil.localnet) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mblx1-0007WI-5i; Sat, 16 Oct 2021 17:50:23 +0200 From: Heiko Stuebner To: Nicolas Frattaroli , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Philipp Zabel , Nicolas Frattaroli Subject: Re: [PATCH 1/4] ASoC: rockchip: i2s-tdm: Strip out direct CRU use Date: Sat, 16 Oct 2021 17:50:22 +0200 Message-ID: <1782571.1Dz21PRzoM@phil> In-Reply-To: <20211016105354.116513-2-frattaroli.nicolas@gmail.com> References: <20211016105354.116513-1-frattaroli.nicolas@gmail.com> <20211016105354.116513-2-frattaroli.nicolas@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: linux-rockchip@lists.infradead.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Am Samstag, 16. Oktober 2021, 12:53:50 CEST schrieb Nicolas Frattaroli: > In cases where both rx and tx lrck are synced to the same source, > the resets for rx and tx need to be triggered simultaneously, > according to the downstream driver. > > As there is no reset API to atomically bulk (de)assert two resets > at once, what the driver did was implement half a reset controller > specific to Rockchip, which tried to write the registers for the > resets within one write ideally or several writes within an irqsave > section. > > This of course violates abstractions quite badly. The driver should > not write to the CRU's registers directly. > > In practice, for the cases I tested the driver with, which is audio > playback, replacing the synchronised asserts with just individual > ones does not seem to make any difference. > > If it turns out that this breaks something in the future, it should > be fixed through the specification and implementation of an atomic > bulk reset API, not with a CRU hack. > > Signed-off-by: Nicolas Frattaroli Reviewed-by: Heiko Stuebner From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 012C2C433F5 for ; Sat, 16 Oct 2021 15:50:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 750CF60F70 for ; Sat, 16 Oct 2021 15:50:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 750CF60F70 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hJbSXIcEQb1aQfLLvnbMmiphcRfmDwtfvsilEWK+gD4=; b=pZ0GHH5eOPqfpr V4qgPR535XB+MI5JK8kSduC+8cg1NfgG1r2eN6ecvoZVIv1RVyKgkjW+m1VWXQ55JDLDBWWoLlcFU kY92LlMIUAsstk62w5SsyOOfUgnOlp0KYJ1fAjbiq2jF1kzQwUKj6iwNrXck8m26CTmQ3Ic135LNk nFsfZFXTTi5LcVC16SDLBt4xlALpdlU+UT+b161YMIih+kwGIETQfnNYYDg/EacQ9d4OHnKo3+7nH ucQbfSEsCxbRHBZRLVfjoL6nT59iwmhd9+5vLLhJvdawMYlP1qtqhPp6sz5TSiFpObA0Lq4w9xYrD 140C0O63tP5xGE3x5nAw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mblxG-00AuN7-9I; Sat, 16 Oct 2021 15:50:38 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mblxD-00AuMR-Lw; Sat, 16 Oct 2021 15:50:36 +0000 Received: from p508fce7c.dip0.t-ipconnect.de ([80.143.206.124] helo=phil.localnet) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mblx1-0007WI-5i; Sat, 16 Oct 2021 17:50:23 +0200 From: Heiko Stuebner To: Nicolas Frattaroli , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Philipp Zabel , Nicolas Frattaroli Cc: linux-rockchip@lists.infradead.org, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/4] ASoC: rockchip: i2s-tdm: Strip out direct CRU use Date: Sat, 16 Oct 2021 17:50:22 +0200 Message-ID: <1782571.1Dz21PRzoM@phil> In-Reply-To: <20211016105354.116513-2-frattaroli.nicolas@gmail.com> References: <20211016105354.116513-1-frattaroli.nicolas@gmail.com> <20211016105354.116513-2-frattaroli.nicolas@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211016_085035_752827_AF22258D X-CRM114-Status: GOOD ( 19.98 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Am Samstag, 16. Oktober 2021, 12:53:50 CEST schrieb Nicolas Frattaroli: > In cases where both rx and tx lrck are synced to the same source, > the resets for rx and tx need to be triggered simultaneously, > according to the downstream driver. > > As there is no reset API to atomically bulk (de)assert two resets > at once, what the driver did was implement half a reset controller > specific to Rockchip, which tried to write the registers for the > resets within one write ideally or several writes within an irqsave > section. > > This of course violates abstractions quite badly. The driver should > not write to the CRU's registers directly. > > In practice, for the cases I tested the driver with, which is audio > playback, replacing the synchronised asserts with just individual > ones does not seem to make any difference. > > If it turns out that this breaks something in the future, it should > be fixed through the specification and implementation of an atomic > bulk reset API, not with a CRU hack. > > Signed-off-by: Nicolas Frattaroli Reviewed-by: Heiko Stuebner _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54A0DC433FE for ; Sat, 16 Oct 2021 15:51:44 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E0EF36101D for ; Sat, 16 Oct 2021 15:51:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E0EF36101D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8BLbTRJN1dbP4LefIQvNWp0arRakGque5UBGWvmTcR8=; b=pa0hW0ahdpAcsA B7kxlw7KBFAxHcLbrKi14GNsOD/vx9+UsiGCWD2OxbYlaPtcwAopiLLhiDntkqY/4M3kQt2xN8JrW M59yn7CPMDEeMuuge6Cfuxi9PSQ2fcEuxC5MAf4HYtVnf4o5ipQ9CJkCvq2TQTwnswBGvzD2Z5ZIS 77fw/d8lx25DlN4NDg6d7Hp++miWHSNACq7Kb3RInIBQF3TNWlSdRqtavcKrUoRaFrD48At8emW5W jt3DP5dqJmINqM8rNiJEUIYSP2T21icFFLtmfue1Dc1+HaOsnR+KXyR4X6DbZg85HYxxFdS6u0d4a lf4GK5uA0JiEDMJN84Zw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mblxH-00AuNH-TX; Sat, 16 Oct 2021 15:50:40 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mblxD-00AuMR-Lw; Sat, 16 Oct 2021 15:50:36 +0000 Received: from p508fce7c.dip0.t-ipconnect.de ([80.143.206.124] helo=phil.localnet) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mblx1-0007WI-5i; Sat, 16 Oct 2021 17:50:23 +0200 From: Heiko Stuebner To: Nicolas Frattaroli , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Philipp Zabel , Nicolas Frattaroli Cc: linux-rockchip@lists.infradead.org, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/4] ASoC: rockchip: i2s-tdm: Strip out direct CRU use Date: Sat, 16 Oct 2021 17:50:22 +0200 Message-ID: <1782571.1Dz21PRzoM@phil> In-Reply-To: <20211016105354.116513-2-frattaroli.nicolas@gmail.com> References: <20211016105354.116513-1-frattaroli.nicolas@gmail.com> <20211016105354.116513-2-frattaroli.nicolas@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211016_085035_752827_AF22258D X-CRM114-Status: GOOD ( 19.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Am Samstag, 16. Oktober 2021, 12:53:50 CEST schrieb Nicolas Frattaroli: > In cases where both rx and tx lrck are synced to the same source, > the resets for rx and tx need to be triggered simultaneously, > according to the downstream driver. > > As there is no reset API to atomically bulk (de)assert two resets > at once, what the driver did was implement half a reset controller > specific to Rockchip, which tried to write the registers for the > resets within one write ideally or several writes within an irqsave > section. > > This of course violates abstractions quite badly. The driver should > not write to the CRU's registers directly. > > In practice, for the cases I tested the driver with, which is audio > playback, replacing the synchronised asserts with just individual > ones does not seem to make any difference. > > If it turns out that this breaks something in the future, it should > be fixed through the specification and implementation of an atomic > bulk reset API, not with a CRU hack. > > Signed-off-by: Nicolas Frattaroli Reviewed-by: Heiko Stuebner _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D5E4C433EF for ; Sat, 16 Oct 2021 15:50:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0DEFD6101D for ; Sat, 16 Oct 2021 15:50:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239638AbhJPPwr (ORCPT ); Sat, 16 Oct 2021 11:52:47 -0400 Received: from gloria.sntech.de ([185.11.138.130]:45836 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231824AbhJPPwp (ORCPT ); Sat, 16 Oct 2021 11:52:45 -0400 Received: from p508fce7c.dip0.t-ipconnect.de ([80.143.206.124] helo=phil.localnet) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mblx1-0007WI-5i; Sat, 16 Oct 2021 17:50:23 +0200 From: Heiko Stuebner To: Nicolas Frattaroli , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Philipp Zabel , Nicolas Frattaroli Cc: linux-rockchip@lists.infradead.org, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/4] ASoC: rockchip: i2s-tdm: Strip out direct CRU use Date: Sat, 16 Oct 2021 17:50:22 +0200 Message-ID: <1782571.1Dz21PRzoM@phil> In-Reply-To: <20211016105354.116513-2-frattaroli.nicolas@gmail.com> References: <20211016105354.116513-1-frattaroli.nicolas@gmail.com> <20211016105354.116513-2-frattaroli.nicolas@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Samstag, 16. Oktober 2021, 12:53:50 CEST schrieb Nicolas Frattaroli: > In cases where both rx and tx lrck are synced to the same source, > the resets for rx and tx need to be triggered simultaneously, > according to the downstream driver. > > As there is no reset API to atomically bulk (de)assert two resets > at once, what the driver did was implement half a reset controller > specific to Rockchip, which tried to write the registers for the > resets within one write ideally or several writes within an irqsave > section. > > This of course violates abstractions quite badly. The driver should > not write to the CRU's registers directly. > > In practice, for the cases I tested the driver with, which is audio > playback, replacing the synchronised asserts with just individual > ones does not seem to make any difference. > > If it turns out that this breaks something in the future, it should > be fixed through the specification and implementation of an atomic > bulk reset API, not with a CRU hack. > > Signed-off-by: Nicolas Frattaroli Reviewed-by: Heiko Stuebner