Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1736142
| From | Boris Ostrovsky <boris.ostrovsky@oracle.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v4 02/13] xen/pvcalls: implement frontend disconnect |
| Date | 2017-09-20 23:10 +0200 |
| Message-ID | <urUpP-8nU-13@gated-at.bofh.it> (permalink) |
| References | <uq7Ud-1h7-3@gated-at.bofh.it> <uq7Ud-1h7-5@gated-at.bofh.it> <uq7Ue-1h7-23@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
>
> static int pvcalls_front_remove(struct xenbus_device *dev)
> {
> + struct pvcalls_bedata *bedata;
> + struct sock_mapping *map = NULL, *n;
> +
> + bedata = dev_get_drvdata(&pvcalls_front_dev->dev);
> + dev_set_drvdata(&dev->dev, NULL);
> + pvcalls_front_dev = NULL;
One more comment on this patch: should this be the last thing to do?
pvcalls_front_dev is what prevents pvcalls_front_probe() from proceeding
and even though I am not sure a probe can be initiated while we are here
perhaps moving this to the end would make things slightly safer.
-boris
> + if (bedata->irq >= 0)
> + unbind_from_irqhandler(bedata->irq, dev);
> +
> + smp_mb();
> + while (atomic_read(&pvcalls_refcount) > 0)
> + cpu_relax();
> + list_for_each_entry_safe(map, n, &bedata->socket_mappings, list) {
> + pvcalls_front_free_map(bedata, map);
> + kfree(map);
> + }
> + list_for_each_entry_safe(map, n, &bedata->socketpass_mappings, list) {
> + spin_lock(&bedata->socket_lock);
> + list_del_init(&map->list);
> + spin_unlock(&bedata->socket_lock);
> + kfree(map);
> + }
> + if (bedata->ref >= 0)
> + gnttab_end_foreign_access(bedata->ref, 0, 0);
> + kfree(bedata->ring.sring);
> + kfree(bedata);
> + xenbus_switch_state(dev, XenbusStateClosed);
> return 0;
> }
>
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v4 01/13] xen/pvcalls: introduce the pvcalls xenbus frontend Stefano Stabellini <sstabellini@kernel.org> - 2017-09-16 01:10 +0200
[PATCH v4 11/13] xen/pvcalls: implement poll command Stefano Stabellini <sstabellini@kernel.org> - 2017-09-16 01:10 +0200
Re: [PATCH v4 11/13] xen/pvcalls: implement poll command Andrea Parri <parri.andrea@gmail.com> - 2017-09-19 17:30 +0200
Re: [PATCH v4 11/13] xen/pvcalls: implement poll command Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-09-23 00:30 +0200
[PATCH v4 12/13] xen/pvcalls: implement release command Stefano Stabellini <sstabellini@kernel.org> - 2017-09-16 01:10 +0200
Re: [PATCH v4 12/13] xen/pvcalls: implement release command Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-09-23 00:50 +0200
Re: [PATCH v4 12/13] xen/pvcalls: implement release command Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-09-23 00:50 +0200
[PATCH v4 02/13] xen/pvcalls: implement frontend disconnect Stefano Stabellini <sstabellini@kernel.org> - 2017-09-16 01:10 +0200
Re: [PATCH v4 02/13] xen/pvcalls: implement frontend disconnect Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-09-20 22:40 +0200
Re: [PATCH v4 02/13] xen/pvcalls: implement frontend disconnect Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-09-20 23:10 +0200
[PATCH v4 10/13] xen/pvcalls: implement recvmsg Stefano Stabellini <sstabellini@kernel.org> - 2017-09-16 01:10 +0200
Re: [PATCH v4 10/13] xen/pvcalls: implement recvmsg Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-09-23 00:10 +0200
[PATCH v4 04/13] xen/pvcalls: implement socket command and handle events Stefano Stabellini <sstabellini@kernel.org> - 2017-09-16 01:10 +0200
Re: [PATCH v4 04/13] xen/pvcalls: implement socket command and handle events Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-09-21 19:50 +0200
[PATCH v4 03/13] xen/pvcalls: connect to the backend Stefano Stabellini <sstabellini@kernel.org> - 2017-09-16 01:10 +0200
Re: [PATCH v4 03/13] xen/pvcalls: connect to the backend Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-09-20 23:20 +0200
[PATCH v4 08/13] xen/pvcalls: implement accept command Stefano Stabellini <sstabellini@kernel.org> - 2017-09-16 01:10 +0200
Re: [PATCH v4 08/13] xen/pvcalls: implement accept command Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-09-22 02:10 +0200
[PATCH v4 09/13] xen/pvcalls: implement sendmsg Stefano Stabellini <sstabellini@kernel.org> - 2017-09-16 01:10 +0200
Re: [PATCH v4 09/13] xen/pvcalls: implement sendmsg Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-09-23 00:00 +0200
[PATCH v4 06/13] xen/pvcalls: implement bind command Stefano Stabellini <sstabellini@kernel.org> - 2017-09-16 01:10 +0200
Re: [PATCH v4 06/13] xen/pvcalls: implement bind command Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-09-21 21:50 +0200
[PATCH v4 05/13] xen/pvcalls: implement connect command Stefano Stabellini <sstabellini@kernel.org> - 2017-09-16 01:10 +0200
Re: [PATCH v4 05/13] xen/pvcalls: implement connect command Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-09-21 20:30 +0200
csiph-web