public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: David Jander <david.jander@protonic.nl>
Cc: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers: regmap: bugfix in regcache-rbtree.c
Date: Wed, 21 Aug 2013 15:44:42 +0100	[thread overview]
Message-ID: <20130821144442.GD26118@sirena.org.uk> (raw)
In-Reply-To: <20130821162143.42ca91de@archvile>

[-- Attachment #1: Type: text/plain, Size: 878 bytes --]

On Wed, Aug 21, 2013 at 04:21:43PM +0200, David Jander wrote:

> I hope you can explain to me how regcache_rbtree_node_alloc() is supposed to
> work, because I start to think that something in there is broken...
> Specially the code at line 323 strikes me:

> 	if (!rbnode->blklen) {
> 		rbnode->blklen = sizeof(*rbnode);
> 		rbnode->base_reg = reg;
> 	}

That's intended to avoid creating lots of tiny blocks.  I think this bit
is actually OK but what should be happening here is that the collision
gets noticed when we try to insert the block and we at least constrain
the size of the new block if not merge it with the old one immediately
after (which is obvioulsy better).

As a bug fix setting blklen to be a single register ought to avoid
triggering problems though it will be less efficient - does that work
for you?  Doing the merging is going to be too much for a fix.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-08-21 14:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-21 13:02 [PATCH] drivers: regmap: bugfix in regcache-rbtree.c David Jander
2013-08-21 13:14 ` David Jander
2013-08-21 14:08   ` Mark Brown
2013-08-21 14:24     ` David Jander
2013-08-21 14:41     ` David Jander
2013-08-21 13:32 ` Mark Brown
2013-08-21 14:21   ` David Jander
2013-08-21 14:44     ` Mark Brown [this message]
2013-08-21 15:08       ` David Jander
2013-08-21 15:28         ` Mark Brown
2013-08-21 17:03           ` Dimitris Papastamos
2013-08-22 10:04             ` Mark Brown

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=20130821144442.GD26118@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=david.jander@protonic.nl \
    --cc=dp@opensource.wolfsonmicro.com \
    --cc=linux-kernel@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