Merge tag 'for-linus-5.5b-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull xen fixes from Juergen Gross: "This contains two cleanup patches and a small series for supporting reloading the Xen block backend driver" * tag 'for-linus-5.5b-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/grant-table: remove multiple BUG_ON on gnttab_interface xen-blkback: support dynamic unbind/bind xen/interface: re-define FRONT/BACK_RING_ATTACH() xenbus: limit when state is forced to closed xenbus: move xenbus_dev_shutdown() into frontend code... xen/blkfront: Adjust indentation in xlvbd_alloc_gendisk
Цей коміт міститься в:
@@ -664,7 +664,6 @@ static int grow_gnttab_list(unsigned int more_frames)
|
||||
unsigned int nr_glist_frames, new_nr_glist_frames;
|
||||
unsigned int grefs_per_frame;
|
||||
|
||||
BUG_ON(gnttab_interface == NULL);
|
||||
grefs_per_frame = gnttab_interface->grefs_per_grant_frame;
|
||||
|
||||
new_nr_grant_frames = nr_grant_frames + more_frames;
|
||||
@@ -1160,7 +1159,6 @@ EXPORT_SYMBOL_GPL(gnttab_unmap_refs_sync);
|
||||
|
||||
static unsigned int nr_status_frames(unsigned int nr_grant_frames)
|
||||
{
|
||||
BUG_ON(gnttab_interface == NULL);
|
||||
return gnttab_frames(nr_grant_frames, SPP);
|
||||
}
|
||||
|
||||
@@ -1388,7 +1386,6 @@ static int gnttab_expand(unsigned int req_entries)
|
||||
int rc;
|
||||
unsigned int cur, extra;
|
||||
|
||||
BUG_ON(gnttab_interface == NULL);
|
||||
cur = nr_grant_frames;
|
||||
extra = ((req_entries + gnttab_interface->grefs_per_grant_frame - 1) /
|
||||
gnttab_interface->grefs_per_grant_frame);
|
||||
@@ -1423,7 +1420,6 @@ int gnttab_init(void)
|
||||
/* Determine the maximum number of frames required for the
|
||||
* grant reference free list on the current hypervisor.
|
||||
*/
|
||||
BUG_ON(gnttab_interface == NULL);
|
||||
max_nr_glist_frames = (max_nr_grant_frames *
|
||||
gnttab_interface->grefs_per_grant_frame / RPP);
|
||||
|
||||
|
@@ -116,8 +116,6 @@ int xenbus_probe_devices(struct xen_bus_type *bus);
|
||||
|
||||
void xenbus_dev_changed(const char *node, struct xen_bus_type *bus);
|
||||
|
||||
void xenbus_dev_shutdown(struct device *_dev);
|
||||
|
||||
int xenbus_dev_suspend(struct device *dev);
|
||||
int xenbus_dev_resume(struct device *dev);
|
||||
int xenbus_dev_cancel(struct device *dev);
|
||||
|
@@ -255,7 +255,6 @@ fail_put:
|
||||
module_put(drv->driver.owner);
|
||||
fail:
|
||||
xenbus_dev_error(dev, err, "xenbus_dev_probe on %s", dev->nodename);
|
||||
xenbus_switch_state(dev, XenbusStateClosed);
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xenbus_dev_probe);
|
||||
@@ -276,34 +275,20 @@ int xenbus_dev_remove(struct device *_dev)
|
||||
|
||||
free_otherend_details(dev);
|
||||
|
||||
xenbus_switch_state(dev, XenbusStateClosed);
|
||||
/*
|
||||
* If the toolstack has forced the device state to closing then set
|
||||
* the state to closed now to allow it to be cleaned up.
|
||||
* Similarly, if the driver does not support re-bind, set the
|
||||
* closed.
|
||||
*/
|
||||
if (!drv->allow_rebind ||
|
||||
xenbus_read_driver_state(dev->nodename) == XenbusStateClosing)
|
||||
xenbus_switch_state(dev, XenbusStateClosed);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xenbus_dev_remove);
|
||||
|
||||
void xenbus_dev_shutdown(struct device *_dev)
|
||||
{
|
||||
struct xenbus_device *dev = to_xenbus_device(_dev);
|
||||
unsigned long timeout = 5*HZ;
|
||||
|
||||
DPRINTK("%s", dev->nodename);
|
||||
|
||||
get_device(&dev->dev);
|
||||
if (dev->state != XenbusStateConnected) {
|
||||
pr_info("%s: %s: %s != Connected, skipping\n",
|
||||
__func__, dev->nodename, xenbus_strstate(dev->state));
|
||||
goto out;
|
||||
}
|
||||
xenbus_switch_state(dev, XenbusStateClosing);
|
||||
timeout = wait_for_completion_timeout(&dev->down, timeout);
|
||||
if (!timeout)
|
||||
pr_info("%s: %s timeout closing device\n",
|
||||
__func__, dev->nodename);
|
||||
out:
|
||||
put_device(&dev->dev);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xenbus_dev_shutdown);
|
||||
|
||||
int xenbus_register_driver_common(struct xenbus_driver *drv,
|
||||
struct xen_bus_type *bus,
|
||||
struct module *owner, const char *mod_name)
|
||||
|
@@ -198,7 +198,6 @@ static struct xen_bus_type xenbus_backend = {
|
||||
.uevent = xenbus_uevent_backend,
|
||||
.probe = xenbus_dev_probe,
|
||||
.remove = xenbus_dev_remove,
|
||||
.shutdown = xenbus_dev_shutdown,
|
||||
.dev_groups = xenbus_dev_groups,
|
||||
},
|
||||
};
|
||||
|
@@ -126,6 +126,28 @@ static int xenbus_frontend_dev_probe(struct device *dev)
|
||||
return xenbus_dev_probe(dev);
|
||||
}
|
||||
|
||||
static void xenbus_frontend_dev_shutdown(struct device *_dev)
|
||||
{
|
||||
struct xenbus_device *dev = to_xenbus_device(_dev);
|
||||
unsigned long timeout = 5*HZ;
|
||||
|
||||
DPRINTK("%s", dev->nodename);
|
||||
|
||||
get_device(&dev->dev);
|
||||
if (dev->state != XenbusStateConnected) {
|
||||
pr_info("%s: %s: %s != Connected, skipping\n",
|
||||
__func__, dev->nodename, xenbus_strstate(dev->state));
|
||||
goto out;
|
||||
}
|
||||
xenbus_switch_state(dev, XenbusStateClosing);
|
||||
timeout = wait_for_completion_timeout(&dev->down, timeout);
|
||||
if (!timeout)
|
||||
pr_info("%s: %s timeout closing device\n",
|
||||
__func__, dev->nodename);
|
||||
out:
|
||||
put_device(&dev->dev);
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops xenbus_pm_ops = {
|
||||
.suspend = xenbus_dev_suspend,
|
||||
.resume = xenbus_frontend_dev_resume,
|
||||
@@ -146,7 +168,7 @@ static struct xen_bus_type xenbus_frontend = {
|
||||
.uevent = xenbus_uevent_frontend,
|
||||
.probe = xenbus_frontend_dev_probe,
|
||||
.remove = xenbus_dev_remove,
|
||||
.shutdown = xenbus_dev_shutdown,
|
||||
.shutdown = xenbus_frontend_dev_shutdown,
|
||||
.dev_groups = xenbus_dev_groups,
|
||||
|
||||
.pm = &xenbus_pm_ops,
|
||||
|
Посилання в новій задачі
Заблокувати користувача