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: 3900221 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AB5B5BF540 for ; Thu, 27 Mar 2014 22:55:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D35B420272 for ; Thu, 27 Mar 2014 22:55:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8B61C20268 for ; Thu, 27 Mar 2014 22:55:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756917AbaC0Wzw (ORCPT ); Thu, 27 Mar 2014 18:55:52 -0400 Received: from ducie-dc1.codethink.co.uk ([185.25.241.215]:41063 "EHLO ducie-dc1.codethink.co.uk" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1756166AbaC0Wzv (ORCPT ); Thu, 27 Mar 2014 18:55:51 -0400 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 Cc: kuninori.morimoto.gx@renesas.com, broonie@kernel.org, lgirdwood@gmail.com, linux-sh@vger.kernel.org, magnus.damm@opensource.se, Ben Dooks Subject: [PATCH] sound: rcar: use fast_io for bus 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 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 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,