Re: [PATCH] drivers: regmap: bugfix in regcache-rbtree.c

2013-08-22 Thread Mark Brown
On Wed, Aug 21, 2013 at 06:03:45PM +0100, Dimitris Papastamos wrote: > Once I have some free time I will look into implementing block > merges. That'd be great, thanks. signature.asc Description: Digital signature

Re: [PATCH] drivers: regmap: bugfix in regcache-rbtree.c

2013-08-21 Thread Dimitris Papastamos
On Wed, Aug 21, 2013 at 04:28:23PM +0100, Mark Brown wrote: > On Wed, Aug 21, 2013 at 05:08:46PM +0200, David Jander wrote: > > > This looks better. Not ideal still, but at least the codec works! > > > Should I re-send a patch with this fix? > > Yes, it's not the fix we actually want (we want to

Re: [PATCH] drivers: regmap: bugfix in regcache-rbtree.c

2013-08-21 Thread Mark Brown
On Wed, Aug 21, 2013 at 05:08:46PM +0200, David Jander wrote: > This looks better. Not ideal still, but at least the codec works! > Should I re-send a patch with this fix? Yes, it's not the fix we actually want (we want to be merging blocks) isn't going to be suitable for a bug fix - ideally I'l

Re: [PATCH] drivers: regmap: bugfix in regcache-rbtree.c

2013-08-21 Thread David Jander
On Wed, 21 Aug 2013 15:44:42 +0100 Mark Brown wrote: > 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 a

Re: [PATCH] drivers: regmap: bugfix in regcache-rbtree.c

2013-08-21 Thread Mark Brown
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) { >

Re: [PATCH] drivers: regmap: bugfix in regcache-rbtree.c

2013-08-21 Thread David Jander
On Wed, 21 Aug 2013 15:08:16 +0100 Mark Brown wrote: > On Wed, Aug 21, 2013 at 03:14:23PM +0200, David Jander wrote: > > > Here's the explanation: > > > 1. If a driver initializes a regmap with a RB-tree cache, and starts > > writing to registers in some arbitrary order, you might get overlappi

Re: [PATCH] drivers: regmap: bugfix in regcache-rbtree.c

2013-08-21 Thread David Jander
On Wed, 21 Aug 2013 15:08:16 +0100 Mark Brown wrote: > On Wed, Aug 21, 2013 at 03:14:23PM +0200, David Jander wrote: > > > Here's the explanation: > > > 1. If a driver initializes a regmap with a RB-tree cache, and starts > > writing to registers in some arbitrary order, you might get overlappi

Re: [PATCH] drivers: regmap: bugfix in regcache-rbtree.c

2013-08-21 Thread David Jander
On Wed, 21 Aug 2013 14:32:00 +0100 Mark Brown wrote: > On Wed, Aug 21, 2013 at 03:02:35PM +0200, David Jander wrote: > > > rbnode register ranges can overlap, which is not a problem as long as > > They can? They aren't supposed to and I'd expect this to cause problems > with the cache sync cod

Re: [PATCH] drivers: regmap: bugfix in regcache-rbtree.c

2013-08-21 Thread Mark Brown
On Wed, Aug 21, 2013 at 03:14:23PM +0200, David Jander wrote: > Here's the explanation: > 1. If a driver initializes a regmap with a RB-tree cache, and starts writing > to > registers in some arbitrary order, you might get overlapping rbnodes: > Suppose I have this rb-tree (a real case I happen

Re: [PATCH] drivers: regmap: bugfix in regcache-rbtree.c

2013-08-21 Thread David Jander
Hi Dimitris, On Wed, 21 Aug 2013 15:02:35 +0200 David Jander wrote: > The functionality of rbtree_ctx->cached_rbnode is broken. Remove it to > avoid hitting the wrong rbnode when locating a register. > rbnode register ranges can overlap, which is not a problem as long as > every lookup for a re

Re: [PATCH] drivers: regmap: bugfix in regcache-rbtree.c

2013-08-21 Thread Mark Brown
On Wed, Aug 21, 2013 at 03:02:35PM +0200, David Jander wrote: > rbnode register ranges can overlap, which is not a problem as long as They can? They aren't supposed to and I'd expect this to cause problems with the cache sync code too. How does this happen? signature.asc Description: Digital