From patchwork Fri Mar 28 11:20:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 3902301 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 63F979F334 for ; Fri, 28 Mar 2014 11:21:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8D517202EC for ; Fri, 28 Mar 2014 11:21:31 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 44402202A7 for ; Fri, 28 Mar 2014 11:21:30 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 437A4261A91; Fri, 28 Mar 2014 12:21:27 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id B1954261A91; Fri, 28 Mar 2014 12:21:17 +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 15419261A91; Fri, 28 Mar 2014 12:21:15 +0100 (CET) Received: from ducie-dc1.codethink.co.uk (unknown [185.25.241.215]) by alsa0.perex.cz (Postfix) with ESMTP id BE01F261A88 for ; Fri, 28 Mar 2014 12:21:06 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTP id 17B75466825; Fri, 28 Mar 2014 11:21:06 +0000 (GMT) X-Virus-Scanned: Debian amavisd-new at ducie-dc1.codethink.co.uk Received: from ducie-dc1.codethink.co.uk ([127.0.0.1]) by localhost (ducie-dc1.codethink.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BBePb-0XzRR8; Fri, 28 Mar 2014 11:21:03 +0000 (GMT) Received: from rainbowdash.ducie.codethink.co.uk (rainbowdash.dyn.ducie.codethink.co.uk [10.24.1.133]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTPS id 2A71F465E80; Fri, 28 Mar 2014 11:21:03 +0000 (GMT) Received: from ben by rainbowdash.ducie.codethink.co.uk with local (Exim 4.82) (envelope-from ) id 1WTUqM-0003nM-Tj; Fri, 28 Mar 2014 11:21:02 +0000 From: Ben Dooks To: alsa-devel@alsa-project.org Date: Fri, 28 Mar 2014 11:20:59 +0000 Message-Id: <1396005659-14557-1-git-send-email-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 1.9.0 Cc: kuninori.morimoto.gx@renesas.com, linux-sh@vger.kernel.org, broonie@kernel.org, lgirdwood@gmail.com, Ben Dooks , magnus.damm@opensource.se Subject: [alsa-devel] [PATCH] ASoC: rsnd: use fast_io for bus 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 X-Virus-Scanned: ClamAV using ClamSMTP The rcar sound driver uses regmap to access registers in various parts of the block and uses regmap to manage mappings. The regmap is created without fast_io set, which means it locks with a mutex rather than a lighter-spinlock. The use of the mutex lock causes issues when the IRQ handler is entered as the code needs to read/write register values and thus with lock debugging enabled the system outputs a number of warnings such as: BUG: sleeping function called from invalid context at rnel/locking/mutex.c:616 The rcar registers are all connected via APB bus and thus not that slow to access. The fix is to set the fast_io in the code so that regmap creates the regmap structures using the faster spinlock functions. Signed-off-by: Ben Dooks --- sound/soc/sh/rcar/gen.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c index 9094970..6468962 100644 --- a/sound/soc/sh/rcar/gen.c +++ b/sound/soc/sh/rcar/gen.c @@ -66,6 +66,7 @@ static int rsnd_regmap_read32(void *context, } static struct regmap_bus rsnd_regmap_bus = { + .fast_io = true, .write = rsnd_regmap_write32, .read = rsnd_regmap_read32, .reg_format_endian_default = REGMAP_ENDIAN_NATIVE,