Skip to contentSkip to conversation

mmc: tegra: Fix a warning message

PATCH Superseded Dan Carpenter 4 participants 5 messages May 15, 2019 – May 28, 2019

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: tegra: Fix a warning message

The WARN_ON() macro takes a condition, not a warning message. I've changed this to use WARN(1, "msg...

Fixes ea8fc5953e8b ("mmc: tegra: update hw tuning process")
---
 drivers/mmc/host/sdhci-tegra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/sdhci-tegra.c +1 -1
index f608417ae967..10d7aaf68bab 100644
@@ -865,7 +865,7 @@ static void tegra_sdhci_tap_correction(struct sdhci_host *host, u8 thd_up,
 	}
 
 	if (!first_fail) {
-		WARN_ON("no edge detected, continue with hw tuned delay.\n");
+		WARN(1, "no edge detected, continue with hw tuned delay.\n");
 	} else if (first_pass) {
 		/* set tap location at fixed tap relative to the first edge */
 		edge1 = first_fail_tap + (first_pass_tap - first_fail_tap) / 2;
Signature · 1 line
2.20.1
#1 lore raw
Quoted 15 lines · Dan Carpenter

The WARN_ON() macro takes a condition, not a warning message. I've changed this to use WARN(1, "msg...

Fixes ea8fc5953e8b ("mmc: tegra: update hw tuning process")
---
 drivers/mmc/host/sdhci-tegra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/sdhci-tegra.c +0 -0
index f608417ae967..10d7aaf68bab 100644

drivers/mmc/host/sdhci-tegra.c static void tegra_sdhci_tap_correction(struct sdhci_host *host, u8 thd_up, · line 868

Quoted 5 lines
drivers/mmc/host/sdhci-tegra.c +1 -1
@@ -865,7 +865,7 @@ static void tegra_sdhci_tap_correction(struct sdhci_host *host, u8 thd_up,
        }
 
        if (!first_fail) {
-               WARN_ON("no edge detected, continue with hw tuned delay.\n");
+               WARN(1, "no edge detected, continue with hw tuned delay.\n");

Not sure why this is a WARN*() in the first place.

Seems like a dev_warn() or possibly a dev_warn_once() should be used instead.

Quoted 6 lines
drivers/mmc/host/sdhci-tegra.c +0 -1
        } else if (first_pass) {
                /* set tap location at fixed tap relative to the first edge */
                edge1 = first_fail_tap + (first_pass_tap - first_fail_tap) / 2;
--

2.20.1

Kind regards
Uffe

#2 lore raw
In reply to Dan Carpenter
Quoted 18 lines · Ulf Hansson
Quoted 17 lines · Dan Carpenter

The WARN_ON() macro takes a condition, not a warning message. I've changed this to use WARN(1, "msg...

Fixes ea8fc5953e8b ("mmc: tegra: update hw tuning process")
---
 drivers/mmc/host/sdhci-tegra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/sdhci-tegra.c +0 -0
index f608417ae967..10d7aaf68bab 100644
@@ -865,7 +865,7 @@ static void tegra_sdhci_tap_correction(struct sdhci_host *host, u8 thd_up,
        }
 
Quoted 7 lines

drivers/mmc/host/sdhci-tegra.c static void tegra_sdhci_tap_correction(struct sdhci_host *host, u8 thd_up, · line 868

Quoted 3 lines
drivers/mmc/host/sdhci-tegra.c +1 -1
        if (!first_fail) {
-               WARN_ON("no edge detected, continue with hw tuned delay.\n");
+               WARN(1, "no edge detected, continue with hw tuned delay.\n");

Not sure why this is a WARN*() in the first place.

Seems like a dev_warn() or possibly a dev_warn_once() should be used instead.

I think this was on purpose in order to increase the likelihood of this getting reported. Sowjanya knows the details much better, but I think this is supposed to be very rare and really a problem with the tap settings in device tree, which is something that we want to know and fix.

Let's see if Sowjanya can shed some light on this.

Thierry

Quoted 10 lines
Quoted 7 lines
drivers/mmc/host/sdhci-tegra.c +0 -1
        } else if (first_pass) {
                /* set tap location at fixed tap relative to the first edge */
                edge1 = first_fail_tap + (first_pass_tap - first_fail_tap) / 2;
--

2.20.1

Kind regards
Uffe

#3 lore raw
In reply to Dan Carpenter
Quoted 30 lines · Thierry Reding
Quoted 17 lines · Ulf Hansson
Quoted 16 lines · Dan Carpenter

The WARN_ON() macro takes a condition, not a warning message. I've changed this to use WARN(1, "msg...

Fixes ea8fc5953e8b ("mmc: tegra: update hw tuning process")
---
  drivers/mmc/host/sdhci-tegra.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/sdhci-tegra.c +0 -0
index f608417ae967..10d7aaf68bab 100644
@@ -865,7 +865,7 @@ static void tegra_sdhci_tap_correction(struct sdhci_host *host, u8 thd_up,
         }
 
Quoted 6 lines

drivers/mmc/host/sdhci-tegra.c static void tegra_sdhci_tap_correction(struct sdhci_host *host, u8 thd_up, · line 868

Quoted 3 lines
drivers/mmc/host/sdhci-tegra.c +1 -1
         if (!first_fail) {
-               WARN_ON("no edge detected, continue with hw tuned delay.\n");
+               WARN(1, "no edge detected, continue with hw tuned delay.\n");

Not sure why this is a WARN*() in the first place.

Seems like a dev_warn() or possibly a dev_warn_once() should be used instead.

I think this was on purpose in order to increase the likelihood of this getting reported. Sowjanya knows the details much better, but I think this is supposed to be very rare and really a problem with the tap settings in device tree, which is something that we want to know and fix.

Quoted 4 lines

Let's see if Sowjanya can shed some light on this.

Thierry

This warn can happen when no edge is detected and hw tuning results include

all passing taps which is very unlikely. So, I believe WARN(1, msg) should be good to use.

Sowjanya

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
drivers/mmc/host/sdhci-tegra.c +0 -1
         } else if (first_pass) {
                 /* set tap location at fixed tap relative to the first edge */
                 edge1 = first_fail_tap + (first_pass_tap - first_fail_tap) / 2;
--

2.20.1

Kind regards
Uffe

#4 lore raw
In reply to Dan Carpenter
Quoted 34 lines · Sowjanya Komatineni
Quoted 32 lines · Thierry Reding
Quoted 17 lines · Ulf Hansson
Quoted 16 lines · Dan Carpenter

The WARN_ON() macro takes a condition, not a warning message. I've changed this to use WARN(1, "msg...

Fixes ea8fc5953e8b ("mmc: tegra: update hw tuning process")
---
  drivers/mmc/host/sdhci-tegra.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/sdhci-tegra.c +0 -0
index f608417ae967..10d7aaf68bab 100644
@@ -865,7 +865,7 @@ static void tegra_sdhci_tap_correction(struct sdhci_host *host, u8 thd_up,
         }
 
Quoted 6 lines

drivers/mmc/host/sdhci-tegra.c static void tegra_sdhci_tap_correction(struct sdhci_host *host, u8 thd_up, · line 868

Quoted 3 lines
drivers/mmc/host/sdhci-tegra.c +1 -1
         if (!first_fail) {
-               WARN_ON("no edge detected, continue with hw tuned delay.\n");
+               WARN(1, "no edge detected, continue with hw tuned delay.\n");

Not sure why this is a WARN*() in the first place.

Seems like a dev_warn() or possibly a dev_warn_once() should be used instead.

I think this was on purpose in order to increase the likelihood of this getting reported. Sowjanya knows the details much better, but I think this is supposed to be very rare and really a problem with the tap settings in device tree, which is something that we want to know and fix.

Let's see if Sowjanya can shed some light on this.

Quoted 8 lines
Quoted 2 lines

Thierry

This warn can happen when no edge is detected and hw tuning results include

all passing taps which is very unlikely. So, I believe WARN(1, msg) should be good to use.

Sowjanya

Okay, so I have picked v1 instead, for fixes, thanks!

Kind regards
Uffe