Official Gitbrew Forums
These forums cover all aspects of the Gitbrew biosphere. If you would like your development project to be based here, ask an admin.

Home » PS3 » OtherOS++ » Linux » Linux Kernelp 3.2.2 and kexec problems
Linux Kernelp 3.2.2 and kexec problems [message #375] Sat, 28 January 2012 17:56 Go to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Trying to figure out why kexec hangs. Probably USB problems.

[Updated on: Sat, 28 January 2012 17:58]

Report message to a moderator

Re: Linux Kernelp 3.2.2 and kexec problems [message #453 is a reply to message #375] Mon, 30 January 2012 19:45 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
System Manager service Ring Buzzer is really helpful with debugging kernel problems.
It can be used very early during Linux kernel boot, e.g. when gelic udbg is not available.
It worked even in arch/powerpc/kernel/setup_64.c:early_setup or
arch/powerpc/kernel/misc_64.S:kexec_sequence.

#include <asm/ps3.h>
#include <asm/lv1call.h>

void sysmgr_beep(void)
{
        unsigned char data[] = {
                /* header */
                0x01,                   /* version */
                0x10,                   /* header length */
                0x00, 0x00,
                0x00, 0x00, 0x00, 0x08, /* payload length */
                0x00, 0x15,             /* sid */
                0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, /* tag */
                /* payload */
                0x01,                   /* version */
                0x29,                   /* arg1 */
                0x0a,                   /* arg2 */
                0x00,
                0x00, 0x00, 0x01, 0xb6  /* arg3 */
        };
        u64 written;
        int i;

        //lv1_write_virtual_uart(2, ps3_mm_phys_to_lpar(__pa(data)), sizeof(data), &written);
        lv1_write_virtual_uart(2, __pa(data), sizeof(data), &written);

        for (i = 0; i < 10000; i++)
                __asm__ __volatile__ ("nop");
}

[Updated on: Mon, 30 January 2012 19:54]

Report message to a moderator

Re: Linux Kernelp 3.2.2 and kexec problems [message #454 is a reply to message #453] Mon, 30 January 2012 20:02 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Wow, cool, ring buzzer even worked after

bl      .kexec_copy_flush


in arch/powerpc/kernel/misc_64.S
Re: Linux Kernelp 3.2.2 and kexec problems [message #455 is a reply to message #454] Mon, 30 January 2012 20:08 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Holy cow, it even worked after

bl      real_mode


in arch/powerpc/kernel/misc_64.S.

That means it works in real mode too. And that kexec worked until this point Smile
Re: Linux Kernelp 3.2.2 and kexec problems [message #456 is a reply to message #455] Mon, 30 January 2012 20:12 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Holy crap, it worked even after

stw     r6,kexec_flag-1b(5)


in arch/powerpc/kernel/misc_64.S.

Looking further.
Re: Linux Kernelp 3.2.2 and kexec problems [message #457 is a reply to message #456] Mon, 30 January 2012 20:17 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Ok, traced kexec till the end. It works until the point where it jumps to new kernel image. Good.
Re: Linux Kernelp 3.2.2 and kexec problems [message #458 is a reply to message #457] Mon, 30 January 2012 20:24 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Wow, cool, kexec even works till the point where it jumps to the new kernel without unloading USB drivers Smile That's great.
So, the problem is somewhere in startup process.

[Updated on: Mon, 30 January 2012 20:25]

Report message to a moderator

Re: Linux Kernelp 3.2.2 and kexec problems [message #459 is a reply to message #458] Mon, 30 January 2012 20:32 Go to previous messageGo to next message
x_redentor is currently offline  x_redentor
Messages: 138
Registered: January 2012
Location: españa
Gitbrew Assistant
jajaja , you're a machine, you're good dude
Re: Linux Kernelp 3.2.2 and kexec problems [message #464 is a reply to message #459] Tue, 31 January 2012 18:41 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
kexec segments with new image:

root@ps3-linux:/# kexec -l /var/petitboot/mnt/sda1/openwrt-ps3-petitboot-vmlinux
.elf
Warning: append= option is not passed. Using the first kernel root partition
Modified cmdline:
Unable to find /proc/device-tree//chosen/linux,stdout-path, printing from purgatory is diabled
segment[0].mem:0x83b000 memsz:8626176
segment[1].mem:0x1075000 memsz:36864
segment[2].mem:0x7fff000 memsz:4096
Re: Linux Kernelp 3.2.2 and kexec problems [message #465 is a reply to message #464] Tue, 31 January 2012 18:42 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Yes, it works, finally !!! kexec works with new image. I can kexec the new image on the new image. Cool.
Kexec works great with Linux kernel 3.2.2.
Re: Linux Kernelp 3.2.2 and kexec problems [message #466 is a reply to message #465] Tue, 31 January 2012 18:43 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Even better, kexec works on Linux kernel 3.2.2 without unloading USB drivers. Great Smile

[Updated on: Tue, 31 January 2012 18:43]

Report message to a moderator

Re: Linux Kernelp 3.2.2 and kexec problems [message #467 is a reply to message #466] Tue, 31 January 2012 18:55 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
 === IMPORTANT ============================
  Use 'passwd' to set your login password
  this will disable telnet and enable SSH
 ------------------------------------------


BusyBox v1.19.3 (2012-01-31 17:28:21 CET) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _____  _____  _____
 |  _  ||  ___||___  |
 |   __||___  ||___  |
 |__|   |_____||_____|
            L I N U X

root@ps3-linux:/# uname -a
Linux ps3-linux 3.2.2 #1 SMP Tue Jan 31 17:35:06 CET 2012 ppc64 GNU/Linux
root@ps3-linux:/# iwconfig wlan0
wlan0     IEEE 802.11bg  Mode:Managed  Channel:0
          Access Point: Not-Associated
          Encryption key:off

root@ps3-linux:/#

[Updated on: Tue, 31 January 2012 18:55]

Report message to a moderator

Re: Linux Kernelp 3.2.2 and kexec problems [message #468 is a reply to message #467] Tue, 31 January 2012 18:56 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
 Petitboot PS3
 ──────────────────────────────────────────────────────────────────────────────
  main: /var/petitboot/mnt/ps3dd2/boot/vmlinux-3.2.2 root=/dev/ps3dd2
  test: /var/petitboot/mnt/ps3dd2/boot/vmlinux-3.2.2-test root=/dev/ps3dd2
  freebsd: /var/petitboot/mnt/ps3dd2/boot/loader.ps3
  netboot: tftp://192.168.1.1 root=/dev/nfs ip=any nfsroot=:
  Boot GameOS
  Set Video Mode
 *Exit to Shell












 ──────────────────────────────────────────────────────────────────────────────
 ESC=exit, Enter=accept, e=edit, o=open
 Welcome to Petitboot
Re: Linux Kernelp 3.2.2 and kexec problems [message #469 is a reply to message #468] Tue, 31 January 2012 19:06 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Image for testing: http://gitbrew.org/~glevand/ps3/linux/openwrt/openwrt-ps3-pe titboot-vmlinux.elf
Re: Linux Kernelp 3.2.2 and kexec problems [message #470 is a reply to message #469] Tue, 31 January 2012 19:27 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Just flashed my new petitboot to PS3 FLASH with ps3-flash-util. It works Smile

http://gitbrew.org/~glevand/ps3/linux/openwrt/dtbImage.ps3.b in

[Updated on: Tue, 31 January 2012 19:27]

Report message to a moderator

Re: Linux Kernelp 3.2.2 and kexec problems [message #514 is a reply to message #470] Thu, 02 February 2012 20:42 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
It seems that kexec still has problems with USB drivers. At least with my keyboard USB driver.
Although booting linux with telnet works fine with detached keyboard. Have to investigate it.

I guess i have to use "ring buzzer" again Smile

[Updated on: Thu, 02 February 2012 20:43]

Report message to a moderator

Re: Linux Kernelp 3.2.2 and kexec problems [message #540 is a reply to message #514] Fri, 03 February 2012 21:10 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
And again i'm hunting kexec bugs.

When i attach my USB keyboard then kexec hanged in

kernel/kexec.c:kexec_load
   kernel_restart_prepare
      device_shutdown


When i kexec a new kernel from telnet without attaching my USB keyboard but with an attached USB drive then it works fine. Very odd.

[Updated on: Fri, 03 February 2012 21:11]

Report message to a moderator

Re: Linux Kernelp 3.2.2 and kexec problems [message #541 is a reply to message #540] Fri, 03 February 2012 21:29 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
It seems that the problem is OHCI or HID driver.

[Updated on: Fri, 03 February 2012 21:30]

Report message to a moderator

Re: Linux Kernelp 3.2.2 and kexec problems [message #543 is a reply to message #541] Fri, 03 February 2012 23:35 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
It hangs somewhere in drivers/base/core.c:device_shutdown

I have a strong suspicion that it hangs in some spinlock.
Re: Linux Kernelp 3.2.2 and kexec problems [message #544 is a reply to message #543] Fri, 03 February 2012 23:57 Go to previous messageGo to next message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
The loop in device_shutdown never terminates. Great.


http://lxr.free-electrons.com/ident?a=powerpc;i=device_shutd own

[Updated on: Sat, 04 February 2012 10:58]

Report message to a moderator

Re: Linux Kernelp 3.2.2 and kexec problems [message #545 is a reply to message #544] Sat, 04 February 2012 00:04 Go to previous message
glevand is currently offline  glevand
Messages: 955
Registered: July 2011
Location: SONY
Gitbrew God
Interesting conversation about device_shutdown hangs here:

http://kerneltrap.org/mailarchive/linux-scsi/2010/3/3/681952 3
Previous Topic: Keymap on OpenWRT
Next Topic: Linux kernel 3.2.2 and PHAT WLAN
Goto Forum:
  


Current Time: Thu Jun 20 10:45:09 CEST 2013

Total time taken to generate the page: 0.02405 seconds