cxl: Fix PSL timebase synchronization detection
authorFrederic Barrat <[email protected]>
Wed, 24 Feb 2016 17:27:51 +0000 (18:27 +0100)
committerMichael Ellerman <[email protected]>
Mon, 29 Feb 2016 10:36:00 +0000 (21:36 +1100)
The PSL timebase synchronization is seemingly failing for
configuration not including VIRT_CPU_ACCOUNTING_NATIVE. The driver
shows the following trace in dmesg:
PSL: Timebase sync: giving up!

The PSL timebase register is actually syncing correctly, but the cxl
driver is not detecting it. Fix is to use the proper timebase-to-time
conversion.

Signed-off-by: Frederic Barrat <[email protected]>
Cc: <[email protected]> # 4.3+
Acked-by: Michael Neuling <[email protected]>
Reviewed-by: Matthew R. Ochs <[email protected]>
Acked-by: Ian Munsie <[email protected]>
Reviewed-by: Andrew Donnellan <[email protected]>
Reviewed-by: Vaibhav Jain <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
drivers/misc/cxl/pci.c

index 4c1903f781fc1793bb7ddf7205d138e60ea2133a..0c6c17a1c59e3a9417dde5ab842fffbab4f09e69 100644 (file)
@@ -415,7 +415,7 @@ static int cxl_setup_psl_timebase(struct cxl *adapter, struct pci_dev *dev)
                delta = mftb() - psl_tb;
                if (delta < 0)
                        delta = -delta;
-       } while (cputime_to_usecs(delta) > 16);
+       } while (tb_to_ns(delta) > 16000);
 
        return 0;
 }