summaryrefslogtreecommitdiffstats
path: root/arch/parisc
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2020-10-17 20:13:06 +0200
committerHelge Deller <deller@gmx.de>2020-10-22 22:44:27 +0200
commitfaade0986e840884438a6e8a21b782c34eb1109c (patch)
treeb139826b34e100c48ecba8243c1e70635313230d /arch/parisc
parentMerge tag 'kconfig-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/ma... (diff)
downloadlinux-faade0986e840884438a6e8a21b782c34eb1109c.tar.xz
linux-faade0986e840884438a6e8a21b782c34eb1109c.zip
parisc: Improve error return codes when setting rtc time
The HP 730 machine returned strange errors when I tried setting the rtc time. Add some debug code to improve the possibility to trace errors and document that hppa probably has as Y2k38 problem. Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc')
-rw-r--r--arch/parisc/kernel/time.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c
index 04508158815c..13d94f0f94a0 100644
--- a/arch/parisc/kernel/time.c
+++ b/arch/parisc/kernel/time.c
@@ -180,9 +180,16 @@ static int rtc_generic_get_time(struct device *dev, struct rtc_time *tm)
static int rtc_generic_set_time(struct device *dev, struct rtc_time *tm)
{
time64_t secs = rtc_tm_to_time64(tm);
-
- if (pdc_tod_set(secs, 0) < 0)
+ int ret;
+
+ /* hppa has Y2K38 problem: pdc_tod_set() takes an u32 value! */
+ ret = pdc_tod_set(secs, 0);
+ if (ret != 0) {
+ pr_warn("pdc_tod_set(%lld) returned error %d\n", secs, ret);
+ if (ret == PDC_INVALID_ARG)
+ return -EINVAL;
return -EOPNOTSUPP;
+ }
return 0;
}