All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Peter Crosthwaite <peter.crosthwaite@xilinx.com>,
	Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Xu Wang <gesaint@linux.vnet.ibm.com>,
	jfrei@linux.vnet.ibm.com,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH for-2.4] watchdog/diag288: correctly register for system reset requests
Date: Wed, 08 Jul 2015 10:01:28 +0200	[thread overview]
Message-ID: <559CD8D8.20604@de.ibm.com> (raw)
In-Reply-To: <559CD740.1020201@redhat.com>

Am 08.07.2015 um 09:54 schrieb Paolo Bonzini:
> 
> 
> On 07/07/2015 12:51, Peter Crosthwaite wrote:
>> On Tue, Jul 7, 2015 at 1:53 AM, Cornelia Huck <cornelia.huck@de.ibm.com> wrote:
>>> From: Xu Wang <gesaint@linux.vnet.ibm.com>
>>>
>>> The diag288 watchdog is no sysbus device, therefore it doesn't get
>>> triggered on resets automatically using dc->reset.
>>>
>>> Let's register the reset handler manually, so we get correctly notified
>>> again when a system reset was requested. Also reset the watchdog on
>>> subsystem resets that don't trigger a full system reset.
>>>
>>> Signed-off-by: Xu Wang <gesaint@linux.vnet.ibm.com>
>>> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
>>> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
>>> ---
>>>  hw/s390x/s390-virtio-ccw.c | 6 +++++-
>>>  hw/watchdog/wdt_diag288.c  | 8 ++++++++
>>>  2 files changed, 13 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
>>> index 3d20d6a..4c51d1a 100644
>>> --- a/hw/s390x/s390-virtio-ccw.c
>>> +++ b/hw/s390x/s390-virtio-ccw.c
>>> @@ -36,7 +36,7 @@ typedef struct S390CcwMachineState {
>>>
>>>  void io_subsystem_reset(void)
>>>  {
>>> -    DeviceState *css, *sclp, *flic;
>>> +    DeviceState *css, *sclp, *flic, *diag288;
>>>
>>>      css = DEVICE(object_resolve_path_type("", "virtual-css-bridge", NULL));
>>>      if (css) {
>>> @@ -51,6 +51,10 @@ void io_subsystem_reset(void)
>>>      if (flic) {
>>>          qdev_reset_all(flic);
>>>      }
>>> +    diag288 = DEVICE(object_resolve_path_type("", "diag288", NULL));
>>> +    if (diag288) {
>>> +        qdev_reset_all(diag288);
>>> +    }
>>>  }
>>>
>>>  static int virtio_ccw_hcall_notify(const uint64_t *args)
>>> diff --git a/hw/watchdog/wdt_diag288.c b/hw/watchdog/wdt_diag288.c
>>> index 1185e06..2a885a4 100644
>>> --- a/hw/watchdog/wdt_diag288.c
>>> +++ b/hw/watchdog/wdt_diag288.c
>>> @@ -40,6 +40,13 @@ static void wdt_diag288_reset(DeviceState *dev)
>>>      timer_del(diag288->timer);
>>>  }
>>>
>>> +static void diag288_reset(void *opaque)
>>> +{
>>> +    DeviceState *diag288 = opaque;
>>> +
>>> +    wdt_diag288_reset(diag288);
>>> +}
>>> +
>>>  static void diag288_timer_expired(void *dev)
>>>  {
>>>      qemu_log_mask(CPU_LOG_RESET, "Watchdog timer expired.\n");
>>> @@ -80,6 +87,7 @@ static void wdt_diag288_realize(DeviceState *dev, Error **errp)
>>>  {
>>>      DIAG288State *diag288 = DIAG288(dev);
>>>
>>> +    qemu_register_reset(diag288_reset, diag288);
>>
>> Doesn't seem right. Even if it is not a SBD it should still sit in the
>> QOM tree in a place where the reset is reached. Where is this device
>> in the QOM tree?
> 
> Reset doesn't follow the QOM tree.
> 
> In fact this is the main reason why I dislike TYPE_DEVICE as a superclass...

Oh, thats why we were asked to use that instead of sysbus device? ;-)

  reply	other threads:[~2015-07-08  8:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-07  8:53 [Qemu-devel] [PATCH for-2.4] s390x: diag288 reset fix Cornelia Huck
2015-07-07  8:53 ` [Qemu-devel] [PATCH for-2.4] watchdog/diag288: correctly register for system reset requests Cornelia Huck
2015-07-07 10:29   ` Christian Borntraeger
2015-07-07 10:51   ` Peter Crosthwaite
2015-07-07 14:22     ` Christian Borntraeger
2015-07-07 21:11       ` Peter Crosthwaite
2015-07-08  7:45         ` Cornelia Huck
2015-07-08 10:31           ` Cornelia Huck
2015-07-09 12:41             ` Cornelia Huck
2015-07-09 16:16               ` Peter Crosthwaite
2015-07-14 13:51                 ` Peter Maydell
2015-07-07 14:22     ` Cornelia Huck
2015-07-08  7:54     ` Paolo Bonzini
2015-07-08  8:01       ` Christian Borntraeger [this message]
2015-07-08  8:44         ` Paolo Bonzini
2015-07-08  8:48           ` Christian Borntraeger
2015-07-08  9:59             ` Paolo Bonzini
2015-07-14 13:33   ` Andreas Färber

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=559CD8D8.20604@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=agraf@suse.de \
    --cc=cornelia.huck@de.ibm.com \
    --cc=gesaint@linux.vnet.ibm.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.crosthwaite@xilinx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.