Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755924AbbGPTHH (ORCPT ); Thu, 16 Jul 2015 15:07:07 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:54319 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752150AbbGPTHG (ORCPT ); Thu, 16 Jul 2015 15:07:06 -0400 Date: Thu, 16 Jul 2015 20:06:57 +0100 From: Mark Brown To: Alexander Stein Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Message-ID: <20150716190657.GA11162@sirena.org.uk> References: <1437061732-21018-1-git-send-email-alexander.stein@systec-electronic.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="JLNA6GjV6wdcumra" Content-Disposition: inline In-Reply-To: <1437061732-21018-1-git-send-email-alexander.stein@systec-electronic.com> X-Cookie: Stay together, drag each other down. User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH 1/1] regmap: regcache-rbtree: Use GFP_ATOMIC when using spinlocks 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: 2205 Lines: 53 --JLNA6GjV6wdcumra Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 16, 2015 at 05:48:52PM +0200, Alexander Stein wrote: > When regmap locking is done using spinlocks (e.g. using > devm_regmap_init_mmio_clk) access is protected using spin_lock_irqsave. > So when calling regmap_write the first time and a node is about to be > inserted kzalloc must not be called with GFP_KERNEL. At this point The expectation here is that we should either be using no or a flat cache here or (if we're using rbtree) providing register defaults to ensure that we never do allocations in the spinlock. The rbtree code is written on the assumption that we only have to be faster than reading =66rom a serial bus so I'd be worried about it not behaving at all nicely in a spinlock even ignoring this issue. Why are you using a dynamically allocated rbtree for a device like this? > interrupts are disabled. This fixes the following warning: > [ 8.605433] WARNING: CPU: 0 PID: 130 at kernel/lockdep.c:2740 lockdep_= trace_alloc+0x124/0x128() > [ 8.614096] DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags)) Please don't paste entire backtraces into commit messages, they're enormous and don't add any value. If you feel a backtrace is useful edit down the relevant context. --JLNA6GjV6wdcumra Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJVqADQAAoJECTWi3JdVIfQBM4H/iML508G+AGDAhzE1FT5NrUY MpQFZVhkAIHTXhQfqXeu8PtN77SUN5Zv9cYctxRnUNeAFTcu/RwMlx56ov86C1QR q8H3mHKSd8MIuKJIhp4lyeMwipqJIDfDMeDZyonYiN/HP99FGjYo9FcQVRbFIize XxtVsMbt9FdFMJ2GDQ9zzQogK3D2nrXpMU3fWK4HPaE1U06wZX2x5bEqg8Aq5xLH 6TMzbuTDDt5wlOj1fFfyq+jw+fXBwodjI2iVatAezi1FbmtTkzjmErMGn/8QynRd LWnOD+USj0k88WXRNELP3mmFl/HSqqN1vcSd2jFunWX6bZUcojCDoo/hrS52dAE= =EezC -----END PGP SIGNATURE----- --JLNA6GjV6wdcumra-- -- 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/