OMAP3630+: SmartReflex 1p5: remove voltage clamp down

Vnom is almost never an exact multiple of PMIC voltage used.
Depending on age, process and PMIC used, it is possible that
the safe adjusted voltage after SR calibration and convergence
is higher than Vnom on few OPPs on certain corner lot samples.

By clamping down on voltage, we essentially force the voltage
to a lower than safe value which can result in not enough
margin on the sample for that specific OPP resulting in device
failures.

Change-Id: I6ce2d1a87a512364c9c278c84ebaa76f7575cf08
Reported-by: Michael Wagner <mwagner@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
diff --git a/arch/arm/mach-omap2/smartreflex-class1p5.c b/arch/arm/mach-omap2/smartreflex-class1p5.c
index 42a76a2..2090884 100644
--- a/arch/arm/mach-omap2/smartreflex-class1p5.c
+++ b/arch/arm/mach-omap2/smartreflex-class1p5.c
@@ -138,7 +138,7 @@
 {
 	struct sr_class1p5_work_data *work_data =
 	    container_of(work, struct sr_class1p5_work_data, work.work);
-	unsigned long u_volt_safe = 0, u_volt_current = 0, u_volt_margin;
+	unsigned long u_volt_safe = 0, u_volt_current = 0, u_volt_margin = 0;
 	struct omap_volt_data *volt_data;
 	struct voltagedomain *voltdm;
 	int idx = 0;
@@ -260,10 +260,6 @@
 		if (work_data->u_volt_samples[idx] > u_volt_safe)
 			u_volt_safe = work_data->u_volt_samples[idx];
 	}
-	/* Use the nominal voltage as the safe voltage to recover bad osc */
-	if (u_volt_safe > volt_data->volt_nominal)
-		u_volt_safe = volt_data->volt_nominal;
-
 
 	/* Fall through to close up common stuff */
 done_calib:
@@ -289,16 +285,16 @@
 		} else {
 			u_volt_margin = volt_data->volt_margin;
 		}
-		/* Add margin IF we are lower than nominal */
-		if ((u_volt_safe + u_volt_margin) < volt_data->volt_nominal) {
-			u_volt_safe += u_volt_margin;
-		} else {
-			pr_err("%s: %s could not add %ld[%d] margin"
-				"to vnom %d curr_v=%ld\n",
-				__func__, voltdm->name, u_volt_margin,
-				volt_data->volt_margin, volt_data->volt_nominal,
-				u_volt_current);
-		}
+
+		u_volt_safe += u_volt_margin;
+	}
+
+	if (u_volt_safe > volt_data->volt_nominal) {
+		pr_warning("%s: %s Vsafe %ld > Vnom %d. %ld[%d] margin on"
+			"vnom %d curr_v=%ld\n", __func__, voltdm->name,
+			u_volt_safe, volt_data->volt_nominal, u_volt_margin,
+			volt_data->volt_margin, volt_data->volt_nominal,
+			u_volt_current);
 	}
 
 	volt_data->volt_calibrated = u_volt_safe;