Skip to contentSkip to conversation

hw/timer/pl031: Add warning "do not use as model to implement a RTC"

PATCH In review Philippe Mathieu-Daudé 2 participants 2 messages Sep 24, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/timer/pl031: Add warning "do not use as model to implement a RTC"

Peter said we should "not use the pl031 as a good model of how to do an RTC, it has some definite flaws."
Add this information to the PL031 header for other developers.

---
 hw/timer/pl031.c | 8 ++++++++
 1 file changed, 8 insertions(+)
hw/timer/pl031.c +8 -0
index 2b3e261006..da453b5b04 100644
@@ -1,6 +1,14 @@
 /*
  * ARM AMBA PrimeCell PL031 RTC
  *
+ * Note from the maintainer:
+ *
+ * Don't use the pl031 code as a good model of how to do an RTC,
+ * it has some definite flaws. x86 or ppc RTC handling is probably
+ * a better place to look.
+ *
+ * See https://lists.gnu.org/archive/html/qemu-devel/2019-09/msg05399.html
+ *
  * Copyright (c) 2007 CodeSourcery
  *
  * This file is free software; you can redistribute it and/or modify
Signature · 1 line
2.20.1
#1 lore raw
Quoted 4 lines · Philippe Mathieu-Daudé

Peter said we should "not use the pl031 as a good model of how to do an RTC, it has some definite flaws."
Add this information to the PL031 header for other developers.

Lots of our code is less than great. I'm not sure this specific case really justifies blazoning it in a comment header at the top of the file... (If you do want to put in a comment, being more specific about exactly what the problems are would be better.)

thanks
-- PMM