Re: [Xen-devel] [RFC 2/6] arm64: Add definitions for fwnode_handle
On 6/12/2017 6:40 AM, Julien Grall wrote: > Hi, > > On 08/06/17 22:57, Stefano Stabellini wrote: >> On Thu, 8 Jun 2017, Goel, Sameer wrote: > diff --git a/xen/include/xen/fwnode.h b/xen/include/xen/fwnode.h > new file mode 100644 > index 000..db65b15 > --- /dev/null > +++ b/xen/include/xen/fwnode.h > @@ -0,0 +1,35 @@ > +/* > + * fwnode.h - Firmware device node object handle type definition. > + * > + * Copyright (C) 2015, Intel Corporation > + * Author: Rafael J. Wysocki > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + * > + * Ported from Linux include/linux/fwnode.h > + * => commit ce793486e23e0162a732c605189c8028e0910e86 > + * > + * No functional Xen modifications. > + */ > + > +#ifndef __XEN_FWNODE_H_ > +#define __XEN_FWNODE_H_ > + > +enum fwnode_type { > + FWNODE_INVALID = 0, > + FWNODE_OF, > + FWNODE_ACPI, > + FWNODE_ACPI_DATA, > + FWNODE_ACPI_STATIC, > + FWNODE_PDATA, > + FWNODE_IRQCHIP Do you really need to introduce all of them? >>> Not really. We are interested in OF and ACPI_STATIC for now. Since the >>> verbatim file from Linux applied ok, I did not remove the other entries. >>> What's your recommendation? >> >> Usually we keep the imported Linux definitions as-is. > > If we keep as-is, the coding style should stay exactly the same. Even > > Otherwise there is no point to import a verbatim copy of Linux as it would be > difficult to keep track of the changes. > > In this case, I am not convinced we have a benefits to keep this code close > to Linux. It is small enough and we don't need 80% of it. Ok. I will go ahead and remove whatever is not needed. > > Cheers, > -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [RFC 2/6] arm64: Add definitions for fwnode_handle
On 6/12/2017 6:51 AM, Julien Grall wrote: > Hi Sameer, > > On 08/06/17 22:42, Goel, Sameer wrote: >> On 6/8/2017 1:59 PM, Julien Grall wrote: >>> >>> >>> On 08/06/2017 20:30, Sameer Goel wrote: This will be used as a device property to match the DMA capable devices with the associated SMMU. The header file is a port from linux. Linux ChangeId:ce793486e23e: driver core / ACPI: Represent ACPI companions using fwnode_handle Signed-off-by: Sameer Goel --- xen/include/asm-arm/device.h | 2 ++ xen/include/xen/fwnode.h | 35 +++ 2 files changed, 37 insertions(+) create mode 100644 xen/include/xen/fwnode.h diff --git a/xen/include/asm-arm/device.h b/xen/include/asm-arm/device.h index 6734ae8..78c38fe 100644 --- a/xen/include/asm-arm/device.h +++ b/xen/include/asm-arm/device.h @@ -2,6 +2,7 @@ #define __ASM_ARM_DEVICE_H #include +#include enum device_type { @@ -19,6 +20,7 @@ struct device #ifdef CONFIG_HAS_DEVICE_TREE struct dt_device_node *of_node; /* Used by drivers imported from Linux */ #endif + struct fwnode_handle *fwnode; /*fw device node identifier */ >>> >>> I am a bit surprised you don't rework struct dev. As of_node is now >>> redundant with fwnode. >> >> I agree that this will eventually be removed. I have kept this in now just >> to maintain compatibility >> (compilation and otherwise) with smmuv2 driver. I will add a comment to >> indicate this. So that it can >> be easily identified and remove when we do a final cleanup. Can I prefix the >> comment with with XEN:TODO:? > > A TODO would be nice, but who is going to do the rework? I will still be on the hook to complete this cleanup. I was hoping to get the basic code in place and then start the rework on older drivers. > > Cheers, > -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [RFC 2/6] arm64: Add definitions for fwnode_handle
Hi Sameer, On 08/06/17 22:42, Goel, Sameer wrote: On 6/8/2017 1:59 PM, Julien Grall wrote: On 08/06/2017 20:30, Sameer Goel wrote: This will be used as a device property to match the DMA capable devices with the associated SMMU. The header file is a port from linux. Linux ChangeId:ce793486e23e: driver core / ACPI: Represent ACPI companions using fwnode_handle Signed-off-by: Sameer Goel --- xen/include/asm-arm/device.h | 2 ++ xen/include/xen/fwnode.h | 35 +++ 2 files changed, 37 insertions(+) create mode 100644 xen/include/xen/fwnode.h diff --git a/xen/include/asm-arm/device.h b/xen/include/asm-arm/device.h index 6734ae8..78c38fe 100644 --- a/xen/include/asm-arm/device.h +++ b/xen/include/asm-arm/device.h @@ -2,6 +2,7 @@ #define __ASM_ARM_DEVICE_H #include +#include enum device_type { @@ -19,6 +20,7 @@ struct device #ifdef CONFIG_HAS_DEVICE_TREE struct dt_device_node *of_node; /* Used by drivers imported from Linux */ #endif +struct fwnode_handle *fwnode; /*fw device node identifier */ I am a bit surprised you don't rework struct dev. As of_node is now redundant with fwnode. I agree that this will eventually be removed. I have kept this in now just to maintain compatibility (compilation and otherwise) with smmuv2 driver. I will add a comment to indicate this. So that it can be easily identified and remove when we do a final cleanup. Can I prefix the comment with with XEN:TODO:? A TODO would be nice, but who is going to do the rework? Cheers, -- Julien Grall ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [RFC 2/6] arm64: Add definitions for fwnode_handle
Hi, On 08/06/17 22:57, Stefano Stabellini wrote: On Thu, 8 Jun 2017, Goel, Sameer wrote: diff --git a/xen/include/xen/fwnode.h b/xen/include/xen/fwnode.h new file mode 100644 index 000..db65b15 --- /dev/null +++ b/xen/include/xen/fwnode.h @@ -0,0 +1,35 @@ +/* + * fwnode.h - Firmware device node object handle type definition. + * + * Copyright (C) 2015, Intel Corporation + * Author: Rafael J. Wysocki + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Ported from Linux include/linux/fwnode.h + * => commit ce793486e23e0162a732c605189c8028e0910e86 + * + * No functional Xen modifications. + */ + +#ifndef __XEN_FWNODE_H_ +#define __XEN_FWNODE_H_ + +enum fwnode_type { +FWNODE_INVALID = 0, +FWNODE_OF, +FWNODE_ACPI, +FWNODE_ACPI_DATA, +FWNODE_ACPI_STATIC, +FWNODE_PDATA, +FWNODE_IRQCHIP Do you really need to introduce all of them? Not really. We are interested in OF and ACPI_STATIC for now. Since the verbatim file from Linux applied ok, I did not remove the other entries. What's your recommendation? Usually we keep the imported Linux definitions as-is. If we keep as-is, the coding style should stay exactly the same. Even Otherwise there is no point to import a verbatim copy of Linux as it would be difficult to keep track of the changes. In this case, I am not convinced we have a benefits to keep this code close to Linux. It is small enough and we don't need 80% of it. Cheers, -- Julien Grall ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [RFC 2/6] arm64: Add definitions for fwnode_handle
On Thu, 8 Jun 2017, Goel, Sameer wrote: > >> diff --git a/xen/include/xen/fwnode.h b/xen/include/xen/fwnode.h > >> new file mode 100644 > >> index 000..db65b15 > >> --- /dev/null > >> +++ b/xen/include/xen/fwnode.h > >> @@ -0,0 +1,35 @@ > >> +/* > >> + * fwnode.h - Firmware device node object handle type definition. > >> + * > >> + * Copyright (C) 2015, Intel Corporation > >> + * Author: Rafael J. Wysocki > >> + * > >> + * This program is free software; you can redistribute it and/or modify > >> + * it under the terms of the GNU General Public License version 2 as > >> + * published by the Free Software Foundation. > >> + * > >> + * Ported from Linux include/linux/fwnode.h > >> + * => commit ce793486e23e0162a732c605189c8028e0910e86 > >> + * > >> + * No functional Xen modifications. > >> + */ > >> + > >> +#ifndef __XEN_FWNODE_H_ > >> +#define __XEN_FWNODE_H_ > >> + > >> +enum fwnode_type { > >> +FWNODE_INVALID = 0, > >> +FWNODE_OF, > >> +FWNODE_ACPI, > >> +FWNODE_ACPI_DATA, > >> +FWNODE_ACPI_STATIC, > >> +FWNODE_PDATA, > >> +FWNODE_IRQCHIP > > > > Do you really need to introduce all of them? > > > Not really. We are interested in OF and ACPI_STATIC for now. Since the > verbatim file from Linux applied ok, I did not remove the other entries. > What's your recommendation? Usually we keep the imported Linux definitions as-is. > >> +}; > >> + > >> +struct fwnode_handle { > >> +enum fwnode_type type; > >> +struct fwnode_handle *secondary; > >> +}; > >> + > >> +#endif > >> ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [RFC 2/6] arm64: Add definitions for fwnode_handle
On 6/8/2017 1:59 PM, Julien Grall wrote: > > > On 08/06/2017 20:30, Sameer Goel wrote: >> This will be used as a device property to match the DMA capable devices >> with the associated SMMU. The header file is a port from linux. >> >> Linux ChangeId:ce793486e23e: driver core / ACPI: Represent ACPI >> companions using fwnode_handle >> >> Signed-off-by: Sameer Goel >> --- >> xen/include/asm-arm/device.h | 2 ++ >> xen/include/xen/fwnode.h | 35 +++ >> 2 files changed, 37 insertions(+) >> create mode 100644 xen/include/xen/fwnode.h >> >> diff --git a/xen/include/asm-arm/device.h b/xen/include/asm-arm/device.h >> index 6734ae8..78c38fe 100644 >> --- a/xen/include/asm-arm/device.h >> +++ b/xen/include/asm-arm/device.h >> @@ -2,6 +2,7 @@ >> #define __ASM_ARM_DEVICE_H >> >> #include >> +#include >> >> enum device_type >> { >> @@ -19,6 +20,7 @@ struct device >> #ifdef CONFIG_HAS_DEVICE_TREE >> struct dt_device_node *of_node; /* Used by drivers imported from Linux >> */ >> #endif >> +struct fwnode_handle *fwnode; /*fw device node identifier */ > > I am a bit surprised you don't rework struct dev. As of_node is now redundant > with fwnode. I agree that this will eventually be removed. I have kept this in now just to maintain compatibility (compilation and otherwise) with smmuv2 driver. I will add a comment to indicate this. So that it can be easily identified and remove when we do a final cleanup. Can I prefix the comment with with XEN:TODO:? > >> struct dev_archdata archdata; >> }; >> >> diff --git a/xen/include/xen/fwnode.h b/xen/include/xen/fwnode.h >> new file mode 100644 >> index 000..db65b15 >> --- /dev/null >> +++ b/xen/include/xen/fwnode.h >> @@ -0,0 +1,35 @@ >> +/* >> + * fwnode.h - Firmware device node object handle type definition. >> + * >> + * Copyright (C) 2015, Intel Corporation >> + * Author: Rafael J. Wysocki >> + * >> + * This program is free software; you can redistribute it and/or modify >> + * it under the terms of the GNU General Public License version 2 as >> + * published by the Free Software Foundation. >> + * >> + * Ported from Linux include/linux/fwnode.h >> + * => commit ce793486e23e0162a732c605189c8028e0910e86 >> + * >> + * No functional Xen modifications. >> + */ >> + >> +#ifndef __XEN_FWNODE_H_ >> +#define __XEN_FWNODE_H_ >> + >> +enum fwnode_type { >> +FWNODE_INVALID = 0, >> +FWNODE_OF, >> +FWNODE_ACPI, >> +FWNODE_ACPI_DATA, >> +FWNODE_ACPI_STATIC, >> +FWNODE_PDATA, >> +FWNODE_IRQCHIP > > Do you really need to introduce all of them? > Not really. We are interested in OF and ACPI_STATIC for now. Since the verbatim file from Linux applied ok, I did not remove the other entries. What's your recommendation? >> +}; >> + >> +struct fwnode_handle { >> +enum fwnode_type type; >> +struct fwnode_handle *secondary; >> +}; >> + >> +#endif >> > > Cheers, > Thanks, Sameer -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [RFC 2/6] arm64: Add definitions for fwnode_handle
On 08/06/2017 20:30, Sameer Goel wrote: This will be used as a device property to match the DMA capable devices with the associated SMMU. The header file is a port from linux. Linux ChangeId:ce793486e23e: driver core / ACPI: Represent ACPI companions using fwnode_handle Signed-off-by: Sameer Goel --- xen/include/asm-arm/device.h | 2 ++ xen/include/xen/fwnode.h | 35 +++ 2 files changed, 37 insertions(+) create mode 100644 xen/include/xen/fwnode.h diff --git a/xen/include/asm-arm/device.h b/xen/include/asm-arm/device.h index 6734ae8..78c38fe 100644 --- a/xen/include/asm-arm/device.h +++ b/xen/include/asm-arm/device.h @@ -2,6 +2,7 @@ #define __ASM_ARM_DEVICE_H #include +#include enum device_type { @@ -19,6 +20,7 @@ struct device #ifdef CONFIG_HAS_DEVICE_TREE struct dt_device_node *of_node; /* Used by drivers imported from Linux */ #endif +struct fwnode_handle *fwnode; /*fw device node identifier */ I am a bit surprised you don't rework struct dev. As of_node is now redundant with fwnode. struct dev_archdata archdata; }; diff --git a/xen/include/xen/fwnode.h b/xen/include/xen/fwnode.h new file mode 100644 index 000..db65b15 --- /dev/null +++ b/xen/include/xen/fwnode.h @@ -0,0 +1,35 @@ +/* + * fwnode.h - Firmware device node object handle type definition. + * + * Copyright (C) 2015, Intel Corporation + * Author: Rafael J. Wysocki + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Ported from Linux include/linux/fwnode.h + * => commit ce793486e23e0162a732c605189c8028e0910e86 + * + * No functional Xen modifications. + */ + +#ifndef __XEN_FWNODE_H_ +#define __XEN_FWNODE_H_ + +enum fwnode_type { + FWNODE_INVALID = 0, + FWNODE_OF, + FWNODE_ACPI, + FWNODE_ACPI_DATA, + FWNODE_ACPI_STATIC, + FWNODE_PDATA, + FWNODE_IRQCHIP Do you really need to introduce all of them? +}; + +struct fwnode_handle { + enum fwnode_type type; + struct fwnode_handle *secondary; +}; + +#endif Cheers, -- Julien Grall ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] [RFC 2/6] arm64: Add definitions for fwnode_handle
Hi, Please CC all the relevant maintainers on this patch. On 08/06/2017 20:30, Sameer Goel wrote: This will be used as a device property to match the DMA capable devices with the associated SMMU. The header file is a port from linux. Linux ChangeId:ce793486e23e: driver core / ACPI: Represent ACPI companions using fwnode_handle Signed-off-by: Sameer Goel --- xen/include/asm-arm/device.h | 2 ++ xen/include/xen/fwnode.h | 35 +++ I am not totally convinced this is the right place for this header. But I will leave the REST maintainers deciding. 2 files changed, 37 insertions(+) create mode 100644 xen/include/xen/fwnode.h diff --git a/xen/include/asm-arm/device.h b/xen/include/asm-arm/device.h index 6734ae8..78c38fe 100644 --- a/xen/include/asm-arm/device.h +++ b/xen/include/asm-arm/device.h @@ -2,6 +2,7 @@ #define __ASM_ARM_DEVICE_H #include +#include enum device_type { @@ -19,6 +20,7 @@ struct device #ifdef CONFIG_HAS_DEVICE_TREE struct dt_device_node *of_node; /* Used by drivers imported from Linux */ #endif +struct fwnode_handle *fwnode; /*fw device node identifier */ struct dev_archdata archdata; }; diff --git a/xen/include/xen/fwnode.h b/xen/include/xen/fwnode.h new file mode 100644 index 000..db65b15 --- /dev/null +++ b/xen/include/xen/fwnode.h @@ -0,0 +1,35 @@ +/* + * fwnode.h - Firmware device node object handle type definition. + * + * Copyright (C) 2015, Intel Corporation + * Author: Rafael J. Wysocki + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Ported from Linux include/linux/fwnode.h + * => commit ce793486e23e0162a732c605189c8028e0910e86 + * + * No functional Xen modifications. + */ + +#ifndef __XEN_FWNODE_H_ +#define __XEN_FWNODE_H_ + +enum fwnode_type { + FWNODE_INVALID = 0, + FWNODE_OF, + FWNODE_ACPI, + FWNODE_ACPI_DATA, + FWNODE_ACPI_STATIC, + FWNODE_PDATA, + FWNODE_IRQCHIP +}; + +struct fwnode_handle { + enum fwnode_type type; + struct fwnode_handle *secondary; +}; + +#endif -- Julien Grall ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel