search for: kobj

Displaying 20 results from an estimated 399 matches for "kobj".

2023 Mar 20
1
[RESEND, PATCH v2 01/10] kobject: introduce kobject_del_and_put()
There are plenty of using kobject_del() and kobject_put() together in the kernel tree. This patch wraps these two calls in a single helper. Signed-off-by: Yangtao Li <frank.li at vivo.com> --- v2: -add kobject_del_and_put() users resend patchset to gregkh, Rafael and Damien include/linux/kobject.h | 1 + lib/kobject.c...
2023 Mar 22
3
[PATCH v3 01/10] kobject: introduce kobject_del_and_put()
There are plenty of using kobject_del() and kobject_put() together in the kernel tree. This patch wraps these two calls in a single helper. Signed-off-by: Yangtao Li <frank.li at vivo.com> --- v3: -convert to inline helper v2: -add kobject_del_and_put() users include/linux/kobject.h | 13 +++++++++++++ lib/kobject.c...
2011 Jan 05
3
[PATCH] virtio-pci: add softlinks between virtio and pci
...ODULE_AUTHOR("Anthony Liguori <aliguori at us.ibm.com>"); MODULE_DESCRIPTION("virtio-pci"); @@ -667,8 +668,21 @@ static int __devinit virtio_pci_probe(struct pci_dev *pci_dev, if (err) goto out_set_drvdata; - return 0; + err = sysfs_create_link(&pci_dev->dev.kobj, &vp_dev->vdev.dev.kobj, + "virtio_device"); + if (err) + goto out_register_device; + + err = sysfs_create_link(&vp_dev->vdev.dev.kobj, &pci_dev->dev.kobj, + "bus_device"); + if (err) + goto out_create_link; + return 0; +out_create_link: + sysfs_re...
2011 Jan 05
3
[PATCH] virtio-pci: add softlinks between virtio and pci
...ODULE_AUTHOR("Anthony Liguori <aliguori at us.ibm.com>"); MODULE_DESCRIPTION("virtio-pci"); @@ -667,8 +668,21 @@ static int __devinit virtio_pci_probe(struct pci_dev *pci_dev, if (err) goto out_set_drvdata; - return 0; + err = sysfs_create_link(&pci_dev->dev.kobj, &vp_dev->vdev.dev.kobj, + "virtio_device"); + if (err) + goto out_register_device; + + err = sysfs_create_link(&vp_dev->vdev.dev.kobj, &pci_dev->dev.kobj, + "bus_device"); + if (err) + goto out_create_link; + return 0; +out_create_link: + sysfs_re...
2008 Sep 27
0
[PATCH 4/9] dom0 PCI: support SR-IOV capability
...+ +#include <linux/ctype.h> +#include <linux/string.h> +#include <linux/pci.h> +#include <linux/delay.h> +#include <asm/page.h> +#include "pci.h" + +#define VF_NAME_LEN 8 + + +struct iov_attr { + struct attribute attr; + ssize_t (*show)(struct kobject *, + struct iov_attr *, char *); + ssize_t (*store)(struct kobject *, + struct iov_attr *, const char *, size_t); +}; + +#define iov_config_attr(field) \ +static ssize_t field##_show(struct kobject *kobj,...
2008 Sep 27
3
[PATCH 4/6 v3] PCI: support SR-IOV capability
...+ +#include <linux/ctype.h> +#include <linux/string.h> +#include <linux/pci.h> +#include <linux/delay.h> +#include <asm/page.h> +#include "pci.h" + +#define VF_NAME_LEN 8 + + +struct iov_attr { + struct attribute attr; + ssize_t (*show)(struct kobject *, + struct iov_attr *, char *); + ssize_t (*store)(struct kobject *, + struct iov_attr *, const char *, size_t); +}; + +#define iov_config_attr(field) \ +static ssize_t field##_show(struct kobject *kobj,...
2008 Sep 27
3
[PATCH 4/6 v3] PCI: support SR-IOV capability
...+ +#include <linux/ctype.h> +#include <linux/string.h> +#include <linux/pci.h> +#include <linux/delay.h> +#include <asm/page.h> +#include "pci.h" + +#define VF_NAME_LEN 8 + + +struct iov_attr { + struct attribute attr; + ssize_t (*show)(struct kobject *, + struct iov_attr *, char *); + ssize_t (*store)(struct kobject *, + struct iov_attr *, const char *, size_t); +}; + +#define iov_config_attr(field) \ +static ssize_t field##_show(struct kobject *kobj,...
2016 Oct 25
1
[PATCH 3/3] hwmon: expose power_max and power_crit
...ttrs = hwmon_power_caps_attributes, > +}; > #endif > > int > @@ -728,8 +763,16 @@ nouveau_hwmon_init(struct drm_device *dev) > if (iccsense && iccsense->data_valid && !list_empty(&iccsense->rails)) { > ret = sysfs_create_group(&hwmon_dev->kobj, > &hwmon_power_attrgroup); > + > if (ret) > goto error; > + > + if (iccsense->power_w_max && iccsense->power_w_crit) { > + ret = sysfs_create_group(&hwmon_dev->kobj, > + &hwmon_power_caps_attrgroup); > + if (ret) >...
2014 Jan 16
0
[PATCH net-next v3 4/5] net-sysfs: add support for device-specific rx queue sysfs attributes
...ice *dev, u16 rxq_index, u32 flow_id, u16 filter_id); #endif +#endif /* CONFIG_RPS */ /* This structure contains an instance of an RX queue. */ struct netdev_rx_queue { +#ifdef CONFIG_RPS struct rps_map __rcu *rps_map; struct rps_dev_flow_table __rcu *rps_flow_table; +#endif struct kobject kobj; struct net_device *dev; } ____cacheline_aligned_in_smp; -#endif /* CONFIG_RPS */ + +/* + * RX queue sysfs structures and functions. + */ +struct rx_queue_attribute { + struct attribute attr; + ssize_t (*show)(struct netdev_rx_queue *queue, + struct rx_queue_attribute *attr, char...
2014 Jan 16
0
[PATCH net-next v4 4/6] net-sysfs: add support for device-specific rx queue sysfs attributes
...ice *dev, u16 rxq_index, u32 flow_id, u16 filter_id); #endif +#endif /* CONFIG_RPS */ /* This structure contains an instance of an RX queue. */ struct netdev_rx_queue { +#ifdef CONFIG_RPS struct rps_map __rcu *rps_map; struct rps_dev_flow_table __rcu *rps_flow_table; +#endif struct kobject kobj; struct net_device *dev; } ____cacheline_aligned_in_smp; -#endif /* CONFIG_RPS */ + +/* + * RX queue sysfs structures and functions. + */ +struct rx_queue_attribute { + struct attribute attr; + ssize_t (*show)(struct netdev_rx_queue *queue, + struct rx_queue_attribute *attr, char...
2014 Mar 19
1
[PATCH] virtio-blk: make the queue depth configurable
Couple more bikesheddy things: Is there ever a reason to use a non __builtin_const_p(perms)? Maybe that should be a BUILD_BUG_ON too BUILD_BUG_ON(!builtin_const_p_perms) My brain of little size gets confused by the BUILD_BUG_ON_ZERO(foo) + vs BUILD_BUG_ON(foo); as it just seems like more text for the same content. Is there any value on the "_ZERO(foo) +" I don't understand?
2014 Mar 19
1
[PATCH] virtio-blk: make the queue depth configurable
Couple more bikesheddy things: Is there ever a reason to use a non __builtin_const_p(perms)? Maybe that should be a BUILD_BUG_ON too BUILD_BUG_ON(!builtin_const_p_perms) My brain of little size gets confused by the BUILD_BUG_ON_ZERO(foo) + vs BUILD_BUG_ON(foo); as it just seems like more text for the same content. Is there any value on the "_ZERO(foo) +" I don't understand?
2008 Oct 14
8
[PATCH 0/8 v4] PCI: Linux kernel SR-IOV support
Greetings, Following patches are intended to support SR-IOV capability in the Linux kernel. With these patches, people can turn a PCI device with the capability into multiple ones from software perspective, which will benefit KVM and achieve other purposes such as QoS, security, and etc. [PATCH 1/8 v4] PCI: define PCI resource names in a 'enum' [PATCH 2/8 v4] PCI: export __pci_read_base
2008 Oct 14
8
[PATCH 0/8 v4] PCI: Linux kernel SR-IOV support
Greetings, Following patches are intended to support SR-IOV capability in the Linux kernel. With these patches, people can turn a PCI device with the capability into multiple ones from software perspective, which will benefit KVM and achieve other purposes such as QoS, security, and etc. [PATCH 1/8 v4] PCI: define PCI resource names in a 'enum' [PATCH 2/8 v4] PCI: export __pci_read_base
2016 Oct 24
0
[PATCH 3/3] hwmon: expose power_max and power_crit
...mon_power_caps_attrgroup = { + .attrs = hwmon_power_caps_attributes, +}; #endif int @@ -728,8 +763,16 @@ nouveau_hwmon_init(struct drm_device *dev) if (iccsense && iccsense->data_valid && !list_empty(&iccsense->rails)) { ret = sysfs_create_group(&hwmon_dev->kobj, &hwmon_power_attrgroup); + if (ret) goto error; + + if (iccsense->power_w_max && iccsense->power_w_crit) { + ret = sysfs_create_group(&hwmon_dev->kobj, + &hwmon_power_caps_attrgroup); + if (ret) + goto error; + } } hwmon->hwmon = h...
2013 Oct 09
1
[PATCH] kobject: show debug info on delayed kobject release
Useful for locating buggy drivers on kernel oops. It may add dozens of new lines to boot dmesg. DEBUG_KOBJECT_RELEASE is hopefully only enabled in debug kernels (like maybe the Fedora rawhide one, or at developers), so being a bit more verbose is likely ok. CC: Russell King - ARM Linux <linux@arm.linux.org.uk> CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Fengguang Wu &...
2019 Sep 24
3
[PATCH V2 5/8] mdev: introduce device specific ops
...e <linux/nospec.h> > @@ -643,6 +644,8 @@ static void kvmgt_put_vfio_device(void *vgpu) > vfio_device_put(((struct intel_vgpu *)vgpu)->vdev.vfio_device); > } > > +static struct vfio_mdev_device_ops intel_vfio_vgpu_dev_ops; > + > static int intel_vgpu_create(struct kobject *kobj, struct mdev_device *mdev) > { > struct intel_vgpu *vgpu = NULL; > @@ -679,6 +682,7 @@ static int intel_vgpu_create(struct kobject *kobj, struct mdev_device *mdev) > ret = 0; > > mdev_set_class_id(mdev, MDEV_ID_VFIO); > + mdev_set_dev_ops(mdev, &intel_vfio...
2019 Sep 24
3
[PATCH V2 5/8] mdev: introduce device specific ops
...e <linux/nospec.h> > @@ -643,6 +644,8 @@ static void kvmgt_put_vfio_device(void *vgpu) > vfio_device_put(((struct intel_vgpu *)vgpu)->vdev.vfio_device); > } > > +static struct vfio_mdev_device_ops intel_vfio_vgpu_dev_ops; > + > static int intel_vgpu_create(struct kobject *kobj, struct mdev_device *mdev) > { > struct intel_vgpu *vgpu = NULL; > @@ -679,6 +682,7 @@ static int intel_vgpu_create(struct kobject *kobj, struct mdev_device *mdev) > ret = 0; > > mdev_set_class_id(mdev, MDEV_ID_VFIO); > + mdev_set_dev_ops(mdev, &intel_vfio...
2008 Feb 04
2
[PATCH 0/2] Move /sys/o2cb to /sys/fs/o2cb
Hi Greg, The following two patches move /sys/o2cb into /sys/fs/o2cb as we previously discussed. A symlink is created to maintain compatibility with existing versions of ocfs2-tools. A patch to automatically search /sys/fs/o2cb has been committed to the ocfs2-tools repo and a release with that code shouldn't be too far out. Old versions of ocfs2-tools have been tested and work fine with the
2019 Sep 24
0
[PATCH V2 5/8] mdev: introduce device specific ops
...<linux/debugfs.h> #include <linux/nospec.h> @@ -643,6 +644,8 @@ static void kvmgt_put_vfio_device(void *vgpu) vfio_device_put(((struct intel_vgpu *)vgpu)->vdev.vfio_device); } +static struct vfio_mdev_device_ops intel_vfio_vgpu_dev_ops; + static int intel_vgpu_create(struct kobject *kobj, struct mdev_device *mdev) { struct intel_vgpu *vgpu = NULL; @@ -679,6 +682,7 @@ static int intel_vgpu_create(struct kobject *kobj, struct mdev_device *mdev) ret = 0; mdev_set_class_id(mdev, MDEV_ID_VFIO); + mdev_set_dev_ops(mdev, &intel_vfio_vgpu_dev_ops); out: return ret;...