[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Revert "nand: Don't inherit from Sysbus"
From: |
Peter Crosthwaite |
Subject: |
Re: [Qemu-devel] [PATCH] Revert "nand: Don't inherit from Sysbus" |
Date: |
Thu, 6 Feb 2014 09:06:42 +1000 |
On Wed, Feb 5, 2014 at 6:55 PM, Andreas Färber <address@hidden> wrote:
> Am 05.02.2014 09:39, schrieb Markus Armbruster:
>> This reverts commit 7426aa72c36c908a7d0eae3e38568bb0a70de479.
>>
>> 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).
>>
>> Peter Crosthwaite is working on a fix, but it's not trivial. Revert
>> the flawed patch for now.
>>
>> Signed-off-by: Markus Armbruster <address@hidden>
>> Acked-by: Peter Crosthwaite <address@hidden>
>> ---
>> hw/block/nand.c | 7 +++----
>> 1 file changed, 3 insertions(+), 4 deletions(-)
>>
>> 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"
>>
>> # define NAND_CMD_READ0 0x00
>> @@ -54,8 +54,7 @@
>>
>> 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 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?
>
Im not going after the info-qtree side fix. I was looking at the
proper busification of NAND. There are possible core fixes to restore
the info-qtree behaviour without this revert, but even if you do, the
information presented by info qtree is bogus, because nand devices to
not attach to root system buses.
Regards,
Peter
> Andreas
>
>> uint8_t manf_id, chip_id;
>> uint8_t buswidth; /* in BYTES */
>> int size, pages;
>> @@ -441,7 +440,7 @@ static void nand_class_init(ObjectClass *klass, void
>> *data)
>>
>> static const TypeInfo nand_info = {
>> .name = TYPE_NAND,
>> - .parent = TYPE_DEVICE,
>> + .parent = TYPE_SYS_BUS_DEVICE,
>> .instance_size = sizeof(NANDFlashState),
>> .class_init = nand_class_init,
>> };
>
> --
> SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
> GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
>