* [PATCH] regmap: Fix order of regmap write log
@ 2020-11-12 15:02 Lucas Tanure
2020-11-12 15:57 ` Charles Keepax
2020-11-12 19:39 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Lucas Tanure @ 2020-11-12 15:02 UTC (permalink / raw)
To: Mark Brown, Greg Kroah-Hartman, Rafael J . Wysocki
Cc: linux-kernel, patches, Lucas Tanure
_regmap_write can trigger a _regmap_select_page, which will call
another _regmap_write that will be executed first, but the log shows
the inverse order
Also, keep consistency with _regmap_read which only logs in case of
success
Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
---
drivers/base/regmap/regmap.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 5db536ccfcd6b..297e95be25b3b 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -1924,12 +1924,15 @@ int _regmap_write(struct regmap *map, unsigned int reg,
}
}
- if (regmap_should_log(map))
- dev_info(map->dev, "%x <= %x\n", reg, val);
+ ret = map->reg_write(context, reg, val);
+ if (ret == 0) {
+ if (regmap_should_log(map))
+ dev_info(map->dev, "%x <= %x\n", reg, val);
- trace_regmap_reg_write(map, reg, val);
+ trace_regmap_reg_write(map, reg, val);
+ }
- return map->reg_write(context, reg, val);
+ return ret;
}
/**
--
2.29.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] regmap: Fix order of regmap write log
2020-11-12 15:02 [PATCH] regmap: Fix order of regmap write log Lucas Tanure
@ 2020-11-12 15:57 ` Charles Keepax
2020-11-12 19:39 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2020-11-12 15:57 UTC (permalink / raw)
To: Lucas Tanure
Cc: Mark Brown, Greg Kroah-Hartman, Rafael J . Wysocki, linux-kernel,
patches
On Thu, Nov 12, 2020 at 03:02:17PM +0000, Lucas Tanure wrote:
> _regmap_write can trigger a _regmap_select_page, which will call
> another _regmap_write that will be executed first, but the log shows
> the inverse order
>
> Also, keep consistency with _regmap_read which only logs in case of
> success
>
> Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
> ---
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] regmap: Fix order of regmap write log
2020-11-12 15:02 [PATCH] regmap: Fix order of regmap write log Lucas Tanure
2020-11-12 15:57 ` Charles Keepax
@ 2020-11-12 19:39 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2020-11-12 19:39 UTC (permalink / raw)
To: Rafael J . Wysocki, Greg Kroah-Hartman, Lucas Tanure
Cc: linux-kernel, patches
On Thu, 12 Nov 2020 15:02:17 +0000, Lucas Tanure wrote:
> _regmap_write can trigger a _regmap_select_page, which will call
> another _regmap_write that will be executed first, but the log shows
> the inverse order
>
> Also, keep consistency with _regmap_read which only logs in case of
> success
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-next
Thanks!
[1/1] regmap: Fix order of regmap write log
commit: f7d01359b0d96331fce7bd4051d3b68a4bb5ea83
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-12 19:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-12 15:02 [PATCH] regmap: Fix order of regmap write log Lucas Tanure
2020-11-12 15:57 ` Charles Keepax
2020-11-12 19:39 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).