* Re: [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations [not found] ` <20120920110439.GB2117@linaro.org> @ 2012-12-11 16:07 ` Guennadi Liakhovetski 2012-12-11 16:33 ` Will Deacon 0 siblings, 1 reply; 19+ messages in thread From: Guennadi Liakhovetski @ 2012-12-11 16:07 UTC (permalink / raw) To: linux-arm-kernel [-- Attachment #1: Type: TEXT/PLAIN, Size: 1303 bytes --] Hi all On Thu, 20 Sep 2012, Dave Martin wrote: > On Thu, Sep 20, 2012 at 11:25:14AM +0100, Lorenzo Pieralisi wrote: > > On Wed, Sep 19, 2012 at 02:46:58PM +0100, Dave Martin wrote: > > > On Tue, Sep 18, 2012 at 05:35:33PM +0100, Lorenzo Pieralisi wrote: > > > > In processors like A15/A7 L2 cache is unified and integrated within the > > > > processor cache hierarchy, so that it is not considered an outer cache > > > > anymore. For processors like A15/A7 flush_cache_all() ends up cleaning > > > > all cache levels up to Level of Coherency (LoC) that includes > > > > the L2 unified cache. > > > > > > > > When a single CPU is suspended (CPU idle) a complete L2 clean is not > > > > required, so generic cpu_suspend code must clean the data cache using the > > > > newly introduced cache LoUIS function. Git bisect identified this patch, in the mainline as commit dbee0c6fb4c1269b2dfc8b0b7a29907ea7fed560 Author: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Date: Fri Sep 7 11:06:57 2012 +0530 ARM: kernel: update cpu_suspend code to use cache LoUIS operations as the culprit of the broken wake up from STR on mackerel, based on an sh7372 A8 SoC. .config attached. Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ [-- Attachment #2: Type: TEXT/PLAIN, Size: 5075 bytes --] # CONFIG_ARM_PATCH_PHYS_VIRT is not set CONFIG_EXPERIMENTAL=y CONFIG_CROSS_COMPILE="arm-none-linux-gnueabi-" CONFIG_LOCALVERSION="-ap4" # CONFIG_LOCALVERSION_AUTO is not set CONFIG_SYSVIPC=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_SYSCTL_SYSCALL=y CONFIG_KALLSYMS_ALL=y CONFIG_EMBEDDED=y CONFIG_SLAB=y CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_LBDAF is not set # CONFIG_BLK_DEV_BSG is not set # CONFIG_IOSCHED_DEADLINE is not set # CONFIG_IOSCHED_CFQ is not set CONFIG_ARCH_SHMOBILE=y CONFIG_ARCH_SH7372=y CONFIG_MACH_AP4EVB=y CONFIG_MACH_MACKEREL=y CONFIG_MEMORY_SIZE=0x20000000 # CONFIG_SH_TIMER_CMT is not set # CONFIG_EM_TIMER_STI is not set # CONFIG_ARM_THUMB is not set CONFIG_AEABI=y CONFIG_FORCE_MAX_ZONEORDER=12 CONFIG_USE_OF=y CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 CONFIG_ARM_APPENDED_DTB=y CONFIG_ARM_ATAG_DTB_COMPAT=y CONFIG_CMDLINE="console=ttySC0,115200 console=tty1 earlyprintk=sh-sci.0,115200" CONFIG_KEXEC=y CONFIG_VFP=y CONFIG_NEON=y # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set CONFIG_PM_RUNTIME=y CONFIG_NET=y CONFIG_PACKET=m CONFIG_UNIX=y CONFIG_INET=y CONFIG_IP_MULTICAST=y CONFIG_IP_PNP=y CONFIG_IP_PNP_DHCP=y CONFIG_IP_PNP_BOOTP=y # CONFIG_INET_XFRM_MODE_TRANSPORT is not set # CONFIG_INET_XFRM_MODE_TUNNEL is not set # CONFIG_INET_XFRM_MODE_BEET is not set CONFIG_INET_DIAG=m CONFIG_INET_UDP_DIAG=m # CONFIG_INET6_XFRM_MODE_TRANSPORT is not set # CONFIG_INET6_XFRM_MODE_TUNNEL is not set # CONFIG_INET6_XFRM_MODE_BEET is not set # CONFIG_IPV6_SIT is not set CONFIG_CFG80211=m CONFIG_CFG80211_WEXT=y CONFIG_MAC80211=m CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" # CONFIG_FIRMWARE_IN_KERNEL is not set CONFIG_PROC_DEVICETREE=y # CONFIG_BLK_DEV is not set CONFIG_NETDEVICES=y CONFIG_NETCONSOLE=y # CONFIG_NET_VENDOR_BROADCOM is not set # CONFIG_NET_VENDOR_CHELSIO is not set # CONFIG_NET_VENDOR_CIRRUS is not set # CONFIG_NET_VENDOR_FARADAY is not set # CONFIG_NET_VENDOR_INTEL is not set # CONFIG_NET_VENDOR_MARVELL is not set # CONFIG_NET_VENDOR_MICREL is not set # CONFIG_NET_VENDOR_NATSEMI is not set # CONFIG_NET_VENDOR_SEEQ is not set CONFIG_SMSC911X=y # CONFIG_NET_VENDOR_STMICRO is not set # CONFIG_NET_VENDOR_WIZNET is not set CONFIG_MDIO_BITBANG=y # CONFIG_WLAN is not set CONFIG_INPUT_MOUSEDEV=m # CONFIG_INPUT_MOUSEDEV_PSAUX is not set CONFIG_INPUT_EVDEV=y # CONFIG_KEYBOARD_ATKBD is not set CONFIG_KEYBOARD_TCA6416=y CONFIG_KEYBOARD_SH_KEYSC=y # CONFIG_INPUT_MOUSE is not set CONFIG_INPUT_TOUCHSCREEN=y CONFIG_TOUCHSCREEN_TSC2007=y CONFIG_TOUCHSCREEN_ST1232=y CONFIG_INPUT_MISC=y CONFIG_INPUT_ADXL34X=m # CONFIG_SERIO is not set # CONFIG_LEGACY_PTYS is not set CONFIG_SERIAL_SH_SCI=y CONFIG_SERIAL_SH_SCI_NR_UARTS=8 CONFIG_SERIAL_SH_SCI_CONSOLE=y CONFIG_SERIAL_SH_SCI_DMA=y CONFIG_I2C=y CONFIG_I2C_CHARDEV=y CONFIG_I2C_SH_MOBILE=y CONFIG_SPI=y CONFIG_SPI_GPIO=m CONFIG_GPIO_SYSFS=y CONFIG_POWER_SUPPLY=y # CONFIG_HWMON is not set CONFIG_SSB=m CONFIG_SSB_SDIOHOST=y CONFIG_REGULATOR=y CONFIG_REGULATOR_DUMMY=y CONFIG_MEDIA_SUPPORT=m CONFIG_MEDIA_CAMERA_SUPPORT=y CONFIG_MEDIA_CONTROLLER=y CONFIG_VIDEO_V4L2_SUBDEV_API=y CONFIG_VIDEO_ADV_DEBUG=y CONFIG_VIDEO_OV7670=m CONFIG_VIDEO_VIVI=m CONFIG_V4L_PLATFORM_DRIVERS=y CONFIG_VIDEO_SH_VOU=m CONFIG_SOC_CAMERA=m CONFIG_SOC_CAMERA_IMX074=m CONFIG_SOC_CAMERA_MT9M111=m CONFIG_SOC_CAMERA_MT9T112=m CONFIG_SOC_CAMERA_MT9V022=m CONFIG_SOC_CAMERA_PLATFORM=m CONFIG_SOC_CAMERA_OV5642=m CONFIG_VIDEO_SH_MOBILE_CSI2=m CONFIG_VIDEO_SH_MOBILE_CEU=m CONFIG_V4L_MEM2MEM_DRIVERS=y CONFIG_VIDEO_MEM2MEM_TESTDEV=m CONFIG_FB=y CONFIG_FB_SH_MOBILE_LCDC=y # CONFIG_LCD_CLASS_DEVICE is not set # CONFIG_BACKLIGHT_GENERIC is not set CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_LOGO=y # CONFIG_LOGO_LINUX_MONO is not set # CONFIG_LOGO_LINUX_VGA16 is not set CONFIG_SOUND=m CONFIG_SND=m # CONFIG_SND_SUPPORT_OLD_API is not set # CONFIG_SND_DRIVERS is not set # CONFIG_SND_ARM is not set # CONFIG_SND_SPI is not set CONFIG_SND_SOC=m CONFIG_SND_SOC_SH4_FSI=m # CONFIG_USB_SUPPORT is not set CONFIG_MMC=m CONFIG_MMC_CLKGATE=y CONFIG_MMC_SDHI=m CONFIG_MMC_SH_MMCIF=m CONFIG_RTC_CLASS=y # CONFIG_RTC_HCTOSYS is not set CONFIG_DMADEVICES=y CONFIG_SH_DMAE=m CONFIG_DMATEST=m # CONFIG_IOMMU_SUPPORT is not set CONFIG_EXT3_FS=y # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set # CONFIG_DNOTIFY is not set CONFIG_FANOTIFY=y CONFIG_VFAT_FS=m CONFIG_TMPFS=y # CONFIG_MISC_FILESYSTEMS is not set CONFIG_NFS_FS=y CONFIG_ROOT_NFS=y CONFIG_NLS_CODEPAGE_437=m CONFIG_NLS_ISO8859_1=m CONFIG_NLS_ISO8859_15=m CONFIG_PRINTK_TIME=y CONFIG_MAGIC_SYSRQ=y CONFIG_LOCKUP_DETECTOR=y # CONFIG_SCHED_DEBUG is not set CONFIG_DEBUG_OBJECTS=y CONFIG_DEBUG_OBJECTS_FREE=y CONFIG_DEBUG_SLAB=y CONFIG_DEBUG_ATOMIC_SLEEP=y # CONFIG_FTRACE is not set # CONFIG_ARM_UNWIND is not set CONFIG_DEBUG_USER=y CONFIG_CRYPTO=y CONFIG_CRYPTO_CBC=m CONFIG_CRYPTO_ECB=m CONFIG_CRYPTO_MD5=m CONFIG_CRYPTO_AES=y CONFIG_CRYPTO_DES=m ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations 2012-12-11 16:07 ` [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations Guennadi Liakhovetski @ 2012-12-11 16:33 ` Will Deacon 2012-12-11 16:38 ` Will Deacon 0 siblings, 1 reply; 19+ messages in thread From: Will Deacon @ 2012-12-11 16:33 UTC (permalink / raw) To: linux-arm-kernel On Tue, Dec 11, 2012 at 04:07:56PM +0000, Guennadi Liakhovetski wrote: > Hi all > > On Thu, 20 Sep 2012, Dave Martin wrote: > > > On Thu, Sep 20, 2012 at 11:25:14AM +0100, Lorenzo Pieralisi wrote: > > > On Wed, Sep 19, 2012 at 02:46:58PM +0100, Dave Martin wrote: > > > > On Tue, Sep 18, 2012 at 05:35:33PM +0100, Lorenzo Pieralisi wrote: > > > > > In processors like A15/A7 L2 cache is unified and integrated within the > > > > > processor cache hierarchy, so that it is not considered an outer cache > > > > > anymore. For processors like A15/A7 flush_cache_all() ends up cleaning > > > > > all cache levels up to Level of Coherency (LoC) that includes > > > > > the L2 unified cache. > > > > > > > > > > When a single CPU is suspended (CPU idle) a complete L2 clean is not > > > > > required, so generic cpu_suspend code must clean the data cache using the > > > > > newly introduced cache LoUIS function. > > Git bisect identified this patch, in the mainline as > > commit dbee0c6fb4c1269b2dfc8b0b7a29907ea7fed560 > Author: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> > Date: Fri Sep 7 11:06:57 2012 +0530 > > ARM: kernel: update cpu_suspend code to use cache LoUIS operations > > as the culprit of the broken wake up from STR on mackerel, based on an > sh7372 A8 SoC. .config attached. My guess is that because Cortex-A8 does not implement the MP extensions, the LoUIS field of the CLIDR reads as zero, and the cache isn't flushed at all (I can see an early exit in v7_flush_dcache_louis). Lorenzo -- how is this supposed to work for uniprocessor CPUs? Will ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations 2012-12-11 16:33 ` Will Deacon @ 2012-12-11 16:38 ` Will Deacon 2012-12-11 17:07 ` Guennadi Liakhovetski ` (2 more replies) 0 siblings, 3 replies; 19+ messages in thread From: Will Deacon @ 2012-12-11 16:38 UTC (permalink / raw) To: linux-arm-kernel On Tue, Dec 11, 2012 at 04:33:13PM +0000, Will Deacon wrote: > On Tue, Dec 11, 2012 at 04:07:56PM +0000, Guennadi Liakhovetski wrote: > > Git bisect identified this patch, in the mainline as > > > > commit dbee0c6fb4c1269b2dfc8b0b7a29907ea7fed560 > > Author: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> > > Date: Fri Sep 7 11:06:57 2012 +0530 > > > > ARM: kernel: update cpu_suspend code to use cache LoUIS operations > > > > as the culprit of the broken wake up from STR on mackerel, based on an > > sh7372 A8 SoC. .config attached. > > My guess is that because Cortex-A8 does not implement the MP extensions, > the LoUIS field of the CLIDR reads as zero, and the cache isn't flushed at > all (I can see an early exit in v7_flush_dcache_louis). > > Lorenzo -- how is this supposed to work for uniprocessor CPUs? Bah, forgot to ask you if the following patch helps... Will --->8 diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S index cd95664..f58248f 100644 --- a/arch/arm/mm/cache-v7.S +++ b/arch/arm/mm/cache-v7.S @@ -44,7 +44,8 @@ ENDPROC(v7_flush_icache_all) ENTRY(v7_flush_dcache_louis) dmb @ ensure ordering with previous memory accesses mrc p15, 1, r0, c0, c0, 1 @ read clidr, r0 = clidr - ands r3, r0, #0xe00000 @ extract LoUIS from clidr + ALT_SMP(ands r3, r0, #(7 << 21)) @ extract LoUIS from clidr + ALT_UP(ands r3, r0, #(7 << 27)) @ extract LoUU from clidr mov r3, r3, lsr #20 @ r3 = LoUIS * 2 moveq pc, lr @ return if level = 0 mov r10, #0 @ r10 (starting level) = 0 ^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations 2012-12-11 16:38 ` Will Deacon @ 2012-12-11 17:07 ` Guennadi Liakhovetski 2012-12-11 17:47 ` Will Deacon 2012-12-11 17:55 ` Guennadi Liakhovetski 2012-12-11 23:27 ` Stephen Boyd 2 siblings, 1 reply; 19+ messages in thread From: Guennadi Liakhovetski @ 2012-12-11 17:07 UTC (permalink / raw) To: linux-arm-kernel Hi Will On Tue, 11 Dec 2012, Will Deacon wrote: > On Tue, Dec 11, 2012 at 04:33:13PM +0000, Will Deacon wrote: > > On Tue, Dec 11, 2012 at 04:07:56PM +0000, Guennadi Liakhovetski wrote: > > > Git bisect identified this patch, in the mainline as > > > > > > commit dbee0c6fb4c1269b2dfc8b0b7a29907ea7fed560 > > > Author: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> > > > Date: Fri Sep 7 11:06:57 2012 +0530 > > > > > > ARM: kernel: update cpu_suspend code to use cache LoUIS operations > > > > > > as the culprit of the broken wake up from STR on mackerel, based on an > > > sh7372 A8 SoC. .config attached. > > > > My guess is that because Cortex-A8 does not implement the MP extensions, > > the LoUIS field of the CLIDR reads as zero, and the cache isn't flushed at > > all (I can see an early exit in v7_flush_dcache_louis). > > > > Lorenzo -- how is this supposed to work for uniprocessor CPUs? > > Bah, forgot to ask you if the following patch helps... Yes, it does. Thanks Guennadi > > Will > > --->8 > > diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S > index cd95664..f58248f 100644 > --- a/arch/arm/mm/cache-v7.S > +++ b/arch/arm/mm/cache-v7.S > @@ -44,7 +44,8 @@ ENDPROC(v7_flush_icache_all) > ENTRY(v7_flush_dcache_louis) > dmb @ ensure ordering with previous memory accesses > mrc p15, 1, r0, c0, c0, 1 @ read clidr, r0 = clidr > - ands r3, r0, #0xe00000 @ extract LoUIS from clidr > + ALT_SMP(ands r3, r0, #(7 << 21)) @ extract LoUIS from clidr > + ALT_UP(ands r3, r0, #(7 << 27)) @ extract LoUU from clidr > mov r3, r3, lsr #20 @ r3 = LoUIS * 2 > moveq pc, lr @ return if level = 0 > mov r10, #0 @ r10 (starting level) = 0 > --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations 2012-12-11 17:07 ` Guennadi Liakhovetski @ 2012-12-11 17:47 ` Will Deacon 0 siblings, 0 replies; 19+ messages in thread From: Will Deacon @ 2012-12-11 17:47 UTC (permalink / raw) To: linux-arm-kernel On Tue, Dec 11, 2012 at 05:07:35PM +0000, Guennadi Liakhovetski wrote: > Hi Will > > On Tue, 11 Dec 2012, Will Deacon wrote: > > > On Tue, Dec 11, 2012 at 04:33:13PM +0000, Will Deacon wrote: > > > On Tue, Dec 11, 2012 at 04:07:56PM +0000, Guennadi Liakhovetski wrote: > > > > Git bisect identified this patch, in the mainline as > > > > > > > > commit dbee0c6fb4c1269b2dfc8b0b7a29907ea7fed560 > > > > Author: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> > > > > Date: Fri Sep 7 11:06:57 2012 +0530 > > > > > > > > ARM: kernel: update cpu_suspend code to use cache LoUIS operations > > > > > > > > as the culprit of the broken wake up from STR on mackerel, based on an > > > > sh7372 A8 SoC. .config attached. > > > > > > My guess is that because Cortex-A8 does not implement the MP extensions, > > > the LoUIS field of the CLIDR reads as zero, and the cache isn't flushed at > > > all (I can see an early exit in v7_flush_dcache_louis). > > > > > > Lorenzo -- how is this supposed to work for uniprocessor CPUs? > > > > Bah, forgot to ask you if the following patch helps... > > Yes, it does. Cracking, can I add you tested-by please? Will ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations 2012-12-11 16:38 ` Will Deacon 2012-12-11 17:07 ` Guennadi Liakhovetski @ 2012-12-11 17:55 ` Guennadi Liakhovetski 2012-12-11 23:27 ` Stephen Boyd 2 siblings, 0 replies; 19+ messages in thread From: Guennadi Liakhovetski @ 2012-12-11 17:55 UTC (permalink / raw) To: linux-arm-kernel On Tue, 11 Dec 2012, Will Deacon wrote: > On Tue, Dec 11, 2012 at 04:33:13PM +0000, Will Deacon wrote: > > On Tue, Dec 11, 2012 at 04:07:56PM +0000, Guennadi Liakhovetski wrote: > > > Git bisect identified this patch, in the mainline as > > > > > > commit dbee0c6fb4c1269b2dfc8b0b7a29907ea7fed560 > > > Author: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> > > > Date: Fri Sep 7 11:06:57 2012 +0530 > > > > > > ARM: kernel: update cpu_suspend code to use cache LoUIS operations > > > > > > as the culprit of the broken wake up from STR on mackerel, based on an > > > sh7372 A8 SoC. .config attached. > > > > My guess is that because Cortex-A8 does not implement the MP extensions, > > the LoUIS field of the CLIDR reads as zero, and the cache isn't flushed at > > all (I can see an early exit in v7_flush_dcache_louis). > > > > Lorenzo -- how is this supposed to work for uniprocessor CPUs? > > Bah, forgot to ask you if the following patch helps... > > Will > > --->8 > > diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S > index cd95664..f58248f 100644 > --- a/arch/arm/mm/cache-v7.S > +++ b/arch/arm/mm/cache-v7.S > @@ -44,7 +44,8 @@ ENDPROC(v7_flush_icache_all) > ENTRY(v7_flush_dcache_louis) > dmb @ ensure ordering with previous memory accesses > mrc p15, 1, r0, c0, c0, 1 @ read clidr, r0 = clidr > - ands r3, r0, #0xe00000 @ extract LoUIS from clidr > + ALT_SMP(ands r3, r0, #(7 << 21)) @ extract LoUIS from clidr > + ALT_UP(ands r3, r0, #(7 << 27)) @ extract LoUU from clidr > mov r3, r3, lsr #20 @ r3 = LoUIS * 2 > moveq pc, lr @ return if level = 0 > mov r10, #0 @ r10 (starting level) = 0 [... later] > > Yes, it does. > > Cracking, can I add you tested-by please? Sure: Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations 2012-12-11 16:38 ` Will Deacon 2012-12-11 17:07 ` Guennadi Liakhovetski 2012-12-11 17:55 ` Guennadi Liakhovetski @ 2012-12-11 23:27 ` Stephen Boyd 2012-12-12 10:31 ` Will Deacon 2012-12-12 10:33 ` Lorenzo Pieralisi 2 siblings, 2 replies; 19+ messages in thread From: Stephen Boyd @ 2012-12-11 23:27 UTC (permalink / raw) To: linux-arm-kernel On 12/11/12 08:38, Will Deacon wrote: > diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S > index cd95664..f58248f 100644 > --- a/arch/arm/mm/cache-v7.S > +++ b/arch/arm/mm/cache-v7.S > @@ -44,7 +44,8 @@ ENDPROC(v7_flush_icache_all) > ENTRY(v7_flush_dcache_louis) > dmb @ ensure ordering with previous memory accesses > mrc p15, 1, r0, c0, c0, 1 @ read clidr, r0 = clidr > - ands r3, r0, #0xe00000 @ extract LoUIS from clidr > + ALT_SMP(ands r3, r0, #(7 << 21)) @ extract LoUIS from clidr > + ALT_UP(ands r3, r0, #(7 << 27)) @ extract LoUU from clidr > mov r3, r3, lsr #20 @ r3 = LoUIS * 2 You need to fix this mov as well, right? -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations 2012-12-11 23:27 ` Stephen Boyd @ 2012-12-12 10:31 ` Will Deacon 2012-12-12 16:43 ` Guennadi Liakhovetski 2012-12-12 10:33 ` Lorenzo Pieralisi 1 sibling, 1 reply; 19+ messages in thread From: Will Deacon @ 2012-12-12 10:31 UTC (permalink / raw) To: linux-arm-kernel On Tue, Dec 11, 2012 at 11:27:39PM +0000, Stephen Boyd wrote: > On 12/11/12 08:38, Will Deacon wrote: > > diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S > > index cd95664..f58248f 100644 > > --- a/arch/arm/mm/cache-v7.S > > +++ b/arch/arm/mm/cache-v7.S > > @@ -44,7 +44,8 @@ ENDPROC(v7_flush_icache_all) > > ENTRY(v7_flush_dcache_louis) > > dmb @ ensure ordering with previous memory accesses > > mrc p15, 1, r0, c0, c0, 1 @ read clidr, r0 = clidr > > - ands r3, r0, #0xe00000 @ extract LoUIS from clidr > > + ALT_SMP(ands r3, r0, #(7 << 21)) @ extract LoUIS from clidr > > + ALT_UP(ands r3, r0, #(7 << 27)) @ extract LoUU from clidr > > mov r3, r3, lsr #20 @ r3 = LoUIS * 2 > > You need to fix this mov as well, right? Ha, nice catch. So the original patch ended up with a ridiculously high level number and would've flushed L2, hence we will need to retest with the fix below... Will --->8 diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S index cd95664..7539ec2 100644 --- a/arch/arm/mm/cache-v7.S +++ b/arch/arm/mm/cache-v7.S @@ -44,8 +44,10 @@ ENDPROC(v7_flush_icache_all) ENTRY(v7_flush_dcache_louis) dmb @ ensure ordering with previous memory accesses mrc p15, 1, r0, c0, c0, 1 @ read clidr, r0 = clidr - ands r3, r0, #0xe00000 @ extract LoUIS from clidr - mov r3, r3, lsr #20 @ r3 = LoUIS * 2 + ALT_SMP(ands r3, r0, #(7 << 21)) @ extract LoUIS from clidr + ALT_UP(ands r3, r0, #(7 << 27)) @ extract LoUU from clidr + ALT_SMP(mov r3, r3, lsr #20) @ r3 = LoUIS * 2 + ALT_UP(mov r3, r3, lsr #26) @ r3 = LoUU * 2 moveq pc, lr @ return if level = 0 mov r10, #0 @ r10 (starting level) = 0 b flush_levels @ start flushing cache levels ^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations 2012-12-12 10:31 ` Will Deacon @ 2012-12-12 16:43 ` Guennadi Liakhovetski 0 siblings, 0 replies; 19+ messages in thread From: Guennadi Liakhovetski @ 2012-12-12 16:43 UTC (permalink / raw) To: linux-arm-kernel Hi Will On Wed, 12 Dec 2012, Will Deacon wrote: > On Tue, Dec 11, 2012 at 11:27:39PM +0000, Stephen Boyd wrote: > > On 12/11/12 08:38, Will Deacon wrote: > > > diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S > > > index cd95664..f58248f 100644 > > > --- a/arch/arm/mm/cache-v7.S > > > +++ b/arch/arm/mm/cache-v7.S > > > @@ -44,7 +44,8 @@ ENDPROC(v7_flush_icache_all) > > > ENTRY(v7_flush_dcache_louis) > > > dmb @ ensure ordering with previous memory accesses > > > mrc p15, 1, r0, c0, c0, 1 @ read clidr, r0 = clidr > > > - ands r3, r0, #0xe00000 @ extract LoUIS from clidr > > > + ALT_SMP(ands r3, r0, #(7 << 21)) @ extract LoUIS from clidr > > > + ALT_UP(ands r3, r0, #(7 << 27)) @ extract LoUU from clidr > > > mov r3, r3, lsr #20 @ r3 = LoUIS * 2 > > > > You need to fix this mov as well, right? > > Ha, nice catch. So the original patch ended up with a ridiculously high > level number and would've flushed L2, hence we will need to retest with the > fix below... Had to apply manually, but it worked too. Thanks Guennadi > > Will > > --->8 > > diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S > index cd95664..7539ec2 100644 > --- a/arch/arm/mm/cache-v7.S > +++ b/arch/arm/mm/cache-v7.S > @@ -44,8 +44,10 @@ ENDPROC(v7_flush_icache_all) > ENTRY(v7_flush_dcache_louis) > dmb @ ensure ordering with previous memory accesses > mrc p15, 1, r0, c0, c0, 1 @ read clidr, r0 = clidr > - ands r3, r0, #0xe00000 @ extract LoUIS from clidr > - mov r3, r3, lsr #20 @ r3 = LoUIS * 2 > + ALT_SMP(ands r3, r0, #(7 << 21)) @ extract LoUIS from clidr > + ALT_UP(ands r3, r0, #(7 << 27)) @ extract LoUU from clidr > + ALT_SMP(mov r3, r3, lsr #20) @ r3 = LoUIS * 2 > + ALT_UP(mov r3, r3, lsr #26) @ r3 = LoUU * 2 > moveq pc, lr @ return if level = 0 > mov r10, #0 @ r10 (starting level) = 0 > b flush_levels @ start flushing cache levels > --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations 2012-12-11 23:27 ` Stephen Boyd 2012-12-12 10:31 ` Will Deacon @ 2012-12-12 10:33 ` Lorenzo Pieralisi 2012-12-12 13:36 ` Will Deacon 2012-12-12 16:43 ` Guennadi Liakhovetski 1 sibling, 2 replies; 19+ messages in thread From: Lorenzo Pieralisi @ 2012-12-12 10:33 UTC (permalink / raw) To: linux-arm-kernel On Tue, Dec 11, 2012 at 11:27:39PM +0000, Stephen Boyd wrote: > On 12/11/12 08:38, Will Deacon wrote: > > diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S > > index cd95664..f58248f 100644 > > --- a/arch/arm/mm/cache-v7.S > > +++ b/arch/arm/mm/cache-v7.S > > @@ -44,7 +44,8 @@ ENDPROC(v7_flush_icache_all) > > ENTRY(v7_flush_dcache_louis) > > dmb @ ensure ordering with previous memory accesses > > mrc p15, 1, r0, c0, c0, 1 @ read clidr, r0 = clidr > > - ands r3, r0, #0xe00000 @ extract LoUIS from clidr > > + ALT_SMP(ands r3, r0, #(7 << 21)) @ extract LoUIS from clidr > > + ALT_UP(ands r3, r0, #(7 << 27)) @ extract LoUU from clidr > > mov r3, r3, lsr #20 @ r3 = LoUIS * 2 > > You need to fix this mov as well, right? And after doing that I think the suspend finisher will still have to call flush_cache_all() since LoUU = 1 on A8, L2 is not cleaned and that's probably what we want if it can be retained. What about this (compile tested) ? Lorenzo --->8 diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S index cd95664..036f80f 100644 --- a/arch/arm/mm/cache-v7.S +++ b/arch/arm/mm/cache-v7.S @@ -44,8 +44,9 @@ ENDPROC(v7_flush_icache_all) ENTRY(v7_flush_dcache_louis) dmb @ ensure ordering with previous memory accesses mrc p15, 1, r0, c0, c0, 1 @ read clidr, r0 = clidr - ands r3, r0, #0xe00000 @ extract LoUIS from clidr - mov r3, r3, lsr #20 @ r3 = LoUIS * 2 + ALT_SMP(lsr r3, r0, #20) @ r3 = clidr[31:20] + ALT_UP(lsr r3, r0, #26) @ r3 = clidr[31:26] + ands r3, r3, #0xe @ r3 = LoUIS/LoUU * 2 moveq pc, lr @ return if level = 0 mov r10, #0 @ r10 (starting level) = 0 b flush_levels @ start flushing cache levels ^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations 2012-12-12 10:33 ` Lorenzo Pieralisi @ 2012-12-12 13:36 ` Will Deacon 2012-12-13 8:09 ` Guennadi Liakhovetski 2012-12-12 16:43 ` Guennadi Liakhovetski 1 sibling, 1 reply; 19+ messages in thread From: Will Deacon @ 2012-12-12 13:36 UTC (permalink / raw) To: linux-arm-kernel On Wed, Dec 12, 2012 at 10:33:38AM +0000, Lorenzo Pieralisi wrote: > On Tue, Dec 11, 2012 at 11:27:39PM +0000, Stephen Boyd wrote: > > On 12/11/12 08:38, Will Deacon wrote: > > > diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S > > > index cd95664..f58248f 100644 > > > --- a/arch/arm/mm/cache-v7.S > > > +++ b/arch/arm/mm/cache-v7.S > > > @@ -44,7 +44,8 @@ ENDPROC(v7_flush_icache_all) > > > ENTRY(v7_flush_dcache_louis) > > > dmb @ ensure ordering with previous memory accesses > > > mrc p15, 1, r0, c0, c0, 1 @ read clidr, r0 = clidr > > > - ands r3, r0, #0xe00000 @ extract LoUIS from clidr > > > + ALT_SMP(ands r3, r0, #(7 << 21)) @ extract LoUIS from clidr > > > + ALT_UP(ands r3, r0, #(7 << 27)) @ extract LoUU from clidr > > > mov r3, r3, lsr #20 @ r3 = LoUIS * 2 > > > > You need to fix this mov as well, right? > > And after doing that I think the suspend finisher will still have > to call flush_cache_all() since LoUU = 1 on A8, L2 is not cleaned > and that's probably what we want if it can be retained. At some point we probably want to describe the level of flushing required in the device tree as a property of the CPU node (or something similar). That would allow us to have *one* function for flushing, e.g. cpu_suspend_flush_cache which flushes to the appropriate level. Then we could remove the louis flush from the CPU suspend code and instead make it the finisher's responsibility to call our flushing function when it's done, which helps to avoid over/under-flushing the cache. In the meantime, fixing louis as we've suggested should work. Back to the case in hand.... Lorenzo just pointed out to me that the finished in question (sh7372_do_idle_sysc) calls v7_flush_dcache_all, so the louis stuff should be irrelevant. The problem may actually be that the finisher disables the L2 cache prior to cleaning/invalidating it, which is the opposite order to that described by the A8 TRM. Guennadi -- can you try moving the kernel_flush call before the L2 disable in sh7372_do_idle_sysc please? Will ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations 2012-12-12 13:36 ` Will Deacon @ 2012-12-13 8:09 ` Guennadi Liakhovetski 2012-12-13 10:51 ` Will Deacon 0 siblings, 1 reply; 19+ messages in thread From: Guennadi Liakhovetski @ 2012-12-13 8:09 UTC (permalink / raw) To: linux-arm-kernel On Wed, 12 Dec 2012, Will Deacon wrote: > On Wed, Dec 12, 2012 at 10:33:38AM +0000, Lorenzo Pieralisi wrote: > > On Tue, Dec 11, 2012 at 11:27:39PM +0000, Stephen Boyd wrote: > > > On 12/11/12 08:38, Will Deacon wrote: > > > > diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S > > > > index cd95664..f58248f 100644 > > > > --- a/arch/arm/mm/cache-v7.S > > > > +++ b/arch/arm/mm/cache-v7.S > > > > @@ -44,7 +44,8 @@ ENDPROC(v7_flush_icache_all) > > > > ENTRY(v7_flush_dcache_louis) > > > > dmb @ ensure ordering with previous memory accesses > > > > mrc p15, 1, r0, c0, c0, 1 @ read clidr, r0 = clidr > > > > - ands r3, r0, #0xe00000 @ extract LoUIS from clidr > > > > + ALT_SMP(ands r3, r0, #(7 << 21)) @ extract LoUIS from clidr > > > > + ALT_UP(ands r3, r0, #(7 << 27)) @ extract LoUU from clidr > > > > mov r3, r3, lsr #20 @ r3 = LoUIS * 2 > > > > > > You need to fix this mov as well, right? > > > > And after doing that I think the suspend finisher will still have > > to call flush_cache_all() since LoUU = 1 on A8, L2 is not cleaned > > and that's probably what we want if it can be retained. > > At some point we probably want to describe the level of flushing required in > the device tree as a property of the CPU node (or something similar). That > would allow us to have *one* function for flushing, > e.g. cpu_suspend_flush_cache which flushes to the appropriate level. Then > we could remove the louis flush from the CPU suspend code and instead make > it the finisher's responsibility to call our flushing function when it's > done, which helps to avoid over/under-flushing the cache. > > In the meantime, fixing louis as we've suggested should work. > > Back to the case in hand.... Lorenzo just pointed out to me that the > finished in question (sh7372_do_idle_sysc) calls v7_flush_dcache_all, so > the louis stuff should be irrelevant. The problem may actually be that the > finisher disables the L2 cache prior to cleaning/invalidating it, which is > the opposite order to that described by the A8 TRM. > > Guennadi -- can you try moving the kernel_flush call before the L2 disable > in sh7372_do_idle_sysc please? Yes, this works too. Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations 2012-12-13 8:09 ` Guennadi Liakhovetski @ 2012-12-13 10:51 ` Will Deacon 2012-12-13 14:32 ` Guennadi Liakhovetski 0 siblings, 1 reply; 19+ messages in thread From: Will Deacon @ 2012-12-13 10:51 UTC (permalink / raw) To: linux-arm-kernel On Thu, Dec 13, 2012 at 08:09:33AM +0000, Guennadi Liakhovetski wrote: > On Wed, 12 Dec 2012, Will Deacon wrote: > > Back to the case in hand.... Lorenzo just pointed out to me that the > > finished in question (sh7372_do_idle_sysc) calls v7_flush_dcache_all, so > > the louis stuff should be irrelevant. The problem may actually be that the > > finisher disables the L2 cache prior to cleaning/invalidating it, which is > > the opposite order to that described by the A8 TRM. > > > > Guennadi -- can you try moving the kernel_flush call before the L2 disable > > in sh7372_do_idle_sysc please? > > Yes, this works too. That's good to know. Please can you send a patch for that? The sequence currently being used by the finisher *is* buggy, and should be fixed independently of the louis stuff. Cheers, Will ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations 2012-12-13 10:51 ` Will Deacon @ 2012-12-13 14:32 ` Guennadi Liakhovetski 2012-12-13 14:39 ` Santosh Shilimkar 2012-12-13 14:52 ` [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations Will Deacon 0 siblings, 2 replies; 19+ messages in thread From: Guennadi Liakhovetski @ 2012-12-13 14:32 UTC (permalink / raw) To: linux-arm-kernel On Thu, 13 Dec 2012, Will Deacon wrote: > On Thu, Dec 13, 2012 at 08:09:33AM +0000, Guennadi Liakhovetski wrote: > > On Wed, 12 Dec 2012, Will Deacon wrote: > > > Back to the case in hand.... Lorenzo just pointed out to me that the > > > finished in question (sh7372_do_idle_sysc) calls v7_flush_dcache_all, so > > > the louis stuff should be irrelevant. The problem may actually be that the > > > finisher disables the L2 cache prior to cleaning/invalidating it, which is > > > the opposite order to that described by the A8 TRM. > > > > > > Guennadi -- can you try moving the kernel_flush call before the L2 disable > > > in sh7372_do_idle_sysc please? > > > > Yes, this works too. > > That's good to know. Please can you send a patch for that? The sequence > currently being used by the finisher *is* buggy, and should be fixed > independently of the louis stuff. Well, the fix is yours, so, it should be "From: you." I can certainly send it just copying your description above, but I'd also need your Sob. Something like the below (feel free to improve the subject line and the description): From: Will Deacon <will.deacon@arm.com> Subject: [PATCH] ARM: sh7372: fix cache clean / invalidate order According to the Cortex A8 TRM the L2 cache should be first cleaned and then disabled. Fix the swapped order on sh7372. Signed-off-by: <you> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> (or even just) Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> diff --git a/arch/arm/mach-shmobile/sleep-sh7372.S b/arch/arm/mach-shmobile/sleep-sh7372.S index 1d56467..df15d8a 100644 --- a/arch/arm/mach-shmobile/sleep-sh7372.S +++ b/arch/arm/mach-shmobile/sleep-sh7372.S @@ -59,16 +59,16 @@ sh7372_do_idle_sysc: mcr p15, 0, r0, c1, c0, 0 isb - /* disable L2 cache in the aux control register */ - mrc p15, 0, r10, c1, c0, 1 - bic r10, r10, #2 - mcr p15, 0, r10, c1, c0, 1 - /* * Invalidate data cache again. */ ldr r1, kernel_flush blx r1 + + /* disable L2 cache in the aux control register */ + mrc p15, 0, r10, c1, c0, 1 + bic r10, r10, #2 + mcr p15, 0, r10, c1, c0, 1 /* * The kernel doesn't interwork: v7_flush_dcache_all in particluar will * always return in Thumb state when CONFIG_THUMB2_KERNEL is enabled. ^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations 2012-12-13 14:32 ` Guennadi Liakhovetski @ 2012-12-13 14:39 ` Santosh Shilimkar 2012-12-28 11:32 ` [PATCH v2] ARM: sh7372: fix cache clean / invalidate order Guennadi Liakhovetski 2012-12-13 14:52 ` [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations Will Deacon 1 sibling, 1 reply; 19+ messages in thread From: Santosh Shilimkar @ 2012-12-13 14:39 UTC (permalink / raw) To: linux-arm-kernel On Thursday 13 December 2012 03:32 PM, Guennadi Liakhovetski wrote: > On Thu, 13 Dec 2012, Will Deacon wrote: > >> On Thu, Dec 13, 2012 at 08:09:33AM +0000, Guennadi Liakhovetski wrote: >>> On Wed, 12 Dec 2012, Will Deacon wrote: >>>> Back to the case in hand.... Lorenzo just pointed out to me that the >>>> finished in question (sh7372_do_idle_sysc) calls v7_flush_dcache_all, so >>>> the louis stuff should be irrelevant. The problem may actually be that the >>>> finisher disables the L2 cache prior to cleaning/invalidating it, which is >>>> the opposite order to that described by the A8 TRM. >>>> >>>> Guennadi -- can you try moving the kernel_flush call before the L2 disable >>>> in sh7372_do_idle_sysc please? >>> >>> Yes, this works too. >> >> That's good to know. Please can you send a patch for that? The sequence >> currently being used by the finisher *is* buggy, and should be fixed >> independently of the louis stuff. > > Well, the fix is yours, so, it should be "From: you." I can certainly send > it just copying your description above, but I'd also need your Sob. > Something like the below (feel free to improve the subject line and the > description): > > From: Will Deacon <will.deacon@arm.com> > Subject: [PATCH] ARM: sh7372: fix cache clean / invalidate order > > According to the Cortex A8 TRM the L2 cache should be first cleaned and > then disabled. Fix the swapped order on sh7372. > > Signed-off-by: <you> > Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> > (or even just) > Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> > > diff --git a/arch/arm/mach-shmobile/sleep-sh7372.S b/arch/arm/mach-shmobile/sleep-sh7372.S > index 1d56467..df15d8a 100644 > --- a/arch/arm/mach-shmobile/sleep-sh7372.S > +++ b/arch/arm/mach-shmobile/sleep-sh7372.S > @@ -59,16 +59,16 @@ sh7372_do_idle_sysc: > mcr p15, 0, r0, c1, c0, 0 > isb > > - /* disable L2 cache in the aux control register */ > - mrc p15, 0, r10, c1, c0, 1 > - bic r10, r10, #2 > - mcr p15, 0, r10, c1, c0, 1 > - > /* > * Invalidate data cache again. > */ kernel_flush does "Clean and Invalidate" > ldr r1, kernel_flush > blx r1 > + > + /* disable L2 cache in the aux control register */ > + mrc p15, 0, r10, c1, c0, 1 > + bic r10, r10, #2 > + mcr p15, 0, r10, c1, c0, 1 An isb will be make it safe. Otherwise patch looks good to me. Feel free to add my review-by tag if you need one. Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com> ^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v2] ARM: sh7372: fix cache clean / invalidate order 2012-12-13 14:39 ` Santosh Shilimkar @ 2012-12-28 11:32 ` Guennadi Liakhovetski 2012-12-28 21:50 ` Simon Horman 0 siblings, 1 reply; 19+ messages in thread From: Guennadi Liakhovetski @ 2012-12-28 11:32 UTC (permalink / raw) To: linux-arm-kernel According to the Cortex A8 TRM the L2 cache should be first cleaned and then disabled. Fix the swapped order on sh7372. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com> --- v2: addressed improvement suggestions by Santosh, thanks diff --git a/arch/arm/mach-shmobile/sleep-sh7372.S b/arch/arm/mach-shmobile/sleep-sh7372.S index 1d56467..a9df53b 100644 --- a/arch/arm/mach-shmobile/sleep-sh7372.S +++ b/arch/arm/mach-shmobile/sleep-sh7372.S @@ -59,17 +59,19 @@ sh7372_do_idle_sysc: mcr p15, 0, r0, c1, c0, 0 isb + /* + * Clean and invalidate data cache again. + */ + ldr r1, kernel_flush + blx r1 + /* disable L2 cache in the aux control register */ mrc p15, 0, r10, c1, c0, 1 bic r10, r10, #2 mcr p15, 0, r10, c1, c0, 1 + isb /* - * Invalidate data cache again. - */ - ldr r1, kernel_flush - blx r1 - /* * The kernel doesn't interwork: v7_flush_dcache_all in particluar will * always return in Thumb state when CONFIG_THUMB2_KERNEL is enabled. * This sequence switches back to ARM. Note that .align may insert a ^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH v2] ARM: sh7372: fix cache clean / invalidate order 2012-12-28 11:32 ` [PATCH v2] ARM: sh7372: fix cache clean / invalidate order Guennadi Liakhovetski @ 2012-12-28 21:50 ` Simon Horman 0 siblings, 0 replies; 19+ messages in thread From: Simon Horman @ 2012-12-28 21:50 UTC (permalink / raw) To: linux-arm-kernel On Fri, Dec 28, 2012 at 12:32:54PM +0100, Guennadi Liakhovetski wrote: > According to the Cortex A8 TRM the L2 cache should be first cleaned and > then disabled. Fix the swapped order on sh7372. > > Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> > Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Thanks, applied to the soc branch of the renesas tree. ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations 2012-12-13 14:32 ` Guennadi Liakhovetski 2012-12-13 14:39 ` Santosh Shilimkar @ 2012-12-13 14:52 ` Will Deacon 1 sibling, 0 replies; 19+ messages in thread From: Will Deacon @ 2012-12-13 14:52 UTC (permalink / raw) To: linux-arm-kernel On Thu, Dec 13, 2012 at 02:32:46PM +0000, Guennadi Liakhovetski wrote: > On Thu, 13 Dec 2012, Will Deacon wrote: > > > On Thu, Dec 13, 2012 at 08:09:33AM +0000, Guennadi Liakhovetski wrote: > > > On Wed, 12 Dec 2012, Will Deacon wrote: > > > > Back to the case in hand.... Lorenzo just pointed out to me that the > > > > finished in question (sh7372_do_idle_sysc) calls v7_flush_dcache_all, so > > > > the louis stuff should be irrelevant. The problem may actually be that the > > > > finisher disables the L2 cache prior to cleaning/invalidating it, which is > > > > the opposite order to that described by the A8 TRM. > > > > > > > > Guennadi -- can you try moving the kernel_flush call before the L2 disable > > > > in sh7372_do_idle_sysc please? > > > > > > Yes, this works too. > > > > That's good to know. Please can you send a patch for that? The sequence > > currently being used by the finisher *is* buggy, and should be fixed > > independently of the louis stuff. > > Well, the fix is yours, so, it should be "From: you." I can certainly send > it just copying your description above, but I'd also need your Sob. > Something like the below (feel free to improve the subject line and the > description): No, I didn't send any code for this so you should be the author. I can review/possibly ack it if you like (please send a v2 addressing Santosh's comments). Will ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations 2012-12-12 10:33 ` Lorenzo Pieralisi 2012-12-12 13:36 ` Will Deacon @ 2012-12-12 16:43 ` Guennadi Liakhovetski 1 sibling, 0 replies; 19+ messages in thread From: Guennadi Liakhovetski @ 2012-12-12 16:43 UTC (permalink / raw) To: linux-arm-kernel Hi Lorenzo On Wed, 12 Dec 2012, Lorenzo Pieralisi wrote: > On Tue, Dec 11, 2012 at 11:27:39PM +0000, Stephen Boyd wrote: > > On 12/11/12 08:38, Will Deacon wrote: > > > diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S > > > index cd95664..f58248f 100644 > > > --- a/arch/arm/mm/cache-v7.S > > > +++ b/arch/arm/mm/cache-v7.S > > > @@ -44,7 +44,8 @@ ENDPROC(v7_flush_icache_all) > > > ENTRY(v7_flush_dcache_louis) > > > dmb @ ensure ordering with previous memory accesses > > > mrc p15, 1, r0, c0, c0, 1 @ read clidr, r0 = clidr > > > - ands r3, r0, #0xe00000 @ extract LoUIS from clidr > > > + ALT_SMP(ands r3, r0, #(7 << 21)) @ extract LoUIS from clidr > > > + ALT_UP(ands r3, r0, #(7 << 27)) @ extract LoUU from clidr > > > mov r3, r3, lsr #20 @ r3 = LoUIS * 2 > > > > You need to fix this mov as well, right? > > And after doing that I think the suspend finisher will still have > to call flush_cache_all() since LoUU = 1 on A8, L2 is not cleaned > and that's probably what we want if it can be retained. > > What about this (compile tested) ? Works too. Thanks Guennadi > > Lorenzo > > --->8 > > diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S > index cd95664..036f80f 100644 > --- a/arch/arm/mm/cache-v7.S > +++ b/arch/arm/mm/cache-v7.S > @@ -44,8 +44,9 @@ ENDPROC(v7_flush_icache_all) > ENTRY(v7_flush_dcache_louis) > dmb @ ensure ordering with previous memory accesses > mrc p15, 1, r0, c0, c0, 1 @ read clidr, r0 = clidr > - ands r3, r0, #0xe00000 @ extract LoUIS from clidr > - mov r3, r3, lsr #20 @ r3 = LoUIS * 2 > + ALT_SMP(lsr r3, r0, #20) @ r3 = clidr[31:20] > + ALT_UP(lsr r3, r0, #26) @ r3 = clidr[31:26] > + ands r3, r3, #0xe @ r3 = LoUIS/LoUU * 2 > moveq pc, lr @ return if level = 0 > mov r10, #0 @ r10 (starting level) = 0 > b flush_levels @ start flushing cache levels > --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ ^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2012-12-28 21:50 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1347986135-17979-1-git-send-email-lorenzo.pieralisi@arm.com>
[not found] ` <1347986135-17979-4-git-send-email-lorenzo.pieralisi@arm.com>
[not found] ` <20120919134658.GA2111@linaro.org>
[not found] ` <20120920102514.GD4588@e102568-lin.cambridge.arm.com>
[not found] ` <20120920110439.GB2117@linaro.org>
2012-12-11 16:07 ` [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations Guennadi Liakhovetski
2012-12-11 16:33 ` Will Deacon
2012-12-11 16:38 ` Will Deacon
2012-12-11 17:07 ` Guennadi Liakhovetski
2012-12-11 17:47 ` Will Deacon
2012-12-11 17:55 ` Guennadi Liakhovetski
2012-12-11 23:27 ` Stephen Boyd
2012-12-12 10:31 ` Will Deacon
2012-12-12 16:43 ` Guennadi Liakhovetski
2012-12-12 10:33 ` Lorenzo Pieralisi
2012-12-12 13:36 ` Will Deacon
2012-12-13 8:09 ` Guennadi Liakhovetski
2012-12-13 10:51 ` Will Deacon
2012-12-13 14:32 ` Guennadi Liakhovetski
2012-12-13 14:39 ` Santosh Shilimkar
2012-12-28 11:32 ` [PATCH v2] ARM: sh7372: fix cache clean / invalidate order Guennadi Liakhovetski
2012-12-28 21:50 ` Simon Horman
2012-12-13 14:52 ` [RFC PATCH v2 3/5] ARM: kernel: update cpu_suspend code to use cache LoUIS operations Will Deacon
2012-12-12 16:43 ` Guennadi Liakhovetski
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).