> -----Original Message----- > From: Jason Gunthorpe <jgg@xxxxxxxx> > Sent: Tuesday, April 21, 2020 5:09 AM > To: Kirsher, Jeffrey T <jeffrey.t.kirsher@xxxxxxxxx> > Cc: davem@xxxxxxxxxxxxx; gregkh@xxxxxxxxxxxxxxxxxxx; Ertman, David M > <david.m.ertman@xxxxxxxxx>; netdev@xxxxxxxxxxxxxxx; linux- > rdma@xxxxxxxxxxxxxxx; nhorman@xxxxxxxxxx; sassmann@xxxxxxxxxx; > parav@xxxxxxxxxxxx; galpress@xxxxxxxxxx; > selvin.xavier@xxxxxxxxxxxx; sriharsha.basavapatna@xxxxxxxxxxxx; > benve@xxxxxxxxx; bharat@xxxxxxxxxxx; xavier.huwei@xxxxxxxxxx; > yishaih@xxxxxxxxxxxx; leonro@xxxxxxxxxxxx; mkalderon@xxxxxxxxxxx; > aditr@xxxxxxxxxx; ranjani.sridharan@xxxxxxxxxxxxxxx; pierre- > louis.bossart@xxxxxxxxxxxxxxx; Patil, Kiran <kiran.patil@xxxxxxxxx>; Bowers, > AndrewX <andrewx.bowers@xxxxxxxxx> > 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 Fix should be in the next revision - sorry for the confusion. -DaveE