Skip to contentSkip to conversation

regulator: of: Lower the severity of the error with no container

PATCH In review Mark Brown 2 participants 11 messages Oct 8, 2014 – Oct 9, 2014 Voltage and current regulator framework

lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

PATCH 1/1 regulator: of: Lower the severity of the error with no container

Description of regulators should generally be optional so if there is no DT node for the regulators container then we shouldn't print an error message. Lower the severity of the message to debug level (it might help someone work out what went wrong) and while we're at it say what we were looking for.

---
 drivers/regulator/of_regulator.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/regulator/of_regulator.c +2 -1
index 7a51814abdc5..5a1d4afa4776 100644
@@ -211,7 +211,8 @@ struct regulator_init_data *regulator_of_get_init_data(struct device *dev,
 		search = dev->of_node;
 
 	if (!search) {
-		dev_err(dev, "Failed to find regulator container node\n");
+		dev_dbg(dev, "Failed to find regulator container node '%s'\n",
+			desc->regulators_node);
 		return NULL;
 	}
 
Signature · 1 line
2.1.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Mark Brown

Description of regulators should generally be optional so if there is no DT node for the regulators container then we shouldn't print an error message. Lower the severity of the message to debug level (it might help someone work out what went wrong) and while we're at it say what we were looking for.

Excellent.

Would it also be possible to lower the severity of the "no parameters" message ?

Thanks,
Guenter

Quoted 21 lines
---
 drivers/regulator/of_regulator.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/regulator/of_regulator.c +2 -1
index 7a51814abdc5..5a1d4afa4776 100644
@@ -211,7 +211,8 @@ struct regulator_init_data *regulator_of_get_init_data(struct device *dev,
 		search = dev->of_node;
 
 	if (!search) {
-		dev_err(dev, "Failed to find regulator container node\n");
+		dev_dbg(dev, "Failed to find regulator container node '%s'\n",
+			desc->regulators_node);
 		return NULL;
 	}
 
Signature · 1 line
2.1.1
author maintainer
#2 lore raw
Quoted 2 lines · Guenter Roeck

Would it also be possible to lower the severity of the "no parameters" message ?

Could you be more specific please?

#3 lore raw
Quoted 6 lines · Mark Brown
Quoted 2 lines · Guenter Roeck

Would it also be possible to lower the severity of the "no parameters" message ?

Could you be more specific please?

There is a log message "no parameters" for each regulator. This is printed unconditionally from print_constraints().

Looking through the code again, looks like this is on purpose. It is just a bit annoying to get lots of those messages. One of the systems I am dealing with has 17 LTC2978 chips in it, with 8 channels each. That results in 136 times "no parameters" in the boot log. And that is not even a fully populated system; if fully populated, there can be more than 60 of those chips. 500+ lines of similar log messages is really a bit on the high side.

It might help if there was a way to silence the messages, ie to make "print_constraints" optional.

Thanks,
Guenter

author maintainer
#4 lore raw
Quoted 10 lines · Guenter Roeck

There is a log message "no parameters" for each regulator. This is printed unconditionally from print_constraints().

Looking through the code again, looks like this is on purpose. It is just a bit annoying to get lots of those messages. One of the systems I am dealing with has 17 LTC2978 chips in it, with 8 channels each. That results in 136 times "no parameters" in the boot log. And that is not even a fully populated system; if fully populated, there can be more than 60 of those chips. 500+ lines of similar log messages is really a bit on the high side.

Quoted 2 lines

It might help if there was a way to silence the messages, ie to make "print_constraints" optional.

Ah, from the constraints rather than from the DT parsing. I do like having it there since it's enormously helpful in debugging and that is a... specialist number of regulators you have in your system. We can definitely at least add a boot argument or something to suppress them, let me have a think if we want to do that by default.

#5 lore raw
Quoted 12 lines · Mark Brown
Quoted 9 lines · Guenter Roeck

There is a log message "no parameters" for each regulator. This is printed unconditionally from print_constraints().

Looking through the code again, looks like this is on purpose. It is just a bit annoying to get lots of those messages. One of the systems I am dealing with has 17 LTC2978 chips in it, with 8 channels each. That results in 136 times "no parameters" in the boot log. And that is not even a fully populated system; if fully populated, there can be more than 60 of those chips. 500+ lines of similar log messages is really a bit on the high side.

Quoted 6 lines
Quoted 2 lines

It might help if there was a way to silence the messages, ie to make "print_constraints" optional.

Ah, from the constraints rather than from the DT parsing. I do like having it there since it's enormously helpful in debugging and that is a... specialist number of regulators you have in your system. We can

Yes, this is a pretty large backbone switch. Kind of amazing how many sensors are in those systems.

Quoted 2 lines

definitely at least add a boot argument or something to suppress them, let me have a think if we want to do that by default.

It is a nuisance, so I might just disable it in our tree if we don't find some other solution.

Did you notice the problem with debugfs I had mentioned earlier ? With all those regulators, not all of them being used, I end up with many having the same name. This causes issues with debugfs, which is trying to create the same file several times.

Any idea how we could solve this ? The constraints message is annoying, but this one is a real issue.

Thanks,
Guenter

author maintainer
#6 lore raw
Quoted 7 lines · Guenter Roeck
Quoted 2 lines · Mark Brown

definitely at least add a boot argument or something to suppress them, let me have a think if we want to do that by default.

It is a nuisance, so I might just disable it in our tree if we don't find some other solution.

We'll do something, just a question of what and what the default is.

Quoted 7 lines

Did you notice the problem with debugfs I had mentioned earlier ? With all those regulators, not all of them being used, I end up with many having the same name. This causes issues with debugfs, which is trying to create the same file several times.

Any idea how we could solve this ? The constraints message is annoying, but this one is a real issue.

Shove a dev_name() on the front if we get a collision? I have to say I've never cared, the debugfs isn't that important so it doesn't matter too much if it fails.

#7 lore raw
Quoted 11 lines · Mark Brown
Quoted 7 lines · Guenter Roeck
Quoted 2 lines · Mark Brown

definitely at least add a boot argument or something to suppress them, let me have a think if we want to do that by default.

It is a nuisance, so I might just disable it in our tree if we don't find some other solution.

We'll do something, just a question of what and what the default is.

Ok. Note that a boot parameter would not work well for our use case, so it would be great if we can find something else.

Quoted 11 lines
Quoted 7 lines

Did you notice the problem with debugfs I had mentioned earlier ? With all those regulators, not all of them being used, I end up with many having the same name. This causes issues with debugfs, which is trying to create the same file several times.

Any idea how we could solve this ? The constraints message is annoying, but this one is a real issue.

Shove a dev_name() on the front if we get a collision? I have to say I've never cared, the debugfs isn't that important so it doesn't matter too much if it fails.

Sure, but, again, I am getting lots and lots of those error messages. I probably would not care either (and probably not even have noticed) if not for those messages.

Want me to submit a patch with the dev_name solution ?

Thanks,
Guenter

author maintainer
#8 lore raw
Quoted 6 lines · Guenter Roeck
Quoted 1 line · Mark Brown

We'll do something, just a question of what and what the default is.

Ok. Note that a boot parameter would not work well for our use case, so it would be great if we can find something else.

Could you explain why please?

Quoted 9 lines
Quoted 3 lines

Shove a dev_name() on the front if we get a collision? I have to say I've never cared, the debugfs isn't that important so it doesn't matter too much if it fails.

Sure, but, again, I am getting lots and lots of those error messages. I probably would not care either (and probably not even have noticed) if not for those messages.

Want me to submit a patch with the dev_name solution ?

Yes, please.

#9 lore raw
Quoted 10 lines · Mark Brown
Quoted 6 lines · Guenter Roeck
Quoted 1 line · Mark Brown

We'll do something, just a question of what and what the default is.

Ok. Note that a boot parameter would not work well for our use case, so it would be great if we can find something else.

Could you explain why please?

Some of the system are loaded from u-boot. We can technically change the environment, but that would not be persistent. Product requirement is that the default (hard-coded) environment has to be the one that is used. And changing u-boot in those systems is more difficult than getting an audience with the Pope - believe me, we went through that. Unless there is a fatal problem, it simply won't be approved.

On x86 systems, which are booted through grub, we have a similar problem. The boot menu is secured and for all practical purposes untouchable.

All that makes it much simpler to carry a one-line patch to remove the output from the log. I may try to do without it and keep the message, but I am quite sure that someone will complain and we'll have to do it.

Quoted 11 lines
Quoted 9 lines
Quoted 3 lines

Shove a dev_name() on the front if we get a collision? I have to say I've never cared, the debugfs isn't that important so it doesn't matter too much if it fails.

Sure, but, again, I am getting lots and lots of those error messages. I probably would not care either (and probably not even have noticed) if not for those messages.

Want me to submit a patch with the dev_name solution ?

Yes, please.

Ok, will do.

Thanks,
Guenter

#10 lore raw
In reply to Mark Brown
Quoted 6 lines · Mark Brown
Quoted 3 lines · Guenter Roeck
Quoted 3 lines

Shove a dev_name() on the front if we get a collision? I have to say I've never cared, the debugfs isn't that important so it doesn't matter too much if it fails.

Quoted 7 lines
Quoted 5 lines

Sure, but, again, I am getting lots and lots of those error messages. I probably would not care either (and probably not even have noticed) if not for those messages.

Want me to submit a patch with the dev_name solution ?

Yes, please.

Turns out that is already supposed to happen if the function creating the entry knows about the device. I guess this explains why others don't see the problem. We'll have to find out what is going on.

Guenter