diff options
author | Jan Beulich <JBeulich@suse.com> | 2012-09-18 12:23:02 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-18 17:20:48 +0100 |
commit | 9fa5780beea1274d498a224822397100022da7d4 (patch) | |
tree | 9dbc2d31f3af70502843bbebe8017828abd63136 /drivers/usb | |
parent | ee42f6c9fc62d1d4d45b0d75e5f947e6645d8c30 (diff) |
USB EHCI/Xen: propagate controller reset information to hypervisor
Just like for the in-tree early console debug port driver, the
hypervisor - when using a debug port based console - also needs to be
told about controller resets, so it can suppress using and then
re-initialize the debug port accordingly.
Other than the in-tree driver, the hypervisor driver actually cares
about doing this only for the device where the debug is port actually
in use, i.e. it needs to be told the coordinates of the device being
reset (quite obviously, leveraging the addition done for that would
likely benefit the in-tree driver too).
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/early/ehci-dbgp.c | 17 | ||||
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/ehci-hub.c | 4 |
3 files changed, 17 insertions, 8 deletions
diff --git a/drivers/usb/early/ehci-dbgp.c b/drivers/usb/early/ehci-dbgp.c index 89dcf155d57..e426ad626d7 100644 --- a/drivers/usb/early/ehci-dbgp.c +++ b/drivers/usb/early/ehci-dbgp.c @@ -491,7 +491,7 @@ static int ehci_wait_for_port(int port); * Return -ENODEV for any general failure * Return -EIO if wait for port fails */ -int dbgp_external_startup(void) +static int _dbgp_external_startup(void) { int devnum; struct usb_debug_descriptor dbgp_desc; @@ -613,6 +613,11 @@ err: goto try_again; return -ENODEV; } + +int dbgp_external_startup(struct usb_hcd *hcd) +{ + return xen_dbgp_external_startup(hcd) ?: _dbgp_external_startup(); +} EXPORT_SYMBOL_GPL(dbgp_external_startup); static int ehci_reset_port(int port) @@ -804,7 +809,7 @@ try_next_port: dbgp_ehci_status("ehci skip - already configured"); } - ret = dbgp_external_startup(); + ret = _dbgp_external_startup(); if (ret == -EIO) goto next_debug_port; @@ -934,7 +939,7 @@ static void early_dbgp_write(struct console *con, const char *str, u32 n) ctrl = readl(&ehci_debug->control); if (!(ctrl & DBGP_ENABLED)) { dbgp_not_safe = 1; - dbgp_external_startup(); + _dbgp_external_startup(); } else { cmd |= CMD_RUN; writel(cmd, &ehci_regs->command); @@ -974,10 +979,14 @@ struct console early_dbgp_console = { .index = -1, }; -int dbgp_reset_prep(void) +int dbgp_reset_prep(struct usb_hcd *hcd) { + int ret = xen_dbgp_reset_prep(hcd); u32 ctrl; + if (ret) + return ret; + dbgp_not_safe = 1; if (!ehci_debug) return 0; diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index b05c6865b61..6bf6c42481e 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -228,7 +228,7 @@ static int ehci_reset (struct ehci_hcd *ehci) /* If the EHCI debug controller is active, special care must be * taken before and after a host controller reset */ - if (ehci->debug && !dbgp_reset_prep()) + if (ehci->debug && !dbgp_reset_prep(ehci_to_hcd(ehci))) ehci->debug = NULL; command |= CMD_RESET; @@ -251,7 +251,7 @@ static int ehci_reset (struct ehci_hcd *ehci) tdi_reset (ehci); if (ehci->debug) - dbgp_external_startup(); + dbgp_external_startup(ehci_to_hcd(ehci)); ehci->port_c_suspend = ehci->suspended_ports = ehci->resuming_ports = 0; diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index c7880223738..914ce9370e7 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c @@ -353,10 +353,10 @@ static int ehci_bus_resume (struct usb_hcd *hcd) goto shutdown; if (unlikely(ehci->debug)) { - if (!dbgp_reset_prep()) + if (!dbgp_reset_prep(hcd)) ehci->debug = NULL; else - dbgp_external_startup(); + dbgp_external_startup(hcd); } /* Ideally and we've got a real resume here, and no port's power |