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

Re: [Xen-devel] [PATCH 1/2] xen/arm: Initial support for PSCI-0.2



On Thu, 2014-10-02 at 11:51 +0100, Julien Grall wrote:

> > +    if ( psci_ver != 2 )
> > +    {
> > +        printk("Error: The retrieved PSCI version (%#x) does not 
> > support.\n", psci_ver);
> 
> NIT: s/does/is/ ?

along with "supported", yes. I'd probably simplify it to "PSCI version %
#x is not supported".

> 
> > +        return -EOPNOTSUPP;
> > +    }
> > +
> > +    psci_cpu_on_nr = PSCI_0_2_FN_CPU_ON;
> > +
> > +    printk(XENLOG_INFO "Using PSCI-0.2 for SMP bringup\n");
> > +
> > +    return 0;
> > +}
> > +
> > +int __init psci_init(void)
> > +{
> > +    const struct dt_device_node *psci;
> > +
> > +    psci = dt_find_compatible_node(NULL, NULL, "arm,psci");
> > +    if ( psci )
> > +        return psci_init_0_1(psci);
> > +
> > +    psci = dt_find_compatible_node(NULL, NULL, "arm,psci-0.2");
> > +    if ( psci )
> > +        return psci_init_0_2(psci);
> > +
> 
> I think we need to prefer PSCI 0.2 if the platform supports the both
> version of PSCI.

Yes, please.

This may require also falling back to 0.1 if psci_init_0_2 fails?

> > +    return -ENODEV;
> > +}
> > +
> >  /*
> >   * Local variables:
> >   * mode: C
> > diff --git a/xen/include/asm-arm/psci.h b/xen/include/asm-arm/psci.h
> > index 9777c03..ab37984 100644
> > --- a/xen/include/asm-arm/psci.h
> > +++ b/xen/include/asm-arm/psci.h
> > @@ -13,10 +13,12 @@
> >  #define PSCI_DISABLED               -8
> >  
> >  /* availability of PSCI on the host for SMP bringup */
> > -extern bool_t psci_available;
> > +extern int psci_ver;
> 
> I would use unsigned int here, or even better an enum to describe the
> different version of PSCI.

unsigned, to match the psci spec, would be sufficient. The code should
also use the existing XEN_PSCI_V_0_1 and XEN_PSCI_V_0_2 where
appropriate.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.