[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200421120848.GR26002@ziepe.ca>
Date: Tue, 21 Apr 2020 09:08:48 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Cc: davem@...emloft.net, gregkh@...uxfoundation.org,
Dave Ertman <david.m.ertman@...el.com>, netdev@...r.kernel.org,
linux-rdma@...r.kernel.org, nhorman@...hat.com,
sassmann@...hat.com, parav@...lanox.com, galpress@...zon.com,
selvin.xavier@...adcom.com, sriharsha.basavapatna@...adcom.com,
benve@...co.com, bharat@...lsio.com, xavier.huwei@...wei.com,
yishaih@...lanox.com, leonro@...lanox.com, mkalderon@...vell.com,
aditr@...are.com, ranjani.sridharan@...ux.intel.com,
pierre-louis.bossart@...ux.intel.com,
Kiran Patil <kiran.patil@...el.com>,
Andrew Bowers <andrewx.bowers@...el.com>
Subject: Re: [net-next v2 1/9] Implementation of Virtual Bus
On Tue, Apr 21, 2020 at 01:02:27AM -0700, Jeff Kirsher wrote:
> +/**
> + * virtbus_release_device - Destroy a virtbus device
> + * @_dev: device to release
> + */
> +static void virtbus_release_device(struct device *_dev)
> +{
> + struct virtbus_device *vdev = to_virtbus_dev(_dev);
> + int ida = vdev->id;
> +
> + vdev->release(vdev);
> + ida_simple_remove(&virtbus_dev_ida, ida);
> +}
> +
> +/**
> + * virtbus_register_device - add a virtual bus device
> + * @vdev: virtual bus device to add
> + */
> +int virtbus_register_device(struct virtbus_device *vdev)
> +{
> + int ret;
> +
> + if (!vdev->release) {
> + dev_err(&vdev->dev, "virtbus_device MUST have a .release callback that does something.\n");
> + return -EINVAL;
> + }
> +
> + /* Don't return on error here before the device_initialize.
> + * All error paths out of this function must perform a
> + * put_device(), unless the release callback does not exist,
> + * so that the .release() callback is called, and thus have
> + * to occur after the device_initialize.
> + */
> + device_initialize(&vdev->dev);
> +
> + vdev->dev.bus = &virtual_bus_type;
> + vdev->dev.release = virtbus_release_device;
> +
> + /* All device IDs are automatically allocated */
> + ret = ida_simple_get(&virtbus_dev_ida, 0, 0, GFP_KERNEL);
> +
> + if (ret < 0) {
> + dev_err(&vdev->dev, "get IDA idx for virtbus device failed!\n");
> + goto device_pre_err;
This still has the problem I described, why are you resending without
fixing?
Jason
Powered by blists - more mailing lists