From patchwork Tue Feb 13 12:16:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 128224 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp4192135ljc; Tue, 13 Feb 2018 04:18:24 -0800 (PST) X-Google-Smtp-Source: AH8x227gWB8B95ARE+87KHjFly9lFjhF+IadpsOO8RylXCXegzRsB4xhU6Ho5GlCtbbknlq7lYJT X-Received: by 10.28.153.147 with SMTP id b141mr1138687wme.47.1518524304428; Tue, 13 Feb 2018 04:18:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518524304; cv=none; d=google.com; s=arc-20160816; b=Rc9fSUfaqVGfgAAEGkTNnHXQZ4LibWFgv4IJo9ubgSDQycbO0ahysuKDTV0CEADYyn V1Qqfi5hA70R/S/zKqPs7BQVcztgbp4s8pc6mpVb86+NTr+ghFAJ1rbwFmc9+5RnpvlA h274vdGJ5hxm3sW48UTlPnS7f8fhmcI6xHPjEVFNzwT+06t3u/RlfgyeJCd5vPQFWY/f UfSzRZ6jkTqfmShDo4ZfKKmlTkUIj6LLc5i4LhNjtybHx6jf2wnJhKwQLX/Ppp42ik1D I9AmZMSkBnloFskEMhjMa2LzmWODJsTcoZN3BFCAxgNhWpUk7ok/Z1pEqPgYHBAiK4HV cf9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=+G9p3uLGcjPv6chPcx7KnCCLZoML5IJ0Pu8dGORQtKA=; b=vpUmw3NhqKgWgPq1ddxsGeqBq8t8z0EWpDoR9zlcJYvJUYi4tOnM+Z+qYyRi0kGb8w /DBAeUkYZg/UCOPZvYtzqjroax5LTWYPVxtcDFL192QFIVaE4fyuj4o1kVlxzcKwASId CFK8cVsX0OuH18hTcjoQexLmh1/coAkw1lbuBBML56+IjV6yTweqTGygcG/JX7vODKmq OmpUbg4fke789GBIhszyA4azcFfJooOf2cDper6zVUYlVwQElOIhRx+y9Iq1spya4rxr +0xma9MpFtlM5wYQ3Jt63qrNZ2y0APa38/xzwqdIc6kHL79UwZfJnNCe6Uwcd8WRZVMv eFaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=T1SuLYAr; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id t16si5055336wmh.222.2018.02.13.04.18.24; Tue, 13 Feb 2018 04:18:24 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=T1SuLYAr; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 5343E2679B2; Tue, 13 Feb 2018 13:17:48 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 833C22679B1; Tue, 13 Feb 2018 13:17:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id BEB53267986 for ; Tue, 13 Feb 2018 13:16:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=xhG6Q0hL100GHxa/dcsTw5mumj55t/f4nBcxeM5l5U4=; b=T1SuLYArw2J0 h3I4qZWmWyFe5C8/y1HPVoQDRO59M2DRKZ0j5OmFkJ/63t9crMRN/FhWIaOxLdaj80REo11+Orv72 ULtWYU//kVMwwzB0MlkIlOarrNMZ6NOACTRyFgawXPA59TvtWoi7bu+gYN0KliQs+N7FyjP1oNHGT Gldjc=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1elZVV-0006TH-R9; Tue, 13 Feb 2018 12:16:21 +0000 Received: from broonie by debutante with local (Exim 4.90) (envelope-from ) id 1elZVV-0005ZQ-CS; Tue, 13 Feb 2018 12:16:21 +0000 From: Mark Brown To: Kuninori Morimoto In-Reply-To: <874lmllk1k.wl%kuninori.morimoto.gx@renesas.com> Message-Id: Date: Tue, 13 Feb 2018 12:16:21 +0000 Cc: alsa-devel@alsa-project.org, Mark Brown , hiroyuki.yokoyama.vx@renesas.com Subject: [alsa-devel] Applied "ASoC: rsnd: indicate IRQ error status for debug" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: rsnd: indicate IRQ error status for debug has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 2b62786951ca38cc9fd0bd9273de0aae1b45134d Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 13 Feb 2018 02:08:53 +0000 Subject: [PATCH] ASoC: rsnd: indicate IRQ error status for debug SSI/SRC have under/over flow error handling, and its status is useful for debuging. But sometimes it might be too much message, and it might blocks necessity other information. To avoid such situation, basically this patch indicates interrupt status debug message if DEBUG was defined, but it will be suppressed if RSND_DEBUG_NO_IRQ_STATUS was defined. Reported-by: Hiroyuki Yokoyama Signed-off-by: Kuninori Morimoto Tested-by: Hiroyuki Yokoyama Signed-off-by: Mark Brown --- sound/soc/sh/rcar/rsnd.h | 10 ++++++++++ sound/soc/sh/rcar/src.c | 22 ++++++++++++++++++++-- sound/soc/sh/rcar/ssi.c | 16 +++++++++++++++- 3 files changed, 45 insertions(+), 3 deletions(-) -- 2.16.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index ad6523595b0a..5241ea7cf153 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -788,4 +788,14 @@ void rsnd_mod_make_sure(struct rsnd_mod *mod, enum rsnd_mod_type type); #define rsnd_mod_confirm_dvc(mdvc) #endif +/* + * If you don't need interrupt status debug message, + * define RSND_DEBUG_NO_IRQ_STATUS as 1 on top of src.c/ssi.c + * + * #define RSND_DEBUG_NO_IRQ_STATUS 1 + */ +#define rsnd_dbg_irq_status(dev, param...) \ + if (!IS_BUILTIN(RSND_DEBUG_NO_IRQ_STATUS)) \ + dev_dbg(dev, param) + #endif diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 510b68a483b4..a727e71587b6 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -8,6 +8,15 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ + +/* + * you can enable below define if you don't need + * SSI interrupt status debug message when debugging + * see rsnd_dbg_irq_status() + * + * #define RSND_DEBUG_NO_IRQ_STATUS 1 + */ + #include "rsnd.h" #define SRC_NAME "src" @@ -325,7 +334,10 @@ static void rsnd_src_status_clear(struct rsnd_mod *mod) static bool rsnd_src_error_occurred(struct rsnd_mod *mod) { + struct rsnd_priv *priv = rsnd_mod_to_priv(mod); + struct device *dev = rsnd_priv_to_dev(priv); u32 val0, val1; + u32 status0, status1; bool ret = false; val0 = val1 = OUF_SRC(rsnd_mod_id(mod)); @@ -338,9 +350,15 @@ static bool rsnd_src_error_occurred(struct rsnd_mod *mod) if (rsnd_src_sync_is_enabled(mod)) val0 = val0 & 0xffff; - if ((rsnd_mod_read(mod, SCU_SYS_STATUS0) & val0) || - (rsnd_mod_read(mod, SCU_SYS_STATUS1) & val1)) + status0 = rsnd_mod_read(mod, SCU_SYS_STATUS0); + status1 = rsnd_mod_read(mod, SCU_SYS_STATUS1); + if ((status0 & val0) || (status1 & val1)) { + rsnd_dbg_irq_status(dev, "%s[%d] err status : 0x%08x, 0x%08x\n", + rsnd_mod_name(mod), rsnd_mod_id(mod), + status0, status1); + ret = true; + } return ret; } diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 97a9db892a8f..333b802681ad 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -11,6 +11,15 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ + +/* + * you can enable below define if you don't need + * SSI interrupt status debug message when debugging + * see rsnd_dbg_irq_status() + * + * #define RSND_DEBUG_NO_IRQ_STATUS 1 + */ + #include #include #include "rsnd.h" @@ -603,6 +612,7 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod, struct rsnd_dai_stream *io) { struct rsnd_priv *priv = rsnd_mod_to_priv(mod); + struct device *dev = rsnd_priv_to_dev(priv); int is_dma = rsnd_ssi_is_dma_mode(mod); u32 status; bool elapsed = false; @@ -621,8 +631,12 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod, elapsed = rsnd_ssi_pio_interrupt(mod, io); /* DMA only */ - if (is_dma && (status & (UIRQ | OIRQ))) + if (is_dma && (status & (UIRQ | OIRQ))) { + rsnd_dbg_irq_status(dev, "%s[%d] err status : 0x%08x\n", + rsnd_mod_name(mod), rsnd_mod_id(mod), status); + stop = true; + } rsnd_ssi_status_clear(mod); rsnd_ssi_interrupt_out: