Re: [PATCH 1/3] fpga: dfl: move dfl_device_id to mod_devicetable.h

2020-09-14 Thread Xu Yilun
On Mon, Sep 14, 2020 at 08:10:14PM -0700, Moritz Fischer wrote:
> On Tue, Sep 15, 2020 at 10:55:17AM +0800, Xu Yilun wrote:
> > On Mon, Sep 14, 2020 at 02:32:32PM -0700, Moritz Fischer wrote:
> > > Hao,
> > > 
> > > On Fri, Sep 11, 2020 at 06:50:18AM +, Wu, Hao wrote:
> > > > > On 9/10/20 1:41 AM, Xu Yilun wrote:
> > > > > > On Wed, Sep 09, 2020 at 05:55:33AM -0700, Tom Rix wrote:
> > > > > >> On 9/7/20 10:48 PM, Xu Yilun wrote:
> > > > > >>> In order to support MODULE_DEVICE_TABLE() for dfl device driver, 
> > > > > >>> this
> > > > > >>> patch moves struct dfl_device_id to mod_devicetable.h
> > > > > >>>
> > > > > >>> Signed-off-by: Xu Yilun 
> > > > > >>> Signed-off-by: Wu Hao 
> > > > > >>> Signed-off-by: Matthew Gerlach 
> > > > > >>> Signed-off-by: Russ Weight 
> > > > > >>> ---
> > > > > >>>  drivers/fpga/dfl.h  | 13 +
> > > > > >>>  include/linux/mod_devicetable.h | 12 
> > > > > >>>  2 files changed, 13 insertions(+), 12 deletions(-)
> > > > > >>>
> > > > > >>> diff --git a/drivers/fpga/dfl.h b/drivers/fpga/dfl.h
> > > > > >>> index 5dc758f..d5b0760 100644
> > > > > >>> --- a/drivers/fpga/dfl.h
> > > > > >>> +++ b/drivers/fpga/dfl.h
> > > > > >>> @@ -26,6 +26,7 @@
> > > > > >>>  #include 
> > > > > >>>  #include 
> > > > > >>>  #include 
> > > > > >>> +#include 
> > > > 
> > > > Please fix the order for the new one, other places to good to me.
> > > > Acked-by: Wu Hao   for DFL related changes after this 
> > > > fix.
> > > 
> > > Do you mean the order of the includes, like alphabeticized? If it's
> > > minor I can fix it up when applying.
> > 
> > I think it is the alphabetic of head files. I could sent v2 patchset for
> > this fix as well as other fixes.
> 
> Alright, works for me. Can you do that?

Yes, I'm working on it. :)

Thanks,
Yilun

> 
> - Moritz


Re: [PATCH 1/3] fpga: dfl: move dfl_device_id to mod_devicetable.h

2020-09-14 Thread Moritz Fischer
On Tue, Sep 15, 2020 at 10:55:17AM +0800, Xu Yilun wrote:
> On Mon, Sep 14, 2020 at 02:32:32PM -0700, Moritz Fischer wrote:
> > Hao,
> > 
> > On Fri, Sep 11, 2020 at 06:50:18AM +, Wu, Hao wrote:
> > > > On 9/10/20 1:41 AM, Xu Yilun wrote:
> > > > > On Wed, Sep 09, 2020 at 05:55:33AM -0700, Tom Rix wrote:
> > > > >> On 9/7/20 10:48 PM, Xu Yilun wrote:
> > > > >>> In order to support MODULE_DEVICE_TABLE() for dfl device driver, 
> > > > >>> this
> > > > >>> patch moves struct dfl_device_id to mod_devicetable.h
> > > > >>>
> > > > >>> Signed-off-by: Xu Yilun 
> > > > >>> Signed-off-by: Wu Hao 
> > > > >>> Signed-off-by: Matthew Gerlach 
> > > > >>> Signed-off-by: Russ Weight 
> > > > >>> ---
> > > > >>>  drivers/fpga/dfl.h  | 13 +
> > > > >>>  include/linux/mod_devicetable.h | 12 
> > > > >>>  2 files changed, 13 insertions(+), 12 deletions(-)
> > > > >>>
> > > > >>> diff --git a/drivers/fpga/dfl.h b/drivers/fpga/dfl.h
> > > > >>> index 5dc758f..d5b0760 100644
> > > > >>> --- a/drivers/fpga/dfl.h
> > > > >>> +++ b/drivers/fpga/dfl.h
> > > > >>> @@ -26,6 +26,7 @@
> > > > >>>  #include 
> > > > >>>  #include 
> > > > >>>  #include 
> > > > >>> +#include 
> > > 
> > > Please fix the order for the new one, other places to good to me.
> > > Acked-by: Wu Hao   for DFL related changes after this 
> > > fix.
> > 
> > Do you mean the order of the includes, like alphabeticized? If it's
> > minor I can fix it up when applying.
> 
> I think it is the alphabetic of head files. I could sent v2 patchset for
> this fix as well as other fixes.

Alright, works for me. Can you do that?

- Moritz


Re: [PATCH 1/3] fpga: dfl: move dfl_device_id to mod_devicetable.h

2020-09-14 Thread Xu Yilun
On Mon, Sep 14, 2020 at 02:32:32PM -0700, Moritz Fischer wrote:
> Hao,
> 
> On Fri, Sep 11, 2020 at 06:50:18AM +, Wu, Hao wrote:
> > > On 9/10/20 1:41 AM, Xu Yilun wrote:
> > > > On Wed, Sep 09, 2020 at 05:55:33AM -0700, Tom Rix wrote:
> > > >> On 9/7/20 10:48 PM, Xu Yilun wrote:
> > > >>> In order to support MODULE_DEVICE_TABLE() for dfl device driver, this
> > > >>> patch moves struct dfl_device_id to mod_devicetable.h
> > > >>>
> > > >>> Signed-off-by: Xu Yilun 
> > > >>> Signed-off-by: Wu Hao 
> > > >>> Signed-off-by: Matthew Gerlach 
> > > >>> Signed-off-by: Russ Weight 
> > > >>> ---
> > > >>>  drivers/fpga/dfl.h  | 13 +
> > > >>>  include/linux/mod_devicetable.h | 12 
> > > >>>  2 files changed, 13 insertions(+), 12 deletions(-)
> > > >>>
> > > >>> diff --git a/drivers/fpga/dfl.h b/drivers/fpga/dfl.h
> > > >>> index 5dc758f..d5b0760 100644
> > > >>> --- a/drivers/fpga/dfl.h
> > > >>> +++ b/drivers/fpga/dfl.h
> > > >>> @@ -26,6 +26,7 @@
> > > >>>  #include 
> > > >>>  #include 
> > > >>>  #include 
> > > >>> +#include 
> > 
> > Please fix the order for the new one, other places to good to me.
> > Acked-by: Wu Hao   for DFL related changes after this fix.
> 
> Do you mean the order of the includes, like alphabeticized? If it's
> minor I can fix it up when applying.

I think it is the alphabetic of head files. I could sent v2 patchset for
this fix as well as other fixes.

Thanks,
Yilun.

> 
> Thanks,
> Moritz


Re: [PATCH 1/3] fpga: dfl: move dfl_device_id to mod_devicetable.h

2020-09-14 Thread Moritz Fischer
Hao,

On Fri, Sep 11, 2020 at 06:50:18AM +, Wu, Hao wrote:
> > On 9/10/20 1:41 AM, Xu Yilun wrote:
> > > On Wed, Sep 09, 2020 at 05:55:33AM -0700, Tom Rix wrote:
> > >> On 9/7/20 10:48 PM, Xu Yilun wrote:
> > >>> In order to support MODULE_DEVICE_TABLE() for dfl device driver, this
> > >>> patch moves struct dfl_device_id to mod_devicetable.h
> > >>>
> > >>> Signed-off-by: Xu Yilun 
> > >>> Signed-off-by: Wu Hao 
> > >>> Signed-off-by: Matthew Gerlach 
> > >>> Signed-off-by: Russ Weight 
> > >>> ---
> > >>>  drivers/fpga/dfl.h  | 13 +
> > >>>  include/linux/mod_devicetable.h | 12 
> > >>>  2 files changed, 13 insertions(+), 12 deletions(-)
> > >>>
> > >>> diff --git a/drivers/fpga/dfl.h b/drivers/fpga/dfl.h
> > >>> index 5dc758f..d5b0760 100644
> > >>> --- a/drivers/fpga/dfl.h
> > >>> +++ b/drivers/fpga/dfl.h
> > >>> @@ -26,6 +26,7 @@
> > >>>  #include 
> > >>>  #include 
> > >>>  #include 
> > >>> +#include 
> 
> Please fix the order for the new one, other places to good to me.
> Acked-by: Wu Hao   for DFL related changes after this fix.

Do you mean the order of the includes, like alphabeticized? If it's
minor I can fix it up when applying.

Thanks,
Moritz


Re: [PATCH 1/3] fpga: dfl: move dfl_device_id to mod_devicetable.h

2020-09-10 Thread Tom Rix


On 9/10/20 1:41 AM, Xu Yilun wrote:
> On Wed, Sep 09, 2020 at 05:55:33AM -0700, Tom Rix wrote:
>> On 9/7/20 10:48 PM, Xu Yilun wrote:
>>> In order to support MODULE_DEVICE_TABLE() for dfl device driver, this
>>> patch moves struct dfl_device_id to mod_devicetable.h
>>>
>>> Signed-off-by: Xu Yilun 
>>> Signed-off-by: Wu Hao 
>>> Signed-off-by: Matthew Gerlach 
>>> Signed-off-by: Russ Weight 
>>> ---
>>>  drivers/fpga/dfl.h  | 13 +
>>>  include/linux/mod_devicetable.h | 12 
>>>  2 files changed, 13 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/drivers/fpga/dfl.h b/drivers/fpga/dfl.h
>>> index 5dc758f..d5b0760 100644
>>> --- a/drivers/fpga/dfl.h
>>> +++ b/drivers/fpga/dfl.h
>>> @@ -26,6 +26,7 @@
>>>  #include 
>>>  #include 
>>>  #include 
>>> +#include 
>>>  
>>>  /* maximum supported number of ports */
>>>  #define MAX_DFL_FPGA_PORT_NUM 4
>>> @@ -526,18 +527,6 @@ enum dfl_id_type {
>>>  };
>>>  
>>>  /**
>>> - * struct dfl_device_id -  dfl device identifier
>>> - * @type: contains 4 bits DFL FIU type of the device. See enum dfl_id_type.
>>> - * @feature_id: contains 12 bits feature identifier local to its DFL FIU 
>>> type.
>>> - * @driver_data: driver specific data.
>>> - */
>>> -struct dfl_device_id {
>>> -   u8 type;
>>> -   u16 feature_id;
>>> -   unsigned long driver_data;
>>> -};
>>> -
>>> -/**
>>>   * struct dfl_device - represent an dfl device on dfl bus
>>>   *
>>>   * @dev: generic device interface.
>>> diff --git a/include/linux/mod_devicetable.h 
>>> b/include/linux/mod_devicetable.h
>>> index 5b08a47..407d8dc 100644
>>> --- a/include/linux/mod_devicetable.h
>>> +++ b/include/linux/mod_devicetable.h
>>> @@ -838,4 +838,16 @@ struct mhi_device_id {
>>> kernel_ulong_t driver_data;
>>>  };
>>>  
>>> +/**
>>> + * struct dfl_device_id -  dfl device identifier
>>> + * @type: contains 4 bits DFL FIU type of the device. See enum dfl_id_type.
>>> + * @feature_id: contains 12 bits feature identifier local to its DFL FIU 
>>> type.
>>> + * @driver_data: driver specific data.
>>> + */
>>> +struct dfl_device_id {
>>> +   __u8 type;
>>> +   __u16 feature_id;
>> I thought i saw feature id's going to 64 bit, does this type need to expand ?
> Feature id is a 12bit field in DFL spec. Previously we define it u64
> cause we are considering it may expand sometime. But now seems GUID will
> be used in future design.
>
> And the header file will be used by modpost, which is not supporting u64
> now. So it is not necessary we use u64 for extra work. A patch is
> already applied for this change - "change data type of feature id to u16"
>
> Thanks,
> Yilun

Thanks for the explanation.

Reviewed-by: Tom Rix 

>
>> Tom 
>>
>>> +   kernel_ulong_t driver_data;
>>> +};
>>> +
>>>  #endif /* LINUX_MOD_DEVICETABLE_H */



Re: [PATCH 1/3] fpga: dfl: move dfl_device_id to mod_devicetable.h

2020-09-10 Thread Xu Yilun
On Wed, Sep 09, 2020 at 05:55:33AM -0700, Tom Rix wrote:
> 
> On 9/7/20 10:48 PM, Xu Yilun wrote:
> > In order to support MODULE_DEVICE_TABLE() for dfl device driver, this
> > patch moves struct dfl_device_id to mod_devicetable.h
> >
> > Signed-off-by: Xu Yilun 
> > Signed-off-by: Wu Hao 
> > Signed-off-by: Matthew Gerlach 
> > Signed-off-by: Russ Weight 
> > ---
> >  drivers/fpga/dfl.h  | 13 +
> >  include/linux/mod_devicetable.h | 12 
> >  2 files changed, 13 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/fpga/dfl.h b/drivers/fpga/dfl.h
> > index 5dc758f..d5b0760 100644
> > --- a/drivers/fpga/dfl.h
> > +++ b/drivers/fpga/dfl.h
> > @@ -26,6 +26,7 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >  
> >  /* maximum supported number of ports */
> >  #define MAX_DFL_FPGA_PORT_NUM 4
> > @@ -526,18 +527,6 @@ enum dfl_id_type {
> >  };
> >  
> >  /**
> > - * struct dfl_device_id -  dfl device identifier
> > - * @type: contains 4 bits DFL FIU type of the device. See enum dfl_id_type.
> > - * @feature_id: contains 12 bits feature identifier local to its DFL FIU 
> > type.
> > - * @driver_data: driver specific data.
> > - */
> > -struct dfl_device_id {
> > -   u8 type;
> > -   u16 feature_id;
> > -   unsigned long driver_data;
> > -};
> > -
> > -/**
> >   * struct dfl_device - represent an dfl device on dfl bus
> >   *
> >   * @dev: generic device interface.
> > diff --git a/include/linux/mod_devicetable.h 
> > b/include/linux/mod_devicetable.h
> > index 5b08a47..407d8dc 100644
> > --- a/include/linux/mod_devicetable.h
> > +++ b/include/linux/mod_devicetable.h
> > @@ -838,4 +838,16 @@ struct mhi_device_id {
> > kernel_ulong_t driver_data;
> >  };
> >  
> > +/**
> > + * struct dfl_device_id -  dfl device identifier
> > + * @type: contains 4 bits DFL FIU type of the device. See enum dfl_id_type.
> > + * @feature_id: contains 12 bits feature identifier local to its DFL FIU 
> > type.
> > + * @driver_data: driver specific data.
> > + */
> > +struct dfl_device_id {
> > +   __u8 type;
> > +   __u16 feature_id;
> 
> I thought i saw feature id's going to 64 bit, does this type need to expand ?

Feature id is a 12bit field in DFL spec. Previously we define it u64
cause we are considering it may expand sometime. But now seems GUID will
be used in future design.

And the header file will be used by modpost, which is not supporting u64
now. So it is not necessary we use u64 for extra work. A patch is
already applied for this change - "change data type of feature id to u16"

Thanks,
Yilun

> 
> Tom 
> 
> > +   kernel_ulong_t driver_data;
> > +};
> > +
> >  #endif /* LINUX_MOD_DEVICETABLE_H */


Re: [PATCH 1/3] fpga: dfl: move dfl_device_id to mod_devicetable.h

2020-09-09 Thread Tom Rix


On 9/7/20 10:48 PM, Xu Yilun wrote:
> In order to support MODULE_DEVICE_TABLE() for dfl device driver, this
> patch moves struct dfl_device_id to mod_devicetable.h
>
> Signed-off-by: Xu Yilun 
> Signed-off-by: Wu Hao 
> Signed-off-by: Matthew Gerlach 
> Signed-off-by: Russ Weight 
> ---
>  drivers/fpga/dfl.h  | 13 +
>  include/linux/mod_devicetable.h | 12 
>  2 files changed, 13 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/fpga/dfl.h b/drivers/fpga/dfl.h
> index 5dc758f..d5b0760 100644
> --- a/drivers/fpga/dfl.h
> +++ b/drivers/fpga/dfl.h
> @@ -26,6 +26,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  /* maximum supported number of ports */
>  #define MAX_DFL_FPGA_PORT_NUM 4
> @@ -526,18 +527,6 @@ enum dfl_id_type {
>  };
>  
>  /**
> - * struct dfl_device_id -  dfl device identifier
> - * @type: contains 4 bits DFL FIU type of the device. See enum dfl_id_type.
> - * @feature_id: contains 12 bits feature identifier local to its DFL FIU 
> type.
> - * @driver_data: driver specific data.
> - */
> -struct dfl_device_id {
> - u8 type;
> - u16 feature_id;
> - unsigned long driver_data;
> -};
> -
> -/**
>   * struct dfl_device - represent an dfl device on dfl bus
>   *
>   * @dev: generic device interface.
> diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
> index 5b08a47..407d8dc 100644
> --- a/include/linux/mod_devicetable.h
> +++ b/include/linux/mod_devicetable.h
> @@ -838,4 +838,16 @@ struct mhi_device_id {
>   kernel_ulong_t driver_data;
>  };
>  
> +/**
> + * struct dfl_device_id -  dfl device identifier
> + * @type: contains 4 bits DFL FIU type of the device. See enum dfl_id_type.
> + * @feature_id: contains 12 bits feature identifier local to its DFL FIU 
> type.
> + * @driver_data: driver specific data.
> + */
> +struct dfl_device_id {
> + __u8 type;
> + __u16 feature_id;

I thought i saw feature id's going to 64 bit, does this type need to expand ?

Tom 

> + kernel_ulong_t driver_data;
> +};
> +
>  #endif /* LINUX_MOD_DEVICETABLE_H */



[PATCH 1/3] fpga: dfl: move dfl_device_id to mod_devicetable.h

2020-09-07 Thread Xu Yilun
In order to support MODULE_DEVICE_TABLE() for dfl device driver, this
patch moves struct dfl_device_id to mod_devicetable.h

Signed-off-by: Xu Yilun 
Signed-off-by: Wu Hao 
Signed-off-by: Matthew Gerlach 
Signed-off-by: Russ Weight 
---
 drivers/fpga/dfl.h  | 13 +
 include/linux/mod_devicetable.h | 12 
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/drivers/fpga/dfl.h b/drivers/fpga/dfl.h
index 5dc758f..d5b0760 100644
--- a/drivers/fpga/dfl.h
+++ b/drivers/fpga/dfl.h
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /* maximum supported number of ports */
 #define MAX_DFL_FPGA_PORT_NUM 4
@@ -526,18 +527,6 @@ enum dfl_id_type {
 };
 
 /**
- * struct dfl_device_id -  dfl device identifier
- * @type: contains 4 bits DFL FIU type of the device. See enum dfl_id_type.
- * @feature_id: contains 12 bits feature identifier local to its DFL FIU type.
- * @driver_data: driver specific data.
- */
-struct dfl_device_id {
-   u8 type;
-   u16 feature_id;
-   unsigned long driver_data;
-};
-
-/**
  * struct dfl_device - represent an dfl device on dfl bus
  *
  * @dev: generic device interface.
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 5b08a47..407d8dc 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -838,4 +838,16 @@ struct mhi_device_id {
kernel_ulong_t driver_data;
 };
 
+/**
+ * struct dfl_device_id -  dfl device identifier
+ * @type: contains 4 bits DFL FIU type of the device. See enum dfl_id_type.
+ * @feature_id: contains 12 bits feature identifier local to its DFL FIU type.
+ * @driver_data: driver specific data.
+ */
+struct dfl_device_id {
+   __u8 type;
+   __u16 feature_id;
+   kernel_ulong_t driver_data;
+};
+
 #endif /* LINUX_MOD_DEVICETABLE_H */
-- 
2.7.4