Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Stefan Agner <stefan@agner.ch>
To: airlied@linux.ie, dri-devel@lists.freedesktop.org
Cc: alison.wang@freescale.com, jianwei.wang.chn@gmail.com,
	meng.yi@nxp.com, alexander.stein@systec-electronic.com,
	Stefan Agner <stefan@agner.ch>, Mark Brown <broonie@kernel.org>,
	stable@vger.kernel.org
Subject: [PATCH] drm/fsl-dcu: use flat regmap cache
Date: Fri,  3 Jun 2016 15:43:19 -0700	[thread overview]
Message-ID: <1464993799-2098-1-git-send-email-stefan@agner.ch> (raw)

Using flat regmap cache instead of RB-tree to avoid the following
lockdep warning on driver load:
WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:2755 lockdep_trace_alloc+0x15c/0x160()
DEBUG_LOCKS_WARN_ON(irqs_disabled_flags(flags))

The RB-tree regmap cache needs to allocate new space on first
writes. However, allocations in an atomic context (e.g. when a
spinlock is held) are not allowed. The function regmap_write
calls map->lock, which acquires a spinlock in the fast_io case.
Since the FSL DCU driver uses MMIO, the regmap bus of type
regmap_mmio is being used which has fast_io set to true.

Use flat regmap cache and specify max register to be large
enouth to cover all registers available in LS1021a and Vybrids
register space.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Cc: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
---
While regmap cache is used for suspend/resume only (which is
broken in its current state) Mark noted that using the RB regmap
cache can also cause issues during initialization of the driver.
This patch migrates to flat regmap cache (which we can also use
to fix the issue in stable kernels), and yet another patchset
moves to the atomic suspend/resume helpers (which will not go
into stable...)

Dave, I saw that you just sent out the pull for rc2, will send
a pull request for rc3 early next week...

--
Stefan

 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 3 ++-
 1 file changed, 2 insertions(+), 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 0ec1ad9..dc723f7 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
@@ -42,9 +42,10 @@ 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,
 
 	.volatile_reg = fsl_dcu_drm_is_volatile_reg,
+	.max_register = 0x11fc,
 };
 
 static int fsl_dcu_drm_irq_init(struct drm_device *dev)
-- 
2.8.2


             reply	other threads:[~2016-06-03 22:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-03 22:43 Stefan Agner [this message]
2016-06-03 23:00 ` [PATCH] drm/fsl-dcu: use flat regmap cache Daniel Vetter
2016-06-04  1:51   ` Stefan Agner
2016-06-04 10:12     ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1464993799-2098-1-git-send-email-stefan@agner.ch \
    --to=stefan@agner.ch \
    --cc=airlied@linux.ie \
    --cc=alexander.stein@systec-electronic.com \
    --cc=alison.wang@freescale.com \
    --cc=broonie@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jianwei.wang.chn@gmail.com \
    --cc=meng.yi@nxp.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox