linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Milton Miller <miltonm@bga.com>
To: Geoff Levand <geoffrey.levand@am.sony.com>
Cc: linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH 8/9] ps3: cleanup ps3fb before clearing HPTE
Date: Sun, 25 Mar 2007 12:43:26 -0500	[thread overview]
Message-ID: <e1f83c095fc09e65524d4a8800c36120@bga.com> (raw)
In-Reply-To: <4605B861.9060006@am.sony.com>


Paul, after reading this note I send a big fat

NACK

to this patch.

On Mar 24, 2007, at 6:46 PM, Geoff Levand wrote:

> Christoph Hellwig wrote:
>>>>  static void ps3_hpte_clear(void)
>>>  {
>>> +
>>> +#ifdef CONFIG_FB_PS3
>>> +    ps3fb_cleanup();
>>> +#endif
>>
>> And well, adding framebuffer calls into the mmu code is rather fucked.
>> This at least needs a big comment explaning the hypervisor braindamage
>> that is responsible for this in colourfull language.
>
> Sorry for such a late reply, but I'm now doing the kexec code and see
> why it was put here (by the original author).  It is so you will have
> debugging output until the very last possible moment during a kexec
> shutdown.

But that is REALLY to late for that.

> The real problem is really that this routine (and the corresponding 
> ppc_md
> variable) are inappropriately named.

Ok, this should be
ppc_md.kexec_cleanup_nothing_but_static_data_bss_real_mode_cleanup()


> In the general case all that is left
> to do is to call ppc_md.hpte_clear_all, but for ps3 we also want to do 
> the
> framebuffer shutdown here, so something like this should be better:
>
> -static void ps3_hpte_clear(void)
> +static void ps3_kexec_final(void)
>
> -       ppc_md.hpte_clear_all = ps3_hpte_clear;
> +       ppc_md.hpte_clear_all = ps3_kexec_final;
>

NACK.

Because at this point, we have already done the copy of the new kernel
to its kexec-specified location, and we are in real mode.   There is
no way ps3fb_cleanup should be running that late.

The only thing ppc_md.htpe_clear_all is allowed to touch is data built
into vmlinux (that is, static data and bss, not even per-cpu data).

Actually, it can touch tce tables, the hash table, and rtas, but only if
they are below the real mode limit.   That's because those regions are 
also
protected from overwrite by default_machine_kexec_prepare().   You 
could use
that hook to protect your fb allocation, but then you need to (1) export
the range to the device tree for kexec user space and (2) change 
kexec-tools
to look for this region.


You could use machine_kexec and machine_crash_kexec, but I would just 
use
the kexec_cpu_down (its called with primary=1 last).

There shouldn't be any debugging after cpu_down anways.  The only things
left are switch stacks, copy kernel, and call htpe_clear.

Oh, I just looked at your ps3 kexec hooks.  Your ps3_kexec_cpu_down 
looks
totally broken.  kexec_cpu_down(crash, secondary) is called on each
cpu, so there should be no for_each_cpu loops there.  Also, the primary
cpu is likely not cpu 0, although it will be called last, after the
other cpus are offline spinning.

If your platform requires you to be on a given cpu you should
set_tasks_allowed() in your machine_kexec_*shutdown, but that will have
an negative effect on crash reliability.

  reply	other threads:[~2007-03-25 17:43 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-25 17:46 [PATCH 0/9] ps3av/fb drivers for 2.6.21 Geert Uytterhoeven
2007-01-25 17:48 ` [PATCH 1/9] ps3: AV Settings Driver Geert Uytterhoeven
2007-01-26  3:12   ` Christoph Hellwig
2007-01-29 14:10     ` Geert Uytterhoeven
2007-01-29 16:15       ` Christoph Hellwig
2007-01-29 19:24         ` Geoff Levand
2007-01-30 18:39         ` Segher Boessenkool
2007-01-30 19:39           ` Geert Uytterhoeven
2007-01-31  8:45           ` Christoph Hellwig
2007-01-26  4:13   ` Arnd Bergmann
2007-01-26 14:56     ` Geert Uytterhoeven
2007-01-28 21:37       ` Benjamin Herrenschmidt
2007-01-29 15:14     ` Geert Uytterhoeven
2007-01-30  0:16       ` Arnd Bergmann
2007-01-25 17:48 ` [PATCH 2/9] fbdev modedb: allow refresh rates for named video modes Geert Uytterhoeven
2007-01-25 17:49 ` [PATCH 3/9] fbdev modedb: make more pointer parameters const Geert Uytterhoeven
2007-01-25 17:49 ` [PATCH 4/9] fb_videomode_to_var: reset virtual screen parameters Geert Uytterhoeven
2007-01-25 17:50 ` [PATCH 5/9] ps3: Preallocate bootmem memory for ps3fb Geert Uytterhoeven
2007-01-30  2:29   ` Michael Ellerman
2007-01-30  8:16     ` Geert Uytterhoeven
2007-01-30  8:27       ` Arnd Bergmann
2007-01-30  8:36         ` Geert Uytterhoeven
2007-01-30  9:08           ` Benjamin Herrenschmidt
2007-01-30 10:44             ` Arnd Bergmann
2007-01-30 22:37       ` Michael Ellerman
2007-01-25 17:50 ` [PATCH 6/9] ps3: Virtual Frame Buffer Driver Geert Uytterhoeven
2007-01-25 21:36   ` [Linux-fbdev-devel] " Bernhard Fischer
2007-01-25 17:51 ` [PATCH 7/9] ps3: disable display flipping during mode changes Geert Uytterhoeven
2007-01-26  2:13   ` Arnd Bergmann
2007-01-25 17:51 ` [PATCH 8/9] ps3: cleanup ps3fb before clearing HPTE Geert Uytterhoeven
2007-01-26  3:14   ` Christoph Hellwig
2007-01-30  2:23     ` Michael Ellerman
2007-03-24 23:46     ` Geoff Levand
2007-03-25 17:43       ` Milton Miller [this message]
2007-03-27  1:06         ` Geoff Levand
2007-03-27 17:35       ` Christoph Hellwig
2007-01-25 17:52 ` [PATCH 9/9] ps3: ps3av/fb defconfig updates Geert Uytterhoeven
2007-01-25 17:55 ` [PATCH 0/9] ps3av/fb drivers for 2.6.21 Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e1f83c095fc09e65524d4a8800c36120@bga.com \
    --to=miltonm@bga.com \
    --cc=geoffrey.levand@am.sony.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).