* hw/s390x: why watchdog device diag288 is resetted twice?
@ 2019-09-26 6:22 Philippe Mathieu-Daudé
2019-09-26 7:17 ` David Hildenbrand
0 siblings, 1 reply; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-26 6:22 UTC (permalink / raw)
To: QEMU Developers, Christian Borntraeger, David Hildenbrand, Xu Wang
Cc: Markus Armbruster
Hi,
hw/watchdog/wdt_diag288.c use 2 different resets:
1/ registered handler:
qemu_register_reset(diag288_reset, diag288);
2/ DeviceClass reset:
dc->reset = wdt_diag288_reset;
diag288_reset() simply calls wdt_diag288_reset():
static void wdt_diag288_reset(DeviceState *dev)
{
DIAG288State *diag288 = DIAG288(dev);
diag288->enabled = false;
timer_del(diag288->timer);
}
static void diag288_reset(void *opaque)
{
DeviceState *diag288 = opaque;
wdt_diag288_reset(diag288);
}
Why do we need this distinction?
Is this some special corner case?
Isn't this device connected to the QOM bus?
Thanks,
Phil.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: hw/s390x: why watchdog device diag288 is resetted twice?
2019-09-26 6:22 hw/s390x: why watchdog device diag288 is resetted twice? Philippe Mathieu-Daudé
@ 2019-09-26 7:17 ` David Hildenbrand
0 siblings, 0 replies; 2+ messages in thread
From: David Hildenbrand @ 2019-09-26 7:17 UTC (permalink / raw)
To: Philippe Mathieu-Daudé,
QEMU Developers, Christian Borntraeger, Xu Wang
Cc: Markus Armbruster
On 26.09.19 08:22, Philippe Mathieu-Daudé wrote:
> Hi,
>
> hw/watchdog/wdt_diag288.c use 2 different resets:
>
> 1/ registered handler:
>
> qemu_register_reset(diag288_reset, diag288);
>
> 2/ DeviceClass reset:
>
> dc->reset = wdt_diag288_reset;
>
> diag288_reset() simply calls wdt_diag288_reset():
>
> static void wdt_diag288_reset(DeviceState *dev)
> {
> DIAG288State *diag288 = DIAG288(dev);
>
> diag288->enabled = false;
> timer_del(diag288->timer);
> }
>
> static void diag288_reset(void *opaque)
> {
> DeviceState *diag288 = opaque;
>
> wdt_diag288_reset(diag288);
> }
>
> Why do we need this distinction?
> Is this some special corner case?
> Isn't this device connected to the QOM bus?
>
It's not a qdev device, so it won't get reset via the sysbus (I saw
patches changing that but I think they are not upstream yet).
The "dc->reset = wdt_diag288_reset;" is needed to make
hw/s390x/s390-virtio-ccw.c:subsystem_reset() work.
--
Thanks,
David / dhildenb
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-09-26 7:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-26 6:22 hw/s390x: why watchdog device diag288 is resetted twice? Philippe Mathieu-Daudé
2019-09-26 7:17 ` David Hildenbrand
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).