From patchwork Tue May 10 18:49:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 9060831 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-renesas-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7E2999F1D3 for ; Tue, 10 May 2016 18:49:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E098C20166 for ; Tue, 10 May 2016 18:49:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D92F20173 for ; Tue, 10 May 2016 18:49:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752073AbcEJSt0 (ORCPT ); Tue, 10 May 2016 14:49:26 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:41042 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751574AbcEJStZ (ORCPT ); Tue, 10 May 2016 14:49:25 -0400 Received: from cpc11-sgyl31-2-0-cust672.sgyl.cable.virginm.net ([94.175.94.161] helo=debutante) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1b0Cie-0006bI-0L; Tue, 10 May 2016 18:49:20 +0000 Received: from broonie by debutante with local (Exim 4.87) (envelope-from ) id 1b0Cia-0007Gr-Tb; Tue, 10 May 2016 19:49:16 +0100 From: Mark Brown To: Kuninori Morimoto Cc: Nguyen Viet Dung , Mark Brown , Mark Brown , Linux-ALSA , Yoshihiro Shimoda , Liam Girdwood , linux-renesas-soc@vger.kernel.org, Simon , Nguyen Viet Dung In-Reply-To: <87d1oumzcr.wl%kuninori.morimoto.gx@renesas.com> Message-Id: Date: Tue, 10 May 2016 19:49:16 +0100 X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Subject: Applied "ASoC: rsnd: don't use prohibited number to PDMACHCRn.SRS" to the asoc tree X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The patch ASoC: rsnd: don't use prohibited number to PDMACHCRn.SRS has been applied to the asoc tree at git://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 ee057d2ee73259f455cfbb7a4db808fc6b6405dd Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 10 May 2016 02:22:37 +0000 Subject: [PATCH] ASoC: rsnd: don't use prohibited number to PDMACHCRn.SRS Current rsnd_dmapp_get_id() returns 0xFF as error code if system used strange connection. It will be used as PDMACHCRn.SRS, but 0xFF is prohibited number. In order not to use prohibited number, this patch indicates error message and returns 0x00 (same as SSI00) in error case. Special thanks to Dung-san. Reported-by: Nguyen Viet Dung Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/sh/rcar/dma.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c index 7658e8fd7bdc..6bc93cbb3049 100644 --- a/sound/soc/sh/rcar/dma.c +++ b/sound/soc/sh/rcar/dma.c @@ -316,11 +316,15 @@ static u32 rsnd_dmapp_get_id(struct rsnd_dai_stream *io, size = ARRAY_SIZE(gen2_id_table_cmd); } - if (!entry) - return 0xFF; + if ((!entry) || (size <= id)) { + struct device *dev = rsnd_priv_to_dev(rsnd_io_to_priv(io)); - if (size <= id) - return 0xFF; + dev_err(dev, "unknown connection (%s[%d])\n", + rsnd_mod_name(mod), rsnd_mod_id(mod)); + + /* use non-prohibited SRS number as error */ + return 0x00; /* SSI00 */ + } return entry[id]; }