Print this page
Add xhci_quiesce to support fast reboot.

@@ -9,10 +9,11 @@
  * http://www.illumos.org/license/CDDL.
  */
 
 /*
  * Copyright (c) 2017, Joyent, Inc.
+ * Copyright (c) 2018, Western Digital Corporation.
  */
 
 /*
  * Extensible Host Controller Interface (xHCI) USB Driver
  *

@@ -1011,14 +1012,14 @@
 xhci_check_regs_acc(xhci_t *xhcip)
 {
         ddi_fm_error_t de;
 
         /*
-         * Treat the case where we can't check as fine so we can treat the code
+         * Treat cases where we can't check as fine so we can treat the code
          * more simply.
          */
-        if (!DDI_FM_ACC_ERR_CAP(xhcip->xhci_fm_caps))
+        if (quiesce_active || !DDI_FM_ACC_ERR_CAP(xhcip->xhci_fm_caps))
                 return (DDI_FM_OK);
 
         ddi_fm_acc_err_get(xhcip->xhci_regs_handle, &de, DDI_FME_VERSION);
         ddi_fm_acc_err_clear(xhcip->xhci_regs_handle, DDI_FME_VERSION);
         return (de.fme_status);

@@ -1969,10 +1970,22 @@
         ddi_soft_state_free(xhci_soft_state, inst);
 
         return (DDI_SUCCESS);
 }
 
+/* QUIESCE(9E) to support fast reboot */
+int
+xhci_quiesce(dev_info_t *dip)
+{
+        xhci_t *xhcip;
+
+        xhcip = ddi_get_soft_state(xhci_soft_state, ddi_get_instance(dip));
+
+        return (xhci_controller_stop(xhcip) == 0 &&
+            xhci_controller_reset(xhcip) == 0 ? DDI_SUCCESS : DDI_FAILURE);
+}
+
 static int
 xhci_attach(dev_info_t *dip, ddi_attach_cmd_t cmd)
 {
         int ret, inst, route;
         xhci_t *xhcip;

@@ -2181,11 +2194,11 @@
         xhci_detach,                    /* devo_detach */
         nodev,                          /* devo_reset */
         &xhci_cb_ops,                   /* devo_cb_ops */
         &usba_hubdi_busops,             /* devo_bus_ops */
         usba_hubdi_root_hub_power,      /* devo_power */
-        ddi_quiesce_not_supported       /* devo_quiesce */
+        xhci_quiesce                    /* devo_quiesce */
 };
 
 static struct modldrv xhci_modldrv = {
         &mod_driverops,
         "USB xHCI Driver",