Print this page
NEX-17944 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>
re #13556, rb4474 LSI Skinny MegaRAID support for mr_sas(7D)
Update mr_sas from illumos-gate (default test)
re #11944 rb3746 need workaround for QEMU bug that induces bad e1000g checksums
re #11242 rb3560 LSI 2208 and 3108 support for mr_sas

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 ↓ 7650 lines elided ↑ open up ↑
7734 7733                  return (DDI_FAILURE);
7735 7734          }
7736 7735          DTRACE_PROBE3(service_evt, int, tgt, int, lun, int, event);
7737 7736          return (DDI_SUCCESS);
7738 7737  }
7739 7738  
7740 7739  static void
7741 7740  mrsas_issue_evt_taskq(struct mrsas_eventinfo *mrevt)
7742 7741  {
7743 7742          struct mrsas_instance *instance = mrevt->instance;
7744      -        dev_info_t *dip, *pdip;
     7743 +        dev_info_t *dip;
7745 7744          int circ1 = 0;
7746      -        char *devname;
7747 7745  
7748 7746          con_log(CL_ANN1, (CE_NOTE, "mrsas_issue_evt_taskq: called for"
7749 7747              " tgt %d lun %d event %d",
7750 7748              mrevt->tgt, mrevt->lun, mrevt->event));
7751 7749  
7752 7750          if (mrevt->tgt < MRDRV_MAX_LD && mrevt->lun == 0) {
7753 7751                  mutex_enter(&instance->config_dev_mtx);
7754 7752                  dip = instance->mr_ld_list[mrevt->tgt].dip;
7755 7753                  mutex_exit(&instance->config_dev_mtx);
7756 7754          } else {
7757 7755                  mutex_enter(&instance->config_dev_mtx);
7758 7756                  dip = instance->mr_tbolt_pd_list[mrevt->tgt].dip;
7759 7757                  mutex_exit(&instance->config_dev_mtx);
7760 7758          }
7761 7759  
7762 7760  
7763 7761          ndi_devi_enter(instance->dip, &circ1);
7764 7762          switch (mrevt->event) {
7765 7763          case MRSAS_EVT_CONFIG_TGT:
7766 7764                  if (dip == NULL) {
7767      -
7768 7765                          if (mrevt->lun == 0) {
7769 7766                                  (void) mrsas_config_ld(instance, mrevt->tgt,
7770 7767                                      0, NULL);
7771 7768                          } else if (instance->tbolt || instance->skinny) {
7772 7769                                  (void) mrsas_tbolt_config_pd(instance,
7773 7770                                      mrevt->tgt,
7774 7771                                      1, NULL);
7775 7772                          }
7776 7773                          con_log(CL_ANN1, (CE_NOTE,
7777 7774                              "mr_sas: EVT_CONFIG_TGT called:"
7778 7775                              " for tgt %d lun %d event %d",
7779 7776                              mrevt->tgt, mrevt->lun, mrevt->event));
7780      -
7781 7777                  } else {
7782 7778                          con_log(CL_ANN1, (CE_NOTE,
7783 7779                              "mr_sas: EVT_CONFIG_TGT dip != NULL:"
7784 7780                              " for tgt %d lun %d event %d",
7785 7781                              mrevt->tgt, mrevt->lun, mrevt->event));
7786 7782                  }
7787 7783                  break;
7788 7784          case MRSAS_EVT_UNCONFIG_TGT:
7789 7785                  if (dip) {
7790      -                        if (i_ddi_devi_attached(dip)) {
7791      -
7792      -                                pdip = ddi_get_parent(dip);
7793      -
7794      -                                devname = kmem_zalloc(MAXNAMELEN + 1, KM_SLEEP);
7795      -                                (void) ddi_deviname(dip, devname);
7796      -
7797      -                                (void) devfs_clean(pdip, devname + 1,
7798      -                                    DV_CLEAN_FORCE);
7799      -                                kmem_free(devname, MAXNAMELEN + 1);
7800      -                        }
7801      -                        (void) ndi_devi_offline(dip, NDI_DEVI_REMOVE);
     7786 +                        (void) ndi_devi_offline(dip,
     7787 +                            NDI_DEVFS_CLEAN | NDI_DEVI_REMOVE);
7802 7788                          con_log(CL_ANN1, (CE_NOTE,
7803 7789                              "mr_sas: EVT_UNCONFIG_TGT called:"
7804 7790                              " for tgt %d lun %d event %d",
7805 7791                              mrevt->tgt, mrevt->lun, mrevt->event));
7806 7792                  } else {
7807 7793                          con_log(CL_ANN1, (CE_NOTE,
7808 7794                              "mr_sas: EVT_UNCONFIG_TGT dip == NULL:"
7809 7795                              " for tgt %d lun %d event %d",
7810 7796                              mrevt->tgt, mrevt->lun, mrevt->event));
7811 7797                  }
↓ open down ↓ 63 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX