public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regmap: debugfs: Fix last entry store in the offset cache
@ 2013-01-16 13:24 Philipp Zabel
  2013-01-16 13:29 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Philipp Zabel @ 2013-01-16 13:24 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mark Brown, Greg Kroah-Hartman, Philipp Zabel

Commit e8d6539c8a94b88fc7ca5d6bdd9eeb0e64b434e4
(regmap: debugfs: Make sure we store the last entry in the offset cache)
causes regmap_debugfs_get_dump_start to unconditionally return base if
the debugfs_off_cache is not empty when the function is called (because
c == NULL). This effectively causes all but the first read from
debugfs/regmap/*/registers to start from register position 0, which
in turn results in infinitely looping debugfs register map output.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/base/regmap/regmap-debugfs.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c
index 46a213a..b3369e6 100644
--- a/drivers/base/regmap/regmap-debugfs.c
+++ b/drivers/base/regmap/regmap-debugfs.c
@@ -114,15 +114,15 @@ static unsigned int regmap_debugfs_get_dump_start(struct regmap *map,
 
 			p += map->debugfs_tot_len;
 		}
-	}
 
-	/* Close the last entry off if we didn't scan beyond it */
-	if (c) {
-		c->max = p - 1;
-		list_add_tail(&c->list,
-			      &map->debugfs_off_cache);
-	} else {
-		return base;
+		/* Close the last entry off if we didn't scan beyond it */
+		if (c) {
+			c->max = p - 1;
+			list_add_tail(&c->list,
+				      &map->debugfs_off_cache);
+		} else {
+			return base;
+		}
 	}
 
 	/*
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] regmap: debugfs: Fix last entry store in the offset cache
  2013-01-16 13:24 [PATCH] regmap: debugfs: Fix last entry store in the offset cache Philipp Zabel
@ 2013-01-16 13:29 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2013-01-16 13:29 UTC (permalink / raw)
  To: Philipp Zabel; +Cc: linux-kernel, Greg Kroah-Hartman

On Wed, Jan 16, 2013 at 02:24:11PM +0100, Philipp Zabel wrote:

> -	/* Close the last entry off if we didn't scan beyond it */
> -	if (c) {
> -		c->max = p - 1;
> -		list_add_tail(&c->list,
> -			      &map->debugfs_off_cache);

Oh, ffs.  I actually fixed this but the cherry pick went wrong.

> -	} else {
> -		return base;
> +		/* Close the last entry off if we didn't scan beyond it */
> +		if (c) {
> +			c->max = p - 1;
> +			list_add_tail(&c->list,
> +				      &map->debugfs_off_cache);
> +		} else {
> +			return base;
> +		}

No, the else clause just needs deleting.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-16 13:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-16 13:24 [PATCH] regmap: debugfs: Fix last entry store in the offset cache Philipp Zabel
2013-01-16 13:29 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox