Skip to contentSkip to conversation

mmc: dw_mmc: Change signal voltage error to dev_dbg()

PATCH Applied Doug Anderson 4 participants 6 messages Oct 11, 2014 – Oct 27, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: dw_mmc: Change signal voltage error to dev_dbg()

In (28f92b5 mmc: core: Try other signal levels during power up) we can see that there are times when it's valid to try several signal voltages. Don't print an ugly error in the logs when that happens.

---
 drivers/mmc/host/dw_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/dw_mmc.c +1 -1
index 69f0cc6..c4afbdd 100644
@@ -1075,7 +1075,7 @@ static int dw_mci_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios)
 		ret = regulator_set_voltage(mmc->supply.vqmmc, min_uv, max_uv);
 
 		if (ret) {
-			dev_err(&mmc->class_dev,
+			dev_dbg(&mmc->class_dev,
 					 "Regulator set error %d: %d - %d\n",
 					 ret, min_uv, max_uv);
 			return ret;
Signature · 1 line
2.1.0.rc2.206.gedb03e5
#1 lore raw

Hi Doug,

Quoted 14 lines · Doug Anderson

In (28f92b5 mmc: core: Try other signal levels during power up) we can see that there are times when it's valid to try several signal voltages. Don't print an ugly error in the logs when that happens.

---
 drivers/mmc/host/dw_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/dw_mmc.c +0 -0
index 69f0cc6..c4afbdd 100644

drivers/mmc/host/dw_mmc.c static int dw_mci_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios) · line 1081

Quoted 8 lines
drivers/mmc/host/dw_mmc.c +1 -1
@@ -1075,7 +1075,7 @@ static int dw_mci_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios)
                ret = regulator_set_voltage(mmc->supply.vqmmc, min_uv, max_uv);
 
                if (ret) {
-                       dev_err(&mmc->class_dev,
+                       dev_dbg(&mmc->class_dev,
                                         "Regulator set error %d: %d - %d\n",
                                         ret, min_uv, max_uv);
                        return ret;

Well, I am ok with this but this info is very useful, what if PMIC failed to actually set the voltage? may be because of some PMIC driver bug or i2c driver bug? Ofcourse this can be found by turning MMC_DEBUG ON, but is that worth in this case. Or is there a way to print that, this failure is because of a regulator re-try?
your thoughts?

Quoted 7 lines

--
2.1.0.rc2.206.gedb03e5

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Regards,
Alim
#2 lore raw

Alim,

Quoted 5 lines · Alim Akhtar
Quoted 5 lines
drivers/mmc/host/dw_mmc.c +0 -0
@@ -1075,7 +1075,7 @@ static int dw_mci_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios)
                ret = regulator_set_voltage(mmc->supply.vqmmc, min_uv, max_uv);
 
Quoted 12 lines

drivers/mmc/host/dw_mmc.c static int dw_mci_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios) · line 1081

Quoted 6 lines
drivers/mmc/host/dw_mmc.c +1 -1
                if (ret) {
-                       dev_err(&mmc->class_dev,
+                       dev_dbg(&mmc->class_dev,
                                         "Regulator set error %d: %d - %d\n",
                                         ret, min_uv, max_uv);
                        return ret;

Well, I am ok with this but this info is very useful, what if PMIC failed to actually set the voltage? may be because of some PMIC driver bug or i2c driver bug? Ofcourse this can be found by turning MMC_DEBUG ON, but is that worth in this case. Or is there a way to print that, this failure is because of a regulator re-try?
your thoughts?

I think that the regulator framework and the i2c framework are supposed to be reliable. If they aren't reliable there will be lots of places that will have problems. I think that you _could_:

* In your regulator driver print an error when an i2c transfer fails.

* In your regulator driver print an error if some unexpected event happens (like a regulator reports that the voltage didn't actually change).

That would get you want you want, right? ...but an error here doesn't belong and that's pretty much determined by (28f92b5 mmc: core: Try other signal levels during power up). That patch wants to be able to try several different voltage levels and if we print an error in that case then it's going to be very confusing to the user.

-Doug

Reviewed-by
#3 lore raw

Hi Doug,

Quoted 31 lines · Doug Anderson

Alim,

Quoted 5 lines · Alim Akhtar
Quoted 5 lines
drivers/mmc/host/dw_mmc.c +0 -0
@@ -1075,7 +1075,7 @@ static int dw_mci_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios)
                ret = regulator_set_voltage(mmc->supply.vqmmc, min_uv, max_uv);
 
Quoted 12 lines

drivers/mmc/host/dw_mmc.c static int dw_mci_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios) · line 1081

Quoted 6 lines
drivers/mmc/host/dw_mmc.c +1 -1
                if (ret) {
-                       dev_err(&mmc->class_dev,
+                       dev_dbg(&mmc->class_dev,
                                         "Regulator set error %d: %d - %d\n",
                                         ret, min_uv, max_uv);
                        return ret;

Well, I am ok with this but this info is very useful, what if PMIC failed to actually set the voltage? may be because of some PMIC driver bug or i2c driver bug? Ofcourse this can be found by turning MMC_DEBUG ON, but is that worth in this case. Or is there a way to print that, this failure is because of a regulator re-try?
your thoughts?

I think that the regulator framework and the i2c framework are supposed to be reliable. If they aren't reliable there will be lots of places that will have problems. I think that you _could_:

* In your regulator driver print an error when an i2c transfer fails.

* In your regulator driver print an error if some unexpected event happens (like a regulator reports that the voltage didn't actually change).

Quoted 6 lines

That would get you want you want, right? ...but an error here doesn't belong and that's pretty much determined by (28f92b5 mmc: core: Try other signal levels during power up). That patch wants to be able to try several different voltage levels and if we print an error in that case then it's going to be very confusing to the user.

Hmm...Ok, convincing enough to me, so

Quoted 1 line

-Doug

Signature · 2 lines
Regards,
Alim
maintainer Acked-by on v1 1/1
#4 lore raw
In reply to Doug Anderson

Best Regards,
Jaehoon Chung

Quoted 23 lines · Doug Anderson

In (28f92b5 mmc: core: Try other signal levels during power up) we can see that there are times when it's valid to try several signal voltages. Don't print an ugly error in the logs when that happens.

---
 drivers/mmc/host/dw_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/dw_mmc.c +1 -1
index 69f0cc6..c4afbdd 100644
@@ -1075,7 +1075,7 @@ static int dw_mci_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios)
 		ret = regulator_set_voltage(mmc->supply.vqmmc, min_uv, max_uv);
 
 		if (ret) {
-			dev_err(&mmc->class_dev,
+			dev_dbg(&mmc->class_dev,
 					 "Regulator set error %d: %d - %d\n",
 					 ret, min_uv, max_uv);
 			return ret;
Applied
#5 lore raw
In reply to Doug Anderson
Quoted 5 lines · Doug Anderson

In (28f92b5 mmc: core: Try other signal levels during power up) we can see that there are times when it's valid to try several signal voltages. Don't print an ugly error in the logs when that happens.

Thanks! Applied for next!

Kind regards
Uffe

Quoted 20 lines
---
 drivers/mmc/host/dw_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/dw_mmc.c +1 -2
index 69f0cc6..c4afbdd 100644
@@ -1075,7 +1075,7 @@ static int dw_mci_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios)
                ret = regulator_set_voltage(mmc->supply.vqmmc, min_uv, max_uv);
 
                if (ret) {
-                       dev_err(&mmc->class_dev,
+                       dev_dbg(&mmc->class_dev,
                                         "Regulator set error %d: %d - %d\n",
                                         ret, min_uv, max_uv);
                        return ret;
--

2.1.0.rc2.206.gedb03e5