From patchwork Wed Nov 28 12:57:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 152252 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1052571ljp; Wed, 28 Nov 2018 04:58:14 -0800 (PST) X-Google-Smtp-Source: AFSGD/W2bpdGAmCYC0K0FD8yWtD/g4roKN0MOCNkAyBu46lwHbOG7+gu0W9uXDRYIAi0lkF7U1Gj X-Received: by 2002:a7b:c0c5:: with SMTP id s5mr1756818wmh.40.1543409894146; Wed, 28 Nov 2018 04:58:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543409894; cv=none; d=google.com; s=arc-20160816; b=C1iEISe0Jp0rfMAMa6n6IGac47ZwTa1/KW0yd6GDsKE0KATLalyijzXbOAQwtDXRIJ UaiSMMAYiRh6gzhxS7ZUQZhqWYOCAzBw3SLYk8bPMzVtDd70cmuMCmaPcUwBBTPz6RF4 d/JdI6wZ7G8gj449dI/+HZKWEuzQ7weM57Hea6R2jNiqphw1Zh5b1EKWOoPrryskHfdt VHptOTHV2j0HzGLa4UI2H14L3zVyWIcEIOOOBdFGd7nAv2vXPzNZaDyFtzDlRol9Hk1n 7sBQATX1/kT47mgy2u0tnEbxud6hkb53PLSN5al5lVTMna4xJJXesBYtkSzTOso89QM0 IDZg== 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; bh=awNKhT4IQgCIsisPqfSwV4G/Bi9jKjHzthvq3PSIG34=; b=SwR04cVoRNMBLP9ZhAKqQ9n9VAMA4VSsNmo00VxzyEqrOreIxDlSsXW/7G7cp8EkZQ 0CXLc472F1VB1wmkqKb1HXzQvf06thD9ahZLxAwfw8o30M29tuwx2Y7LeGjJJ1Pt8SpB V8DGklA3fX8YUAf4LHNIXi4fCAN38OdnLba+gy0fY1H2dkSxKCg/eO3zt7Pba/HHKk1I HGfl2O741vs7ow7W/VHIiXScz1Q/nXU7HtQg/PkbrbALd0cAP7FUDyF7P7N8U1HsnJI5 3XoB0K7KiGd/ktcQoZeN/X04zUUluDfSm+hBZnrzd18sZZJ159JwrdTIjaG63mfPf++r IxPg== 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=RylHALYh; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id i7si6066084wrq.79.2018.11.28.04.58.13; Wed, 28 Nov 2018 04:58:14 -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=RylHALYh; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id E740E267B5C; Wed, 28 Nov 2018 13:57:58 +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 1F0BC267B59; Wed, 28 Nov 2018 13:57:57 +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.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE 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 D0B49267B4F for ; Wed, 28 Nov 2018 13:57:51 +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=Vo4aPVf/XuEPMyrGz9ghbSDJIrvmsPDwZuIjqCTV0Qw=; b=RylHALYhGJ3G pHhzcQ6kP3yNPfUjb8IJcelq1n3z4n1XTOyMIS3sZQp4b+1M8VeWTUtu/ph2I1YTg33BCQUa5n1bu 1fupVABvcIdoyCuablJgY50WMd9ogWVhL6n4FLxY4yGaRqco1+Ew3wt4e0/SvanxpjGhun8L+qSoe k/LeE=; Received: from 92.40.248.202.threembb.co.uk ([92.40.248.202] helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gRzPZ-0005HM-U6; Wed, 28 Nov 2018 12:57:50 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id AE9DF440078; Wed, 28 Nov 2018 12:57:42 +0000 (GMT) From: Mark Brown To: Subhransu S. Prusty In-Reply-To: Message-Id: <20181128125742.AE9DF440078@finisterre.ee.mobilebroadband> Date: Wed, 28 Nov 2018 12:57:42 +0000 (GMT) Cc: Vinod Koul , Sriram Periyasamy , alsa-devel@alsa-project.org, Mark Brown Subject: [alsa-devel] Applied "ASoC: Intel: Skylake: Make DSP replies more human readable" 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: Intel: Skylake: Make DSP replies more human readable 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 aa15679b2dc898049e9117fbe3ddda0b50fa52d2 Mon Sep 17 00:00:00 2001 From: "Subhransu S. Prusty" Date: Mon, 29 Jan 2018 21:45:59 +0530 Subject: [PATCH] ASoC: Intel: Skylake: Make DSP replies more human readable Add more meaning to the IPC replies for easy debugging. Replace the switch case with a lookup table to lookup for the IPC replies and print in human readable form. Signed-off-by: Subhransu S. Prusty Signed-off-by: Sriram Periyasamy Signed-off-by: Vinod Koul Signed-off-by: Mark Brown --- sound/soc/intel/skylake/skl-sst-ipc.c | 44 ++++++++++++++++++++------- 1 file changed, 33 insertions(+), 11 deletions(-) -- 2.19.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/intel/skylake/skl-sst-ipc.c b/sound/soc/intel/skylake/skl-sst-ipc.c index 5234fafb758a..8708755a8f9a 100644 --- a/sound/soc/intel/skylake/skl-sst-ipc.c +++ b/sound/soc/intel/skylake/skl-sst-ipc.c @@ -392,18 +392,43 @@ int skl_ipc_process_notification(struct sst_generic_ipc *ipc, return 0; } -static int skl_ipc_set_reply_error_code(u32 reply) +struct skl_ipc_err_map { + const char *msg; + enum skl_ipc_glb_reply reply; + int err; +}; + +static struct skl_ipc_err_map skl_err_map[] = { + {"DSP out of memory", IPC_GLB_REPLY_OUT_OF_MEMORY, -ENOMEM}, + {"DSP busy", IPC_GLB_REPLY_BUSY, -EBUSY}, +}; + +static int skl_ipc_set_reply_error_code(struct sst_generic_ipc *ipc, u32 reply) { - switch (reply) { - case IPC_GLB_REPLY_OUT_OF_MEMORY: - return -ENOMEM; + int i; - case IPC_GLB_REPLY_BUSY: - return -EBUSY; + for (i = 0; i < ARRAY_SIZE(skl_err_map); i++) { + if (skl_err_map[i].reply == reply) + break; + } - default: + if (i == ARRAY_SIZE(skl_err_map)) { + dev_err(ipc->dev, "ipc FW reply: %d FW Error Code: %u\n", + reply, + ipc->dsp->fw_ops.get_fw_errcode(ipc->dsp)); return -EINVAL; } + + if (skl_err_map[i].err < 0) + dev_err(ipc->dev, "ipc FW reply: %s FW Error Code: %u\n", + skl_err_map[i].msg, + ipc->dsp->fw_ops.get_fw_errcode(ipc->dsp)); + else + dev_info(ipc->dev, "ipc FW reply: %s FW Error Code: %u\n", + skl_err_map[i].msg, + ipc->dsp->fw_ops.get_fw_errcode(ipc->dsp)); + + return skl_err_map[i].err; } void skl_ipc_process_reply(struct sst_generic_ipc *ipc, @@ -441,10 +466,7 @@ void skl_ipc_process_reply(struct sst_generic_ipc *ipc, } } else { - msg->errno = skl_ipc_set_reply_error_code(reply); - dev_err(ipc->dev, "ipc FW reply: reply=%d\n", reply); - dev_err(ipc->dev, "FW Error Code: %u\n", - ipc->dsp->fw_ops.get_fw_errcode(ipc->dsp)); + msg->errno = skl_ipc_set_reply_error_code(ipc, reply); switch (IPC_GLB_NOTIFY_MSG_TYPE(header.primary)) { case IPC_GLB_LOAD_MULTIPLE_MODS: case IPC_GLB_LOAD_LIBRARY: