Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760505AbbLCO4d (ORCPT ); Thu, 3 Dec 2015 09:56:33 -0500 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:59327 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755274AbbLCO4c (ORCPT ); Thu, 3 Dec 2015 09:56:32 -0500 Date: Thu, 3 Dec 2015 14:56:12 +0000 From: Mark Brown To: Takashi Iwai Cc: Koro Chen , lgirdwood@gmail.com, alsa-devel@alsa-project.org, srv_heupstream@mediatek.com, s.hauer@pengutronix.de, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Message-ID: <20151203145612.GF5727@sirena.org.uk> References: <1449129208-63615-1-git-send-email-koro.chen@mediatek.com> <20151203110158.GD5727@sirena.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gneEPciiIl/aKvOT" Content-Disposition: inline In-Reply-To: X-Cookie: revolutionary, adj.: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [alsa-devel] [PATCH] ASoC: mediatek: Use current HW pointer for pointer callback X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1808 Lines: 45 --gneEPciiIl/aKvOT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Dec 03, 2015 at 12:07:26PM +0100, Takashi Iwai wrote: > 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(). I know that's what you meant - that should be done by preallocating the cache (which can be done with defaults) and providing your own lock if there's a spinlock already held (since we use _irqsave() which IIRC isn't nestable). We can also use GFP_ATOMIC for some of the allocations in reasonable use cases but it's not in general supported. --gneEPciiIl/aKvOT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWYFgLAAoJECTWi3JdVIfQshMH/1f+2R0EI/UaBMiaMm4uXBCo +NvM9ef0R8WKSz6VJPlovVywMxEucpPJW/rmv1eXajVlwv12XaswNLTs+Ys6Wxf6 FGzyzwM2ltkFR3Ks9sHXSdRB0MhjQuQIf7a+6DYHUiVUq2vwjq/VrDxplAYGSk/2 7JmAQIpVmZHZ9jj9nDiAoxa6vLKESm8aMwOy+gxI/60b/2bCcisjqrBwxJin7Uie qzgiGr7qhFBRFowBAEvoxi8zTLW/OvQdO8ZTrTAWBOJkN+bi8lxXjnY5F8woW6de 3n0PWhHknatINmpyUuM4KDdr+F8lH5tYAjFMCsQnMA5B293Y5wnj8ZZVAS+G3E8= =ML7L -----END PGP SIGNATURE----- --gneEPciiIl/aKvOT-- -- 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/