Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964995AbbLCLjl (ORCPT ); Thu, 3 Dec 2015 06:39:41 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:41794 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1756741AbbLCLjj (ORCPT ); Thu, 3 Dec 2015 06:39:39 -0500 X-Listener-Flag: 11101 Message-ID: <1449142774.17544.8.camel@mtksdaap41> Subject: Re: [alsa-devel] [PATCH] ASoC: mediatek: Use current HW pointer for pointer callback From: Koro Chen To: Takashi Iwai CC: Mark Brown , , , , , , , Date: Thu, 3 Dec 2015 19:39:34 +0800 In-Reply-To: References: <1449129208-63615-1-git-send-email-koro.chen@mediatek.com> <20151203110158.GD5727@sirena.org.uk> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1420 Lines: 37 On Thu, 2015-12-03 at 12:07 +0100, Takashi Iwai wrote: > On Thu, 03 Dec 2015 12:01:58 +0100, > Mark Brown wrote: > > > > On Thu, Dec 03, 2015 at 10:41:38AM +0100, Takashi Iwai wrote: > > > > > While reading this patch, I wondered how regmap can be used safely in > > > an irq-disabled context. Mark, do we have any API for that? > > > > We can use user supplied locks or spin_lock_irqsave(). > > I meant how to guarantee to make regmap_read() working in an already > spin-locked context, typically in an irq handler? regmap_read() > involves with the regcache and it may invoke kmalloc(). > Yes, we were hit by this before. When using devm_regmap_init_mmio() for regmap, it uses spin_lock_irqsave() before every read/write, and if cache type is RBTREE, then kmalloc will occur after spin_lock_irqsave() and it brings warning. That's why we changed RBTREE to NONE. Setting cache type to FLAT will also work, but we think our register accessing is fast enough without need of cache. > > Takashi > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/