Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755993AbcC2G6U (ORCPT ); Tue, 29 Mar 2016 02:58:20 -0400 Received: from webbox1416.server-home.net ([77.236.96.61]:35871 "EHLO webbox1416.server-home.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752145AbcC2G4l (ORCPT ); Tue, 29 Mar 2016 02:56:41 -0400 From: Alexander Stein To: Stefan Agner Cc: Alison Wang , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] drm: fsl-dcu: Use flat cache Date: Tue, 29 Mar 2016 08:56:12 +0200 Message-ID: <16406347.uLoyTglLnv@ws-stein> User-Agent: KMail/4.14.10 (Linux/4.1.15-gentoo-r1; KDE/4.14.16; x86_64; ; ) In-Reply-To: <43567cc2f2f6b3b7d1a06a094f6ff90a@agner.ch> References: <1458826413-3916-1-git-send-email-alexander.stein@systec-electronic.com> <43567cc2f2f6b3b7d1a06a094f6ff90a@agner.ch> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1927 Lines: 54 On Friday 25 March 2016 09:24:28, Stefan Agner wrote: > Hi Alexander, > > On 2016-03-24 06:33, Alexander Stein wrote: > > Using REGCACHE_RBTREE for MMIO regmap is not valid as spinlock's will be > > used during cache allocation. > > > > This fixes the following bug: > > BUG: sleeping function called from invalid context at mm/slab.h:388 > > in_atomic(): 1, irqs_disabled(): 128, pid: 192, name: udevd > > [...] > > > > Signed-off-by: Alexander Stein > > --- > > Please refer also to the discussion at > > https://lists.freedesktop.org/archives/dri-devel/2016-January/098696.html > > > > drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c > > b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c > > index e8d9337..ea65140 100644 > > --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c > > +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c > > @@ -40,7 +40,7 @@ static const struct regmap_config fsl_dcu_regmap_config > > = {> > > .reg_bits = 32, > > .reg_stride = 4, > > .val_bits = 32, > > > > - .cache_type = REGCACHE_RBTREE, > > + .cache_type = REGCACHE_FLAT, > > To use flat regcache you also need to set the max_register. Ah, thanks for that hint, I was not aware of that. I wondered why my kernel crashed using flat cache. Seems cache allocation is too small when max_register=0. Just sent a patch enforcing setting max_register. > I already have such a patch, see: > https://lists.freedesktop.org/archives/dri-devel/2016-January/099121.html Thanks, meanwhile this will do for me. I think. > However, the current suspend/resume implementation (which uses the > regcache) is anyway flawed. I currently prepare a patchset to remove the > regmap cache entirely and use Thierry's new generic suspend/resume > functions. Feel free to cc me. Best regards, Alexander