From patchwork Tue May 10 02:22:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9053081 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 918959F372 for ; Tue, 10 May 2016 02:22:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F294320123 for ; Tue, 10 May 2016 02:22:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 430B420114 for ; Tue, 10 May 2016 02:22:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752780AbcEJCWn (ORCPT ); Mon, 9 May 2016 22:22:43 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:64471 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750982AbcEJCWm (ORCPT ); Mon, 9 May 2016 22:22:42 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 10 May 2016 11:22:40 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 2029A3C1B7; Tue, 10 May 2016 11:22:40 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 1718C480A4; Tue, 10 May 2016 11:22:40 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 10B3448014; Tue, 10 May 2016 11:22:40 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id MAB24398; Tue, 10 May 2016 11:22:39 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="210485361" Received: from mail-hk2apc01lp0214.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.214]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 10 May 2016 11:22:39 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=RB7P7npjhreAwh43l5gVhXWT5RtZC1BkLWaZNVZEMbs=; b=IETUBwfsJkAoZSN3C56mPQuv/44yI24Cn/3TVGI1oU7D5n1jh5egwepIbxgSuLP4VTAmrT80VU/jN7iuCq4lfcolDr3SN2D1yZEO/GF5D9SUETYc+BW/5s2R22kRO+hGK6nuxtVUoPGX4fLqCBMFoWUhRhG93lBP3NYK0l4XNFs= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.144) by HK2PR06MB1697.apcprd06.prod.outlook.com (10.167.73.11) with Microsoft SMTP Server (TLS) id 15.1.492.11; Tue, 10 May 2016 02:22:37 +0000 Message-ID: <87d1oumzcr.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH] ASoC: rsnd: don't use prohibited number to PDMACHCRn.SRS User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown CC: Linux-ALSA , Liam Girdwood , Simon , , Yoshihiro Shimoda , Nguyen Viet Dung In-Reply-To: References: <87vb2o3vfz.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Tue, 10 May 2016 02:22:37 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS1PR01CA0003.jpnprd01.prod.outlook.com (10.161.225.141) To HK2PR06MB1697.apcprd06.prod.outlook.com (10.167.73.11) X-MS-Office365-Filtering-Correlation-Id: aae9fa2f-e199-4ae3-c494-08d37879f4c2 X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1697; 2:oGaTr4IVCAFwve0EA1zAoRIVj95Q1MwSUR6sw3b3Tb3TVkYs72Tj21Gja6vCX2lG5qo8DlXQ5LduqqNoIp1RFiM9rhdPOJ65KBt8bCEqpCba1HJk2VXIOpBIyge7UkyPbP7dov0TqEvduJPtRSMRWG5Pm+AqLqq7fgXG9JLnIXdb3YcnGUGA0gSqCKDYWJfa; 3:tmsyaMCX8rPwxAqdr74Jo0v0eQhbOYsIhP1sHHAgMS2Gv6IzDRmSy4S4aKsSkP5sLyq7+zB3NgpCBkBPDN0yzETntCXBrO/Zi63zFBRj0n8jdzAMan5HM/VqErH7qu0b; 25:aV0sbHxweSXWnlP1F25VDfJs0ZByCA+vDh4UtO9Ps++tvXxPagyK/E6AXaG6ce0p9HNUfpOD8L+9FU/djdjfVvR8SFDXGm6yKTAWOtGxJSiJ+4ta8X+RZ/SUn69D1WbzPZuVeCjXK8V/XTBh1V/MtVPJU1oj6AJko360V/MpUpu0szIOVqwbx7IBZOH4eVvBHwTitHDjD0O9GZLA2ZwZlRAMdcZmLTv1MMt3y/vntgqVD5/8RgnCHW6g5SR0aUXAm4Y+YqdieDX7sSUoLUoxPcAoNFSc0MzVhAUbWwvSAVsSRiF/AA/oJfGAWb8D2SdfK3S4+kd5BQtCkBBvmM6edljcwXRF5vKg6ggt3JyxYBAEjpipLSOjXlPPQxxciigJs4Mr8XcpYHXOaPmt5Jr6N0reu/sMq5leGJQIxcJ9EX3+0lZQ2Mit0qRCRx1BUWb+ X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HK2PR06MB1697; X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1697; 20:ZKA5GFKobVQdsG7KoKnob3XPfvKPw5BcUyzG+fQZSLbd8QwmeomXkGDDjDS6SnsebF969U+gQjHsNYmVR0Waln58ZqUI9sZr6fbv3ePcL6Bmvo1XfOGk5ZtNT3HdRxWMBPQYdRNCoyPvvlaNDWyq4YgVXnwDeBAuSzWSZl5ymtWtOAZ0ZtNrrGptzhtcr/escTcXRywEDArnzVct/e4PODXLJOR8i2xs2VOwV9WpfmSx5nCvfq4iq/33r23s8ovgmeU2b/YLzT1HqIKKiLFA8FPF2CPHg3wWR6zAeuqBFntMD4aVOnWZAtx7EWM/8DOvjecpdzlhhKST7V+BarTFD7n3R3nrEkxq/JFvdHoB95t5PP+NoVTPLWYRtVGYsvvm8vy3N9rjqrSMMHCblW9px6HC6q+mYf5RXc17nNQrH3wLpjNXl0DqBL9tRm6Uq/XFgzuxF8bunfmmeTBWs1DgTaOfu2J+LpIcuhkODBVzMZ4LUVkfgWwMzJQ5nuTdKavU; 4:HpDv/Mtw8EAdfsbl6sQMoBAYI+M4l5pH+M+Q7Debo4ptJIP9BkJBpQh4a86nfvxHnj1fide37VdTp7k+R93B8CvO2bdg0/4CftpvjAjVfmvt3+heopIHQ5emEePkEmyr3MNwZ7ZXqlDzxkG7FUHlW0GlwJ4UbHrhMW+LyUzD/oXdqVZMxfrYY4zQvplbVp+FoWE3MCocZbzJtvDkrlG1YRNWXXAGF7Y0OGoYGOBWCzw3p6aNpytx8uD/MBHqKNypJHCpwRbum/At6WwlfmRD/TKiO25JyboCjBAyg41UwMRuSSUC2bMy7WKJyr1iUFx5XRTmU5TV6blytBZOQxaly48MrT1UclfL8LfTginvuDJ76Q1IdaAB4i9AxqNKnZkJ2Opn32gmhdzyx/TTp91jxg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:HK2PR06MB1697; BCL:0; PCL:0; RULEID:; SRVR:HK2PR06MB1697; X-Forefront-PRVS: 0938781D02 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(50466002)(46406003)(229853001)(36756003)(54356999)(19580405001)(19580395003)(50986999)(76176999)(53416004)(2950100001)(33646002)(5004730100002)(81166005)(93886004)(4001350100001)(77096005)(42186005)(5008740100001)(83506001)(66066001)(3846002)(23726003)(6116002)(47776003)(586003)(2906002)(4326007)(92566002)(189998001)(110136002)(86362001)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR06MB1697; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HK2PR06MB1697; 23:SMBRTLl73V29+Fy9Ye9Ne0NJQr+g5NQu7AwaXbMas?= =?us-ascii?Q?9gKY8k6aEZSfdJ2KHPZShjtRmW2uyF1puujm0C40UhVmUXwnXmtBW6tiDYqE?= =?us-ascii?Q?iCA1SUmtxmZwJMQV+0Mvd74jik88R605x2oxGg5olS3ms0Gu9mTebuNQEgD4?= =?us-ascii?Q?lGeU14uPRqgdCGvk4jSlWC1pWGLxng3AOibSvyYCxVvcr6OtmPEULFKAsrzj?= =?us-ascii?Q?p6lnQUqqgkefg+TFKs3HXdI/3tZRJOG01tn8tB9i55bdXuFkzUD72rSnfW1Q?= =?us-ascii?Q?VdOsKsR8qH4Vc9epLl25YxhRpoFmrQXYUYVY7B3YvcFbc7Kptv4ibi804zBJ?= =?us-ascii?Q?cifi4ttEldqBoJd7Nq5PSZKy5o/kewoTxfq+4AGHmBnCFLa24hzbxL1rKkF3?= =?us-ascii?Q?RZeJ600Aswp8h1tYxI3SKm340mDmZwgWegtlSSl2WtmB/b+7nyq2Sjw5DTNZ?= =?us-ascii?Q?VnACuK2BRITofwpV50gxGX3spypDnEFMN7Z7Tr4Co+Jj5/O9AqDu1MzF/dRH?= =?us-ascii?Q?7fT9kzqhjUbo8E0DCUI1bbaofXlVwUF1pl3yPm+1AOyy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kbk8BcHGEPvQb9qCRimbzttq7C1AGKK3xDI0FFxljHY8Qru+PjvqjkGgHVXV5xfYycmNUOluTLo2mxf9kuOPe43u72sFfcnGksNTm0tHnS53iG+BnbYUMY= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2016 02:22:37.3715 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB1697 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto 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 --- 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 7658e8f..6bc93cb 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]; }