Received: from eggs.gnu.org ([2001:4830:134:3::10]:51954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WB1XR-00040Z-DY for qemu-devel@nongnu.org; Wed, 05 Feb 2014 07:25:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WB1XM-0008J1-7F for qemu-devel@nongnu.org; Wed, 05 Feb 2014 07:25:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:14640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WB1XL-0008Ch-US for qemu-devel@nongnu.org; Wed, 05 Feb 2014 07:25:04 -0500 From: Markus Armbruster References: <1391589562-9010-1-git-send-email-armbru@redhat.com> <52F1FC8C.8090705@suse.de> Date: Wed, 05 Feb 2014 13:24:58 +0100 In-Reply-To: <52F1FC8C.8090705@suse.de> ("Andreas =?utf-8?Q?F=C3=A4rber=22?= =?utf-8?Q?'s?= message of "Wed, 05 Feb 2014 09:55:40 +0100") Message-ID: <871tzhd9wl.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] Revert "nand: Don't inherit from Sysbus" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?utf-8?Q?F=C3=A4rber?= Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, qemu-devel@nongnu.org, pbonzini@redhat.com Andreas F=C3=A4rber writes: > Am 05.02.2014 09:39, schrieb Markus Armbruster: >> This reverts commit 7426aa72c36c908a7d0eae3e38568bb0a70de479. >>=20 >> The commit goes into a sensible direction, but it violates qdev design >> assumptions. Symptom: "info qtree" crashes for all boards including >> the device (akita, borzoi, spitz, terrier, tosa, axis-dev88). >>=20 >> Peter Crosthwaite is working on a fix, but it's not trivial. Revert >> the flawed patch for now. >>=20 >> Signed-off-by: Markus Armbruster >> Acked-by: Peter Crosthwaite >> --- >> hw/block/nand.c | 7 +++---- >> 1 file changed, 3 insertions(+), 4 deletions(-) >>=20 >> diff --git a/hw/block/nand.c b/hw/block/nand.c >> index a871ce0..a0232d1 100644 >> --- a/hw/block/nand.c >> +++ b/hw/block/nand.c >> @@ -21,7 +21,7 @@ >> # include "hw/hw.h" >> # include "hw/block/flash.h" >> # include "sysemu/blockdev.h" >> -#include "hw/qdev.h" >> +# include "hw/sysbus.h" >> #include "qemu/error-report.h" >>=20=20 >> # define NAND_CMD_READ0 0x00 >> @@ -54,8 +54,7 @@ >>=20=20 >> typedef struct NANDFlashState NANDFlashState; >> struct NANDFlashState { >> - DeviceState parent_obj; >> - >> + SysBusDevice busdev; > > Negative on calling it busdev again, that surely has nothing to do with > a crash since it's not being used anywhere in this patch. I do not believe in messing with clean reverts such as this one. Any follow-up cleanup should be a separate patch. The easiest way to tell me what cleanup you want could be a patch :) > I still have not seen a single backtrace of what is going wrong, only > Paolo saying something about adding to main_system_bus in "the patch". > Clearly that is not in this patch! Where is that happening and why is > that so complicated for Peter C. to fix? My commit message should suffice to reproduce: start a qemu for any of the listed boards, run "info qtree". But I'm happy to spell it out: $ QEMU_AUDIO_DRV=3Dnone ~/work/qemu/bld/arm-softmmu/qemu-system-arm -M = akita -nodefaults -display none -monitor stdio -M akita -sd /dev/null -S QEMU 1.7.50 monitor - type 'help' for more information (qemu) info qtree bus: main-system-bus type System dev: scoop, id "" gpio-in 16 gpio-out 16 irq 0 mmio 0000000010800000/0000000000001000 dev: spitz-keyboard, id "" gpio-in 11 gpio-out 7 irq 0 dev: nand, id "" manufacturer_id =3D 236 chip_id =3D 241 drive =3D /work/armbru/qemu/hw/core/sysbus.c:209:sysbus_dev_print: Object 0x7f750= ab9d910 is not an instance of type sys-bus-device Aborted (core dumped) Backtrace: #0 0x00007fffee698c55 in raise () from /lib64/libc.so.6 #1 0x00007fffee69a408 in abort () from /lib64/libc.so.6 #2 0x00005555557bef59 in object_dynamic_cast_assert (obj=3D0x55555634d= 910,=20 typename=3Dtypename@entry=3D0x555555943e4d "sys-bus-device", file= =3Dfile@entry=3D 0x55555594a6f0 "/work/armbru/qemu/hw/core/sysbus.c", line=3Dline@en= try=3D209,=20 func=3Dfunc@entry=3D0x55555594a940 <__func__.23193> "sysbus_dev_pri= nt") at /work/armbru/qemu/qom/object.c:484 #3 0x00005555556b3c16 in sysbus_dev_print (mon=3D0x55555625fe00,=20 dev=3D, indent=3D4) at /work/armbru/qemu/hw/core/sys= bus.c:209 #4 0x00005555557a2e24 in bus_print_dev (indent=3D4, dev=3D0x55555634d9= 10, mon=3D 0x55555625fe00, bus=3D) at /work/armbru/qemu/qdev-monitor.c:599 #5 qdev_print (indent=3D4, dev=3D0x55555634d910, mon=3D0x55555625fe00) at /work/armbru/qemu/qdev-monitor.c:621 #6 qbus_print (mon=3D0x55555625fe00, bus=3D, indent=3D2) at /work/armbru/qemu/qdev-monitor.c:636 #7 0x00005555558a8e39 in handle_user_command (mon=3Dmon@entry=3D0x5555= 5625fe00,=20 cmdline=3D) at /work/armbru/qemu/monitor.c:4144 #8 0x00005555558a91cb in monitor_command_cb (opaque=3D0x55555625fe00,= =20 cmdline=3D, readline_opaque=3D) at /work/armbru/qemu/monitor.c:4761 #9 0x00005555559276b4 in readline_handle_byte (rs=3D0x555556273c90,=20 ch=3D) at /work/armbru/qemu/util/readline.c:371 ---Type to continue, or q to quit--- #10 0x00005555558a8f04 in monitor_read (opaque=3D,=20 buf=3D, size=3D) at /work/armbru/qemu/monitor.c:4744 #11 0x00005555557a6eba in qemu_chr_be_write (len=3D, buf= =3D 0x7fffffffcbd0 "\r", s=3D0x55555625e400) at /work/armbru/qemu/qemu-= char.c:165 #12 fd_chr_read (chan=3D, cond=3D, opaque= =3D 0x55555625e400) at /work/armbru/qemu/qemu-char.c:848 #13 0x00007ffff76f7a55 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0 #14 0x0000555555775001 in glib_pollfds_poll () at /work/armbru/qemu/main-loop.c:189 #15 os_host_main_loop_wait (timeout=3D) at /work/armbru/qemu/main-loop.c:234 #16 main_loop_wait (nonblocking=3D) at /work/armbru/qemu/main-loop.c:483 #17 0x0000555555601ed1 in main_loop () at /work/armbru/qemu/vl.c:2018 #18 main (argc=3D, argv=3D, envp=3D) at /work/armbru/qemu/vl.c:4410 As to why it's complicated for Peter to fix, here's what Peter wrote: "That series got very big on me with complications. I think near term we just proceed with the revert. Sorry for the delay." I have no reason to second-guess him. Promptly reverting patches that cause regressions when a fix isn't ready is standard operating procedure. We can delay a revert a reasonable amount of time to deliberate what to do, and perhaps find a fix. We did that, and then some: four weeks. We should revert, and try again. Neither harm nor shame in that. A cleanup of nand is quite welcome, but there's absolutely no rush. [...]