mmc: tegra: fix no marginal window case condition
R Raj Kumar [Mon, 15 Jul 2013 11:27:06 +0000 (16:27 +0530)]
Fix the condition of partial window quality when there is no marginal
window for both windows.

Bug 1320353

Reviewed-on: http://git-master/r/249167
(cherry picked from commit 9c754a628a9e9469b78668ad1097b192e8d61874)
Change-Id: Ifd5f9b6db4c64182d7508bc8e09c1374cdc944fe

Signed-off-by: R Raj Kumar <rrajk@nvidia.com>
Change-Id: I126d4322ea42b336d07edddf1fb75781d1ccef18
Reviewed-on: http://git-master/r/252338
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>

drivers/mmc/host/sdhci-tegra.c

index bf7788e..25a7844 100644 (file)
@@ -1584,7 +1584,7 @@ static void calculate_high_freq_tap_value(struct sdhci_host *sdhci)
        partial_win_quality = (vmid_tap_data->partial_win -
                vmid_tap_data->sampling_point) - partial_win_tap;
 
-       if ((full_win_quality <= 0) && (partial_win_quality)) {
+       if ((full_win_quality <= 0) && (partial_win_quality <= 0)) {
                dev_warn(mmc_dev(sdhci->mmc),
                        "No margin window for both windows\n");
                tuning_data->best_tap_value = vmax_tap_data->full_win_begin +