diff options
| -rw-r--r-- | arch/powerpc/include/asm/book3s/32/pgalloc.h | 1 | ||||
| -rw-r--r-- | arch/powerpc/include/asm/nohash/32/pgalloc.h | 1 | ||||
| -rw-r--r-- | arch/powerpc/include/asm/systbl.h | 1 | ||||
| -rw-r--r-- | arch/powerpc/include/asm/unistd.h | 2 | ||||
| -rw-r--r-- | arch/powerpc/include/uapi/asm/unistd.h | 1 | ||||
| -rw-r--r-- | arch/powerpc/platforms/powermac/time.c | 29 |
6 files changed, 23 insertions, 12 deletions
diff --git a/arch/powerpc/include/asm/book3s/32/pgalloc.h b/arch/powerpc/include/asm/book3s/32/pgalloc.h index e4633803fe43..82e44b1a00ae 100644 --- a/arch/powerpc/include/asm/book3s/32/pgalloc.h +++ b/arch/powerpc/include/asm/book3s/32/pgalloc.h | |||
| @@ -138,7 +138,6 @@ static inline void pgtable_free_tlb(struct mmu_gather *tlb, | |||
| 138 | static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, | 138 | static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, |
| 139 | unsigned long address) | 139 | unsigned long address) |
| 140 | { | 140 | { |
| 141 | pgtable_page_dtor(table); | ||
| 142 | pgtable_free_tlb(tlb, page_address(table), 0); | 141 | pgtable_free_tlb(tlb, page_address(table), 0); |
| 143 | } | 142 | } |
| 144 | #endif /* _ASM_POWERPC_BOOK3S_32_PGALLOC_H */ | 143 | #endif /* _ASM_POWERPC_BOOK3S_32_PGALLOC_H */ |
diff --git a/arch/powerpc/include/asm/nohash/32/pgalloc.h b/arch/powerpc/include/asm/nohash/32/pgalloc.h index 9de40eb614da..8825953c225b 100644 --- a/arch/powerpc/include/asm/nohash/32/pgalloc.h +++ b/arch/powerpc/include/asm/nohash/32/pgalloc.h | |||
| @@ -140,7 +140,6 @@ static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, | |||
| 140 | unsigned long address) | 140 | unsigned long address) |
| 141 | { | 141 | { |
| 142 | tlb_flush_pgtable(tlb, address); | 142 | tlb_flush_pgtable(tlb, address); |
| 143 | pgtable_page_dtor(table); | ||
| 144 | pgtable_free_tlb(tlb, page_address(table), 0); | 143 | pgtable_free_tlb(tlb, page_address(table), 0); |
| 145 | } | 144 | } |
| 146 | #endif /* _ASM_POWERPC_PGALLOC_32_H */ | 145 | #endif /* _ASM_POWERPC_PGALLOC_32_H */ |
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h index cfcf6a874cfa..01b5171ea189 100644 --- a/arch/powerpc/include/asm/systbl.h +++ b/arch/powerpc/include/asm/systbl.h | |||
| @@ -393,3 +393,4 @@ SYSCALL(pkey_alloc) | |||
| 393 | SYSCALL(pkey_free) | 393 | SYSCALL(pkey_free) |
| 394 | SYSCALL(pkey_mprotect) | 394 | SYSCALL(pkey_mprotect) |
| 395 | SYSCALL(rseq) | 395 | SYSCALL(rseq) |
| 396 | COMPAT_SYS(io_pgetevents) | ||
diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h index 1e9708632dce..c19379f0a32e 100644 --- a/arch/powerpc/include/asm/unistd.h +++ b/arch/powerpc/include/asm/unistd.h | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #include <uapi/asm/unistd.h> | 12 | #include <uapi/asm/unistd.h> |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | #define NR_syscalls 388 | 15 | #define NR_syscalls 389 |
| 16 | 16 | ||
| 17 | #define __NR__exit __NR_exit | 17 | #define __NR__exit __NR_exit |
| 18 | 18 | ||
diff --git a/arch/powerpc/include/uapi/asm/unistd.h b/arch/powerpc/include/uapi/asm/unistd.h index ac5ba55066dd..985534d0b448 100644 --- a/arch/powerpc/include/uapi/asm/unistd.h +++ b/arch/powerpc/include/uapi/asm/unistd.h | |||
| @@ -399,5 +399,6 @@ | |||
| 399 | #define __NR_pkey_free 385 | 399 | #define __NR_pkey_free 385 |
| 400 | #define __NR_pkey_mprotect 386 | 400 | #define __NR_pkey_mprotect 386 |
| 401 | #define __NR_rseq 387 | 401 | #define __NR_rseq 387 |
| 402 | #define __NR_io_pgetevents 388 | ||
| 402 | 403 | ||
| 403 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ | 404 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ |
diff --git a/arch/powerpc/platforms/powermac/time.c b/arch/powerpc/platforms/powermac/time.c index 7c968e46736f..12e6e4d30602 100644 --- a/arch/powerpc/platforms/powermac/time.c +++ b/arch/powerpc/platforms/powermac/time.c | |||
| @@ -42,7 +42,11 @@ | |||
| 42 | #define DBG(x...) | 42 | #define DBG(x...) |
| 43 | #endif | 43 | #endif |
| 44 | 44 | ||
| 45 | /* Apparently the RTC stores seconds since 1 Jan 1904 */ | 45 | /* |
| 46 | * Offset between Unix time (1970-based) and Mac time (1904-based). Cuda and PMU | ||
| 47 | * times wrap in 2040. If we need to handle later times, the read_time functions | ||
| 48 | * need to be changed to interpret wrapped times as post-2040. | ||
| 49 | */ | ||
| 46 | #define RTC_OFFSET 2082844800 | 50 | #define RTC_OFFSET 2082844800 |
| 47 | 51 | ||
| 48 | /* | 52 | /* |
| @@ -97,8 +101,11 @@ static time64_t cuda_get_time(void) | |||
| 97 | if (req.reply_len != 7) | 101 | if (req.reply_len != 7) |
| 98 | printk(KERN_ERR "cuda_get_time: got %d byte reply\n", | 102 | printk(KERN_ERR "cuda_get_time: got %d byte reply\n", |
| 99 | req.reply_len); | 103 | req.reply_len); |
| 100 | now = (req.reply[3] << 24) + (req.reply[4] << 16) | 104 | now = (u32)((req.reply[3] << 24) + (req.reply[4] << 16) + |
| 101 | + (req.reply[5] << 8) + req.reply[6]; | 105 | (req.reply[5] << 8) + req.reply[6]); |
| 106 | /* it's either after year 2040, or the RTC has gone backwards */ | ||
| 107 | WARN_ON(now < RTC_OFFSET); | ||
| 108 | |||
| 102 | return now - RTC_OFFSET; | 109 | return now - RTC_OFFSET; |
| 103 | } | 110 | } |
| 104 | 111 | ||
| @@ -106,10 +113,10 @@ static time64_t cuda_get_time(void) | |||
| 106 | 113 | ||
| 107 | static int cuda_set_rtc_time(struct rtc_time *tm) | 114 | static int cuda_set_rtc_time(struct rtc_time *tm) |
| 108 | { | 115 | { |
| 109 | time64_t nowtime; | 116 | u32 nowtime; |
| 110 | struct adb_request req; | 117 | struct adb_request req; |
| 111 | 118 | ||
| 112 | nowtime = rtc_tm_to_time64(tm) + RTC_OFFSET; | 119 | nowtime = lower_32_bits(rtc_tm_to_time64(tm) + RTC_OFFSET); |
| 113 | if (cuda_request(&req, NULL, 6, CUDA_PACKET, CUDA_SET_TIME, | 120 | if (cuda_request(&req, NULL, 6, CUDA_PACKET, CUDA_SET_TIME, |
| 114 | nowtime >> 24, nowtime >> 16, nowtime >> 8, | 121 | nowtime >> 24, nowtime >> 16, nowtime >> 8, |
| 115 | nowtime) < 0) | 122 | nowtime) < 0) |
| @@ -140,8 +147,12 @@ static time64_t pmu_get_time(void) | |||
| 140 | if (req.reply_len != 4) | 147 | if (req.reply_len != 4) |
| 141 | printk(KERN_ERR "pmu_get_time: got %d byte reply from PMU\n", | 148 | printk(KERN_ERR "pmu_get_time: got %d byte reply from PMU\n", |
| 142 | req.reply_len); | 149 | req.reply_len); |
| 143 | now = (req.reply[0] << 24) + (req.reply[1] << 16) | 150 | now = (u32)((req.reply[0] << 24) + (req.reply[1] << 16) + |
| 144 | + (req.reply[2] << 8) + req.reply[3]; | 151 | (req.reply[2] << 8) + req.reply[3]); |
| 152 | |||
| 153 | /* it's either after year 2040, or the RTC has gone backwards */ | ||
| 154 | WARN_ON(now < RTC_OFFSET); | ||
| 155 | |||
| 145 | return now - RTC_OFFSET; | 156 | return now - RTC_OFFSET; |
| 146 | } | 157 | } |
| 147 | 158 | ||
| @@ -149,10 +160,10 @@ static time64_t pmu_get_time(void) | |||
| 149 | 160 | ||
| 150 | static int pmu_set_rtc_time(struct rtc_time *tm) | 161 | static int pmu_set_rtc_time(struct rtc_time *tm) |
| 151 | { | 162 | { |
| 152 | time64_t nowtime; | 163 | u32 nowtime; |
| 153 | struct adb_request req; | 164 | struct adb_request req; |
| 154 | 165 | ||
| 155 | nowtime = rtc_tm_to_time64(tm) + RTC_OFFSET; | 166 | nowtime = lower_32_bits(rtc_tm_to_time64(tm) + RTC_OFFSET); |
| 156 | if (pmu_request(&req, NULL, 5, PMU_SET_RTC, nowtime >> 24, | 167 | if (pmu_request(&req, NULL, 5, PMU_SET_RTC, nowtime >> 24, |
| 157 | nowtime >> 16, nowtime >> 8, nowtime) < 0) | 168 | nowtime >> 16, nowtime >> 8, nowtime) < 0) |
| 158 | return -ENXIO; | 169 | return -ENXIO; |
