qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bernhard Beschow <shentey@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Thomas Huth" <thuth@redhat.com>,
	qemu-arm@nongnu.org
Subject: Re: [PATCH v2 1/2] hw/arm/fsl-imx8mp: Derive struct FslImx8mpState from TYPE_SYS_BUS_DEVICE
Date: Wed, 19 Mar 2025 16:51:38 +0000	[thread overview]
Message-ID: <10C0F394-2118-4AA6-A815-44B636B5DCEB@gmail.com> (raw)
In-Reply-To: <CAFEAcA-jbRt7x7w-gA5KEBRK8_kHgHRcX4ri+vn-umz2wAsGxA@mail.gmail.com>



Am 18. März 2025 15:29:17 UTC schrieb Peter Maydell <peter.maydell@linaro.org>:
>On Tue, 18 Mar 2025 at 15:27, Peter Maydell <peter.maydell@linaro.org> wrote:
>>
>> On Fri, 14 Mar 2025 at 18:32, Bernhard Beschow <shentey@gmail.com> wrote:
>> >
>> > Deriving from TYPE_SYS_BUS_DEVICE fixes the SoC object to be reset upon machine
>> > reset. It also makes the SoC implementation not user-creatable which can trigger
>> > the following crash:
>> >
>> >   $ ./qemu-system-aarch64  -M virt -device fsl-imx8mp
>> >   **
>> >   ERROR:../../devel/qemu/tcg/tcg.c:1006:tcg_register_thread: assertion failed:
>> >   (n < tcg_max_ctxs)
>> >   Bail out! ERROR:../../devel/qemu/tcg/tcg.c:1006:tcg_register_thread:
>> >   assertion failed: (n < tcg_max_ctxs)
>> >   Aborted (core dumped)
>>
>> > diff --git a/hw/arm/fsl-imx8mp.c b/hw/arm/fsl-imx8mp.c
>> > index c3f6da6322..82edf61082 100644
>> > --- a/hw/arm/fsl-imx8mp.c
>> > +++ b/hw/arm/fsl-imx8mp.c
>> > @@ -702,7 +702,7 @@ static void fsl_imx8mp_class_init(ObjectClass *oc, void *data)
>> >  static const TypeInfo fsl_imx8mp_types[] = {
>> >      {
>> >          .name = TYPE_FSL_IMX8MP,
>> > -        .parent = TYPE_DEVICE,
>> > +        .parent = TYPE_SYS_BUS_DEVICE,
>> >          .instance_size = sizeof(FslImx8mpState),
>> >          .instance_init = fsl_imx8mp_init,
>> >          .class_init = fsl_imx8mp_class_init,
>> > diff --git a/hw/arm/imx8mp-evk.c b/hw/arm/imx8mp-evk.c
>> > index e1a7892fd7..f17d5db466 100644
>> > --- a/hw/arm/imx8mp-evk.c
>> > +++ b/hw/arm/imx8mp-evk.c
>> > @@ -37,7 +37,7 @@ static void imx8mp_evk_init(MachineState *machine)
>> >      s = FSL_IMX8MP(object_new(TYPE_FSL_IMX8MP));
>> >      object_property_add_child(OBJECT(machine), "soc", OBJECT(s));
>> >      object_property_set_uint(OBJECT(s), "fec1-phy-num", 1, &error_fatal);
>> > -    qdev_realize(DEVICE(s), NULL, &error_fatal);
>> > +    sysbus_realize_and_unref(SYS_BUS_DEVICE(s), &error_fatal);
>>
>> You want sysbus_realize() here, not the _and_unref() variant,
>> because the device was created with object_initialize_child().
>
>No, that's wrong, we create it with object_new(). So
>the _and_unref() *is* correct, but this is a separate bug fix
>from the "should be sysbus, not qdev" bug this patch says
>it is fixing. Can it be in a separate patch, please?

Sure, fixed in v3.

Best regards,
Bernhard

>
>thanks
>-- PMM


  reply	other threads:[~2025-03-19 16:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-14 18:32 [PATCH v2 0/2] i.MX 8M Plus EVK Fixes Bernhard Beschow
2025-03-14 18:32 ` [PATCH v2 1/2] hw/arm/fsl-imx8mp: Derive struct FslImx8mpState from TYPE_SYS_BUS_DEVICE Bernhard Beschow
2025-03-18 15:27   ` Peter Maydell
2025-03-18 15:29     ` Peter Maydell
2025-03-19 16:51       ` Bernhard Beschow [this message]
2025-03-14 18:32 ` [PATCH v2 2/2] hw/arm/fsl-imx8mp: Remove unused define Bernhard Beschow
2025-03-18 15:17   ` Peter Maydell

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=10C0F394-2118-4AA6-A815-44B636B5DCEB@gmail.com \
    --to=shentey@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /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).