powerpc fixes for 4.18 #3
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.
-----BEGIN PGP SIGNATURE-----
iQIwBAABCAAaBQJbNt7oExxtcGVAZWxsZXJtYW4uaWQuYXUACgkQUevqPMjhpYDJ
CA//QZuarC+Hy4j4MrQL5RDdHThGWsQwPPv087efKnMRObp5Fxs+IdZO+dzwqpFg
2nbIXfKWmkIOvHQF5bo0LK8IIpoz8rIcduobzSTttgMQJ2i4u6uShtU6oa4Hg9JR
ULxjvySi2zWYDtsVXvpxid1ox39VhoPptMizStxSnCvvQKoZksGZzAUMYQkOrIUc
RS/BbREpdcXRyYeqGiOCEKENUBWJFgxOy8WOPszAqKkdwtaGv28Ory6hOI9I5iFF
7LeFFS/EJIF/BnHAgp8X+hCt3yVVFcKH0Ipitvqp3usKb3D08u56oxTINyI2BNc0
zgAUcuuYFJ0Nl6jHOo2bzBn+Wxl1KIXbQt4lTZsFJwOJiw1+QYq5ivDpBPn2pc91
PBKZ1jIY+QwbJQPogVAKt4hSZDiss0Bpxg1gHT6WY7oNoeYOSKlKrkWn+e/GLzXb
Xid0hvytQTaKIuST3SgDaixk+cLjzxY/Pm+rRdBOot+sCfG4eIMRPL8jDQ1E3+jK
bIXnKCtwr+rz1T8OaRlEJMoDGqU42hxSyW1yHoKs36oJo1e7GQoSpffENqE2fJbH
9AqlrCV0WVBmr9PQsisf9noRdktlkPHw0wy7HZOE1PIEx2Rl+n5WD0z0YOoYAk7h
LvNNYZATZvhgw8dvvyRKNtwEST9DowXzTLvS8thLc/UsdDk=
=kHJC
-----END PGP SIGNATURE-----
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
This commit is contained in:
commit
1904148a36
6 changed files with 23 additions and 12 deletions
|
|
@ -138,7 +138,6 @@ static inline void pgtable_free_tlb(struct mmu_gather *tlb,
|
|||
static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table,
|
||||
unsigned long address)
|
||||
{
|
||||
pgtable_page_dtor(table);
|
||||
pgtable_free_tlb(tlb, page_address(table), 0);
|
||||
}
|
||||
#endif /* _ASM_POWERPC_BOOK3S_32_PGALLOC_H */
|
||||
|
|
|
|||
|
|
@ -140,7 +140,6 @@ static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table,
|
|||
unsigned long address)
|
||||
{
|
||||
tlb_flush_pgtable(tlb, address);
|
||||
pgtable_page_dtor(table);
|
||||
pgtable_free_tlb(tlb, page_address(table), 0);
|
||||
}
|
||||
#endif /* _ASM_POWERPC_PGALLOC_32_H */
|
||||
|
|
|
|||
|
|
@ -393,3 +393,4 @@ SYSCALL(pkey_alloc)
|
|||
SYSCALL(pkey_free)
|
||||
SYSCALL(pkey_mprotect)
|
||||
SYSCALL(rseq)
|
||||
COMPAT_SYS(io_pgetevents)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#include <uapi/asm/unistd.h>
|
||||
|
||||
|
||||
#define NR_syscalls 388
|
||||
#define NR_syscalls 389
|
||||
|
||||
#define __NR__exit __NR_exit
|
||||
|
||||
|
|
|
|||
|
|
@ -399,5 +399,6 @@
|
|||
#define __NR_pkey_free 385
|
||||
#define __NR_pkey_mprotect 386
|
||||
#define __NR_rseq 387
|
||||
#define __NR_io_pgetevents 388
|
||||
|
||||
#endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
|
||||
|
|
|
|||
|
|
@ -42,7 +42,11 @@
|
|||
#define DBG(x...)
|
||||
#endif
|
||||
|
||||
/* Apparently the RTC stores seconds since 1 Jan 1904 */
|
||||
/*
|
||||
* Offset between Unix time (1970-based) and Mac time (1904-based). Cuda and PMU
|
||||
* times wrap in 2040. If we need to handle later times, the read_time functions
|
||||
* need to be changed to interpret wrapped times as post-2040.
|
||||
*/
|
||||
#define RTC_OFFSET 2082844800
|
||||
|
||||
/*
|
||||
|
|
@ -97,8 +101,11 @@ static time64_t cuda_get_time(void)
|
|||
if (req.reply_len != 7)
|
||||
printk(KERN_ERR "cuda_get_time: got %d byte reply\n",
|
||||
req.reply_len);
|
||||
now = (req.reply[3] << 24) + (req.reply[4] << 16)
|
||||
+ (req.reply[5] << 8) + req.reply[6];
|
||||
now = (u32)((req.reply[3] << 24) + (req.reply[4] << 16) +
|
||||
(req.reply[5] << 8) + req.reply[6]);
|
||||
/* it's either after year 2040, or the RTC has gone backwards */
|
||||
WARN_ON(now < RTC_OFFSET);
|
||||
|
||||
return now - RTC_OFFSET;
|
||||
}
|
||||
|
||||
|
|
@ -106,10 +113,10 @@ static time64_t cuda_get_time(void)
|
|||
|
||||
static int cuda_set_rtc_time(struct rtc_time *tm)
|
||||
{
|
||||
time64_t nowtime;
|
||||
u32 nowtime;
|
||||
struct adb_request req;
|
||||
|
||||
nowtime = rtc_tm_to_time64(tm) + RTC_OFFSET;
|
||||
nowtime = lower_32_bits(rtc_tm_to_time64(tm) + RTC_OFFSET);
|
||||
if (cuda_request(&req, NULL, 6, CUDA_PACKET, CUDA_SET_TIME,
|
||||
nowtime >> 24, nowtime >> 16, nowtime >> 8,
|
||||
nowtime) < 0)
|
||||
|
|
@ -140,8 +147,12 @@ static time64_t pmu_get_time(void)
|
|||
if (req.reply_len != 4)
|
||||
printk(KERN_ERR "pmu_get_time: got %d byte reply from PMU\n",
|
||||
req.reply_len);
|
||||
now = (req.reply[0] << 24) + (req.reply[1] << 16)
|
||||
+ (req.reply[2] << 8) + req.reply[3];
|
||||
now = (u32)((req.reply[0] << 24) + (req.reply[1] << 16) +
|
||||
(req.reply[2] << 8) + req.reply[3]);
|
||||
|
||||
/* it's either after year 2040, or the RTC has gone backwards */
|
||||
WARN_ON(now < RTC_OFFSET);
|
||||
|
||||
return now - RTC_OFFSET;
|
||||
}
|
||||
|
||||
|
|
@ -149,10 +160,10 @@ static time64_t pmu_get_time(void)
|
|||
|
||||
static int pmu_set_rtc_time(struct rtc_time *tm)
|
||||
{
|
||||
time64_t nowtime;
|
||||
u32 nowtime;
|
||||
struct adb_request req;
|
||||
|
||||
nowtime = rtc_tm_to_time64(tm) + RTC_OFFSET;
|
||||
nowtime = lower_32_bits(rtc_tm_to_time64(tm) + RTC_OFFSET);
|
||||
if (pmu_request(&req, NULL, 5, PMU_SET_RTC, nowtime >> 24,
|
||||
nowtime >> 16, nowtime >> 8, nowtime) < 0)
|
||||
return -ENXIO;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue