Skip to contentSkip to conversation

cxl: Fix PSL timebase synchronization detection

PATCH Applied Frederic Barrat 7 participants 7 messages Feb 24, 2016 – Feb 29, 2016 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cxl: Fix PSL timebase synchronization detection

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.

---
 drivers/misc/cxl/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/cxl/pci.c +1 -1
index 4c1903f..0c6c17a1 100644
@@ -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;
 }
Signature · 1 line
1.9.1
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Frederic Barrat

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!
=20
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.
=20

Looks good!

Quoted 19 lines
Cc <[email protected]> # 4.3+
---
 drivers/misc/cxl/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

=20

drivers/misc/cxl/pci.c +1 -1
index 4c1903f..0c6c17a1 100644
@@ -415,7 +415,7 @@ static int cxl_setup_psl_timebase(struct cxl
 *adapter, struct pci_dev *dev)
 		delta =3D mftb() - psl_tb;
 		if (delta < 0)
 			delta =3D -delta;
-	} while (cputime_to_usecs(delta) > 16);
+	} while (tb_to_ns(delta) > 16000);

=20
return 0;
}

Reviewed-by on v1 1/1
#4 lore raw
In reply to Frederic Barrat
Quoted 11 lines · Frederic Barrat

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.

Signature · 3 lines
Andrew Donnellan              Software Engineer, OzLabs
[email protected]  Australia Development Lab, Canberra
+61 2 6201 8874 (work)        IBM Australia Limited
Reviewed-by on v1 1/1
#5 lore raw
In reply to Frederic Barrat
Quoted 11 lines · Frederic Barrat

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.

#6 lore raw
In reply to Frederic Barrat
Quoted 9 lines · Frederic Barrat

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.

Quoted 7 lines

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/923adb1646d5ba739d2a1e63ee

cheers