* [patch 0/2] ARM: Disable outer cache before kexec call -V3
@ 2010-07-05 11:52 Thomas Gleixner
2010-07-05 11:52 ` [patch 1/2] arm: Disable outer (L2) cache in kexec Thomas Gleixner
` (2 more replies)
0 siblings, 3 replies; 18+ messages in thread
From: Thomas Gleixner @ 2010-07-05 11:52 UTC (permalink / raw)
To: linux-arm-kernel
The following patch series addresses the problem that the kexec code
does not disable the outer cache before disabling the inner cache and
jumping into the new kernel. This results in random crashes of the new
kernel.
Changes since version 2:
- Use CLEAN_INV_WAY in l2x0_flush_all according to Catalin
- Rename outer_cache_disable() to outer_disable()
- Added a BUG_ON() when l2x0_inv_all() is called with L2 enabled.
Thanks,
tglx
^ permalink raw reply [flat|nested] 18+ messages in thread
* [patch 1/2] arm: Disable outer (L2) cache in kexec
2010-07-05 11:52 [patch 0/2] ARM: Disable outer cache before kexec call -V3 Thomas Gleixner
@ 2010-07-05 11:52 ` Thomas Gleixner
2010-07-05 12:11 ` Catalin Marinas
2010-07-05 11:52 ` [patch 2/2] arm: Implement l2x0 cache disable functions Thomas Gleixner
2010-08-03 14:20 ` [patch 0/2] ARM: Disable outer cache before kexec call -V3 Andrea Paterniani
2 siblings, 1 reply; 18+ messages in thread
From: Thomas Gleixner @ 2010-07-05 11:52 UTC (permalink / raw)
To: linux-arm-kernel
An embedded and charset-unspecified text was scrubbed...
Name: arm-outer-cache-disable-for-kexec.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100705/e4b93b58/attachment.ksh>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [patch 1/2] arm: Disable outer (L2) cache in kexec
2010-07-05 11:52 ` [patch 1/2] arm: Disable outer (L2) cache in kexec Thomas Gleixner
@ 2010-07-05 12:11 ` Catalin Marinas
0 siblings, 0 replies; 18+ messages in thread
From: Catalin Marinas @ 2010-07-05 12:11 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 2010-07-05 at 12:52 +0100, Thomas Gleixner wrote:
> kexec does not disable the outer cache before disabling the inner
> caches in cpu_proc_fin(). So L2 is enabled across the kexec jump. When
> the new kernel enables chaches again, it randomly crashes.
>
> Disabling L2 before calling cpu_proc_fin() cures the problem.
>
> Disabling L2 requires the following new functions: flush_all(),
> inv_all() and disable(). Add them to outer_cache_fns and call them
> from the kexec code.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
--
Catalin
^ permalink raw reply [flat|nested] 18+ messages in thread
* [patch 2/2] arm: Implement l2x0 cache disable functions
2010-07-05 11:52 [patch 0/2] ARM: Disable outer cache before kexec call -V3 Thomas Gleixner
2010-07-05 11:52 ` [patch 1/2] arm: Disable outer (L2) cache in kexec Thomas Gleixner
@ 2010-07-05 11:52 ` Thomas Gleixner
2010-07-05 12:13 ` Catalin Marinas
2010-08-03 12:44 ` Linus Walleij
2010-08-03 14:20 ` [patch 0/2] ARM: Disable outer cache before kexec call -V3 Andrea Paterniani
2 siblings, 2 replies; 18+ messages in thread
From: Thomas Gleixner @ 2010-07-05 11:52 UTC (permalink / raw)
To: linux-arm-kernel
An embedded and charset-unspecified text was scrubbed...
Name: arm-l2x0-cache-disable.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100705/b88b1a1a/attachment.ksh>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [patch 2/2] arm: Implement l2x0 cache disable functions
2010-07-05 11:52 ` [patch 2/2] arm: Implement l2x0 cache disable functions Thomas Gleixner
@ 2010-07-05 12:13 ` Catalin Marinas
2010-08-03 12:44 ` Linus Walleij
1 sibling, 0 replies; 18+ messages in thread
From: Catalin Marinas @ 2010-07-05 12:13 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 2010-07-05 at 12:52 +0100, Thomas Gleixner wrote:
> Add flush_all, inv_all and disable functions to the l2x0 code. These
> functions are called from kexec code to prevent random crashes in the
> new kernel.
>
> Platforms like OMAP which control L2 enable/disable via SMI mode can
> override the outer_cache.disable() function to implement their own.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
[...]
> -static inline void l2x0_inv_all(void)
> +static void l2x0_flush_all(void)
> +{
> + unsigned long flags;
> +
> + /* clean all ways */
Minor point - /* clean and invalidate all ways */
But the patch looks good to me:
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
--
Catalin
^ permalink raw reply [flat|nested] 18+ messages in thread
* [patch 2/2] arm: Implement l2x0 cache disable functions
2010-07-05 11:52 ` [patch 2/2] arm: Implement l2x0 cache disable functions Thomas Gleixner
2010-07-05 12:13 ` Catalin Marinas
@ 2010-08-03 12:44 ` Linus Walleij
1 sibling, 0 replies; 18+ messages in thread
From: Linus Walleij @ 2010-08-03 12:44 UTC (permalink / raw)
To: linux-arm-kernel
2010/7/5 Thomas Gleixner <tglx@linutronix.de>:
> Add flush_all, inv_all and disable functions to the l2x0 code. These
> functions are called from kexec code to prevent random crashes in the
> new kernel.
> (...)
> +static void l2x0_disable(void)
> +{
> + ? ? ? unsigned long flags;
> +
> + ? ? ? spin_lock_irqsave(&l2x0_lock, flags);
> + ? ? ? writel(0, l2x0_base + L2X0_CTRL);
> + ? ? ? spin_unlock_irqrestore(&l2x0_lock, flags);
> +}
> +
Does this take into account this comment from Srinidhi:
[Srinidhi KASAGAR wrote]
> I think it's a problem for PL310 controller where the access to
> L2X0_CTRL is secure, accessing this in non-secure mode will fault.
I'm worried that a writel() into the CTRL register like that will cause
a bus error on platforms that have L2x0 in Trusted World (TrustZone)?
Or that it may be ignored simply on such platforms causing
trouble that way?
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 18+ messages in thread
* [patch 0/2] ARM: Disable outer cache before kexec call -V3
2010-07-05 11:52 [patch 0/2] ARM: Disable outer cache before kexec call -V3 Thomas Gleixner
2010-07-05 11:52 ` [patch 1/2] arm: Disable outer (L2) cache in kexec Thomas Gleixner
2010-07-05 11:52 ` [patch 2/2] arm: Implement l2x0 cache disable functions Thomas Gleixner
@ 2010-08-03 14:20 ` Andrea Paterniani
2010-08-03 17:36 ` Gadiyar, Anand
2 siblings, 1 reply; 18+ messages in thread
From: Andrea Paterniani @ 2010-08-03 14:20 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
I have applied your patches to kernel 2.6.35-rc4 running on my
beagleboard.
I'm using kexec-tools-2.0.1.
My u-boot bootargs is:
console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext3
rootwait ip=192.168.2.13::255.255.255.0
To restart the system I type:
> sync
> kexec -l /boot/zImage --append="console=ttyS2,115200n8
root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait
ip=192.168.2.13::255.255.255.0"
> kexec -e
Not every time the system restart.
In some cases no output on the console after the following:
Bye!
Uncompressing Linux... done, booting the kernel.
Any idea?
Regards,
Andrea
Il 05/07/2010 13.52, Thomas Gleixner ha scritto:
> The following patch series addresses the problem that the kexec code
> does not disable the outer cache before disabling the inner cache and
> jumping into the new kernel. This results in random crashes of the new
> kernel.
>
> Changes since version 2:
>
> - Use CLEAN_INV_WAY in l2x0_flush_all according to Catalin
>
> - Rename outer_cache_disable() to outer_disable()
>
> - Added a BUG_ON() when l2x0_inv_all() is called with L2 enabled.
>
> Thanks,
>
> tglx
>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
>
--
^ permalink raw reply [flat|nested] 18+ messages in thread
* [patch 0/2] ARM: Disable outer cache before kexec call -V3
2010-08-03 14:20 ` [patch 0/2] ARM: Disable outer cache before kexec call -V3 Andrea Paterniani
@ 2010-08-03 17:36 ` Gadiyar, Anand
2010-08-04 6:46 ` Andrea Paterniani
2010-08-04 9:19 ` Andrea Paterniani
0 siblings, 2 replies; 18+ messages in thread
From: Gadiyar, Anand @ 2010-08-03 17:36 UTC (permalink / raw)
To: linux-arm-kernel
Andrea Paterniani wrote:
> Hi,
> I have applied your patches to kernel 2.6.35-rc4 running on my beagleboard.
> I'm using kexec-tools-2.0.1.
>
> My u-boot bootargs is:
> console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait ip=192.168.2.13::255.255.255.0
>
> To restart the system I type:
> > sync
> > kexec -l /boot/zImage --append="console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait ip=192.168.2.13::255.255.255.0"
> > kexec -e
>
> Not every time the system restart.
> In some cases no output on the console after the following:
> Bye!
> Uncompressing Linux... done, booting the kernel.
>
> Any idea?
>
Can you try building your kernel with CONFIG_EARLY_PRINTK,
and add the word "earlyprintk" to your bootargs?
> Il 05/07/2010 13.52, Thomas Gleixner ha scritto:
> > The following patch series addresses the problem that the kexec code
> > does not disable the outer cache before disabling the inner cache and
> > jumping into the new kernel. This results in random crashes of the new
> > kernel.
> >
> > Changes since version 2:
> >
> > - Use CLEAN_INV_WAY in l2x0_flush_all according to Catalin
> >
> > - Rename outer_cache_disable() to outer_disable()
> >
> > - Added a BUG_ON() when l2x0_inv_all() is called with L2 enabled.
> >
> > Thanks,
> >
> > tglx
> >
> >
> >
^ permalink raw reply [flat|nested] 18+ messages in thread
* [patch 0/2] ARM: Disable outer cache before kexec call -V3
2010-08-03 17:36 ` Gadiyar, Anand
@ 2010-08-04 6:46 ` Andrea Paterniani
2010-08-04 6:50 ` Shilimkar, Santosh
2010-08-04 7:00 ` Baruch Siach
2010-08-04 9:19 ` Andrea Paterniani
1 sibling, 2 replies; 18+ messages in thread
From: Andrea Paterniani @ 2010-08-04 6:46 UTC (permalink / raw)
To: linux-arm-kernel
Il 03/08/2010 19.36, Gadiyar, Anand ha scritto:
> Andrea Paterniani wrote:
>
>> Hi,
>> I have applied your patches to kernel 2.6.35-rc4 running on my beagleboard.
>> I'm using kexec-tools-2.0.1.
>>
>> My u-boot bootargs is:
>> console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait ip=192.168.2.13::255.255.255.0
>>
>> To restart the system I type:
>> > sync
>> > kexec -l /boot/zImage --append="console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait ip=192.168.2.13::255.255.255.0"
>> > kexec -e
>>
>> Not every time the system restart.
>> In some cases no output on the console after the following:
>> Bye!
>> Uncompressing Linux... done, booting the kernel.
>>
>> Any idea?
>>
>>
> Can you try building your kernel with CONFIG_EARLY_PRINTK,
> and add the word "earlyprintk" to your bootargs?
>
>
How to enable EARLY_PRINTK for ARM architecture?
Browsing kernel source I find arch/arm/kernel/early_printk.c but no way
to enable CONFIG_EARLY_PRINTK from make menuconfig.
Is there any patch to have this config option for ARM?
- Andrea
>
>
>> Il 05/07/2010 13.52, Thomas Gleixner ha scritto:
>>
>>> The following patch series addresses the problem that the kexec code
>>> does not disable the outer cache before disabling the inner cache and
>>> jumping into the new kernel. This results in random crashes of the new
>>> kernel.
>>>
>>> Changes since version 2:
>>>
>>> - Use CLEAN_INV_WAY in l2x0_flush_all according to Catalin
>>>
>>> - Rename outer_cache_disable() to outer_disable()
>>>
>>> - Added a BUG_ON() when l2x0_inv_all() is called with L2 enabled.
>>>
>>> Thanks,
>>>
>>> tglx
>>>
>>>
>>>
>>>
>
--
^ permalink raw reply [flat|nested] 18+ messages in thread
* [patch 0/2] ARM: Disable outer cache before kexec call -V3
2010-08-04 6:46 ` Andrea Paterniani
@ 2010-08-04 6:50 ` Shilimkar, Santosh
2010-08-04 7:00 ` Baruch Siach
1 sibling, 0 replies; 18+ messages in thread
From: Shilimkar, Santosh @ 2010-08-04 6:50 UTC (permalink / raw)
To: linux-arm-kernel
> -----Original Message-----
> From: Andrea Paterniani [mailto:a.paterniani at swapp-eng.it]
> Sent: Wednesday, August 04, 2010 12:16 PM
> To: Gadiyar, Anand
> Cc: linux-arm-kernel at lists.infradead.org; Thomas Gleixner;
> catalin.marinas at arm.com; Shilimkar, Santosh
> Subject: Re: [patch 0/2] ARM: Disable outer cache before kexec call -V3
>
> Il 03/08/2010 19.36, Gadiyar, Anand ha scritto:
> > Andrea Paterniani wrote:
> >
> >> Hi,
> >> I have applied your patches to kernel 2.6.35-rc4 running on my
> beagleboard.
> >> I'm using kexec-tools-2.0.1.
> >>
> >> My u-boot bootargs is:
> >> console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext3
> rootwait ip=192.168.2.13::255.255.255.0
> >>
> >> To restart the system I type:
> >> > sync
> >> > kexec -l /boot/zImage --append="console=ttyS2,115200n8
> root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait
> ip=192.168.2.13::255.255.255.0"
> >> > kexec -e
> >>
> >> Not every time the system restart.
> >> In some cases no output on the console after the following:
> >> Bye!
> >> Uncompressing Linux... done, booting the kernel.
> >>
> >> Any idea?
> >>
> >>
> > Can you try building your kernel with CONFIG_EARLY_PRINTK,
> > and add the word "earlyprintk" to your bootargs?
> >
> >
> How to enable EARLY_PRINTK for ARM architecture?
> Browsing kernel source I find arch/arm/kernel/early_printk.c but no way
> to enable CONFIG_EARLY_PRINTK from make menuconfig.
> Is there any patch to have this config option for ARM?
>
Menuconfig >
Kernel hacking ->
Kernel low-level debugging functions
-->Early printk (NEW)
^ permalink raw reply [flat|nested] 18+ messages in thread
* [patch 0/2] ARM: Disable outer cache before kexec call -V3
2010-08-04 6:46 ` Andrea Paterniani
2010-08-04 6:50 ` Shilimkar, Santosh
@ 2010-08-04 7:00 ` Baruch Siach
1 sibling, 0 replies; 18+ messages in thread
From: Baruch Siach @ 2010-08-04 7:00 UTC (permalink / raw)
To: linux-arm-kernel
Hi Andrea,
On Wed, Aug 04, 2010 at 08:46:21AM +0200, Andrea Paterniani wrote:
> Il 03/08/2010 19.36, Gadiyar, Anand ha scritto:
> >Andrea Paterniani wrote:
> >>Hi,
> >> I have applied your patches to kernel 2.6.35-rc4 running on my beagleboard.
> >>I'm using kexec-tools-2.0.1.
> >>
> >>My u-boot bootargs is:
> >> console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait ip=192.168.2.13::255.255.255.0
> >>
> >>To restart the system I type:
> >> > sync
> >> > kexec -l /boot/zImage --append="console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait ip=192.168.2.13::255.255.255.0"
> >> > kexec -e
> >>
> >>Not every time the system restart.
> >>In some cases no output on the console after the following:
> >> Bye!
> >> Uncompressing Linux... done, booting the kernel.
> >>
> >>Any idea?
> >>
> >Can you try building your kernel with CONFIG_EARLY_PRINTK,
> >and add the word "earlyprintk" to your bootargs?
> >
> How to enable EARLY_PRINTK for ARM architecture?
> Browsing kernel source I find arch/arm/kernel/early_printk.c but no
> way to enable CONFIG_EARLY_PRINTK from make menuconfig.
> Is there any patch to have this config option for ARM?
EARLY_PRINTK is in arch/arm/Kconfig.debug. It depends on DEBUG_LL, though. So
you must enable DEBUG_LL to make EARLY_PRINTK visible.
baruch
>
> - Andrea
> >
> >>Il 05/07/2010 13.52, Thomas Gleixner ha scritto:
> >>>The following patch series addresses the problem that the kexec code
> >>>does not disable the outer cache before disabling the inner cache and
> >>>jumping into the new kernel. This results in random crashes of the new
> >>>kernel.
> >>>
> >>>Changes since version 2:
> >>>
> >>> - Use CLEAN_INV_WAY in l2x0_flush_all according to Catalin
> >>>
> >>> - Rename outer_cache_disable() to outer_disable()
> >>>
> >>> - Added a BUG_ON() when l2x0_inv_all() is called with L2 enabled.
> >>>
> >>>Thanks,
> >>>
> >>> tglx
--
~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
^ permalink raw reply [flat|nested] 18+ messages in thread
* [patch 0/2] ARM: Disable outer cache before kexec call -V3
2010-08-03 17:36 ` Gadiyar, Anand
2010-08-04 6:46 ` Andrea Paterniani
@ 2010-08-04 9:19 ` Andrea Paterniani
2010-08-06 6:16 ` Andrea Paterniani
1 sibling, 1 reply; 18+ messages in thread
From: Andrea Paterniani @ 2010-08-04 9:19 UTC (permalink / raw)
To: linux-arm-kernel
Il 03/08/2010 19.36, Gadiyar, Anand ha scritto:
> Andrea Paterniani wrote:
>
>> Hi,
>> I have applied your patches to kernel 2.6.35-rc4 running on my beagleboard.
>> I'm using kexec-tools-2.0.1.
>>
>> My u-boot bootargs is:
>> console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait ip=192.168.2.13::255.255.255.0
>>
>> To restart the system I type:
>> > sync
>> > kexec -l /boot/zImage --append="console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait ip=192.168.2.13::255.255.255.0"
>> > kexec -e
>>
>> Not every time the system restart.
>> In some cases no output on the console after the following:
>> Bye!
>> Uncompressing Linux... done, booting the kernel.
>>
>> Any idea?
>>
>>
> Can you try building your kernel with CONFIG_EARLY_PRINTK,
> and add the word "earlyprintk" to your bootargs?
>
>
I built the kernel with (also verified via zcat /proc/config.gz | grep
... after succesfull kexec):
CONFIG_EARLY_PRINTK=y
CONFIG_DEBUG_LL=y
I load new kernel zImage via:
kexec -l /boot/zImage --append="earlyprintk console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait ip=192.168.2.13::255.255.255.0"
but when kexec fails I got only the following:
Bye!
Uncompressing Linux... done, booting the kernel.
What do I miss whith earlyprintk?
Perhaps I did not enough tests, but at the moment it seems that system boot with nfs rootfs followed by kexec with mmc rootfs works.
Problems arise with system boot and kexec both with mmc rootfs.
Regards,
- Andrea
>
>
>> Il 05/07/2010 13.52, Thomas Gleixner ha scritto:
>>
>>> The following patch series addresses the problem that the kexec code
>>> does not disable the outer cache before disabling the inner cache and
>>> jumping into the new kernel. This results in random crashes of the new
>>> kernel.
>>>
>>> Changes since version 2:
>>>
>>> - Use CLEAN_INV_WAY in l2x0_flush_all according to Catalin
>>>
>>> - Rename outer_cache_disable() to outer_disable()
>>>
>>> - Added a BUG_ON() when l2x0_inv_all() is called with L2 enabled.
>>>
>>> Thanks,
>>>
>>> tglx
>>>
>>>
>>>
>>>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
>
--
^ permalink raw reply [flat|nested] 18+ messages in thread
* [patch 0/2] ARM: Disable outer cache before kexec call -V3
2010-08-04 9:19 ` Andrea Paterniani
@ 2010-08-06 6:16 ` Andrea Paterniani
0 siblings, 0 replies; 18+ messages in thread
From: Andrea Paterniani @ 2010-08-06 6:16 UTC (permalink / raw)
To: linux-arm-kernel
Any other suggestion?
Thanks
- Andrea
Il 04/08/2010 11.19, Andrea Paterniani ha scritto:
> Il 03/08/2010 19.36, Gadiyar, Anand ha scritto:
>> Andrea Paterniani wrote:
>>> Hi,
>>> I have applied your patches to kernel 2.6.35-rc4 running on my
>>> beagleboard.
>>> I'm using kexec-tools-2.0.1.
>>>
>>> My u-boot bootargs is:
>>> console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootfstype=ext3
>>> rootwait ip=192.168.2.13::255.255.255.0
>>>
>>> To restart the system I type:
>>> > sync
>>> > kexec -l /boot/zImage --append="console=ttyS2,115200n8
>>> root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait
>>> ip=192.168.2.13::255.255.255.0"
>>> > kexec -e
>>>
>>> Not every time the system restart.
>>> In some cases no output on the console after the following:
>>> Bye!
>>> Uncompressing Linux... done, booting the kernel.
>>>
>>> Any idea?
>>>
>> Can you try building your kernel with CONFIG_EARLY_PRINTK,
>> and add the word "earlyprintk" to your bootargs?
>>
> I built the kernel with (also verified via zcat /proc/config.gz | grep
> ... after succesfull kexec):
>
> CONFIG_EARLY_PRINTK=y
> CONFIG_DEBUG_LL=y
>
> I load new kernel zImage via:
> kexec -l /boot/zImage --append="earlyprintk console=ttyS2,115200n8
> root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait
> ip=192.168.2.13::255.255.255.0"
>
> but when kexec fails I got only the following:
> Bye!
> Uncompressing Linux... done, booting the kernel.
>
> What do I miss whith earlyprintk?
>
> Perhaps I did not enough tests, but at the moment it seems that system
> boot with nfs rootfs followed by kexec with mmc rootfs works.
> Problems arise with system boot and kexec both with mmc rootfs.
>
> Regards,
> - Andrea
>
>>
>>> Il 05/07/2010 13.52, Thomas Gleixner ha scritto:
>>>> The following patch series addresses the problem that the kexec code
>>>> does not disable the outer cache before disabling the inner cache and
>>>> jumping into the new kernel. This results in random crashes of the new
>>>> kernel.
>>>>
>>>> Changes since version 2:
>>>>
>>>> - Use CLEAN_INV_WAY in l2x0_flush_all according to Catalin
>>>>
>>>> - Rename outer_cache_disable() to outer_disable()
>>>>
>>>> - Added a BUG_ON() when l2x0_inv_all() is called with L2 enabled.
>>>>
>>>> Thanks,
>>>>
>>>> tglx
>>>>
>>>>
>>>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>>
>
--
^ permalink raw reply [flat|nested] 18+ messages in thread
* [patch 0/2] [patch 0/2] ARM: Disable outer cache before kexec call -V2
@ 2010-07-05 9:25 Thomas Gleixner
2010-07-05 9:25 ` [patch 1/2] arm: Disable outer (L2) cache in kexec Thomas Gleixner
0 siblings, 1 reply; 18+ messages in thread
From: Thomas Gleixner @ 2010-07-05 9:25 UTC (permalink / raw)
To: linux-arm-kernel
The following patch series addresses the problem, that the kexec code
does not disable the outer cache before disabling the inner cache and
jumping into the new kernel. This results in random crashes of the new
kernel.
Changes since version 1:
- added flush_all() and inv_all() functions to outer_cache_fns
so OMAP can override the disable() function easily.
- changed the implementation from inv_all() -> disable() to
flush_all() -> disable() -> inv_all() according to feedback from
Russell and Catalin.
Thanks,
tglx
^ permalink raw reply [flat|nested] 18+ messages in thread
* [patch 1/2] arm: Disable outer (L2) cache in kexec
2010-07-05 9:25 [patch 0/2] [patch 0/2] ARM: Disable outer cache before kexec call -V2 Thomas Gleixner
@ 2010-07-05 9:25 ` Thomas Gleixner
2010-07-05 10:52 ` Catalin Marinas
0 siblings, 1 reply; 18+ messages in thread
From: Thomas Gleixner @ 2010-07-05 9:25 UTC (permalink / raw)
To: linux-arm-kernel
An embedded and charset-unspecified text was scrubbed...
Name: arm-outer-cache-disable-for-kexec.patch
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100705/76e5d455/attachment.ksh>
^ permalink raw reply [flat|nested] 18+ messages in thread
* [patch 1/2] arm: Disable outer (L2) cache in kexec
2010-07-05 9:25 ` [patch 1/2] arm: Disable outer (L2) cache in kexec Thomas Gleixner
@ 2010-07-05 10:52 ` Catalin Marinas
2010-07-05 11:13 ` Thomas Gleixner
0 siblings, 1 reply; 18+ messages in thread
From: Catalin Marinas @ 2010-07-05 10:52 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 2010-07-05 at 10:25 +0100, Thomas Gleixner wrote:
> kexec does not disable the outer cache before disabling the inner
> caches in cpu_proc_fin(). So L2 is enabled across the kexec jump. When
> the new kernel enables chaches again, it randomly crashes.
>
> Disabling L2 before calling cpu_proc_fin() cures the problem.
>
> Disabling L2 requires the following new functions: flush_all(),
> inv_all() and disable(). Add them to outer_cache_fns and call them
> from the kexec code.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Index: linux-2.6/arch/arm/include/asm/outercache.h
> ===================================================================
> --- linux-2.6.orig/arch/arm/include/asm/outercache.h
> +++ linux-2.6/arch/arm/include/asm/outercache.h
> @@ -25,6 +25,9 @@ struct outer_cache_fns {
> void (*inv_range)(unsigned long, unsigned long);
> void (*clean_range)(unsigned long, unsigned long);
> void (*flush_range)(unsigned long, unsigned long);
> + void (*flush_all)(void);
> + void (*inv_all)(void);
> + void (*disable)(void);
Why don't we handle the flush_all/inv_all in the disable function and
avoid exporting them? Once exported, people may start using them in
drivers and they should use the DMA API for this. The inv_all is also
dangerous if called when the L2 is enabled.
> +static inline void outer_cache_disable(void)
> +{
> + if (outer_cache.disable)
> + outer_cache.disable();
> +}
Personal preference - "outer_disable()" as we don't call any of the
other functions outer_cache_*().
> --- linux-2.6.orig/arch/arm/kernel/machine_kexec.c
> +++ linux-2.6/arch/arm/kernel/machine_kexec.c
> @@ -74,7 +74,10 @@ void machine_kexec(struct kimage *image)
> (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE);
> printk(KERN_INFO "Bye!\n");
>
> + outer_flush_all();
> + outer_cache_disable();
> cpu_proc_fin();
> + outer_inv_all();
As I said above, we could have just outer_disable() here which does
outer_flush_all, disabling and outer_inv_all. I don't think the
invalidation needs to be done after cup_proc_fin().
Thanks.
--
Catalin
^ permalink raw reply [flat|nested] 18+ messages in thread
* [patch 1/2] arm: Disable outer (L2) cache in kexec
2010-07-05 10:52 ` Catalin Marinas
@ 2010-07-05 11:13 ` Thomas Gleixner
2010-07-05 11:16 ` Catalin Marinas
0 siblings, 1 reply; 18+ messages in thread
From: Thomas Gleixner @ 2010-07-05 11:13 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 5 Jul 2010, Catalin Marinas wrote:
> On Mon, 2010-07-05 at 10:25 +0100, Thomas Gleixner wrote:
> > kexec does not disable the outer cache before disabling the inner
> > caches in cpu_proc_fin(). So L2 is enabled across the kexec jump. When
> > the new kernel enables chaches again, it randomly crashes.
> >
> > Disabling L2 before calling cpu_proc_fin() cures the problem.
> >
> > Disabling L2 requires the following new functions: flush_all(),
> > inv_all() and disable(). Add them to outer_cache_fns and call them
> > from the kexec code.
> >
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > Index: linux-2.6/arch/arm/include/asm/outercache.h
> > ===================================================================
> > --- linux-2.6.orig/arch/arm/include/asm/outercache.h
> > +++ linux-2.6/arch/arm/include/asm/outercache.h
> > @@ -25,6 +25,9 @@ struct outer_cache_fns {
> > void (*inv_range)(unsigned long, unsigned long);
> > void (*clean_range)(unsigned long, unsigned long);
> > void (*flush_range)(unsigned long, unsigned long);
> > + void (*flush_all)(void);
> > + void (*inv_all)(void);
> > + void (*disable)(void);
>
> Why don't we handle the flush_all/inv_all in the disable function and
> avoid exporting them? Once exported, people may start using them in
Because OMAP needs them to avoid reimplementing everything in the OMAP
part. So OMAP only needs to override the disable function. And if
Russell wants to add his cleanup patch which he posted last week, then
the split and the export needs to be done anyway.
Thanks,
tglx
^ permalink raw reply [flat|nested] 18+ messages in thread
* [patch 1/2] arm: Disable outer (L2) cache in kexec
2010-07-05 11:13 ` Thomas Gleixner
@ 2010-07-05 11:16 ` Catalin Marinas
0 siblings, 0 replies; 18+ messages in thread
From: Catalin Marinas @ 2010-07-05 11:16 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 2010-07-05 at 12:13 +0100, Thomas Gleixner wrote:
> On Mon, 5 Jul 2010, Catalin Marinas wrote:
>
> > On Mon, 2010-07-05 at 10:25 +0100, Thomas Gleixner wrote:
> > > kexec does not disable the outer cache before disabling the inner
> > > caches in cpu_proc_fin(). So L2 is enabled across the kexec jump. When
> > > the new kernel enables chaches again, it randomly crashes.
> > >
> > > Disabling L2 before calling cpu_proc_fin() cures the problem.
> > >
> > > Disabling L2 requires the following new functions: flush_all(),
> > > inv_all() and disable(). Add them to outer_cache_fns and call them
> > > from the kexec code.
> > >
> > > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > > Index: linux-2.6/arch/arm/include/asm/outercache.h
> > > ===================================================================
> > > --- linux-2.6.orig/arch/arm/include/asm/outercache.h
> > > +++ linux-2.6/arch/arm/include/asm/outercache.h
> > > @@ -25,6 +25,9 @@ struct outer_cache_fns {
> > > void (*inv_range)(unsigned long, unsigned long);
> > > void (*clean_range)(unsigned long, unsigned long);
> > > void (*flush_range)(unsigned long, unsigned long);
> > > + void (*flush_all)(void);
> > > + void (*inv_all)(void);
> > > + void (*disable)(void);
> >
> > Why don't we handle the flush_all/inv_all in the disable function and
> > avoid exporting them? Once exported, people may start using them in
>
> Because OMAP needs them to avoid reimplementing everything in the OMAP
> part. So OMAP only needs to override the disable function. And if
> Russell wants to add his cleanup patch which he posted last week, then
> the split and the export needs to be done anyway.
OK, good point.
Thanks.
--
Catalin
^ permalink raw reply [flat|nested] 18+ messages in thread
* [patch 0/2] ARM: Disable outer cache before kexec call
@ 2010-07-01 16:05 Thomas Gleixner
2010-07-01 16:05 ` [patch 1/2] arm: Disable outer (L2) cache in kexec Thomas Gleixner
0 siblings, 1 reply; 18+ messages in thread
From: Thomas Gleixner @ 2010-07-01 16:05 UTC (permalink / raw)
To: linux-arm-kernel
The following patch series addresses the problem, that the kexec code
does not disable the outer cache before disabling the inner cache and
jumping into the new kernel. This results in random crashes of the new
kernel.
Thanks,
tglx
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2010-08-06 6:16 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-05 11:52 [patch 0/2] ARM: Disable outer cache before kexec call -V3 Thomas Gleixner
2010-07-05 11:52 ` [patch 1/2] arm: Disable outer (L2) cache in kexec Thomas Gleixner
2010-07-05 12:11 ` Catalin Marinas
2010-07-05 11:52 ` [patch 2/2] arm: Implement l2x0 cache disable functions Thomas Gleixner
2010-07-05 12:13 ` Catalin Marinas
2010-08-03 12:44 ` Linus Walleij
2010-08-03 14:20 ` [patch 0/2] ARM: Disable outer cache before kexec call -V3 Andrea Paterniani
2010-08-03 17:36 ` Gadiyar, Anand
2010-08-04 6:46 ` Andrea Paterniani
2010-08-04 6:50 ` Shilimkar, Santosh
2010-08-04 7:00 ` Baruch Siach
2010-08-04 9:19 ` Andrea Paterniani
2010-08-06 6:16 ` Andrea Paterniani
-- strict thread matches above, loose matches on Subject: below --
2010-07-05 9:25 [patch 0/2] [patch 0/2] ARM: Disable outer cache before kexec call -V2 Thomas Gleixner
2010-07-05 9:25 ` [patch 1/2] arm: Disable outer (L2) cache in kexec Thomas Gleixner
2010-07-05 10:52 ` Catalin Marinas
2010-07-05 11:13 ` Thomas Gleixner
2010-07-05 11:16 ` Catalin Marinas
2010-07-01 16:05 [patch 0/2] ARM: Disable outer cache before kexec call Thomas Gleixner
2010-07-01 16:05 ` [patch 1/2] arm: Disable outer (L2) cache in kexec Thomas Gleixner
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).