Print this page
9702 HBA drivers don't need the redundant devfs_clean step
Reviewed by: Dan Fields <dan.fields@nexenta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/mr_sas/mr_sas.c
          +++ new/usr/src/uts/common/io/mr_sas/mr_sas.c
↓ open down ↓ 36 lines elided ↑ open up ↑
  37   37   * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  38   38   * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  39   39   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  40   40   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  41   41   * DAMAGE.
  42   42   */
  43   43  
  44   44  /*
  45   45   * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  46   46   * Copyright (c) 2011 Bayard G. Bell. All rights reserved.
  47      - * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
       47 + * Copyright 2018 Nexenta Systems, Inc.
  48   48   * Copyright 2015, 2017 Citrus IT Limited. All rights reserved.
  49   49   * Copyright 2015 Garrett D'Amore <garrett@damore.org>
  50   50   */
  51   51  
  52   52  #include <sys/types.h>
  53   53  #include <sys/param.h>
  54   54  #include <sys/file.h>
  55   55  #include <sys/errno.h>
  56   56  #include <sys/open.h>
  57   57  #include <sys/cred.h>
↓ open down ↓ 5 lines elided ↑ open up ↑
  63   63  #include <sys/stat.h>
  64   64  #include <sys/mkdev.h>
  65   65  #include <sys/pci.h>
  66   66  #include <sys/scsi/scsi.h>
  67   67  #include <sys/ddi.h>
  68   68  #include <sys/sunddi.h>
  69   69  #include <sys/atomic.h>
  70   70  #include <sys/signal.h>
  71   71  #include <sys/byteorder.h>
  72   72  #include <sys/sdt.h>
  73      -#include <sys/fs/dv_node.h>     /* devfs_clean */
  74   73  
  75   74  #include "mr_sas.h"
  76   75  
  77   76  /*
  78   77   * FMA header files
  79   78   */
  80   79  #include <sys/ddifm.h>
  81   80  #include <sys/fm/protocol.h>
  82   81  #include <sys/fm/util.h>
  83   82  #include <sys/fm/io/ddi.h>
↓ open down ↓ 7651 lines elided ↑ open up ↑
7735 7734                  return (DDI_FAILURE);
7736 7735          }
7737 7736          DTRACE_PROBE3(service_evt, int, tgt, int, lun, int, event);
7738 7737          return (DDI_SUCCESS);
7739 7738  }
7740 7739  
7741 7740  static void
7742 7741  mrsas_issue_evt_taskq(struct mrsas_eventinfo *mrevt)
7743 7742  {
7744 7743          struct mrsas_instance *instance = mrevt->instance;
7745      -        dev_info_t *dip, *pdip;
     7744 +        dev_info_t *dip;
7746 7745          int circ1 = 0;
7747      -        char *devname;
7748 7746  
7749 7747          con_log(CL_ANN1, (CE_NOTE, "mrsas_issue_evt_taskq: called for"
7750 7748              " tgt %d lun %d event %d",
7751 7749              mrevt->tgt, mrevt->lun, mrevt->event));
7752 7750  
7753 7751          if (mrevt->tgt < MRDRV_MAX_LD && mrevt->lun == 0) {
7754 7752                  mutex_enter(&instance->config_dev_mtx);
7755 7753                  dip = instance->mr_ld_list[mrevt->tgt].dip;
7756 7754                  mutex_exit(&instance->config_dev_mtx);
7757 7755          } else {
7758 7756                  mutex_enter(&instance->config_dev_mtx);
7759 7757                  dip = instance->mr_tbolt_pd_list[mrevt->tgt].dip;
7760 7758                  mutex_exit(&instance->config_dev_mtx);
7761 7759          }
7762 7760  
7763 7761  
7764 7762          ndi_devi_enter(instance->dip, &circ1);
7765 7763          switch (mrevt->event) {
7766 7764          case MRSAS_EVT_CONFIG_TGT:
7767 7765                  if (dip == NULL) {
7768      -
7769 7766                          if (mrevt->lun == 0) {
7770 7767                                  (void) mrsas_config_ld(instance, mrevt->tgt,
7771 7768                                      0, NULL);
7772 7769                          } else if (instance->tbolt || instance->skinny) {
7773 7770                                  (void) mrsas_tbolt_config_pd(instance,
7774 7771                                      mrevt->tgt,
7775 7772                                      1, NULL);
7776 7773                          }
7777 7774                          con_log(CL_ANN1, (CE_NOTE,
7778 7775                              "mr_sas: EVT_CONFIG_TGT called:"
7779 7776                              " for tgt %d lun %d event %d",
7780 7777                              mrevt->tgt, mrevt->lun, mrevt->event));
7781      -
7782 7778                  } else {
7783 7779                          con_log(CL_ANN1, (CE_NOTE,
7784 7780                              "mr_sas: EVT_CONFIG_TGT dip != NULL:"
7785 7781                              " for tgt %d lun %d event %d",
7786 7782                              mrevt->tgt, mrevt->lun, mrevt->event));
7787 7783                  }
7788 7784                  break;
7789 7785          case MRSAS_EVT_UNCONFIG_TGT:
7790 7786                  if (dip) {
7791      -                        if (i_ddi_devi_attached(dip)) {
7792      -
7793      -                                pdip = ddi_get_parent(dip);
7794      -
7795      -                                devname = kmem_zalloc(MAXNAMELEN + 1, KM_SLEEP);
7796      -                                (void) ddi_deviname(dip, devname);
7797      -
7798      -                                (void) devfs_clean(pdip, devname + 1,
7799      -                                    DV_CLEAN_FORCE);
7800      -                                kmem_free(devname, MAXNAMELEN + 1);
7801      -                        }
7802      -                        (void) ndi_devi_offline(dip, NDI_DEVI_REMOVE);
     7787 +                        (void) ndi_devi_offline(dip,
     7788 +                            NDI_DEVFS_CLEAN | NDI_DEVI_REMOVE);
7803 7789                          con_log(CL_ANN1, (CE_NOTE,
7804 7790                              "mr_sas: EVT_UNCONFIG_TGT called:"
7805 7791                              " for tgt %d lun %d event %d",
7806 7792                              mrevt->tgt, mrevt->lun, mrevt->event));
7807 7793                  } else {
7808 7794                          con_log(CL_ANN1, (CE_NOTE,
7809 7795                              "mr_sas: EVT_UNCONFIG_TGT dip == NULL:"
7810 7796                              " for tgt %d lun %d event %d",
7811 7797                              mrevt->tgt, mrevt->lun, mrevt->event));
7812 7798                  }
↓ open down ↓ 63 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX