From patchwork Fri Apr 17 15:30:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Blankertz X-Patchwork-Id: 11495421 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4222E15AB for ; Fri, 17 Apr 2020 15:30:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 34AF021924 for ; Fri, 17 Apr 2020 15:30:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729119AbgDQPay (ORCPT ); Fri, 17 Apr 2020 11:30:54 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:59765 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729023AbgDQPau (ORCPT ); Fri, 17 Apr 2020 11:30:50 -0400 Received: from mail.cetitecgmbh.com ([87.190.42.90]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N1Ofr-1jEYe61Uxn-012rTp; Fri, 17 Apr 2020 17:30:29 +0200 Received: from pflvmailgateway.corp.cetitec.com (unknown [127.0.0.1]) by mail.cetitecgmbh.com (Postfix) with ESMTP id 72E7C650EEE; Fri, 17 Apr 2020 15:30:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at cetitec.com Received: from mail.cetitecgmbh.com ([127.0.0.1]) by pflvmailgateway.corp.cetitec.com (pflvmailgateway.corp.cetitec.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uQP4eFNE1n7O; Fri, 17 Apr 2020 17:30:28 +0200 (CEST) Received: from pfwsexchange.corp.cetitec.com (unknown [10.10.1.99]) by mail.cetitecgmbh.com (Postfix) with ESMTPS id 1DCB064ECEB; Fri, 17 Apr 2020 17:30:28 +0200 (CEST) Received: from pflmmbl.corp.cetitec.com (10.8.5.29) by PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 17 Apr 2020 17:30:27 +0200 From: Matthias Blankertz To: Mark Brown , Liam Girdwood CC: Jaroslav Kysela , Takashi Iwai , "Kuninori Morimoto" , , , Subject: [PATCH 1/2] ASoC: rsnd: Don't treat master SSI in multi SSI setup as parent Date: Fri, 17 Apr 2020 17:30:16 +0200 Message-ID: <20200417153017.1744454-2-matthias.blankertz@cetitec.com> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200417153017.1744454-1-matthias.blankertz@cetitec.com> References: <20200417153017.1744454-1-matthias.blankertz@cetitec.com> MIME-Version: 1.0 X-Originating-IP: [10.8.5.29] X-ClientProxiedBy: PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) To PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) X-EsetResult: clean, is OK X-EsetId: 37303A290D7F536B64766A X-Provags-ID: V03:K1:905W2ZJz4v+jyqVb/Nkvj2ugtw0+l5agWgbR+E2f0oGvVpyMN/q qa1EhDJDpS2Eafj1RUrBekh2aaYG/aC6xLZ41KfAOCsnsspfX0vdypKjU0GwkzAirD5cT/b yWb3b1gdvaV9kmOMALR5EtVN+ggi6Gp1RfLTum7tkJd0faq1RNivbzD1LfNx4TBV7RxEGtm HRBjm5pnQwiV8dZhNG7sg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:cKC4gVX6Fxs=:R1T2Lf//daTbxWdr+e2Byq lILnLt6XnnWw1QXcZcckIShXRT7nuSPWSxjfrVhysO5tnsF470C1iMaSRzXKKn3JCX0+msJ9h /TXEILm7/pQ7YWWtoo1merok/zla470NF5D9sCK/jzUXif3MMFeeB/8mLRTkxVQlrmDUdL5Rn cP96NX2hru+1BqyTsz3mpQ3G0FXWcHRRfAl9QUVvLvkQwBXd2UV8vqmJYrKCuMGNBCSARzgLK oO48RdsppUXEtVi2+6ABIcwN7+R1ua8Q55lfWilZ47XPjsKrm4c+rN1aQpJ0+SRBt/cg0RpzY oaWsOGCQV3g7jxzDCHWkSmQGL2ULMbUwfa2/NRPR/hYfUfF+xROcpC3zsAhvBCqOjUZmW+cCg Dd1vQ7Xz0FdpZ5g1nu8ZnC3QLK8vlXV4UKLhVuHm2rFKdUioMVSP8ELkD4/nnRO715qq2dg6q gbiWRq594q5lFhJRXIqvj9AF4mEhfJCsL3hlM2RTLXRFJpRatzeVXeUcFNjExDG0n/xYcjejg OhJWlRcCPlMVLnDe+EetaMvptbyXM5N1YBepgiOPkwy7BKE4/SHs7w+2lQ/z9T8Rz+/oASpPv 0hG8i0A5dJzQPEV9/3RfiD5xS5vooQCykjYLa9CO6yZhH8zFh6VWcToyvVBBNqvGcsKzfnIyN Do33/JDUlmln4jbrYIUPqE86TPaz0D45NKZ6iAB9fXVGLOGql1/783o1ChvCnI/uh5Jx88MeZ 6WEQESPsyVUIIWhCZP7dvYnggVXaWXfXSBlIVFVDvj2jLmF068Oz2gTL5cp5JOj6vg9FJ5bss UyrBV+D3hgGbfIm12LTLpxuvWUDIWm0jm+FCfFDQZdjoOnoaQ0Ke1kZtE03fFWN1s3aYzQRVW 0S7mFzLSiASnzNS0acag== Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org The master SSI of a multi-SSI setup was attached both to the RSND_MOD_SSI slot and the RSND_MOD_SSIP slot of the rsnd_dai_stream. This is not correct wrt. the meaning of being "parent" in the rest of the SSI code, where it seems to indicate an SSI that provides clock and word sync but is not transmitting/receiving audio data. Not treating the multi-SSI master as parent allows removal of various special cases to the rsnd_ssi_is_parent conditions introduced in commit a09fb3f28a60 ("ASoC: rsnd: Fix parent SSI start/stop in multi-SSI mode"). It also fixes the issue that operations performed via rsnd_dai_call() were performed twice for the master SSI. This caused some "status check failed" spam when stopping a multi-SSI stream as the driver attempted to stop the master SSI twice. Signed-off-by: Matthias Blankertz --- sound/soc/sh/rcar/ssi.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index d51fb3a39448..9900a4f6f4e5 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -407,7 +407,7 @@ static void rsnd_ssi_config_init(struct rsnd_mod *mod, * We shouldn't exchange SWSP after running. * This means, parent needs to care it. */ - if (rsnd_ssi_is_parent(mod, io) && !rsnd_ssi_multi_slaves(io)) + if (rsnd_ssi_is_parent(mod, io)) goto init_end; if (rsnd_io_is_play(io)) @@ -559,7 +559,7 @@ static int rsnd_ssi_start(struct rsnd_mod *mod, * EN is for data output. * SSI parent EN is not needed. */ - if (rsnd_ssi_is_parent(mod, io) && !rsnd_ssi_multi_slaves(io)) + if (rsnd_ssi_is_parent(mod, io)) return 0; ssi->cr_en = EN; @@ -582,7 +582,7 @@ static int rsnd_ssi_stop(struct rsnd_mod *mod, if (!rsnd_ssi_is_run_mods(mod, io)) return 0; - if (rsnd_ssi_is_parent(mod, io) && !rsnd_ssi_multi_slaves(io)) + if (rsnd_ssi_is_parent(mod, io)) return 0; cr = ssi->cr_own | @@ -620,7 +620,7 @@ static int rsnd_ssi_irq(struct rsnd_mod *mod, if (rsnd_is_gen1(priv)) return 0; - if (rsnd_ssi_is_parent(mod, io) && !rsnd_ssi_multi_slaves(io)) + if (rsnd_ssi_is_parent(mod, io)) return 0; if (!rsnd_ssi_is_run_mods(mod, io)) @@ -737,6 +737,9 @@ static void rsnd_ssi_parent_attach(struct rsnd_mod *mod, if (!rsnd_rdai_is_clk_master(rdai)) return; + if (rsnd_ssi_is_multi_slave(mod, io)) + return; + switch (rsnd_mod_id(mod)) { case 1: case 2: From patchwork Fri Apr 17 15:30:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Blankertz X-Patchwork-Id: 11495419 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8F27F92C for ; Fri, 17 Apr 2020 15:30:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8142D208E4 for ; Fri, 17 Apr 2020 15:30:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729161AbgDQPau (ORCPT ); Fri, 17 Apr 2020 11:30:50 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:52003 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729119AbgDQPat (ORCPT ); Fri, 17 Apr 2020 11:30:49 -0400 Received: from mail.cetitecgmbh.com ([87.190.42.90]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N0WsG-1j4Nko1EJA-00wSVb; Fri, 17 Apr 2020 17:30:30 +0200 Received: from pflvmailgateway.corp.cetitec.com (unknown [127.0.0.1]) by mail.cetitecgmbh.com (Postfix) with ESMTP id B5F9E64ECEB; Fri, 17 Apr 2020 15:30:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at cetitec.com Received: from mail.cetitecgmbh.com ([127.0.0.1]) by pflvmailgateway.corp.cetitec.com (pflvmailgateway.corp.cetitec.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V9ig1oZlNVEl; Fri, 17 Apr 2020 17:30:28 +0200 (CEST) Received: from pfwsexchange.corp.cetitec.com (unknown [10.10.1.99]) by mail.cetitecgmbh.com (Postfix) with ESMTPS id 6E047650DE0; Fri, 17 Apr 2020 17:30:28 +0200 (CEST) Received: from pflmmbl.corp.cetitec.com (10.8.5.29) by PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 17 Apr 2020 17:30:28 +0200 From: Matthias Blankertz To: Mark Brown , Liam Girdwood CC: Jaroslav Kysela , Takashi Iwai , "Kuninori Morimoto" , , , Subject: [PATCH 2/2] ASoC: rsnd: Fix "status check failed" spam for multi-SSI Date: Fri, 17 Apr 2020 17:30:17 +0200 Message-ID: <20200417153017.1744454-3-matthias.blankertz@cetitec.com> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200417153017.1744454-1-matthias.blankertz@cetitec.com> References: <20200417153017.1744454-1-matthias.blankertz@cetitec.com> MIME-Version: 1.0 X-Originating-IP: [10.8.5.29] X-ClientProxiedBy: PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) To PFWSEXCHANGE.corp.cetitec.com (10.10.1.99) X-EsetResult: clean, is OK X-EsetId: 37303A290D7F536B64766A X-Provags-ID: V03:K1:0iRD0Id+7QAfQTeP6+QurWwUltdZG+fqMJxBvkqJPUd9FojZGun sf/9XgiwufPW5lLOJnygfUJDpIG3Z4/yUnjoh2uQ3UTbt+ieGVMXWejLjl4NJFwleR7VHXz eRsYNxfKmS1M33G07P44CMIo742DTe2CGMpOqZivLTzQTkStbAMtWDN5CKCSydpQxOTyUkZ FwuIJnLucp0OAHrIeur5g== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:qrbtVe90pA4=:tpoXoz3xiMvTH8cBv3+3P5 O4EfrILxVOr5loC4L9WtX5APJDqGNf3/02r4YxVynorLJGVCh/O4fVnfGLw7bn1ah8a2azkk9 GbUbFIDS9MYt5+SS2kfMgcoemth2pPdoReZlC3AempfKFBat9gacbxiGTH+zdL5pyXvXZ6P5b i0rXQ3ka5ADlVHSX8K/wVthVsNVlKd9/f7238FjMJkns3Zk/b+HUfYa7gwOlBYqlMviXeUdCd 6xf19mziHr6IBOetMAF1i2bVDnwU7xxFy1aYFIGXqzvpDGDvwTYEGpBGB+OvLhKLn1KOZBlXx yHpsVOGpORrmCSQLRpNaMCymL6RoaDJCco3APjIMVIqyTBsvpDEVT6VF6y4BHbRs2Gv85ARNJ DSX7qcjmp7FW2QHI/vUk9tcVuER2NYUWlRv5QPhbtp441llHqfXKfsogfMIbMBMQ7yzTKx4s2 0sbIazv1WZR618d1aRS7H6N5/+Te/h2a5bC0KBLN3aacObwZCpGXRt3Gv2oLMGo4IidjwqEbD RpvbEUHoAsBTR5X0Feqks9hQFhkJFU1ukodv65khpgHXq1+kPT350qQj27Eb+YjWyR5Q8Jk66 APq2T35CZTvLSAHG3IoAbxVEOcvfDH33qutyMOUDelS0C6i6xKnN6yb7wQmyF7meFkOtRdZsV OH2IZCe3Q8X3nV//JRVeP5fa0yJpgqPmtbXsekghIoZ0DMhWdA3z0H2FOIAKFWIf8F7s3lmtt bmOoT5ZGm/lwnPkCLZPwlARHRXc/zIi2RNJ3qfQiSxP0xDOy8fnTcKJmZiTWGw9iNPK6Wt1Ad jUgYyQPkWFiAUeibo2fhkR/uZhGy4SJid8Ysld0jikN58hBAUX0hoXh9/fCDCC1W2IQIaHzkd ebk9P8irWlOJkEzhT4sQ== Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Fix the rsnd_ssi_stop function to skip disabling the individual SSIs of a multi-SSI setup, as the actual stop is performed by rsnd_ssiu_stop_gen2 - the same logic as in rsnd_ssi_start. The attempt to disable these SSIs was harmless, but caused a "status check failed" message to be printed for every SSI in the multi-SSI setup. The disabling of interrupts is still performed, as they are enabled for all SSIs in rsnd_ssi_init, but care is taken to not accidentally set the EN bit for an SSI where it was not set by rsnd_ssi_start. Signed-off-by: Matthias Blankertz --- sound/soc/sh/rcar/ssi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 9900a4f6f4e5..4a7d3413917f 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -594,10 +594,16 @@ static int rsnd_ssi_stop(struct rsnd_mod *mod, * Capture: It might not receave data. Do nothing */ if (rsnd_io_is_play(io)) { - rsnd_mod_write(mod, SSICR, cr | EN); + rsnd_mod_write(mod, SSICR, cr | ssi->cr_en); rsnd_ssi_status_check(mod, DIRQ); } + /* In multi-SSI mode, stop is performed by setting ssi0129 in + * SSI_CONTROL to 0 (in rsnd_ssio_stop_gen2). Do nothing here. + */ + if (rsnd_ssi_multi_slaves_runtime(io)) + return 0; + /* * disable SSI, * and, wait idle state