qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [FIX PATCH] spapr_drc: Return correct state for logical D


From: David Gibson
Subject: Re: [Qemu-ppc] [FIX PATCH] spapr_drc: Return correct state for logical DR in entity_sense()
Date: Tue, 8 Sep 2015 11:22:50 +1000
User-agent: Mutt/1.5.23 (2014-03-12)

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 <address@hidden>
> Cc: Michael Roth <address@hidden>

Reviewed-by: David Gibson <address@hidden>

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: pgpJe5gWlNNLH.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]