# git rev-parse -q --verify 22db552b50fa11d8c1d171de908a1f9ef62172b7^{commit} 22db552b50fa11d8c1d171de908a1f9ef62172b7 already have revision, skipping fetch # git checkout -q -f -B kisskb 22db552b50fa11d8c1d171de908a1f9ef62172b7 # git clean -qxdf # < git log -1 # commit 22db552b50fa11d8c1d171de908a1f9ef62172b7 # Author: Arnd Bergmann # Date: Tue Jun 19 16:02:27 2018 +0200 # # powerpc/powermac: Fix rtc read/write functions # # As Mathieu pointed out, my conversion to time64_t was incorrect and # resulted in negative times to be read from the RTC. The problem is # that during the conversion from a byte array to a time64_t, the # 'unsigned char' variable holding the top byte gets turned into a # negative signed 32-bit integer before being assigned to the 64-bit # variable for any times after 1972. # # This changes the logic to cast to an unsigned 32-bit number first for # the Macintosh time and then convert that to the Unix time, which then # gives us a time in the documented 1904..2040 year range. I decided not # to use the longer 1970..2106 range that other drivers use, for # consistency with the literal interpretation of the register, but that # could be easily changed if we decide we want to support any Mac after # 2040. # # Just to be on the safe side, I'm also adding a WARN_ON that will # trigger if either the year 2040 has come and is observed by this # driver, or we run into an RTC that got set back to a pre-1970 date for # some reason (the two are indistinguishable). # # For the RTC write functions, Andreas found another problem: both # pmu_request() and cuda_request() are varargs functions, so changing # the type of the arguments passed into them from 32 bit to 64 bit # breaks the API for the set_rtc_time functions. This changes it back to # 32 bits. # # The same code exists in arch/m68k/ and is patched in an identical way # now in a separate patch. # # Fixes: 5bfd643583b2 ("powerpc: use time64_t in read_persistent_clock") # Reported-by: Mathieu Malaterre # Reported-by: Andreas Schwab # Signed-off-by: Arnd Bergmann # Tested-by: Mathieu Malaterre # Signed-off-by: Michael Ellerman # < /opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux-gcc --version # < git log --format=%s --max-count=1 22db552b50fa11d8c1d171de908a1f9ef62172b7 # < make -s -j 48 ARCH=mips O=/kisskb/build/powerpc-fixes_mips-defconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- defconfig # make -s -j 48 ARCH=mips O=/kisskb/build/powerpc-fixes_mips-defconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- :1332:2: warning: #warning syscall io_pgetevents not implemented [-Wcpp] :1335:2: warning: #warning syscall rseq not implemented [-Wcpp] /kisskb/src/mm/memblock.c:1340:15: error: redefinition of 'memblock_virt_alloc_try_nid_raw' void * __init memblock_virt_alloc_try_nid_raw( ^ In file included from /kisskb/src/mm/memblock.c:23:0: /kisskb/src/include/linux/bootmem.h:332:29: note: previous definition of 'memblock_virt_alloc_try_nid_raw' was here static inline void * __init memblock_virt_alloc_try_nid_raw( ^ /kisskb/src/mm/memblock.c:1377:15: error: redefinition of 'memblock_virt_alloc_try_nid_nopanic' void * __init memblock_virt_alloc_try_nid_nopanic( ^ In file included from /kisskb/src/mm/memblock.c:23:0: /kisskb/src/include/linux/bootmem.h:340:29: note: previous definition of 'memblock_virt_alloc_try_nid_nopanic' was here static inline void * __init memblock_virt_alloc_try_nid_nopanic( ^ /kisskb/src/mm/memblock.c:1413:15: error: redefinition of 'memblock_virt_alloc_try_nid' void * __init memblock_virt_alloc_try_nid( ^ In file included from /kisskb/src/mm/memblock.c:23:0: /kisskb/src/include/linux/bootmem.h:325:29: note: previous definition of 'memblock_virt_alloc_try_nid' was here static inline void * __init memblock_virt_alloc_try_nid(phys_addr_t size, ^ /kisskb/src/scripts/Makefile.build:317: recipe for target 'mm/memblock.o' failed make[2]: *** [mm/memblock.o] Error 1 make[2]: *** Waiting for unfinished jobs.... /kisskb/src/Makefile:1034: recipe for target 'mm' failed make[1]: *** [mm] Error 2 make[1]: *** Waiting for unfinished jobs.... Makefile:146: recipe for target 'sub-make' failed make: *** [sub-make] Error 2 Command 'make -s -j 48 ARCH=mips O=/kisskb/build/powerpc-fixes_mips-defconfig_mipsel CROSS_COMPILE=/opt/cross/kisskb/br-mipsel-o32-full-2016.08-613-ge98b4dd/bin/mipsel-linux- ' returned non-zero exit status 2 # rm -rf /kisskb/build/powerpc-fixes_mips-defconfig_mipsel # Build took: 0:01:38.013436