Displaying 20 results from an estimated 157 matches for "err_free".
2012 Dec 26
5
[RFC PATCH] virtio-net: reset virtqueue affinity when doing cpu hotplug
...virtnet_del_vqs(struct virtnet_info *vi)
{
struct virtio_device *vdev = vi->vdev;
+ unregister_hotcpu_notifier(&virtnet_cpu_notifier);
+
virtnet_set_affinity(vi, false);
vdev->config->del_vqs(vdev);
@@ -1372,6 +1404,11 @@ static int init_vqs(struct virtnet_info *vi)
goto err_free;
virtnet_set_affinity(vi, true);
+
+ ret = register_hotcpu_notifier(&virtnet_cpu_notifier);
+ if (ret)
+ goto err_free;
+
return 0;
err_free:
--
1.8.0
2012 Dec 26
5
[RFC PATCH] virtio-net: reset virtqueue affinity when doing cpu hotplug
...virtnet_del_vqs(struct virtnet_info *vi)
{
struct virtio_device *vdev = vi->vdev;
+ unregister_hotcpu_notifier(&virtnet_cpu_notifier);
+
virtnet_set_affinity(vi, false);
vdev->config->del_vqs(vdev);
@@ -1372,6 +1404,11 @@ static int init_vqs(struct virtnet_info *vi)
goto err_free;
virtnet_set_affinity(vi, true);
+
+ ret = register_hotcpu_notifier(&virtnet_cpu_notifier);
+ if (ret)
+ goto err_free;
+
return 0;
err_free:
--
1.8.0
2018 Nov 23
2
[PATCH] drm/nouveau: tegra: Call nouveau_drm_device_init()
...drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 2b2baf6e0e0d..d2928d43f29a 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -1171,10 +1171,16 @@ nouveau_platform_device_create(const struct nvkm_device_tegra_func *func,
goto err_free;
}
+ err = nouveau_drm_device_init(drm);
+ if (err)
+ goto err_put;
+
platform_set_drvdata(pdev, drm);
return drm;
+err_put:
+ drm_dev_put(drm);
err_free:
nvkm_device_del(pdevice);
--
2.19.1
2020 Aug 21
0
[PATCH v3 5/6] iommu/virtio: Support topology description in config space
...io_iommu_topo_mmio mmio;
+ } __iomem *cfg = buf;
+ struct virt_topo_endpoint *spec;
+
+ spec = kzalloc(sizeof(*spec), GFP_KERNEL);
+ if (!spec)
+ return ERR_PTR(-ENOMEM);
+
+ switch (ioread8(&cfg->hdr.type)) {
+ case VIRTIO_IOMMU_TOPO_PCI_RANGE:
+ if (len < sizeof(cfg->pci))
+ goto err_free;
+
+ spec->dev_id.type = VIRT_TOPO_DEV_TYPE_PCI;
+ spec->dev_id.segment = ioread16(&cfg->pci.segment);
+ spec->dev_id.bdf_start = ioread16(&cfg->pci.bdf_start);
+ spec->dev_id.bdf_end = ioread16(&cfg->pci.bdf_end);
+ spec->endpoint_id = ioread32(&cfg->...
2020 Sep 04
1
[PATCH v3 5/6] iommu/virtio: Support topology description in config space
...gt; + struct virt_topo_endpoint *spec;
> +
> + spec = kzalloc(sizeof(*spec), GFP_KERNEL);
> + if (!spec)
> + return ERR_PTR(-ENOMEM);
> +
> + switch (ioread8(&cfg->hdr.type)) {
> + case VIRTIO_IOMMU_TOPO_PCI_RANGE:
> + if (len < sizeof(cfg->pci))
> + goto err_free;
> +
> + spec->dev_id.type = VIRT_TOPO_DEV_TYPE_PCI;
> + spec->dev_id.segment = ioread16(&cfg->pci.segment);
> + spec->dev_id.bdf_start = ioread16(&cfg->pci.bdf_start);
> + spec->dev_id.bdf_end = ioread16(&cfg->pci.bdf_end);
> + spec->endpo...
2020 Nov 06
2
[PATCH 2/3] drm/nouveau: manage nouveau_drm lifetime with devres
...; + struct drm_device *drm_dev;
> int err;
>
> err = nvkm_device_tegra_new(func, pdev, nouveau_config, nouveau_debug,
> @@ -1293,22 +1288,21 @@ nouveau_platform_device_create(const struct nvkm_device_tegra_func *func,
> if (err)
> goto err_free;
>
> - drm = drm_dev_alloc(&driver_platform, &pdev->dev);
> - if (IS_ERR(drm)) {
> - err = PTR_ERR(drm);
> + nv_dev = devm_drm_dev_alloc(&pdev->dev, &driver_platform, typeof(*nv_dev), drm_dev);
> + if (IS_ERR(nv_dev)) {
&...
2020 Nov 06
0
[PATCH 2/3] drm/nouveau: manage nouveau_drm lifetime with devres
...device)
{
- struct drm_device *drm;
+ struct nouveau_drm *nv_dev;
+ struct drm_device *drm_dev;
int err;
err = nvkm_device_tegra_new(func, pdev, nouveau_config, nouveau_debug,
@@ -1293,22 +1288,21 @@ nouveau_platform_device_create(const struct nvkm_device_tegra_func *func,
if (err)
goto err_free;
- drm = drm_dev_alloc(&driver_platform, &pdev->dev);
- if (IS_ERR(drm)) {
- err = PTR_ERR(drm);
+ nv_dev = devm_drm_dev_alloc(&pdev->dev, &driver_platform, typeof(*nv_dev), drm_dev);
+ if (IS_ERR(nv_dev)) {
+ err = PTR_ERR(nv_dev);
goto err_free;
}
+ drm_dev = nouvea...
2013 Jan 18
3
[PATCH V5 1/2] virtio-net: fix the set affinity bug when CPU IDs are not consecutive
...void virtnet_del_vqs(struct virtnet_info *vi)
{
struct virtio_device *vdev = vi->vdev;
+ get_online_cpus();
virtnet_set_affinity(vi, false);
+ put_online_cpus();
vdev->config->del_vqs(vdev);
@@ -1371,7 +1399,10 @@ static int init_vqs(struct virtnet_info *vi)
if (ret)
goto err_free;
+ get_online_cpus();
virtnet_set_affinity(vi, true);
+ put_online_cpus();
+
return 0;
err_free:
@@ -1453,6 +1484,10 @@ static int virtnet_probe(struct virtio_device *vdev)
if (vi->stats == NULL)
goto free;
+ vi->vq_index = alloc_percpu(int);
+ if (vi->vq_index == NULL)
+...
2013 Jan 18
3
[PATCH V5 1/2] virtio-net: fix the set affinity bug when CPU IDs are not consecutive
...void virtnet_del_vqs(struct virtnet_info *vi)
{
struct virtio_device *vdev = vi->vdev;
+ get_online_cpus();
virtnet_set_affinity(vi, false);
+ put_online_cpus();
vdev->config->del_vqs(vdev);
@@ -1371,7 +1399,10 @@ static int init_vqs(struct virtnet_info *vi)
if (ret)
goto err_free;
+ get_online_cpus();
virtnet_set_affinity(vi, true);
+ put_online_cpus();
+
return 0;
err_free:
@@ -1453,6 +1484,10 @@ static int virtnet_probe(struct virtio_device *vdev)
if (vi->stats == NULL)
goto free;
+ vi->vq_index = alloc_percpu(int);
+ if (vi->vq_index == NULL)
+...
2013 Oct 25
2
[PATCH] vhost/scsi: Fix incorrect usage of get_user_pages_fast write parameter
...q)
if (data_direction != DMA_NONE) {
ret = vhost_scsi_map_iov_to_sgl(cmd,
&vq->iov[data_first], data_num,
- data_direction == DMA_TO_DEVICE);
+ data_direction == DMA_FROM_DEVICE);
if (unlikely(ret)) {
vq_err(vq, "Failed to map iov to sgl\n");
goto err_free;
--
1.7.2.5
2013 Oct 25
2
[PATCH] vhost/scsi: Fix incorrect usage of get_user_pages_fast write parameter
...q)
if (data_direction != DMA_NONE) {
ret = vhost_scsi_map_iov_to_sgl(cmd,
&vq->iov[data_first], data_num,
- data_direction == DMA_TO_DEVICE);
+ data_direction == DMA_FROM_DEVICE);
if (unlikely(ret)) {
vq_err(vq, "Failed to map iov to sgl\n");
goto err_free;
--
1.7.2.5
2013 Jan 21
6
[PATCH V6 1/3] virtio-net: fix the set affinity bug when CPU IDs are not consecutive
...q = skb_get_rx_queue(skb);
+ } else {
+ txq = *__this_cpu_ptr(vi->vq_index);
+ if (txq == -1)
+ txq = 0;
+ }
while (unlikely(txq >= dev->real_num_tx_queues))
txq -= dev->real_num_tx_queues;
@@ -1371,7 +1397,10 @@ static int init_vqs(struct virtnet_info *vi)
if (ret)
goto err_free;
+ get_online_cpus();
virtnet_set_affinity(vi, true);
+ put_online_cpus();
+
return 0;
err_free:
@@ -1453,6 +1482,10 @@ static int virtnet_probe(struct virtio_device *vdev)
if (vi->stats == NULL)
goto free;
+ vi->vq_index = alloc_percpu(int);
+ if (vi->vq_index == NULL)
+...
2013 Jan 21
6
[PATCH V6 1/3] virtio-net: fix the set affinity bug when CPU IDs are not consecutive
...q = skb_get_rx_queue(skb);
+ } else {
+ txq = *__this_cpu_ptr(vi->vq_index);
+ if (txq == -1)
+ txq = 0;
+ }
while (unlikely(txq >= dev->real_num_tx_queues))
txq -= dev->real_num_tx_queues;
@@ -1371,7 +1397,10 @@ static int init_vqs(struct virtnet_info *vi)
if (ret)
goto err_free;
+ get_online_cpus();
virtnet_set_affinity(vi, true);
+ put_online_cpus();
+
return 0;
err_free:
@@ -1453,6 +1482,10 @@ static int virtnet_probe(struct virtio_device *vdev)
if (vi->stats == NULL)
goto free;
+ vi->vq_index = alloc_percpu(int);
+ if (vi->vq_index == NULL)
+...
2013 Jan 25
4
[PATCH V7 1/3] virtio-net: fix the set affinity bug when CPU IDs are not consecutive
...q = skb_get_rx_queue(skb);
+ } else {
+ txq = *__this_cpu_ptr(vi->vq_index);
+ if (txq == -1)
+ txq = 0;
+ }
while (unlikely(txq >= dev->real_num_tx_queues))
txq -= dev->real_num_tx_queues;
@@ -1371,7 +1397,10 @@ static int init_vqs(struct virtnet_info *vi)
if (ret)
goto err_free;
+ get_online_cpus();
virtnet_set_affinity(vi, true);
+ put_online_cpus();
+
return 0;
err_free:
@@ -1453,6 +1482,10 @@ static int virtnet_probe(struct virtio_device *vdev)
if (vi->stats == NULL)
goto free;
+ vi->vq_index = alloc_percpu(int);
+ if (vi->vq_index == NULL)
+...
2013 Jan 25
4
[PATCH V7 1/3] virtio-net: fix the set affinity bug when CPU IDs are not consecutive
...q = skb_get_rx_queue(skb);
+ } else {
+ txq = *__this_cpu_ptr(vi->vq_index);
+ if (txq == -1)
+ txq = 0;
+ }
while (unlikely(txq >= dev->real_num_tx_queues))
txq -= dev->real_num_tx_queues;
@@ -1371,7 +1397,10 @@ static int init_vqs(struct virtnet_info *vi)
if (ret)
goto err_free;
+ get_online_cpus();
virtnet_set_affinity(vi, true);
+ put_online_cpus();
+
return 0;
err_free:
@@ -1453,6 +1482,10 @@ static int virtnet_probe(struct virtio_device *vdev)
if (vi->stats == NULL)
goto free;
+ vi->vq_index = alloc_percpu(int);
+ if (vi->vq_index == NULL)
+...
2020 Aug 21
17
[PATCH v3 0/6] Add virtio-iommu built-in topology
Add a topology description to the virtio-iommu driver and enable x86
platforms.
Since [v2] we have made some progress on adding ACPI support for
virtio-iommu, which is the preferred boot method on x86. It will be a
new vendor-agnostic table describing para-virtual topologies in a
minimal format. However some platforms don't use either ACPI or DT for
booting (for example microvm), and will
2020 Aug 21
17
[PATCH v3 0/6] Add virtio-iommu built-in topology
Add a topology description to the virtio-iommu driver and enable x86
platforms.
Since [v2] we have made some progress on adding ACPI support for
virtio-iommu, which is the preferred boot method on x86. It will be a
new vendor-agnostic table describing para-virtual topologies in a
minimal format. However some platforms don't use either ACPI or DT for
booting (for example microvm), and will
2018 Apr 26
0
[Intel-gfx] [PATCH] drm/core: Remove drm_dev_unref() and it's uses
...amd/amdgpu/amdgpu_drv.c
> index 0b19482b36b8..5fb455febeba 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -647,7 +647,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
> err_pci:
> pci_disable_device(pdev);
> err_free:
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
> return ret;
> }
>
> @@ -657,7 +657,7 @@ amdgpu_pci_remove(struct pci_dev *pdev)
> struct drm_device *dev = pci_get_drvdata(pdev);
>
> drm_dev_unregister(dev);
> - drm_dev_unref(dev);
> + drm_dev_put(dev);
&...
2018 Apr 26
5
[PATCH] drm/core: Remove drm_dev_unref() and it's uses
...gpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 0b19482b36b8..5fb455febeba 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -647,7 +647,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
err_pci:
pci_disable_device(pdev);
err_free:
- drm_dev_unref(dev);
+ drm_dev_put(dev);
return ret;
}
@@ -657,7 +657,7 @@ amdgpu_pci_remove(struct pci_dev *pdev)
struct drm_device *dev = pci_get_drvdata(pdev);
drm_dev_unregister(dev);
- drm_dev_unref(dev);
+ drm_dev_put(dev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL...
2018 Apr 26
5
[PATCH] drm/core: Remove drm_dev_unref() and it's uses
...gpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 0b19482b36b8..5fb455febeba 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -647,7 +647,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
err_pci:
pci_disable_device(pdev);
err_free:
- drm_dev_unref(dev);
+ drm_dev_put(dev);
return ret;
}
@@ -657,7 +657,7 @@ amdgpu_pci_remove(struct pci_dev *pdev)
struct drm_device *dev = pci_get_drvdata(pdev);
drm_dev_unregister(dev);
- drm_dev_unref(dev);
+ drm_dev_put(dev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL...