From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZ7dg-0001hb-7x for qemu-devel@nongnu.org; Mon, 07 Sep 2015 21:24:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZ7df-0001pD-Ay for qemu-devel@nongnu.org; Mon, 07 Sep 2015 21:24:00 -0400 Date: Tue, 8 Sep 2015 11:22:50 +1000 From: David Gibson Message-ID: <20150908012250.GG6537@voom.redhat.com> References: <1441606024-1238-1-git-send-email-bharata@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wZwWzkkm73dI25u3" Content-Disposition: inline In-Reply-To: <1441606024-1238-1-git-send-email-bharata@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [FIX PATCH] spapr_drc: Return correct state for logical DR in entity_sense() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bharata B Rao Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Michael Roth --wZwWzkkm73dI25u3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 07, 2015 at 11:37:04AM +0530, Bharata B Rao wrote: > When drmgr is run in the guest to add a device for which device_add > hasn't been issued in QEMU, configure-connector call fails. > When configure-connector call fails, the guest would release (*) > the previously acquired DRC by setting back the DRC isolation state > to ISOLATED and allocation state to UNUSABLE. These calls will be issued > only if get-sensor-state call returns PRESENT state. However currently for > a logical DR, entity_sense() would unconditinally return UNUSABLE > state only. This prevents any subsequent hotplug of the device with > that DRC. >=20 > Fix this by returning the right state in entity_sense() by checking > the allocation_state of DRC. >=20 > (*) https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-September/133430= =2Ehtml >=20 > Signed-off-by: Bharata B Rao > Cc: Michael Roth Reviewed-by: David Gibson and applied to my tree. > --- > hw/ppc/spapr_drc.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) >=20 > diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c > index 9ce844a..2586065 100644 > --- a/hw/ppc/spapr_drc.c > +++ b/hw/ppc/spapr_drc.c > @@ -186,7 +186,11 @@ static sPAPRDREntitySense entity_sense(sPAPRDRConnec= tor *drc) > */ > state =3D SPAPR_DR_ENTITY_SENSE_EMPTY; > } else { > - state =3D SPAPR_DR_ENTITY_SENSE_UNUSABLE; > + if (drc->allocation_state =3D=3D SPAPR_DR_ALLOCATION_STATE_U= NUSABLE) { > + state =3D SPAPR_DR_ENTITY_SENSE_UNUSABLE; > + } else { > + state =3D SPAPR_DR_ENTITY_SENSE_PRESENT; > + } > } > } > =20 --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --wZwWzkkm73dI25u3 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJV7jhqAAoJEGw4ysog2bOSKIAP/3BhFAGLyhyXu7BX5tQg5DiD tH/QZTShwcPSaYb25U2gOGqwMWAVy2mwxUyUyh1nwd0aDs4im6yxO+75SEtKtEIU FYX65/q++NV3fd8tQkQfZGITx6bNr26PXrplhc4oAr4Uh25e1m2RyKdhlovYN6mu OIpjioaYRmnKF2XXZEzeqXJvcBZhaNdOWcs8a3Hfoi0D9Yr9JiTIDjfGJcc7/03q DXZPG9LFmdzK/iVaPsU5+/8bgYGhOA1wkMRJko5RlWSBRsg5K93Y2DhI5M4vScL+ 9jpgSwQHezuyEYN0d2xAqgdC8981YyrzKJz/scWys5yUoYuu77+GLEmLvZF1StBn /7oFGR4SigamZ/uQQ6oktzarbDIME8NAgJB9i/MzCGYat5anP7bvHn5t8/6G7zay 37dex4JpxhEdMaPjCeq3W+YPPaw0G/tH+G2fvbCanz1w06PBu24t9PFHzZxIO3vM wNN0T1jdOGZYhWFSigtmEA4vzxT8SC/waJ7OiHsp3VbZsolUlJSjG5+EpXKmKqby N8zjUzsCasNj37HngPzkv9P8luuouau/7U4fBqR3NhlYAz93pJ0Eke2z5ulOns01 HK58wUreRtSwdRf+DPS2kd3ubbS1JHGWht5SiSuKtyID8QesewtAg/mGreGNZa6o K5LFNxba480RMV3Kbr0O =gRAr -----END PGP SIGNATURE----- --wZwWzkkm73dI25u3--