From: David Gibson <david@gibson.dropbear.id.au>
To: Bharata B Rao <bharata@linux.vnet.ibm.com>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
Michael Roth <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [FIX PATCH] spapr_drc: Return correct state for logical DR in entity_sense()
Date: Tue, 8 Sep 2015 11:22:50 +1000 [thread overview]
Message-ID: <20150908012250.GG6537@voom.redhat.com> (raw)
In-Reply-To: <1441606024-1238-1-git-send-email-bharata@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1985 bytes --]
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.
>
> Fix this by returning the right state in entity_sense() by checking
> the allocation_state of DRC.
>
> (*) https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-September/133430.html
>
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
and applied to my tree.
> ---
> hw/ppc/spapr_drc.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> 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(sPAPRDRConnector *drc)
> */
> state = SPAPR_DR_ENTITY_SENSE_EMPTY;
> } else {
> - state = SPAPR_DR_ENTITY_SENSE_UNUSABLE;
> + if (drc->allocation_state == SPAPR_DR_ALLOCATION_STATE_UNUSABLE) {
> + state = SPAPR_DR_ENTITY_SENSE_UNUSABLE;
> + } else {
> + state = SPAPR_DR_ENTITY_SENSE_PRESENT;
> + }
> }
> }
>
--
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
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-09-08 1:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-07 6:07 [Qemu-devel] [FIX PATCH] spapr_drc: Return correct state for logical DR in entity_sense() Bharata B Rao
2015-09-08 1:22 ` David Gibson [this message]
2015-09-08 21:03 ` Michael Roth
2015-09-08 21:06 ` Michael Roth
2015-09-08 22:03 ` Michael Roth
2015-09-09 4:02 ` Bharata B Rao
2015-09-09 6:05 ` David Gibson
2015-09-09 4:13 ` David Gibson
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=20150908012250.GG6537@voom.redhat.com \
--to=david@gibson.dropbear.id.au \
--cc=bharata@linux.vnet.ibm.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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.