Print this page
NEX-8219 sudden reboot when accessing bge2 on HP Gen 9 - real fix
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
NEX-6635 sudden reboot when accessing bge2 on HP Gen9
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Dan Fields <dan.fields@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/bge/bge_main2.c
          +++ new/usr/src/uts/common/io/bge/bge_main2.c
↓ open down ↓ 3636 lines elided ↑ open up ↑
3637 3637          uint32_t pci_state_reg;
3638 3638  #ifdef BGE_IPMI_ASF
3639 3639          uint32_t mhcrValue;
3640 3640  #ifdef __sparc
3641 3641          uint16_t value16;
3642 3642  #endif
3643 3643  #ifdef BGE_NETCONSOLE
3644 3644          int retval;
3645 3645  #endif
3646 3646  #endif
     3647 +        int prop_len = 128;
     3648 +        char *prop_name, *prop_val;
3647 3649  
3648 3650          instance = ddi_get_instance(devinfo);
3649 3651  
3650 3652          BGE_GTRACE(("bge_attach($%p, %d) instance %d",
3651 3653              (void *)devinfo, cmd, instance));
3652 3654          BGE_BRKPT(NULL, "bge_attach");
3653 3655  
3654 3656          switch (cmd) {
3655 3657          default:
3656 3658                  return (DDI_FAILURE);
↓ open down ↓ 16 lines elided ↑ open up ↑
3673 3675  
3674 3676          /*
3675 3677           * Initialize more fields in BGE private data
3676 3678           */
3677 3679          bgep->debug = ddi_prop_get_int(DDI_DEV_T_ANY, devinfo,
3678 3680              DDI_PROP_DONTPASS, debug_propname, bge_debug);
3679 3681          (void) snprintf(bgep->ifname, sizeof (bgep->ifname), "%s%d",
3680 3682              BGE_DRIVER_NAME, instance);
3681 3683  
3682 3684          /*
     3685 +         * Check whether this specific instance has been disabled.
     3686 +         */
     3687 +        prop_name = kmem_zalloc(prop_len, KM_SLEEP);
     3688 +        (void) snprintf(prop_name, prop_len, "disable-%s", bgep->ifname);
     3689 +        if (ddi_prop_lookup_string(DDI_DEV_T_ANY, devinfo, 0, prop_name,
     3690 +            &prop_val) == DDI_SUCCESS) {
     3691 +                if (strcmp(prop_val, "true") == 0) {
     3692 +                        ddi_prop_free(prop_val);
     3693 +                        kmem_free(prop_name, prop_len);
     3694 +                        goto attach_fail;
     3695 +                }
     3696 +                ddi_prop_free(prop_val);
     3697 +        }
     3698 +        kmem_free(prop_name, prop_len);
     3699 +
     3700 +        /*
3683 3701           * Initialize for fma support
3684 3702           */
3685 3703          bgep->fm_capabilities = ddi_prop_get_int(DDI_DEV_T_ANY, devinfo,
3686 3704              DDI_PROP_DONTPASS, fm_cap,
3687 3705              DDI_FM_EREPORT_CAPABLE | DDI_FM_ACCCHK_CAPABLE |
3688 3706              DDI_FM_DMACHK_CAPABLE | DDI_FM_ERRCB_CAPABLE);
3689 3707          BGE_DEBUG(("bgep->fm_capabilities = %d", bgep->fm_capabilities));
3690 3708          bge_fm_init(bgep);
3691 3709  
3692 3710          /*
↓ open down ↓ 858 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX