Received: from eggs.gnu.org ([2001:4830:134:3::10]:36369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCk4E-0004cn-IC for qemu-devel@nongnu.org; Wed, 08 Jul 2015 03:46:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCk4B-0007Q4-Aq for qemu-devel@nongnu.org; Wed, 08 Jul 2015 03:46:54 -0400 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:37519) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCk4B-0007Pm-1R for qemu-devel@nongnu.org; Wed, 08 Jul 2015 03:46:51 -0400 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 8 Jul 2015 08:46:46 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 386F8219006D for ; Wed, 8 Jul 2015 08:44:45 +0100 (BST) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t687j7jq22413512 for ; Wed, 8 Jul 2015 07:45:07 GMT Received: from d06av07.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t687j6YB008854 for ; Wed, 8 Jul 2015 03:45:07 -0400 Date: Wed, 8 Jul 2015 09:45:05 +0200 From: Cornelia Huck Message-ID: <20150708094505.11a3364b.cornelia.huck@de.ibm.com> In-Reply-To: References: <1436259202-20509-1-git-send-email-cornelia.huck@de.ibm.com> <1436259202-20509-2-git-send-email-cornelia.huck@de.ibm.com> <559BE08A.9010305@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.4] watchdog/diag288: correctly register for system reset requests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: Christian Borntraeger , jfrei@linux.vnet.ibm.com, "qemu-devel@nongnu.org Developers" , Alexander Graf , Xu Wang On Tue, 7 Jul 2015 14:11:18 -0700 Peter Crosthwaite wrote: > On Tue, Jul 7, 2015 at 7:22 AM, Christian Borntraeger > wrote: > > Am 07.07.2015 um 12:51 schrieb Peter Crosthwaite: > >>> 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? > > > > Hmm, to me it seems that qemu_devices_reset does only work for devices > > on a bus. This is a busless-device so the reset function gets not triggered. > > > > Yes I see. I think it is a core code bug though and we want to avoid > having to patch individual devs based on their system level > connectivity. I'm looking at qbus_realize, and there, there is code to > register a reset for orphaned busses. So we have precedent for lazily > setting up a reset for an orphaned bus at realize time, just not for > indiv. devs. We can do the same. > > I think this can be added to device_set_realized(). If a devices > parent is not a bus, then register its reset individually to catch-all > these. Solving this in the core sounds good, but do you already have some kind of patch ready? :) As we're pretty late in the cycle, it might make sense to merge the existing fix for diag288 first, and switch to a generic solution later on. > There are other devs that will qualify as well. I remember a > similar issue for NAND (hw/block/nand.c) where we lost it from the > qtree because we removed it from the sysbus. Looking at the code, I > fear NAND may be susceptible to this same missing-reset bug.