Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'powerpc-4.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:
"Two regression fixes, and a new syscall wire-up:

- A fix for the recent conversion to time64_t in the powermac RTC
routines, which caused time to go backward.

- Another fix for fallout from the split PMD PTL conversion.

- Wire up the new io_pgetevents() syscall.

Thanks to: Aneesh Kumar K.V, Arnd Bergmann, Breno Leitao, Mathieu
Malaterre"

* tag 'powerpc-4.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/powermac: Fix rtc read/write functions
powerpc/mm/32: Fix pgtable_page_dtor call
powerpc: Wire up io_pgetevents

+23 -12
-1
arch/powerpc/include/asm/book3s/32/pgalloc.h
··· 138 138 static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, 139 139 unsigned long address) 140 140 { 141 - pgtable_page_dtor(table); 142 141 pgtable_free_tlb(tlb, page_address(table), 0); 143 142 } 144 143 #endif /* _ASM_POWERPC_BOOK3S_32_PGALLOC_H */
-1
arch/powerpc/include/asm/nohash/32/pgalloc.h
··· 140 140 unsigned long address) 141 141 { 142 142 tlb_flush_pgtable(tlb, address); 143 - pgtable_page_dtor(table); 144 143 pgtable_free_tlb(tlb, page_address(table), 0); 145 144 } 146 145 #endif /* _ASM_POWERPC_PGALLOC_32_H */
+1
arch/powerpc/include/asm/systbl.h
··· 393 393 SYSCALL(pkey_free) 394 394 SYSCALL(pkey_mprotect) 395 395 SYSCALL(rseq) 396 + COMPAT_SYS(io_pgetevents)
+1 -1
arch/powerpc/include/asm/unistd.h
··· 12 12 #include <uapi/asm/unistd.h> 13 13 14 14 15 - #define NR_syscalls 388 15 + #define NR_syscalls 389 16 16 17 17 #define __NR__exit __NR_exit 18 18
+1
arch/powerpc/include/uapi/asm/unistd.h
··· 399 399 #define __NR_pkey_free 385 400 400 #define __NR_pkey_mprotect 386 401 401 #define __NR_rseq 387 402 + #define __NR_io_pgetevents 388 402 403 403 404 #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
+20 -9
arch/powerpc/platforms/powermac/time.c
··· 42 42 #define DBG(x...) 43 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 50 #define RTC_OFFSET 2082844800 47 51 48 52 /* ··· 101 97 if (req.reply_len != 7) 102 98 printk(KERN_ERR "cuda_get_time: got %d byte reply\n", 103 99 req.reply_len); 104 - now = (req.reply[3] << 24) + (req.reply[4] << 16) 105 - + (req.reply[5] << 8) + req.reply[6]; 100 + now = (u32)((req.reply[3] << 24) + (req.reply[4] << 16) + 101 + (req.reply[5] << 8) + req.reply[6]); 102 + /* it's either after year 2040, or the RTC has gone backwards */ 103 + WARN_ON(now < RTC_OFFSET); 104 + 106 105 return now - RTC_OFFSET; 107 106 } 108 107 ··· 113 106 114 107 static int cuda_set_rtc_time(struct rtc_time *tm) 115 108 { 116 - time64_t nowtime; 109 + u32 nowtime; 117 110 struct adb_request req; 118 111 119 - nowtime = rtc_tm_to_time64(tm) + RTC_OFFSET; 112 + nowtime = lower_32_bits(rtc_tm_to_time64(tm) + RTC_OFFSET); 120 113 if (cuda_request(&req, NULL, 6, CUDA_PACKET, CUDA_SET_TIME, 121 114 nowtime >> 24, nowtime >> 16, nowtime >> 8, 122 115 nowtime) < 0) ··· 147 140 if (req.reply_len != 4) 148 141 printk(KERN_ERR "pmu_get_time: got %d byte reply from PMU\n", 149 142 req.reply_len); 150 - now = (req.reply[0] << 24) + (req.reply[1] << 16) 151 - + (req.reply[2] << 8) + req.reply[3]; 143 + now = (u32)((req.reply[0] << 24) + (req.reply[1] << 16) + 144 + (req.reply[2] << 8) + req.reply[3]); 145 + 146 + /* it's either after year 2040, or the RTC has gone backwards */ 147 + WARN_ON(now < RTC_OFFSET); 148 + 152 149 return now - RTC_OFFSET; 153 150 } 154 151 ··· 160 149 161 150 static int pmu_set_rtc_time(struct rtc_time *tm) 162 151 { 163 - time64_t nowtime; 152 + u32 nowtime; 164 153 struct adb_request req; 165 154 166 - nowtime = rtc_tm_to_time64(tm) + RTC_OFFSET; 155 + nowtime = lower_32_bits(rtc_tm_to_time64(tm) + RTC_OFFSET); 167 156 if (pmu_request(&req, NULL, 5, PMU_SET_RTC, nowtime >> 24, 168 157 nowtime >> 16, nowtime >> 8, nowtime) < 0) 169 158 return -ENXIO;