# 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/gcc-5.3.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < git log --format=%s --max-count=1 22db552b50fa11d8c1d171de908a1f9ef62172b7 # < make -s -j 48 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc85xx_smp_defconfig_powerpc-5.3 CROSS_COMPILE=/opt/cross/kisskb/gcc-5.3.0-nolibc/powerpc64-linux/bin/powerpc64-linux- mpc85xx_smp_defconfig # make -s -j 48 ARCH=powerpc O=/kisskb/build/powerpc-fixes_mpc85xx_smp_defconfig_powerpc-5.3 CROSS_COMPILE=/opt/cross/kisskb/gcc-5.3.0-nolibc/powerpc64-linux/bin/powerpc64-linux- /kisskb/src/net/Makefile:24: CC cannot link executables. Skipping bpfilter. /kisskb/src/net/Makefile:24: CC cannot link executables. Skipping bpfilter. In file included from /kisskb/src/include/linux/kernel.h:10:0, from /kisskb/src/include/linux/list.h:9, from /kisskb/src/include/linux/module.h:9, from /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c:15: /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c: In function 'allocate_bd': /kisskb/src/include/linux/err.h:22:49: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO) ^ /kisskb/src/include/linux/compiler.h:77:42: note: in definition of macro 'unlikely' # define unlikely(x) __builtin_expect(!!(x), 0) ^ /kisskb/src/drivers/net/ethernet/freescale/fs_enet/mac-scc.c:139:6: note: in expansion of macro 'IS_ERR_VALUE' if (IS_ERR_VALUE(fep->ring_mem_addr)) ^ arch/powerpc/boot/mpc8555cds.dtb: Warning (pci_device_bus_num): /pci@e0008000/i8259@19000:bus-range: PCI bus number 1 out of range, expected (0 - 0) arch/powerpc/boot/mpc8541cds.dtb: Warning (pci_device_bus_num): /pci@e0008000/i8259@19000:bus-range: PCI bus number 1 out of range, expected (0 - 0) INFO: Uncompressed kernel (size 0xbf56e4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbf56e4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbf56e4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbf56e4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbf56e4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbf56e4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbf56e4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbf56e4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbf56e4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbf56e4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbf56e4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbf56e4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbf56e4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbf56e4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbf56e4) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) INFO: Uncompressed kernel (size 0xbe4f2c) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0xc00000) Image Name: Linux-4.18.0-rc1-g22db552 Created: Wed Jun 27 23:35:19 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5894805 Bytes = 5756.65 kB = 5.62 MB Load Address: 00c00000 Entry Point: 00c0020c Image Name: Linux-4.18.0-rc1-g22db552 Created: Wed Jun 27 23:35:19 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5894437 Bytes = 5756.29 kB = 5.62 MB Load Address: 00c00000 Entry Point: 00c0020c Image Name: Linux-4.18.0-rc1-g22db552 Created: Wed Jun 27 23:35:19 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5895909 Bytes = 5757.72 kB = 5.62 MB Load Address: 00c00000 Entry Point: 00c0020c Image Name: Linux-4.18.0-rc1-g22db552 Created: Wed Jun 27 23:35:20 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5872716 Bytes = 5735.07 kB = 5.60 MB Load Address: 00000000 Entry Point: 00000000 Image Name: Linux-4.18.0-rc1-g22db552 Created: Wed Jun 27 23:35:20 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5895587 Bytes = 5757.41 kB = 5.62 MB Load Address: 00c00000 Entry Point: 00c00278 Image Name: Linux-4.18.0-rc1-g22db552 Created: Wed Jun 27 23:35:20 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5894548 Bytes = 5756.39 kB = 5.62 MB Load Address: 00c00000 Entry Point: 00c00278 Image Name: Linux-4.18.0-rc1-g22db552 Created: Wed Jun 27 23:35:20 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5896006 Bytes = 5757.82 kB = 5.62 MB Load Address: 00c00000 Entry Point: 00c0020c Image Name: Linux-4.18.0-rc1-g22db552 Created: Wed Jun 27 23:35:20 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5894518 Bytes = 5756.37 kB = 5.62 MB Load Address: 00c00000 Entry Point: 00c00278 Image Name: Linux-4.18.0-rc1-g22db552 Created: Wed Jun 27 23:35:20 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5894533 Bytes = 5756.38 kB = 5.62 MB Load Address: 00c00000 Entry Point: 00c0020c Image Name: Linux-4.18.0-rc1-g22db552 Created: Wed Jun 27 23:35:20 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5895609 Bytes = 5757.43 kB = 5.62 MB Load Address: 00c00000 Entry Point: 00c0020c Image Name: Linux-4.18.0-rc1-g22db552 Created: Wed Jun 27 23:35:20 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5895595 Bytes = 5757.42 kB = 5.62 MB Load Address: 00c00000 Entry Point: 00c0020c Image Name: Linux-4.18.0-rc1-g22db552 Created: Wed Jun 27 23:35:20 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5895588 Bytes = 5757.41 kB = 5.62 MB Load Address: 00c00000 Entry Point: 00c00278 Image Name: Linux-4.18.0-rc1-g22db552 Created: Wed Jun 27 23:35:21 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5894150 Bytes = 5756.01 kB = 5.62 MB Load Address: 00c00000 Entry Point: 00c0020c Image Name: Linux-4.18.0-rc1-g22db552 Created: Wed Jun 27 23:35:20 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5894191 Bytes = 5756.05 kB = 5.62 MB Load Address: 00c00000 Entry Point: 00c00278 Image Name: Linux-4.18.0-rc1-g22db552 Created: Wed Jun 27 23:35:21 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5894149 Bytes = 5756.00 kB = 5.62 MB Load Address: 00c00000 Entry Point: 00c0020c Image Name: Linux-4.18.0-rc1-g22db552 Created: Wed Jun 27 23:35:21 2018 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 5895612 Bytes = 5757.43 kB = 5.62 MB Load Address: 00c00000 Entry Point: 00c0020c Completed OK # rm -rf /kisskb/build/powerpc-fixes_mpc85xx_smp_defconfig_powerpc-5.3 # Build took: 0:02:01.468431