]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
MIPS: Routerboard 532: Fix vendor retry check code
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Wed, 8 May 2024 12:07:00 +0000 (15:07 +0300)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Tue, 11 Jun 2024 14:04:55 +0000 (16:04 +0200)
read_config_dword() contains strange condition checking ret for a
number of values. The ret variable, however, is always zero because
config_access() never returns anything else. Thus, the retry is always
taken until number of tries is exceeded.

The code looks like it wants to check *val instead of ret to see if the
read gave an error response.

Fixes: 73b4390fb234 ("[MIPS] Routerboard 532: Support for base system")
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/pci/ops-rc32434.c

index 874ed6df97683ad1d6dbce7b49c72c091e64488c..34b9323bdabb0e50c8ac5eded8b7419a23eb1ff1 100644 (file)
@@ -112,8 +112,8 @@ retry:
         * gives them time to settle
         */
        if (where == PCI_VENDOR_ID) {
-               if (ret == 0xffffffff || ret == 0x00000000 ||
-                   ret == 0x0000ffff || ret == 0xffff0000) {
+               if (*val == 0xffffffff || *val == 0x00000000 ||
+                   *val == 0x0000ffff || *val == 0xffff0000) {
                        if (delay > 4)
                                return 0;
                        delay *= 2;