* [PATCH] ppc/pnv: I2C controller is not user creatable
@ 2024-03-18 15:44 Cédric Le Goater
2024-03-18 15:53 ` Thomas Huth
2024-03-18 15:54 ` Cédric Le Goater
0 siblings, 2 replies; 4+ messages in thread
From: Cédric Le Goater @ 2024-03-18 15:44 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-ppc, Nicholas Piggin, Cédric Le Goater, Glenn Miles,
Thomas Huth
The I2C controller is a subunit of the processor. Make it so and avoid
QEMU crashes.
$ build/qemu-system-ppc64 -S -machine powernv9 -device pnv-i2c
qemu-system-ppc64: ../hw/ppc/pnv_i2c.c:521: pnv_i2c_realize: Assertion `i2c->chip' failed.
Aborted (core dumped)
Cc: Glenn Miles <milesg@linux.vnet.ibm.com>
Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
hw/ppc/pnv_i2c.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/ppc/pnv_i2c.c b/hw/ppc/pnv_i2c.c
index 4581cc5e5d4645ab3e358d983a633e33a214c425..37d7b3d68a98d88f201b9a297dbb18678ffdcec2 100644
--- a/hw/ppc/pnv_i2c.c
+++ b/hw/ppc/pnv_i2c.c
@@ -559,6 +559,7 @@ static void pnv_i2c_class_init(ObjectClass *klass, void *data)
dc->desc = "PowerNV I2C";
dc->realize = pnv_i2c_realize;
+ dc->user_creatable = false;
device_class_set_props(dc, pnv_i2c_properties);
}
--
2.44.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ppc/pnv: I2C controller is not user creatable
2024-03-18 15:44 [PATCH] ppc/pnv: I2C controller is not user creatable Cédric Le Goater
@ 2024-03-18 15:53 ` Thomas Huth
2024-03-18 15:54 ` Cédric Le Goater
2024-03-18 15:54 ` Cédric Le Goater
1 sibling, 1 reply; 4+ messages in thread
From: Thomas Huth @ 2024-03-18 15:53 UTC (permalink / raw)
To: Cédric Le Goater, qemu-devel; +Cc: qemu-ppc, Nicholas Piggin, Glenn Miles
On 18/03/2024 16.44, Cédric Le Goater wrote:
> The I2C controller is a subunit of the processor. Make it so and avoid
> QEMU crashes.
>
> $ build/qemu-system-ppc64 -S -machine powernv9 -device pnv-i2c
> qemu-system-ppc64: ../hw/ppc/pnv_i2c.c:521: pnv_i2c_realize: Assertion `i2c->chip' failed.
> Aborted (core dumped)
>
> Cc: Glenn Miles <milesg@linux.vnet.ibm.com>
> Reported-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Cédric Le Goater <clg@redhat.com>
> ---
> hw/ppc/pnv_i2c.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/ppc/pnv_i2c.c b/hw/ppc/pnv_i2c.c
> index 4581cc5e5d4645ab3e358d983a633e33a214c425..37d7b3d68a98d88f201b9a297dbb18678ffdcec2 100644
> --- a/hw/ppc/pnv_i2c.c
> +++ b/hw/ppc/pnv_i2c.c
> @@ -559,6 +559,7 @@ static void pnv_i2c_class_init(ObjectClass *klass, void *data)
>
> dc->desc = "PowerNV I2C";
> dc->realize = pnv_i2c_realize;
> + dc->user_creatable = false;
Maybe add a comment in front of it (which is good style for setting
user_creatable = false):
/* This device is part of the CPU and cannot be used separately */
or so.
Anyway:
Reviewed-by: Thomas Huth <thuth@redhat.com>
> device_class_set_props(dc, pnv_i2c_properties);
> }
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ppc/pnv: I2C controller is not user creatable
2024-03-18 15:53 ` Thomas Huth
@ 2024-03-18 15:54 ` Cédric Le Goater
0 siblings, 0 replies; 4+ messages in thread
From: Cédric Le Goater @ 2024-03-18 15:54 UTC (permalink / raw)
To: Thomas Huth, qemu-devel; +Cc: qemu-ppc, Nicholas Piggin, Glenn Miles
On 3/18/24 16:53, Thomas Huth wrote:
> On 18/03/2024 16.44, Cédric Le Goater wrote:
>> The I2C controller is a subunit of the processor. Make it so and avoid
>> QEMU crashes.
>>
>> $ build/qemu-system-ppc64 -S -machine powernv9 -device pnv-i2c
>> qemu-system-ppc64: ../hw/ppc/pnv_i2c.c:521: pnv_i2c_realize: Assertion `i2c->chip' failed.
>> Aborted (core dumped)
>>
>> Cc: Glenn Miles <milesg@linux.vnet.ibm.com>
>> Reported-by: Thomas Huth <thuth@redhat.com>
>> Signed-off-by: Cédric Le Goater <clg@redhat.com>
>> ---
>> hw/ppc/pnv_i2c.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/hw/ppc/pnv_i2c.c b/hw/ppc/pnv_i2c.c
>> index 4581cc5e5d4645ab3e358d983a633e33a214c425..37d7b3d68a98d88f201b9a297dbb18678ffdcec2 100644
>> --- a/hw/ppc/pnv_i2c.c
>> +++ b/hw/ppc/pnv_i2c.c
>> @@ -559,6 +559,7 @@ static void pnv_i2c_class_init(ObjectClass *klass, void *data)
>> dc->desc = "PowerNV I2C";
>> dc->realize = pnv_i2c_realize;
>> + dc->user_creatable = false;
>
> Maybe add a comment in front of it (which is good style for setting user_creatable = false):
>
> /* This device is part of the CPU and cannot be used separately */
>
> or so.
ok. will resend.
Thanks,
C.
>
> Anyway:
> Reviewed-by: Thomas Huth <thuth@redhat.com>
>
>> device_class_set_props(dc, pnv_i2c_properties);
>> }
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ppc/pnv: I2C controller is not user creatable
2024-03-18 15:44 [PATCH] ppc/pnv: I2C controller is not user creatable Cédric Le Goater
2024-03-18 15:53 ` Thomas Huth
@ 2024-03-18 15:54 ` Cédric Le Goater
1 sibling, 0 replies; 4+ messages in thread
From: Cédric Le Goater @ 2024-03-18 15:54 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-ppc, Nicholas Piggin, Glenn Miles, Thomas Huth
On 3/18/24 16:44, Cédric Le Goater wrote:
> The I2C controller is a subunit of the processor. Make it so and avoid
> QEMU crashes.
>
> $ build/qemu-system-ppc64 -S -machine powernv9 -device pnv-i2c
> qemu-system-ppc64: ../hw/ppc/pnv_i2c.c:521: pnv_i2c_realize: Assertion `i2c->chip' failed.
> Aborted (core dumped)
and
Fixes: 263b81ee15af ("ppc/pnv: Add an I2C controller model")
Sorry for the noise,
C.
> Cc: Glenn Miles <milesg@linux.vnet.ibm.com>
> Reported-by: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Cédric Le Goater <clg@redhat.com>
> ---
> hw/ppc/pnv_i2c.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/ppc/pnv_i2c.c b/hw/ppc/pnv_i2c.c
> index 4581cc5e5d4645ab3e358d983a633e33a214c425..37d7b3d68a98d88f201b9a297dbb18678ffdcec2 100644
> --- a/hw/ppc/pnv_i2c.c
> +++ b/hw/ppc/pnv_i2c.c
> @@ -559,6 +559,7 @@ static void pnv_i2c_class_init(ObjectClass *klass, void *data)
>
> dc->desc = "PowerNV I2C";
> dc->realize = pnv_i2c_realize;
> + dc->user_creatable = false;
> device_class_set_props(dc, pnv_i2c_properties);
> }
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-03-18 15:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-18 15:44 [PATCH] ppc/pnv: I2C controller is not user creatable Cédric Le Goater
2024-03-18 15:53 ` Thomas Huth
2024-03-18 15:54 ` Cédric Le Goater
2024-03-18 15:54 ` Cédric Le Goater
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).