From patchwork Tue Mar 18 03:58:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Reid X-Patchwork-Id: 3847231 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 2E55D9F370 for ; Tue, 18 Mar 2014 03:59:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 379CA202EB for ; Tue, 18 Mar 2014 03:59:58 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id E1A06201EF for ; Tue, 18 Mar 2014 03:59:55 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3E527261AA0; Tue, 18 Mar 2014 04:59:54 +0100 (CET) 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 8C851261A89; Tue, 18 Mar 2014 04:59:48 +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 3AF4B261A8C; Tue, 18 Mar 2014 04:59:47 +0100 (CET) Received: from mail-ig0-f202.google.com (mail-ig0-f202.google.com [209.85.213.202]) by alsa0.perex.cz (Postfix) with ESMTP id 5D311261A84 for ; Tue, 18 Mar 2014 04:59:40 +0100 (CET) Received: by mail-ig0-f202.google.com with SMTP id uq10so715381igb.1 for ; Mon, 17 Mar 2014 20:59:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=QtqlSupLsH7MiPZEk+6ukszodhrj6+Ra408YcEIC+Xo=; b=mHZDsXpsU0CEOTl6dpooNy2MXnnBNzefNo0rPkmV78W53QVd97k3grMOIiKd+T5iYP hA3GVaM4XGWv16bHWaSvB/44z4/69/zs5yb7c0NFYMYa9hctCfRbO48c+umsaH1B8TaV ySWMUixZ3g9DSfYw1r9HJxsKY3Ls3k8fkQDUWq7IqD0Y6T1BLWqIefOczFfxrXHvlW/u TWmQqjs0uGs4F6dkqEOOqq9YIawkcP+YQP1F8SrfljPkVhqu42pO+SiYiPToOnBXE5aZ w86aGlB6ALfX7OkONA1IYk6xDMaGydYWWiclEHarvEyclYSsd8VfzDNMh0JHrAehDdsh OK8w== X-Gm-Message-State: ALoCoQkWRtsbeDM41buDG5bV1QdUyKBE/QOzm2PIvUJG4hA7p2mzDqQsHelSIeA6FTPJTa17ePiaPOC22zBfEuRTdCG/7z915R+eaWcHXfU/mKHUhfXp9biosm+72IcHDOzfs/cdaVjeVBabnTF/0U8ooAkcDTIi1qy5vkMCmjHiXMRH41t6bPGg5QHHGoP1WyZflWxYxvnwUsLfsmjloWkUrtfT9LWwV3yUFIyNdBAhz3ok55kz+GA= X-Received: by 10.50.164.198 with SMTP id ys6mr6930025igb.2.1395115178806; Mon, 17 Mar 2014 20:59:38 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id c9si1689862yhm.7.2014.03.17.20.59.38 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Mar 2014 20:59:38 -0700 (PDT) Received: from hojo20.mtv.corp.google.com (hojo20.mtv.corp.google.com [172.22.72.28]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id 922795A40F4; Mon, 17 Mar 2014 20:59:38 -0700 (PDT) Received: by hojo20.mtv.corp.google.com (Postfix, from userid 123195) id 2B96418162A; Mon, 17 Mar 2014 20:59:38 -0700 (PDT) From: Dylan Reid To: alsa-devel@alsa-project.org Date: Mon, 17 Mar 2014 20:58:59 -0700 Message-Id: <1395115139-22243-1-git-send-email-dgreid@chromium.org> X-Mailer: git-send-email 1.8.1.3.605.g02339dd Cc: linux-tegra@vger.kernel.org, abrestic@chromium.org, Dylan Reid , broonie@kernel.org, swarren@wwwdotorg.org Subject: [alsa-devel] [PATCH] ASoC: tegra: Use flat regcache. 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 When using an rbtree cache, there can be allocations the first time a register is accessed. This can cause an attempt to schedule while atomic in the case that the regmap is using a spinlock. This could be fixed by either initializing all the registers or using a flat cache. The register maps for tegra30_ahub and tegra30_i2s are dense and don't save much from using a tree so convert them to flat. Signed-off-by: Dylan Reid --- sound/soc/tegra/tegra30_ahub.c | 4 ++-- sound/soc/tegra/tegra30_i2s.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/tegra/tegra30_ahub.c b/sound/soc/tegra/tegra30_ahub.c index d6f4c99..0db68f4 100644 --- a/sound/soc/tegra/tegra30_ahub.c +++ b/sound/soc/tegra/tegra30_ahub.c @@ -471,7 +471,7 @@ static const struct regmap_config tegra30_ahub_apbif_regmap_config = { .readable_reg = tegra30_ahub_apbif_wr_rd_reg, .volatile_reg = tegra30_ahub_apbif_volatile_reg, .precious_reg = tegra30_ahub_apbif_precious_reg, - .cache_type = REGCACHE_RBTREE, + .cache_type = REGCACHE_FLAT, }; static bool tegra30_ahub_ahub_wr_rd_reg(struct device *dev, unsigned int reg) @@ -490,7 +490,7 @@ static const struct regmap_config tegra30_ahub_ahub_regmap_config = { .max_register = LAST_REG(AUDIO_RX), .writeable_reg = tegra30_ahub_ahub_wr_rd_reg, .readable_reg = tegra30_ahub_ahub_wr_rd_reg, - .cache_type = REGCACHE_RBTREE, + .cache_type = REGCACHE_FLAT, }; static struct tegra30_ahub_soc_data soc_data_tegra30 = { diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c index 49ad936..f146c41 100644 --- a/sound/soc/tegra/tegra30_i2s.c +++ b/sound/soc/tegra/tegra30_i2s.c @@ -357,7 +357,7 @@ static const struct regmap_config tegra30_i2s_regmap_config = { .writeable_reg = tegra30_i2s_wr_rd_reg, .readable_reg = tegra30_i2s_wr_rd_reg, .volatile_reg = tegra30_i2s_volatile_reg, - .cache_type = REGCACHE_RBTREE, + .cache_type = REGCACHE_FLAT, }; static const struct tegra30_i2s_soc_data tegra30_i2s_config = {