Re: [PATCH 09/10] IB/hfi1: Do not free hfi1 cdev parent structure early

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 19, 2016 at 12:31:00PM -0600, Jason Gunthorpe wrote:
On Thu, May 19, 2016 at 05:26:44AM -0700, Dennis Dalessandro wrote:
 static int hfi1_file_open(struct inode *inode, struct file *fp)
 {
+	struct hfi1_devdata *dd = container_of(inode->i_cdev,
+					       struct hfi1_devdata,
+					       user_cdev);
+
+	/* Just take a ref now. Not all opens result in a context assign */
+	kobject_get(&dd->kobj);

Eh?

If dd->kobj is passed as the parent to hfi1_cdev_init then cdev core
will do this for you, just confusing to duplicate it here??

I see your point. Will go ahead and remove it in the next version.

@@ -1007,6 +1009,15 @@ void hfi1_free_devdata(struct hfi1_devdata *dd)
 	rvt_dealloc_device(&dd->verbs_dev.rdi);

Hurm. How are you synchronizing pci device removal with ioctls on the
cdev?

This patch addresses the parent structure disappearing out from under the cdev. We are looking into if further work is needed around the pci device disappearing. I don't think there is anything specific to the ioctl changes though. In other words this is basically a port of write() to ioctl() so the same issues would be in both. Let me get back to you on this.

-Denny
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux