diff options
| author | Jordan Paige Hendricks <jordan.hendricks@joyent.com> | 2019-03-25 17:22:13 +0000 |
|---|---|---|
| committer | Robert Mustacchi <rm@fingolfin.org> | 2021-04-05 17:17:41 -0700 |
| commit | ffb6483089015eb90be1f5e7fc2a96c9929546a6 (patch) | |
| tree | bf7931c50a83cba1557b932f66c2c2d1b6d89141 /usr/src/uts/common/os/ddi_hp_ndi.c | |
| parent | 8054a0e4c809d98ffb44f17b9a8b932ca2c24b2c (diff) | |
| download | illumos-joyent-ffb6483089015eb90be1f5e7fc2a96c9929546a6.tar.gz | |
11698 Want NVMe Hotplug Support
11699 x86 pci configurator should not fail device teardown if device is gone
11700 DDI hotplug request handler resets connection handle state before performing state change operations
11701 ldi_handle dcmd segfaults occasionally
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Rob Johnston <rob.johnston@joyent.com>
Reviewed by: Paul Winder <paul@winder.uk.net>
Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/uts/common/os/ddi_hp_ndi.c')
| -rw-r--r-- | usr/src/uts/common/os/ddi_hp_ndi.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/usr/src/uts/common/os/ddi_hp_ndi.c b/usr/src/uts/common/os/ddi_hp_ndi.c index a41a12fc74..73c62dc6b9 100644 --- a/usr/src/uts/common/os/ddi_hp_ndi.c +++ b/usr/src/uts/common/os/ddi_hp_ndi.c @@ -21,6 +21,8 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2019 Joyent, Inc. */ /* @@ -380,13 +382,19 @@ ddihp_cn_req_handler(ddi_hp_cn_handle_t *hdlp, ASSERT(DEVI_BUSY_OWNED(dip)); - if (ddihp_cn_getstate(hdlp) != DDI_SUCCESS) { - DDI_HP_NEXDBG((CE_CONT, "ddihp_cn_req_handler: dip %p, " - "hdlp %p ddi_cn_getstate failed\n", (void *)dip, - (void *)hdlp)); - - return (NDI_UNCLAIMED); - } + /* + * We do not want to fetch the state first, as calling ddihp_cn_getstate + * will update the cn_state member of the connection handle. The + * connector's hotplug operations rely on this value to know how + * target_state compares to the last known state of the device and make + * decisions about whether to clean up, post sysevents about the state + * change, and so on. + * + * Instead, just carry out the request to change the state. The + * connector's hotplug operations will update the state in the + * connection handle after they complete their necessary state change + * actions. + */ if (hdlp->cn_info.cn_state != target_state) { ddi_hp_cn_state_t result_state = 0; |
