From patchwork Thu Mar 27 22:55:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 3900231 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 279A89F334 for ; Thu, 27 Mar 2014 22:56:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 56B9220270 for ; Thu, 27 Mar 2014 22:56:17 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 1CB6520268 for ; Thu, 27 Mar 2014 22:56:16 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 8B18C26549E; Thu, 27 Mar 2014 23:56:09 +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, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 57417265475; Thu, 27 Mar 2014 23:55:59 +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 8048D265486; Thu, 27 Mar 2014 23:55:57 +0100 (CET) Received: from ducie-dc1.codethink.co.uk (unknown [185.25.241.215]) by alsa0.perex.cz (Postfix) with ESMTP id C1DAB2619D7 for ; Thu, 27 Mar 2014 23:55:50 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTP id EA1F44621B0; Thu, 27 Mar 2014 22:55:49 +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 Gx29w36l9XQV; Thu, 27 Mar 2014 22:55:48 +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 2D3AF461D67; Thu, 27 Mar 2014 22:55:48 +0000 (GMT) Received: from ben by rainbowdash.ducie.codethink.co.uk with local (Exim 4.82) (envelope-from ) id 1WTJD9-0004hK-U4; Thu, 27 Mar 2014 22:55:47 +0000 From: Ben Dooks To: alsa-devel@alsa-project.org Date: Thu, 27 Mar 2014 22:55:42 +0000 Message-Id: <1395960942-18025-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] sound: rcar: 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,