From patchwork Wed Jul 23 21:19:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 4613181 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 B00B79F295 for ; Wed, 23 Jul 2014 21:19:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C5308201C8 for ; Wed, 23 Jul 2014 21:19:38 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id B0ADB201C7 for ; Wed, 23 Jul 2014 21:19:37 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0AEFA265747; Wed, 23 Jul 2014 23:19:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: 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 D7E63265732; Wed, 23 Jul 2014 23:19:25 +0200 (CEST) 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 C4C93265733; Wed, 23 Jul 2014 23:19:23 +0200 (CEST) Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [95.142.166.194]) by alsa0.perex.cz (Postfix) with ESMTP id DBE9A265732 for ; Wed, 23 Jul 2014 23:19:14 +0200 (CEST) Received: from avalon.ideasonboard.com (242.232-240-81.adsl-dyn.isp.belgacom.be [81.240.232.242]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 47540359F1; Wed, 23 Jul 2014 23:18:05 +0200 (CEST) From: Laurent Pinchart To: alsa-devel@alsa-project.org Date: Wed, 23 Jul 2014 23:19:26 +0200 Message-Id: <1406150366-10169-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 1.8.5.5 Cc: Kuninori Morimoto , linux-sh@vger.kernel.org Subject: [alsa-devel] [PATCH] ASoC: rsnd: Protect register accesses with a spinlock instead of a mutex 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 hardware registers are accessed from atomic contexts (the rsnd_soc_dai_trigger function, for instance, is called with the PCM substream spinlock held). They thus can't be protected by a mutex. Protect regmap register accesses with a spinlock instead of a mutex by setting the fast_io flag. Signed-off-by: Laurent Pinchart --- sound/soc/sh/rcar/gen.c | 1 + 1 file changed, 1 insertion(+) An even better solution might be to use regmap-mmio instead of a custom bus. Morimoto-san, is there anything that would prevent the driver from switching to regmap-mmio ? diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c index 73ce4c9..ec9ac5e 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,