qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Christian Borntraeger" <borntraeger@de.ibm.com>,
	"Xu Wang" <gesaint@linux.vnet.ibm.com>
Cc: Markus Armbruster <armbru@redhat.com>
Subject: Re: hw/s390x: why watchdog device diag288 is resetted twice?
Date: Thu, 26 Sep 2019 09:17:35 +0200	[thread overview]
Message-ID: <ef3d6a2e-d102-ff01-4a3f-17c438065202@redhat.com> (raw)
In-Reply-To: <a52656b8-3b99-fb9e-f554-fbd988f62d87@redhat.com>

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


      reply	other threads:[~2019-09-26  7:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=ef3d6a2e-d102-ff01-4a3f-17c438065202@redhat.com \
    --to=david@redhat.com \
    --cc=armbru@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=gesaint@linux.vnet.ibm.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).