Displaying 20 results from an estimated 43 matches for "mdev_parent_dev".
2019 Sep 10
0
[RFC PATCH 2/4] mdev: introduce helper to set per device dma ops
...8,12 @@ static struct class_compat *mdev_bus_compat_class;
static LIST_HEAD(mdev_list);
static DEFINE_MUTEX(mdev_list_lock);
+void mdev_set_dma_ops(struct mdev_device *mdev, struct dma_map_ops *ops)
+{
+ set_dma_ops(&mdev->dev, ops);
+}
+EXPORT_SYMBOL(mdev_set_dma_ops);
+
struct device *mdev_parent_dev(struct mdev_device *mdev)
{
return mdev->parent->dev;
diff --git a/include/linux/mdev.h b/include/linux/mdev.h
index 0ce30ca78db0..7195f40bf8bf 100644
--- a/include/linux/mdev.h
+++ b/include/linux/mdev.h
@@ -145,4 +145,6 @@ struct device *mdev_parent_dev(struct mdev_device *mdev);
struct...
2019 Sep 17
1
[RFC PATCH 2/4] mdev: introduce helper to set per device dma ops
...ma_ops(&mdev->dev, ops);
> +}
> +EXPORT_SYMBOL(mdev_set_dma_ops);
> +
Why does mdev need to be involved here? Your sample driver in 4/4 calls
this from its create callback, where it could just as easily call:
set_dma_ops(mdev_dev(mdev), ops);
Thanks,
Alex
> struct device *mdev_parent_dev(struct mdev_device *mdev)
> {
> return mdev->parent->dev;
> diff --git a/include/linux/mdev.h b/include/linux/mdev.h
> index 0ce30ca78db0..7195f40bf8bf 100644
> --- a/include/linux/mdev.h
> +++ b/include/linux/mdev.h
> @@ -145,4 +145,6 @@ struct device *mdev_parent_dev...
2019 Oct 21
0
[RFC 2/2] vhost: IFC VF vdpa layer
...};
>>> +
>>> +const struct attribute_group *mdev_dev_groups[] = {
>>> +??? NULL,
>>> +};
>>> +
>>> +static int ifcvf_mdev_create(struct kobject *kobj, struct
>>> mdev_device *mdev)
>>> +{
>>> +??? struct device *dev = mdev_parent_dev(mdev);
>>> +??? struct pci_dev *pdev = to_pci_dev(dev);
>>> +??? struct ifcvf_adapter *adapter = pci_get_drvdata(pdev);
>>> +??? int ret = 0;
>>> +
>>> +??? mutex_lock(&adapter->mdev_lock);
>>> +
>>> +??? if (adapter->mdev_cou...
2019 Oct 16
0
[RFC 2/2] vhost: IFC VF vdpa layer
...ibute_group *mdev_type_groups[] = {
> + &mdev_type_group,
> + NULL,
> +};
> +
> +const struct attribute_group *mdev_dev_groups[] = {
> + NULL,
> +};
> +
> +static int ifcvf_mdev_create(struct kobject *kobj, struct mdev_device *mdev)
> +{
> + struct device *dev = mdev_parent_dev(mdev);
> + struct pci_dev *pdev = to_pci_dev(dev);
> + struct ifcvf_adapter *adapter = pci_get_drvdata(pdev);
> + int ret = 0;
> +
> + mutex_lock(&adapter->mdev_lock);
> +
> + if (adapter->mdev_count < 1) {
> + ret = -EINVAL;
> + goto out;
> + }
> +
&...
2019 Nov 06
0
[PATCH 2/2] IFC VDPA layer
...&mdev_type_group_virtio,
> + &mdev_type_group_vhost,
> + NULL,
> +};
> +
> +const struct attribute_group *mdev_dev_groups[] = {
> + NULL,
> +};
> +
> +static int ifcvf_mdev_create(struct kobject *kobj, struct mdev_device *mdev)
> +{
> + struct device *dev = mdev_parent_dev(mdev);
> + struct pci_dev *pdev = to_pci_dev(dev);
> + struct ifcvf_adapter *adapter = pci_get_drvdata(pdev);
> + int ret = 0;
> +
> + mutex_lock(&adapter->mdev_lock);
> +
> + if (adapter->mdev_count < IFCVF_MDEV_LIMIT) {
> + IFC_ERR(&pdev->dev,
> +...
2019 Sep 17
1
[RFC PATCH 1/2] mdev: device id support
...mdev_parent_ops *ops);
> +int mdev_register_vfio_device(struct device *dev, const struct
> mdev_parent_ops *ops);
> void mdev_unregister_device(struct device *dev);
>
> int mdev_register_driver(struct mdev_driver *drv, struct module *owner);
> @@ -145,4 +147,6 @@ struct device *mdev_parent_dev(struct
> mdev_device *mdev);
> struct device *mdev_dev(struct mdev_device *mdev);
> struct mdev_device *mdev_from_dev(struct device *dev);
>
> +#define MDEV_ID_VFIO 1 /* VFIO device */
> +
> #endif /* MDEV_H */
> diff --git a/include/linux/mod_devicetable.h
> b/includ...
2019 Sep 24
1
[PATCH V2 2/8] mdev: class id support
...mdev_device *mdev);
> void mdev_set_drvdata(struct mdev_device *mdev, void *data);
> +void mdev_set_class_id(struct mdev_device *mdev, u16 id);
> const guid_t *mdev_uuid(struct mdev_device *mdev);
>
> extern struct bus_type mdev_bus_type;
> @@ -145,4 +148,9 @@ struct device *mdev_parent_dev(struct mdev_device *mdev);
> struct device *mdev_dev(struct mdev_device *mdev);
> struct mdev_device *mdev_from_dev(struct device *dev);
>
> +enum {
> + MDEV_ID_VFIO = 1,
> + /* New entries must be added here */
> +};
> +
> #endif /* MDEV_H */
> diff --git a/inclu...
2019 Sep 12
0
[RFC PATCH 1/2] mdev: device id support
...ct device *dev, const struct mdev_parent_ops *ops);
+int mdev_register_vfio_device(struct device *dev, const struct mdev_parent_ops *ops);
void mdev_unregister_device(struct device *dev);
int mdev_register_driver(struct mdev_driver *drv, struct module *owner);
@@ -145,4 +147,6 @@ struct device *mdev_parent_dev(struct mdev_device *mdev);
struct device *mdev_dev(struct mdev_device *mdev);
struct mdev_device *mdev_from_dev(struct device *dev);
+#define MDEV_ID_VFIO 1 /* VFIO device */
+
#endif /* MDEV_H */
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 5714fd35a83c...
2019 Sep 24
0
[PATCH V2 2/8] mdev: class id support
...void *mdev_get_drvdata(struct mdev_device *mdev);
void mdev_set_drvdata(struct mdev_device *mdev, void *data);
+void mdev_set_class_id(struct mdev_device *mdev, u16 id);
const guid_t *mdev_uuid(struct mdev_device *mdev);
extern struct bus_type mdev_bus_type;
@@ -145,4 +148,9 @@ struct device *mdev_parent_dev(struct mdev_device *mdev);
struct device *mdev_dev(struct mdev_device *mdev);
struct mdev_device *mdev_from_dev(struct device *dev);
+enum {
+ MDEV_ID_VFIO = 1,
+ /* New entries must be added here */
+};
+
#endif /* MDEV_H */
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_dev...
2019 Nov 05
0
[PATCH V8 1/6] mdev: class id support
...void *mdev_get_drvdata(struct mdev_device *mdev);
void mdev_set_drvdata(struct mdev_device *mdev, void *data);
const guid_t *mdev_uuid(struct mdev_device *mdev);
+void mdev_set_class(struct mdev_device *mdev, u16 id);
extern struct bus_type mdev_bus_type;
@@ -145,4 +148,9 @@ struct device *mdev_parent_dev(struct mdev_device *mdev);
struct device *mdev_dev(struct mdev_device *mdev);
struct mdev_device *mdev_from_dev(struct device *dev);
+enum {
+ MDEV_CLASS_ID_VFIO = 1,
+ /* New entries must be added here */
+};
+
#endif /* MDEV_H */
diff --git a/include/linux/mod_devicetable.h b/include/linux/m...
2019 Nov 04
0
[PATCH V7 1/6] mdev: class id support
...void *mdev_get_drvdata(struct mdev_device *mdev);
void mdev_set_drvdata(struct mdev_device *mdev, void *data);
const guid_t *mdev_uuid(struct mdev_device *mdev);
+void mdev_set_class(struct mdev_device *mdev, u16 id);
extern struct bus_type mdev_bus_type;
@@ -145,4 +148,9 @@ struct device *mdev_parent_dev(struct mdev_device *mdev);
struct device *mdev_dev(struct mdev_device *mdev);
struct mdev_device *mdev_from_dev(struct device *dev);
+enum {
+ MDEV_CLASS_ID_VFIO = 1,
+ /* New entries must be added here */
+};
+
#endif /* MDEV_H */
diff --git a/include/linux/mod_devicetable.h b/include/linux/m...
2019 Oct 11
0
[PATCH V3 1/7] mdev: class id support
...void *mdev_get_drvdata(struct mdev_device *mdev);
void mdev_set_drvdata(struct mdev_device *mdev, void *data);
+void mdev_set_class(struct mdev_device *mdev, u16 id);
const guid_t *mdev_uuid(struct mdev_device *mdev);
extern struct bus_type mdev_bus_type;
@@ -145,4 +148,9 @@ struct device *mdev_parent_dev(struct mdev_device *mdev);
struct device *mdev_dev(struct mdev_device *mdev);
struct mdev_device *mdev_from_dev(struct device *dev);
+enum {
+ MDEV_ID_VFIO = 1,
+ /* New entries must be added here */
+};
+
#endif /* MDEV_H */
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_dev...
2019 Oct 23
0
[PATCH V5 1/6] mdev: class id support
...void *mdev_get_drvdata(struct mdev_device *mdev);
void mdev_set_drvdata(struct mdev_device *mdev, void *data);
const guid_t *mdev_uuid(struct mdev_device *mdev);
+void mdev_set_class(struct mdev_device *mdev, u16 id);
extern struct bus_type mdev_bus_type;
@@ -145,4 +148,9 @@ struct device *mdev_parent_dev(struct mdev_device *mdev);
struct device *mdev_dev(struct mdev_device *mdev);
struct mdev_device *mdev_from_dev(struct device *dev);
+enum {
+ MDEV_CLASS_ID_VFIO = 1,
+ /* New entries must be added here */
+};
+
#endif /* MDEV_H */
diff --git a/include/linux/mod_devicetable.h b/include/linux/m...
2019 Sep 23
0
[PATCH 1/6] mdev: class id support
...*dev, const struct mdev_parent_ops *ops);
+int mdev_register_vfio_device(struct device *dev,
+ const struct mdev_parent_ops *ops);
void mdev_unregister_device(struct device *dev);
int mdev_register_driver(struct mdev_driver *drv, struct module *owner);
@@ -145,4 +148,6 @@ struct device *mdev_parent_dev(struct mdev_device *mdev);
struct device *mdev_dev(struct mdev_device *mdev);
struct mdev_device *mdev_from_dev(struct device *dev);
+#define MDEV_ID_VFIO 1 /* VFIO device */
+
#endif /* MDEV_H */
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 5714fd35a83c...
2019 Oct 24
0
[PATCH V5 1/6] mdev: class id support
...mdev_set_drvdata(struct mdev_device *mdev, void *data);
>> const guid_t *mdev_uuid(struct mdev_device *mdev);
>> +void mdev_set_class(struct mdev_device *mdev, u16 id);
>>
>> extern struct bus_type mdev_bus_type;
>>
>> @@ -145,4 +148,9 @@ struct device *mdev_parent_dev(struct mdev_device *mdev);
>> struct device *mdev_dev(struct mdev_device *mdev);
>> struct mdev_device *mdev_from_dev(struct device *dev);
>>
>> +enum {
>> + MDEV_CLASS_ID_VFIO = 1,
>> + /* New entries must be added here */
>> +};
>> +
>>...
2019 Oct 23
2
[PATCH V5 1/6] mdev: class id support
...v_device *mdev);
> void mdev_set_drvdata(struct mdev_device *mdev, void *data);
> const guid_t *mdev_uuid(struct mdev_device *mdev);
> +void mdev_set_class(struct mdev_device *mdev, u16 id);
>
> extern struct bus_type mdev_bus_type;
>
> @@ -145,4 +148,9 @@ struct device *mdev_parent_dev(struct mdev_device *mdev);
> struct device *mdev_dev(struct mdev_device *mdev);
> struct mdev_device *mdev_from_dev(struct device *dev);
>
> +enum {
> + MDEV_CLASS_ID_VFIO = 1,
> + /* New entries must be added here */
> +};
> +
> #endif /* MDEV_H */
> diff --git a...
2019 Oct 23
2
[PATCH V5 1/6] mdev: class id support
...v_device *mdev);
> void mdev_set_drvdata(struct mdev_device *mdev, void *data);
> const guid_t *mdev_uuid(struct mdev_device *mdev);
> +void mdev_set_class(struct mdev_device *mdev, u16 id);
>
> extern struct bus_type mdev_bus_type;
>
> @@ -145,4 +148,9 @@ struct device *mdev_parent_dev(struct mdev_device *mdev);
> struct device *mdev_dev(struct mdev_device *mdev);
> struct mdev_device *mdev_from_dev(struct device *dev);
>
> +enum {
> + MDEV_CLASS_ID_VFIO = 1,
> + /* New entries must be added here */
> +};
> +
> #endif /* MDEV_H */
> diff --git a...
2019 Oct 16
0
[PATCH V3 1/7] mdev: class id support
...>> +void mdev_set_class(struct mdev_device *mdev, u16 id);
> Better to insert new API after mdev_uuid().
Ok.
Thanks
>
>> const guid_t *mdev_uuid(struct mdev_device *mdev);
>>
>> extern struct bus_type mdev_bus_type;
>> @@ -145,4 +148,9 @@ struct device *mdev_parent_dev(struct mdev_device
>> *mdev); struct device *mdev_dev(struct mdev_device *mdev); struct
>> mdev_device *mdev_from_dev(struct device *dev);
>>
>> +enum {
>> + MDEV_ID_VFIO = 1,
>> + /* New entries must be added here */
>> +};
>> +
>> #endif /...
2019 Sep 24
0
[PATCH 1/6] mdev: class id support
...int mdev_register_vfio_device(struct device *dev,
>> + const struct mdev_parent_ops *ops);
>> void mdev_unregister_device(struct device *dev);
>>
>> int mdev_register_driver(struct mdev_driver *drv, struct module *owner);
>> @@ -145,4 +148,6 @@ struct device *mdev_parent_dev(struct mdev_device
>> *mdev); struct device *mdev_dev(struct mdev_device *mdev); struct
>> mdev_device *mdev_from_dev(struct device *dev);
>>
>> +#define MDEV_ID_VFIO 1 /* VFIO device */
>> +
> Instead of define, please put them as enum
>
> enum mdev_class/...
2019 Sep 25
1
[PATCH V2 2/8] mdev: class id support
...t mdev_device *mdev);
> void mdev_set_drvdata(struct mdev_device *mdev, void *data);
> +void mdev_set_class_id(struct mdev_device *mdev, u16 id);
> const guid_t *mdev_uuid(struct mdev_device *mdev);
>
> extern struct bus_type mdev_bus_type;
> @@ -145,4 +148,9 @@ struct device *mdev_parent_dev(struct
> mdev_device *mdev);
> struct device *mdev_dev(struct mdev_device *mdev);
> struct mdev_device *mdev_from_dev(struct device *dev);
>
> +enum {
> + MDEV_ID_VFIO = 1,
> + /* New entries must be added here */
> +};
> +
> #endif /* MDEV_H */
> diff --git a/i...