From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQEBH-0000BF-G4 for qemu-devel@nongnu.org; Fri, 14 Aug 2015 08:33:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZQEBE-0005C3-4m for qemu-devel@nongnu.org; Fri, 14 Aug 2015 08:33:55 -0400 References: <1439470382-17540-1-git-send-email-lvivier@redhat.com> From: Laurent Vivier Message-ID: <55CDE02B.6010409@redhat.com> Date: Fri, 14 Aug 2015 14:33:47 +0200 MIME-Version: 1.0 In-Reply-To: <1439470382-17540-1-git-send-email-lvivier@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH RFC] pseries: define coldplugged devices as "configured" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Michael Roth Cc: dgibson@redhat.com, Alexander Graf I'd like to know if it is the good way to fix the problem: are there more comments on this patch ? People from IBM ? Laurent On 13/08/2015 14:53, Laurent Vivier wrote: > When a device is hotplugged, attach() sets "configured" to > false, waiting an action from the OS to configure it and then > to call ibm,configure-connector. On ibm,configure-connector, > the hypervisor sets "configured" to true. > > In case of coldplugged device, attach() sets "configured" to > false, but firmware and OS never call the ibm,configure-connector > in this case, so it remains set to false. > > It could be harmless, but when we unplug a device, hypervisor > waits the device becomes configured because for it, a not configured > device is a device being configured, so it waits the end of configuration > to unplug it... and it never happens, so it is never unplugged. > > This patch set by default coldplugged device to "configured=true", > hotplugged device to "configured=false". > > Signed-off-by: Laurent Vivier > --- > hw/ppc/spapr_drc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c > index ee87432..e86babf 100644 > --- a/hw/ppc/spapr_drc.c > +++ b/hw/ppc/spapr_drc.c > @@ -310,7 +310,7 @@ static void attach(sPAPRDRConnector *drc, DeviceState *d, void *fdt, > drc->dev = d; > drc->fdt = fdt; > drc->fdt_start_offset = fdt_start_offset; > - drc->configured = false; > + drc->configured = coldplug; > > object_property_add_link(OBJECT(drc), "device", > object_get_typename(OBJECT(drc->dev)), >