Print this page
Code review comments

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 ↓ 207 lines elided ↑ open up ↑
 208  208  
 209  209  static struct mrsas_function_template mrsas_function_template_ppc = {
 210  210          .read_fw_status_reg = read_fw_status_reg_ppc,
 211  211          .issue_cmd = issue_cmd_ppc,
 212  212          .issue_cmd_in_sync_mode = issue_cmd_in_sync_mode_ppc,
 213  213          .issue_cmd_in_poll_mode = issue_cmd_in_poll_mode_ppc,
 214  214          .enable_intr = enable_intr_ppc,
 215  215          .disable_intr = disable_intr_ppc,
 216  216          .intr_ack = intr_ack_ppc,
 217  217          .init_adapter = mrsas_init_adapter_ppc
 218      -/*      .reset_adapter = mrsas_reset_adapter_ppc */
 219  218  };
 220  219  
 221  220  
 222  221  static struct mrsas_function_template mrsas_function_template_fusion = {
 223  222          .read_fw_status_reg = tbolt_read_fw_status_reg,
 224  223          .issue_cmd = tbolt_issue_cmd,
 225  224          .issue_cmd_in_sync_mode = tbolt_issue_cmd_in_sync_mode,
 226  225          .issue_cmd_in_poll_mode = tbolt_issue_cmd_in_poll_mode,
 227  226          .enable_intr = tbolt_enable_intr,
 228  227          .disable_intr = tbolt_disable_intr,
↓ open down ↓ 67 lines elided ↑ open up ↑
 296  295          nodev,
 297  296  #endif  /* __sparc */
 298  297          &mrsas_cb_ops,          /* char/block ops */
 299  298          NULL,                   /* bus ops */
 300  299          NULL,                   /* power */
 301  300  #ifdef __sparc
 302  301          ddi_quiesce_not_needed
 303  302  #else   /* __sparc */
 304  303          mrsas_quiesce   /* quiesce */
 305  304  #endif  /* __sparc */
 306      -
 307  305  };
 308  306  
 309  307  static struct modldrv modldrv = {
 310  308          &mod_driverops,         /* module type - driver */
 311  309          MRSAS_VERSION,
 312  310          &mrsas_ops,             /* driver ops */
 313  311  };
 314  312  
 315  313  static struct modlinkage modlinkage = {
 316  314          MODREV_1,       /* ml_rev - must be MODREV_1 */
↓ open down ↓ 1 lines elided ↑ open up ↑
 318  316          NULL            /* end of driver linkage */
 319  317  };
 320  318  
 321  319  static struct ddi_device_acc_attr endian_attr = {
 322  320          DDI_DEVICE_ATTR_V1,
 323  321          DDI_STRUCTURE_LE_ACC,
 324  322          DDI_STRICTORDER_ACC,
 325  323          DDI_DEFAULT_ACC
 326  324  };
 327  325  
 328      -
      326 +/* Use the LSI Fast Path for the 2208 (tbolt) commands. */
 329  327  unsigned int enable_fp = 1;
 330  328  
 331  329  
 332  330  /*
 333  331   * ************************************************************************** *
 334  332   *                                                                            *
 335  333   *         common entry points - for loadable kernel modules                  *
 336  334   *                                                                            *
 337  335   * ************************************************************************** *
 338  336   */
↓ open down ↓ 167 lines elided ↑ open up ↑
 506  504                  instance = (struct mrsas_instance *)ddi_get_soft_state
 507  505                      (mrsas_state, instance_no);
 508  506  
 509  507                  if (instance == NULL) {
 510  508                          cmn_err(CE_WARN,
 511  509                              "mr_sas%d: Bad soft state", instance_no);
 512  510                          ddi_soft_state_free(mrsas_state, instance_no);
 513  511                          return (DDI_FAILURE);
 514  512                  }
 515  513  
 516      -                bzero(instance, sizeof (struct mrsas_instance));
 517      -
 518  514                  instance->unroll.softs  = 1;
 519  515  
 520  516                  /* Setup the PCI configuration space handles */
 521  517                  if (pci_config_setup(dip, &instance->pci_handle) !=
 522  518                      DDI_SUCCESS) {
 523  519                          cmn_err(CE_WARN,
 524  520                              "mr_sas%d: pci config setup failed ",
 525  521                              instance_no);
 526  522  
 527  523                          ddi_soft_state_free(mrsas_state, instance_no);
 528  524                          return (DDI_FAILURE);
 529  525                  }
 530      -                if (instance->pci_handle == NULL) {
 531      -                        cmn_err(CE_WARN,
 532      -                            "mr_sas%d: pci config setup failed ",
 533      -                            instance_no);
 534      -                        ddi_soft_state_free(mrsas_state, instance_no);
 535      -                        return (DDI_FAILURE);
 536      -                }
 537  526  
 538      -
 539      -
 540  527                  if (ddi_dev_nregs(dip, &nregs) != DDI_SUCCESS) {
 541  528                          cmn_err(CE_WARN,
 542  529                              "mr_sas: failed to get registers.");
 543  530  
 544  531                          pci_config_teardown(&instance->pci_handle);
 545  532                          ddi_soft_state_free(mrsas_state, instance_no);
 546  533                          return (DDI_FAILURE);
 547  534                  }
 548  535  
 549  536                  vendor_id = pci_config_get16(instance->pci_handle,
↓ open down ↓ 97 lines elided ↑ open up ↑
 647  634                              reglength));
 648  635                  }
 649  636                  if (ddi_regs_map_setup(instance->dip,
 650  637                      REGISTER_SET_IO_2108, &instance->regmap, 0,
 651  638                      reglength, &endian_attr, &instance->regmap_handle)
 652  639                      != DDI_SUCCESS) {
 653  640                          cmn_err(CE_WARN,
 654  641                              "mr_sas: couldn't map control registers");
 655  642                          goto fail_attach;
 656  643                  }
 657      -                if (instance->regmap_handle == NULL) {
 658      -                        cmn_err(CE_WARN,
 659      -                            "mr_sas: couldn't map control registers");
 660      -                        goto fail_attach;
 661      -                }
 662  644  
 663  645                  instance->unroll.regs = 1;
 664  646  
 665  647                  /*
 666  648                   * Disable Interrupt Now.
 667  649                   * Setup Software interrupt
 668  650                   */
 669  651                  instance->func_ptr->disable_intr(instance);
 670  652  
 671  653                  if (ddi_prop_lookup_string(DDI_DEV_T_ANY, dip, 0,
↓ open down ↓ 515 lines elided ↑ open up ↑
1187 1169  mrsas_undo_resources(dev_info_t *dip, struct mrsas_instance *instance)
1188 1170  {
1189 1171          int     instance_no;
1190 1172  
1191 1173          con_log(CL_ANN, (CE_NOTE, "chkpnt:%s:%d", __func__, __LINE__));
1192 1174  
1193 1175  
1194 1176          instance_no = ddi_get_instance(dip);
1195 1177  
1196 1178  
1197      -        if (instance->unroll.ioctl == 1)  {
     1179 +        if (instance->unroll.ioctl == 1) {
1198 1180                  ddi_remove_minor_node(dip, instance->iocnode);
1199 1181                  instance->unroll.ioctl = 0;
1200 1182          }
1201 1183  
1202      -        if (instance->unroll.scsictl == 1)  {
     1184 +        if (instance->unroll.scsictl == 1) {
1203 1185                  ddi_remove_minor_node(dip, "scsi");
1204 1186                  instance->unroll.scsictl = 0;
1205 1187          }
1206 1188  
1207      -        if (instance->unroll.devctl == 1)  {
     1189 +        if (instance->unroll.devctl == 1) {
1208 1190                  ddi_remove_minor_node(dip, "devctl");
1209 1191                  instance->unroll.devctl = 0;
1210 1192          }
1211 1193  
1212      -        if (instance->unroll.tranSetup == 1)  {
     1194 +        if (instance->unroll.tranSetup == 1) {
1213 1195                  if (scsi_hba_detach(dip) != DDI_SUCCESS) {
1214 1196                          cmn_err(CE_WARN,
1215 1197                              "mr_sas2%d: failed to detach", instance_no);
1216 1198                          return;  /* DDI_FAILURE */
1217 1199                  }
1218 1200                  instance->unroll.tranSetup = 0;
1219 1201                  con_log(CL_ANN1, (CE_CONT, "scsi_hba_dettach()  done."));
1220 1202          }
1221 1203  
1222 1204          if (instance->unroll.tran == 1)  {
1223 1205                  scsi_hba_tran_free(instance->tran);
1224 1206                  instance->unroll.tran = 0;
1225 1207                  con_log(CL_ANN1, (CE_CONT, "scsi_hba_tran_free()  done."));
1226 1208          }
1227 1209  
1228      -        if (instance->unroll.syncCmd == 1)  {
     1210 +        if (instance->unroll.syncCmd == 1) {
1229 1211                  if (instance->tbolt) {
1230 1212                          if (abort_syncmap_cmd(instance,
1231 1213                              instance->map_update_cmd)) {
1232 1214                                  cmn_err(CE_WARN, "mrsas_detach: "
1233 1215                                      "failed to abort previous syncmap command");
1234 1216                          }
1235 1217  
1236 1218                          instance->unroll.syncCmd = 0;
1237 1219                          con_log(CL_ANN1, (CE_CONT, "sync cmd aborted, done."));
1238 1220                  }
1239 1221          }
1240 1222  
1241      -        if (instance->unroll.aenPend == 1)  {
     1223 +        if (instance->unroll.aenPend == 1) {
1242 1224                  if (abort_aen_cmd(instance, instance->aen_cmd))
1243 1225                          cmn_err(CE_WARN, "mrsas_detach: "
1244 1226                              "failed to abort prevous AEN command");
1245 1227  
1246 1228                  instance->unroll.aenPend = 0;
1247 1229                  con_log(CL_ANN1, (CE_CONT, "aen cmd aborted, done."));
1248      -                /* This means the controller is fully initialzed and running */
     1230 +                /* This means the controller is fully initialized and running */
1249 1231                  /* Shutdown should be a last command to controller. */
1250 1232                  /* shutdown_controller(); */
1251 1233          }
1252 1234  
1253 1235  
1254 1236          if (instance->unroll.timer == 1)         {
1255      -                if (instance->timeout_id != (timeout_id_t)-1)  {
     1237 +                if (instance->timeout_id != (timeout_id_t)-1) {
1256 1238                          (void) untimeout(instance->timeout_id);
1257 1239                          instance->timeout_id = (timeout_id_t)-1;
1258 1240  
1259 1241                          instance->unroll.timer = 0;
1260 1242                  }
1261 1243          }
1262 1244  
1263 1245          instance->func_ptr->disable_intr(instance);
1264 1246  
1265 1247  
1266      -        if (instance->unroll.mutexs == 1)  {
     1248 +        if (instance->unroll.mutexs == 1) {
1267 1249                  mutex_destroy(&instance->cmd_pool_mtx);
1268 1250                  mutex_destroy(&instance->app_cmd_pool_mtx);
1269 1251                  mutex_destroy(&instance->cmd_pend_mtx);
1270 1252                  mutex_destroy(&instance->completed_pool_mtx);
1271 1253                  mutex_destroy(&instance->sync_map_mtx);
1272 1254                  mutex_destroy(&instance->int_cmd_mtx);
1273 1255                  cv_destroy(&instance->int_cmd_cv);
1274 1256                  mutex_destroy(&instance->config_dev_mtx);
1275 1257                  mutex_destroy(&instance->ocr_flags_mtx);
1276 1258                  mutex_destroy(&instance->reg_write_mtx);
↓ open down ↓ 190 lines elided ↑ open up ↑
1467 1449                  con_log(CL_ANN, (CE_WARN, "mr_sas: adapter not found."));
1468 1450                  return (ENXIO);
1469 1451          }
1470 1452  
1471 1453          ioctl = (struct mrsas_ioctl *)kmem_zalloc(sizeof (struct mrsas_ioctl),
1472 1454              KM_SLEEP);
1473 1455          if (ioctl == NULL) {
1474 1456                  /* Failed to allocate memory for ioctl  */
1475 1457                  con_log(CL_ANN, (CE_WARN, "mr_sas_ioctl: "
1476 1458                      "failed to allocate memory for ioctl"));
1477      -                return (ENXIO);
     1459 +                return (ENOMEM);
1478 1460          }
1479 1461  
1480 1462          switch ((uint_t)cmd) {
1481 1463                  case MRSAS_IOCTL_FIRMWARE:
1482 1464                          if (ddi_copyin((void *)arg, ioctl,
1483 1465                              sizeof (struct mrsas_ioctl), mode)) {
1484 1466                                  con_log(CL_ANN, (CE_WARN, "mrsas_ioctl: "
1485 1467                                      "ERROR IOCTL copyin"));
1486 1468                                  kmem_free(ioctl, sizeof (struct mrsas_ioctl));
1487 1469                                  return (EFAULT);
↓ open down ↓ 1053 lines elided ↑ open up ↑
2541 2523   * After clearing the frame buffer the context id of the
2542 2524   * frame buffer SHOULD be restored back.
2543 2525   */
2544 2526  static struct mrsas_cmd *
2545 2527  get_mfi_pkt(struct mrsas_instance *instance)
2546 2528  {
2547 2529          mlist_t                 *head = &instance->cmd_pool_list;
2548 2530          struct mrsas_cmd        *cmd = NULL;
2549 2531  
2550 2532          mutex_enter(&instance->cmd_pool_mtx);
2551      -        ASSERT(mutex_owned(&instance->cmd_pool_mtx));
2552 2533  
2553 2534          if (!mlist_empty(head)) {
2554 2535                  cmd = mlist_entry(head->next, struct mrsas_cmd, list);
2555 2536                  mlist_del_init(head->next);
2556 2537          }
2557 2538          if (cmd != NULL) {
2558 2539                  cmd->pkt = NULL;
2559 2540                  cmd->retry_count_for_ocr = 0;
2560 2541                  cmd->drv_pkt_time = 0;
2561 2542  
↓ open down ↓ 3 lines elided ↑ open up ↑
2565 2546          return (cmd);
2566 2547  }
2567 2548  
2568 2549  static struct mrsas_cmd *
2569 2550  get_mfi_app_pkt(struct mrsas_instance *instance)
2570 2551  {
2571 2552          mlist_t                         *head = &instance->app_cmd_pool_list;
2572 2553          struct mrsas_cmd        *cmd = NULL;
2573 2554  
2574 2555          mutex_enter(&instance->app_cmd_pool_mtx);
2575      -        ASSERT(mutex_owned(&instance->app_cmd_pool_mtx));
2576 2556  
2577 2557          if (!mlist_empty(head)) {
2578 2558                  cmd = mlist_entry(head->next, struct mrsas_cmd, list);
2579 2559                  mlist_del_init(head->next);
2580 2560          }
2581 2561          if (cmd != NULL) {
2582 2562                  cmd->pkt = NULL;
2583 2563                  cmd->retry_count_for_ocr = 0;
2584 2564                  cmd->drv_pkt_time = 0;
2585 2565          }
↓ open down ↓ 2 lines elided ↑ open up ↑
2588 2568  
2589 2569          return (cmd);
2590 2570  }
2591 2571  /*
2592 2572   * return_mfi_pkt : Return a cmd to free command pool
2593 2573   */
2594 2574  static void
2595 2575  return_mfi_pkt(struct mrsas_instance *instance, struct mrsas_cmd *cmd)
2596 2576  {
2597 2577          mutex_enter(&instance->cmd_pool_mtx);
2598      -        ASSERT(mutex_owned(&instance->cmd_pool_mtx));
2599 2578          /* use mlist_add_tail for debug assistance */
2600 2579          mlist_add_tail(&cmd->list, &instance->cmd_pool_list);
2601 2580  
2602 2581          mutex_exit(&instance->cmd_pool_mtx);
2603 2582  }
2604 2583  
2605 2584  static void
2606 2585  return_mfi_app_pkt(struct mrsas_instance *instance, struct mrsas_cmd *cmd)
2607 2586  {
2608 2587          mutex_enter(&instance->app_cmd_pool_mtx);
2609      -        ASSERT(mutex_owned(&instance->app_cmd_pool_mtx));
2610 2588  
2611 2589          mlist_add(&cmd->list, &instance->app_cmd_pool_list);
2612 2590  
2613 2591          mutex_exit(&instance->app_cmd_pool_mtx);
2614 2592  }
2615 2593  void
2616 2594  push_pending_mfi_pkt(struct mrsas_instance *instance, struct mrsas_cmd *cmd)
2617 2595  {
2618 2596          struct scsi_pkt *pkt;
2619 2597          struct mrsas_header     *hdr;
2620 2598          con_log(CL_DLEVEL2, (CE_NOTE, "push_pending_pkt(): Called\n"));
2621 2599          mutex_enter(&instance->cmd_pend_mtx);
2622      -        ASSERT(mutex_owned(&instance->cmd_pend_mtx));
2623 2600          mlist_del_init(&cmd->list);
2624 2601          mlist_add_tail(&cmd->list, &instance->cmd_pend_list);
2625 2602          if (cmd->sync_cmd == MRSAS_TRUE) {
2626 2603                  hdr = (struct mrsas_header *)&cmd->frame->hdr;
2627 2604                  if (hdr) {
2628 2605                          con_log(CL_ANN1, (CE_CONT,
2629 2606                              "push_pending_mfi_pkt: "
2630 2607                              "cmd %p index %x "
2631 2608                              "time %llx",
2632 2609                              (void *)cmd, cmd->index,
↓ open down ↓ 38 lines elided ↑ open up ↑
2671 2648  {
2672 2649          mlist_t *head = &instance->cmd_pend_list;
2673 2650          mlist_t *tmp = head;
2674 2651          struct mrsas_cmd *cmd = NULL;
2675 2652          struct mrsas_header     *hdr;
2676 2653          unsigned int            flag = 1;
2677 2654          struct scsi_pkt *pkt;
2678 2655          int saved_level;
2679 2656          int cmd_count = 0;
2680 2657  
2681      -
2682 2658          saved_level = debug_level_g;
2683 2659          debug_level_g = CL_ANN1;
2684 2660  
2685 2661          cmn_err(CE_NOTE, "mrsas_print_pending_cmds(): Called\n");
2686 2662  
2687 2663          while (flag) {
2688 2664                  mutex_enter(&instance->cmd_pend_mtx);
2689 2665                  tmp     =       tmp->next;
2690 2666                  if (tmp == head) {
2691 2667                          mutex_exit(&instance->cmd_pend_mtx);
↓ open down ↓ 985 lines elided ↑ open up ↑
3677 3653           * Disable interrupt before sending init frame ( see linux driver code)
3678 3654           * send INIT MFI frame in polled mode
3679 3655           */
3680 3656          if (instance->func_ptr->issue_cmd_in_poll_mode(instance, cmd)) {
3681 3657                  con_log(CL_ANN, (CE_WARN, "failed to init firmware"));
3682 3658                  goto fail_fw_init;
3683 3659          }
3684 3660  
3685 3661          if (mrsas_common_check(instance, cmd) != DDI_SUCCESS)
3686 3662                  goto fail_fw_init;
3687      -        /* return_mfi_pkt(instance, cmd); */ /* XXX KEBE ASKS, inherit? */
     3663 +        return_mfi_pkt(instance, cmd);
3688 3664  
3689 3665          if (ctio_enable &&
3690 3666              (instance->func_ptr->read_fw_status_reg(instance) & 0x04000000)) {
3691 3667                  con_log(CL_ANN, (CE_NOTE, "mr_sas: IEEE SGL's supported"));
3692 3668                  instance->flag_ieee = 1;
3693 3669          } else {
3694 3670                  instance->flag_ieee = 0;
3695 3671          }
3696 3672  
3697 3673          instance->unroll.alloc_space_mfi = 1;
↓ open down ↓ 1179 lines elided ↑ open up ↑
4877 4853              DDI_DMA_RDWR | DDI_DMA_STREAMING, DDI_DMA_SLEEP, NULL,
4878 4854              &obj->buffer, &alen, &obj->acc_handle) != DDI_SUCCESS) ||
4879 4855              alen < obj->size) {
4880 4856  
4881 4857                  ddi_dma_free_handle(&obj->dma_handle);
4882 4858  
4883 4859                  con_log(CL_ANN, (CE_WARN, "Failed : ddi_dma_mem_alloc"));
4884 4860  
4885 4861                  return (-1);
4886 4862          }
4887      -        if (obj->dma_handle == NULL) {
4888      -                /* XXX KEBE ASKS --> fm_service_impact()? */
4889      -                con_log(CL_ANN, (CE_WARN, "Failed : ddi_dma_mem_alloc"));
4890      -                return (-1);
4891      -        }
4892 4863  
4893 4864          if (ddi_dma_addr_bind_handle(obj->dma_handle, NULL, obj->buffer,
4894 4865              obj->size, DDI_DMA_RDWR | DDI_DMA_STREAMING, DDI_DMA_SLEEP,
4895 4866              NULL, &obj->dma_cookie[0], &cookie_cnt) != DDI_SUCCESS) {
4896 4867  
4897 4868                  ddi_dma_mem_free(&obj->acc_handle);
4898 4869                  ddi_dma_free_handle(&obj->dma_handle);
4899 4870  
4900 4871                  con_log(CL_ANN, (CE_WARN, "Failed : ddi_dma_addr_bind_handle"));
4901 4872  
4902 4873                  return (-1);
4903 4874          }
4904      -        if (obj->acc_handle == NULL) {
4905      -                /* XXX KEBE ASKS --> fm_service_impact()? */
4906      -                ddi_dma_mem_free(&obj->acc_handle);
4907      -                ddi_dma_free_handle(&obj->dma_handle);
4908 4875  
4909      -                con_log(CL_ANN, (CE_WARN, "Failed : ddi_dma_addr_bind_handle"));
4910      -                return (-1);
4911      -        }
4912      -
4913 4876          if (mrsas_check_dma_handle(obj->dma_handle) != DDI_SUCCESS) {
4914 4877                  ddi_fm_service_impact(instance->dip, DDI_SERVICE_LOST);
4915 4878                  return (-1);
4916 4879          }
4917 4880  
4918 4881          if (mrsas_check_acc_handle(obj->acc_handle) != DDI_SUCCESS) {
4919 4882                  ddi_fm_service_impact(instance->dip, DDI_SERVICE_LOST);
4920 4883                  return (-1);
4921 4884          }
4922 4885  
↓ open down ↓ 568 lines elided ↑ open up ↑
5491 5454  /*
5492 5455   * issue_mfi_pthru
5493 5456   */
5494 5457  static int
5495 5458  issue_mfi_pthru(struct mrsas_instance *instance, struct mrsas_ioctl *ioctl,
5496 5459      struct mrsas_cmd *cmd, int mode)
5497 5460  {
5498 5461          void            *ubuf;
5499 5462          uint32_t        kphys_addr = 0;
5500 5463          uint32_t        xferlen = 0;
5501      -        uint32_t new_xfer_length = 0;
     5464 +        uint32_t        new_xfer_length = 0;
5502 5465          uint_t          model;
5503 5466          ddi_acc_handle_t        acc_handle = cmd->frame_dma_obj.acc_handle;
5504 5467          dma_obj_t                       pthru_dma_obj;
5505 5468          struct mrsas_pthru_frame        *kpthru;
5506 5469          struct mrsas_pthru_frame        *pthru;
5507 5470          int i;
5508 5471          pthru = &cmd->frame->pthru;
5509 5472          kpthru = (struct mrsas_pthru_frame *)&ioctl->frame[0];
5510 5473  
5511 5474          if (instance->adapterresetinprogress) {
↓ open down ↓ 1328 lines elided ↑ open up ↑
6840 6803                          push_pending_mfi_pkt(instance, cmd);
6841 6804                  }
6842 6805  
6843 6806          } else {
6844 6807                  con_log(CL_DLEVEL1, (CE_NOTE, "%llx : issue_cmd_ppc:"
6845 6808                      "ISSUED CMD TO FW : called : cmd : %p, instance: %p"
6846 6809                      "(NO PKT)\n", gethrtime(), (void *)cmd, (void *)instance));
6847 6810          }
6848 6811  
6849 6812          mutex_enter(&instance->reg_write_mtx);
6850      -        ASSERT(mutex_owned(&instance->reg_write_mtx));
6851 6813          /* Issue the command to the FW */
6852 6814          WR_IB_QPORT((cmd->frame_phys_addr) |
6853 6815              (((cmd->frame_count - 1) << 1) | 1), instance);
6854 6816          mutex_exit(&instance->reg_write_mtx);
6855 6817  
6856 6818  }
6857 6819  
6858 6820  /*
6859 6821   * issue_cmd_in_sync_mode
6860 6822   */
↓ open down ↓ 20 lines elided ↑ open up ↑
6881 6843  
6882 6844                  return (DDI_SUCCESS);
6883 6845          } else {
6884 6846                  con_log(CL_ANN1, (CE_NOTE, "sync_mode_ppc: pushing the pkt\n"));
6885 6847                  push_pending_mfi_pkt(instance, cmd);
6886 6848          }
6887 6849  
6888 6850          cmd->cmd_status = ENODATA;
6889 6851  
6890 6852          mutex_enter(&instance->reg_write_mtx);
6891      -        ASSERT(mutex_owned(&instance->reg_write_mtx));
6892 6853          /* Issue the command to the FW */
6893 6854          WR_IB_QPORT((cmd->frame_phys_addr) |
6894 6855              (((cmd->frame_count - 1) << 1) | 1), instance);
6895 6856          mutex_exit(&instance->reg_write_mtx);
6896 6857  
6897 6858          mutex_enter(&instance->int_cmd_mtx);
6898 6859          for (i = 0; i < msecs && (cmd->cmd_status == ENODATA); i++) {
6899 6860                  cv_wait(&instance->int_cmd_cv, &instance->int_cmd_mtx);
6900 6861          }
6901 6862          mutex_exit(&instance->int_cmd_mtx);
↓ open down ↓ 281 lines elided ↑ open up ↑
7183 7144          con_log(CL_ANN1, (CE_NOTE, "mrsas_reset_ppc: "
7184 7145              "mrsas_print_pending_cmd done\n"));
7185 7146  
7186 7147          instance->func_ptr->enable_intr(instance);
7187 7148          instance->fw_outstanding = 0;
7188 7149  
7189 7150          con_log(CL_ANN1, (CE_NOTE, "mrsas_reset_ppc: "
7190 7151              "Calling mrsas_issue_pending_cmds"));
7191 7152          (void) mrsas_issue_pending_cmds(instance);
7192 7153          con_log(CL_ANN1, (CE_NOTE, "mrsas_reset_ppc: "
7193      -        "issue_pending_cmds done.\n"));
     7154 +            "issue_pending_cmds done.\n"));
7194 7155  
7195 7156          con_log(CL_ANN1, (CE_NOTE, "mrsas_reset_ppc: "
7196 7157              "Calling aen registration"));
7197 7158  
7198 7159  
7199 7160          instance->aen_cmd->retry_count_for_ocr = 0;
7200 7161          instance->aen_cmd->drv_pkt_time = 0;
7201 7162  
7202 7163          instance->func_ptr->issue_cmd(instance->aen_cmd, instance);
7203 7164          con_log(CL_ANN1, (CE_NOTE, "Unsetting adpresetinprogress flag.\n"));
↓ open down ↓ 818 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX