rk: revert 20f3d0b+v3.0.66 to v3.0
[firefly-linux-kernel-4.4.55.git] / drivers / edac / amd64_edac.c
index feb2d10bba660605f798a2150cdfb177f2c16f9d..9a8bebcf6b177fa79e9635ecde71f05b2578e798 100644 (file)
@@ -161,11 +161,8 @@ static int __amd64_set_scrub_rate(struct pci_dev *ctl, u32 new_bw, u32 min_rate)
         * memory controller and apply to register. Search for the first
         * bandwidth entry that is greater or equal than the setting requested
         * and program that. If at last entry, turn off DRAM scrubbing.
-        *
-        * If no suitable bandwidth is found, turn off DRAM scrubbing entirely
-        * by falling back to the last element in scrubrates[].
         */
-       for (i = 0; i < ARRAY_SIZE(scrubrates) - 1; i++) {
+       for (i = 0; i < ARRAY_SIZE(scrubrates); i++) {
                /*
                 * skip scrub rates which aren't recommended
                 * (see F10 BKDG, F3x58)
@@ -175,6 +172,12 @@ static int __amd64_set_scrub_rate(struct pci_dev *ctl, u32 new_bw, u32 min_rate)
 
                if (scrubrates[i].bandwidth <= new_bw)
                        break;
+
+               /*
+                * if no suitable bandwidth found, turn off DRAM scrubbing
+                * entirely by falling back to the last element in the
+                * scrubrates array.
+                */
        }
 
        scrubval = scrubrates[i].scrubval;