Print this page
NEX-18919 Platform component fix for the MetroHA reboot -dn issue
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
NEX-17910 vhci_scsi_reset is too noisy
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
NEX-1049 System panic in module "scsi_vhci" due to a NULL pointer dereference
OS-62 slow io error detector is needed.
re #13247 rb4316 Large, fixed command timeouts impair command drop recovery

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/scsi/adapters/scsi_vhci/scsi_vhci.c
          +++ new/usr/src/uts/common/io/scsi/adapters/scsi_vhci/scsi_vhci.c
↓ open down ↓ 10 lines elided ↑ open up ↑
  11   11   * and limitations under the License.
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
       21 +
  21   22  /*
  22   23   * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
  23      - */
  24      -/*
  25      - * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
       24 + * Copyright 2018 Nexenta Systems, Inc.
  26   25   * Copyright (c) 2016 by Delphix. All rights reserved.
  27   26   */
  28   27  
  29   28  /*
  30   29   * Multiplexed I/O SCSI vHCI implementation
  31   30   */
  32   31  
  33   32  #include <sys/conf.h>
  34   33  #include <sys/file.h>
  35   34  #include <sys/ddi.h>
↓ open down ↓ 11 lines elided ↑ open up ↑
  47   46  extern ddi_dma_attr_t scsi_alloc_attr;
  48   47  
  49   48  #ifdef  DEBUG
  50   49  int     vhci_debug = VHCI_DEBUG_DEFAULT_VAL;
  51   50  #endif
  52   51  
  53   52  /* retry for the vhci_do_prout command when a not ready is returned */
  54   53  int vhci_prout_not_ready_retry = 180;
  55   54  
  56   55  /*
       56 + * Timeout in seconds for SCSI commands used by vHCI.
       57 + */
       58 +int vhci_io_time = 30;
       59 +
       60 +/*
  57   61   * These values are defined to support the internal retry of
  58   62   * SCSI packets for better sense code handling.
  59   63   */
  60   64  #define VHCI_CMD_CMPLT  0
  61   65  #define VHCI_CMD_RETRY  1
  62   66  #define VHCI_CMD_ERROR  -1
  63   67  
  64   68  #define PROPFLAGS (DDI_PROP_DONTPASS | DDI_PROP_NOTPROM)
  65   69  #define VHCI_SCSI_PERR          0x47
  66   70  #define VHCI_PGR_ILLEGALOP      -2
↓ open down ↓ 58 lines elided ↑ open up ↑
 125  129      scsi_hba_tran_t *, struct scsi_device *);
 126  130  static void vhci_scsi_tgt_free(dev_info_t *, dev_info_t *, scsi_hba_tran_t *,
 127  131      struct scsi_device *);
 128  132  static int vhci_pgr_register_start(scsi_vhci_lun_t *, struct scsi_pkt *);
 129  133  static int vhci_scsi_start(struct scsi_address *, struct scsi_pkt *);
 130  134  static int vhci_scsi_abort(struct scsi_address *, struct scsi_pkt *);
 131  135  static int vhci_scsi_reset(struct scsi_address *, int);
 132  136  static int vhci_scsi_reset_target(struct scsi_address *, int level,
 133  137      uint8_t select_path);
 134  138  static int vhci_scsi_reset_bus(struct scsi_address *);
      139 +static int vhci_scsi_reset_all_paths(struct scsi_address *);
 135  140  static int vhci_scsi_getcap(struct scsi_address *, char *, int);
 136  141  static int vhci_scsi_setcap(struct scsi_address *, char *, int, int);
 137  142  static int vhci_commoncap(struct scsi_address *, char *, int, int, int);
 138  143  static int vhci_pHCI_cap(struct scsi_address *ap, char *cap, int val, int whom,
 139  144      mdi_pathinfo_t *pip);
 140  145  static struct scsi_pkt *vhci_scsi_init_pkt(struct scsi_address *,
 141  146      struct scsi_pkt *, struct buf *, int, int, int, int, int (*)(), caddr_t);
 142  147  static void vhci_scsi_destroy_pkt(struct scsi_address *, struct scsi_pkt *);
 143  148  static void vhci_scsi_dmafree(struct scsi_address *, struct scsi_pkt *);
 144  149  static void vhci_scsi_sync_pkt(struct scsi_address *, struct scsi_pkt *);
↓ open down ↓ 1234 lines elided ↑ open up ↑
1379 1384  
1380 1385                                  if (restore_lbp)
1381 1386                                          (void) mdi_set_lb_policy(cdip, lbp);
1382 1387  
1383 1388                                  /* no need to check pkt_reserve_cmd here */
1384 1389                                  vlun->svl_flags &= ~VLUN_QUIESCED_FLG;
1385 1390                                  return (TRAN_FATAL_ERROR);
1386 1391                          }
1387 1392  
1388 1393                          rel_pkt->pkt_cdbp[0] = SCMD_RELEASE;
1389      -                        rel_pkt->pkt_time = 60;
     1394 +                        rel_pkt->pkt_time = vhci_io_time;
1390 1395  
1391 1396                          /*
1392 1397                           * Ignore the return value.  If it will fail
1393 1398                           * then most likely it is no longer reserved
1394 1399                           * anyway.
1395 1400                           */
1396 1401                          (void) vhci_do_scsi_cmd(rel_pkt);
1397 1402                          VHCI_DEBUG(1, (CE_NOTE, NULL,
1398 1403                              "!vhci_scsi_start: path 0x%p, issued SCSI-2"
1399 1404                              " RELEASE\n", (void *)pip));
↓ open down ↓ 128 lines elided ↑ open up ↑
1528 1533          return (TRAN_BUSY);
1529 1534  }
1530 1535  
1531 1536  /*
1532 1537   * Function name : vhci_scsi_reset()
1533 1538   *
1534 1539   * Return Values : 0 - reset failed
1535 1540   *                 1 - reset succeeded
1536 1541   */
1537 1542  
1538      -/* ARGSUSED */
1539 1543  static int
1540 1544  vhci_scsi_reset(struct scsi_address *ap, int level)
1541 1545  {
1542      -        int rval = 0;
1543      -
1544      -        cmn_err(CE_WARN, "!vhci_scsi_reset 0x%x", level);
1545 1546          if ((level == RESET_TARGET) || (level == RESET_LUN)) {
1546 1547                  return (vhci_scsi_reset_target(ap, level, TRUE));
1547 1548          } else if (level == RESET_ALL) {
1548 1549                  return (vhci_scsi_reset_bus(ap));
     1550 +        } else {
     1551 +                return (0);
1549 1552          }
1550      -
1551      -        return (rval);
1552 1553  }
1553 1554  
1554 1555  /*
1555 1556   * vhci_recovery_reset:
1556 1557   *      Issues reset to the device
1557 1558   * Input:
1558 1559   *      vlun - vhci lun pointer of the device
1559 1560   *      ap - address of the device
1560 1561   *      select_path:
1561 1562   *              If select_path is FALSE, then the address specified in ap is
↓ open down ↓ 45 lines elided ↑ open up ↑
1607 1608  /*
1608 1609   * Note: The scsi_address passed to this routine could be the scsi_address
1609 1610   * for the virtual device or the physical device. No assumptions should be
1610 1611   * made in this routine about the contents of the ap structure.
1611 1612   * Further, note that the child dip would be the dip of the ssd node regardless
1612 1613   * of the scsi_address passed in.
1613 1614   */
1614 1615  static int
1615 1616  vhci_scsi_reset_target(struct scsi_address *ap, int level, uint8_t select_path)
1616 1617  {
1617      -        dev_info_t              *vdip, *cdip;
     1618 +        dev_info_t              *vdip, *cdip = NULL;
1618 1619          mdi_pathinfo_t          *pip = NULL;
1619 1620          mdi_pathinfo_t          *npip = NULL;
1620 1621          int                     rval = -1;
1621 1622          scsi_vhci_priv_t        *svp = NULL;
1622 1623          struct scsi_address     *pap = NULL;
1623 1624          scsi_hba_tran_t         *hba = NULL;
1624 1625          int                     sps;
1625 1626          struct scsi_vhci        *vhci = NULL;
1626 1627  
1627 1628          if (select_path != TRUE) {
1628 1629                  ASSERT(ap != NULL);
1629 1630                  if (level == RESET_LUN) {
1630 1631                          hba = ap->a_hba_tran;
1631 1632                          ASSERT(hba != NULL);
1632 1633                          return (hba->tran_reset(ap, RESET_LUN));
1633 1634                  }
1634 1635                  return (scsi_reset(ap, level));
1635 1636          }
1636 1637  
1637      -        cdip = ADDR2DIP(ap);
     1638 +        /*
     1639 +         * SCSI address should be interpreted according to the pHBA flags.
     1640 +         */
     1641 +        if (ap->a_hba_tran->tran_hba_flags & SCSI_HBA_ADDR_COMPLEX)
     1642 +                cdip = ADDR2DIP(ap);
     1643 +        else if (ap->a_hba_tran->tran_hba_flags & SCSI_HBA_TRAN_CLONE)
     1644 +                cdip = ap->a_hba_tran->tran_sd->sd_dev;
     1645 +
1638 1646          ASSERT(cdip != NULL);
1639 1647          vdip = ddi_get_parent(cdip);
1640 1648          ASSERT(vdip != NULL);
1641 1649          vhci = ddi_get_soft_state(vhci_softstate, ddi_get_instance(vdip));
1642 1650          ASSERT(vhci != NULL);
1643 1651  
1644 1652          rval = mdi_select_path(cdip, NULL, MDI_SELECT_ONLINE_PATH, NULL, &pip);
1645 1653          if ((rval != MDI_SUCCESS) || (pip == NULL)) {
1646 1654                  VHCI_DEBUG(2, (CE_WARN, NULL, "!vhci_scsi_reset_target: "
1647 1655                      "Unable to get a path, dip 0x%p", (void *)cdip));
↓ open down ↓ 50 lines elided ↑ open up ↑
1698 1706                  mutex_exit(&vhci->vhci_mutex);
1699 1707                  VHCI_DEBUG(6, (CE_NOTE, NULL, "!vhci_scsi_reset_target: "
1700 1708                      "reset %d sent down pip:%p for cdip:%p\n", level,
1701 1709                      (void *)pip, (void *)cdip));
1702 1710                  return (1);
1703 1711          }
1704 1712          mdi_rele_path(pip);
1705 1713          return (0);
1706 1714  }
1707 1715  
1708      -
1709 1716  /* ARGSUSED */
1710 1717  static int
1711 1718  vhci_scsi_reset_bus(struct scsi_address *ap)
1712 1719  {
1713 1720          return (1);
1714 1721  }
1715 1722  
     1723 +/*
     1724 + * This is a special version of LUN reset routine
     1725 + * which sends a reset down all available paths.
     1726 + */
     1727 +static int
     1728 +vhci_scsi_reset_all_paths(struct scsi_address *ap)
     1729 +{
     1730 +        dev_info_t              *vdip, *cdip = NULL;
     1731 +        mdi_pathinfo_t          *pip = NULL;
     1732 +        mdi_pathinfo_t          *npip = NULL;
     1733 +        int                     rval = -1;
     1734 +        scsi_vhci_priv_t        *svp = NULL;
     1735 +        struct scsi_address     *pap = NULL;
     1736 +        scsi_hba_tran_t         *hba = NULL;
     1737 +        int                     sps = MDI_SUCCESS;
     1738 +        int                     reset_result = 0;
     1739 +        struct scsi_vhci        *vhci = NULL;
1716 1740  
     1741 +        /*
     1742 +         * SCSI address should be interpreted according to the pHBA flags.
     1743 +         */
     1744 +        if (ap->a_hba_tran->tran_hba_flags & SCSI_HBA_ADDR_COMPLEX)
     1745 +                cdip = ADDR2DIP(ap);
     1746 +        else if (ap->a_hba_tran->tran_hba_flags & SCSI_HBA_TRAN_CLONE)
     1747 +                cdip = ap->a_hba_tran->tran_sd->sd_dev;
     1748 +
     1749 +        if (cdip == NULL || (vdip = ddi_get_parent(cdip)) == NULL ||
     1750 +            (vhci = ddi_get_soft_state(vhci_softstate,
     1751 +                ddi_get_instance(vdip))) == NULL) {
     1752 +                VHCI_DEBUG(2, (CE_WARN, NULL, "!%s: "
     1753 +                    "Child info pointer NULL, cdip 0x%p",
     1754 +                    __func__, (void *)cdip));
     1755 +                return (0);
     1756 +        }
     1757 +
     1758 +        rval = mdi_select_path(cdip, NULL, MDI_SELECT_ONLINE_PATH, NULL, &pip);
     1759 +        if ((rval != MDI_SUCCESS) || (pip == NULL)) {
     1760 +                VHCI_DEBUG(2, (CE_WARN, NULL, "!%s: "
     1761 +                    "Unable to get a path, dip 0x%p",
     1762 +                    __func__, (void *)cdip));
     1763 +                return (0);
     1764 +        }
     1765 +again:
     1766 +        svp = (scsi_vhci_priv_t *)mdi_pi_get_vhci_private(pip);
     1767 +
     1768 +        if (svp == NULL || svp->svp_psd == NULL) {
     1769 +                VHCI_DEBUG(2, (CE_WARN, NULL, "!%s: "
     1770 +                    "private data is NULL, pip 0x%p",
     1771 +                    __func__, (void *)pip));
     1772 +                mdi_rele_path(pip);
     1773 +                return (0);
     1774 +        }
     1775 +
     1776 +        pap = &svp->svp_psd->sd_address;
     1777 +        hba = pap->a_hba_tran;
     1778 +
     1779 +        if (pap != NULL && hba != NULL && hba->tran_reset != NULL) {
     1780 +                /*
     1781 +                 * The following sends reset down all available paths
     1782 +                 */
     1783 +                if (sps == MDI_SUCCESS) {
     1784 +                        reset_result = hba->tran_reset(pap, RESET_LUN);
     1785 +
     1786 +                        VHCI_DEBUG(2, (CE_WARN, vdip, "!%s%d: "
     1787 +                            "path %s, reset LUN %s",
     1788 +                            ddi_driver_name(cdip), ddi_get_instance(cdip),
     1789 +                            mdi_pi_spathname(pip),
     1790 +                            (reset_result ? "Success" : "Failed")));
     1791 +
     1792 +                        /*
     1793 +                         * Select next path and issue the reset, repeat
     1794 +                         * until all paths are exhausted regardless of success
     1795 +                         * or failure of the previous reset.
     1796 +                         */
     1797 +                        sps = mdi_select_path(cdip, NULL,
     1798 +                            MDI_SELECT_ONLINE_PATH, pip, &npip);
     1799 +                        if ((sps != MDI_SUCCESS) || (npip == NULL)) {
     1800 +                                mdi_rele_path(pip);
     1801 +                                return (0);
     1802 +                        }
     1803 +                        mdi_rele_path(pip);
     1804 +                        pip = npip;
     1805 +                        goto again;
     1806 +                }
     1807 +                mdi_rele_path(pip);
     1808 +                mutex_enter(&vhci->vhci_mutex);
     1809 +                scsi_hba_reset_notify_callback(&vhci->vhci_mutex,
     1810 +                    &vhci->vhci_reset_notify_listf);
     1811 +                mutex_exit(&vhci->vhci_mutex);
     1812 +                VHCI_DEBUG(6, (CE_NOTE, NULL, "!vhci_scsi_reset_target: "
     1813 +                    "reset %d sent down pip:%p for cdip:%p\n", RESET_LUN,
     1814 +                    (void *)pip, (void *)cdip));
     1815 +                return (1);
     1816 +        }
     1817 +        mdi_rele_path(pip);
     1818 +        return (0);
     1819 +}
     1820 +
1717 1821  /*
1718 1822   * called by vhci_getcap and vhci_setcap to get and set (respectively)
1719 1823   * SCSI capabilities
1720 1824   */
1721 1825  /* ARGSUSED */
1722 1826  static int
1723 1827  vhci_commoncap(struct scsi_address *ap, char *cap,
1724 1828      int val, int tgtonly, int doset)
1725 1829  {
1726 1830          struct scsi_vhci                *vhci = ADDR2VHCI(ap);
↓ open down ↓ 1452 lines elided ↑ open up ↑
3179 3283  
3180 3284          /*
3181 3285           * sync up the target driver's pkt with the pkt that
3182 3286           * we actually used
3183 3287           */
3184 3288          *(tpkt->pkt_scbp) = *(pkt->pkt_scbp);
3185 3289          tpkt->pkt_resid = pkt->pkt_resid;
3186 3290          tpkt->pkt_state = pkt->pkt_state;
3187 3291          tpkt->pkt_statistics = pkt->pkt_statistics;
3188 3292          tpkt->pkt_reason = pkt->pkt_reason;
     3293 +        tpkt->pkt_start = pkt->pkt_start;
     3294 +        tpkt->pkt_stop = pkt->pkt_stop;
3189 3295  
3190 3296          /* Return path_instance information back to the target driver. */
3191 3297          if (scsi_pkt_allocated_correctly(tpkt)) {
3192 3298                  if (scsi_pkt_allocated_correctly(pkt)) {
3193 3299                          /*
3194 3300                           * If both packets were correctly allocated,
3195 3301                           * return path returned by pHCI.
3196 3302                           */
3197 3303                          tpkt->pkt_path_instance = pkt->pkt_path_instance;
3198 3304                  } else {
↓ open down ↓ 751 lines elided ↑ open up ↑
3950 4056                                  mdi_rele_path(pip);
3951 4057                                  goto done;
3952 4058                          }
3953 4059                          pkt = scsi_init_pkt(&svp->svp_psd->sd_address, NULL, bp,
3954 4060                              CDB_GROUP1, sizeof (struct scsi_arq_status), 0,
3955 4061                              PKT_CONSISTENT, NULL, NULL);
3956 4062                          if (pkt) {
3957 4063                                  (void) scsi_setup_cdb((union scsi_cdb *)
3958 4064                                      (uintptr_t)pkt->pkt_cdbp, SCMD_READ, 1, 1,
3959 4065                                      0);
3960      -                                pkt->pkt_time = 3*30;
     4066 +                                pkt->pkt_time = 2 * vhci_io_time;
3961 4067                                  pkt->pkt_flags = FLAG_NOINTR;
3962 4068                                  pkt->pkt_path_instance =
3963 4069                                      mdi_pi_get_path_instance(pip);
3964 4070  
3965 4071                                  if ((scsi_transport(pkt) == TRAN_ACCEPT) &&
3966 4072                                      (pkt->pkt_reason == CMD_CMPLT) &&
3967 4073                                      (SCBP_C(pkt) ==
3968 4074                                      STATUS_RESERVATION_CONFLICT)) {
3969 4075                                          VHCI_DEBUG(1, (CE_NOTE, NULL,
3970 4076                                              "!vhci_update_pathstates: reserv. "
↓ open down ↓ 1244 lines elided ↑ open up ↑
5215 5321                              SLEEP_FUNC, NULL);
5216 5322                          if (pkt == NULL) {
5217 5323                                  VHCI_DEBUG(1, (CE_NOTE, NULL,
5218 5324                                      "!vhci_pathinfo_online: "
5219 5325                                      "Release init_pkt failed :%p\n",
5220 5326                                      (void *)pip));
5221 5327                                  rval = MDI_FAILURE;
5222 5328                                  goto failure;
5223 5329                          }
5224 5330                          pkt->pkt_cdbp[0] = SCMD_RELEASE;
5225      -                        pkt->pkt_time = 60;
     5331 +                        pkt->pkt_time = vhci_io_time;
5226 5332  
5227 5333                          VHCI_DEBUG(1, (CE_NOTE, NULL,
5228 5334                              "!vhci_path_online: path:%p "
5229 5335                              "Issued SCSI-2 RELEASE\n", (void *)pip));
5230 5336  
5231 5337                          /* Ignore the return value */
5232 5338                          (void) vhci_do_scsi_cmd(pkt);
5233 5339                          scsi_destroy_pkt(pkt);
5234 5340                  }
5235 5341          }
↓ open down ↓ 906 lines elided ↑ open up ↑
6142 6248                  retval = mdi_select_path(child, NULL,
6143 6249                      (MDI_SELECT_ONLINE_PATH | MDI_SELECT_STANDBY_PATH),
6144 6250                      NULL, &pip);
6145 6251                  if ((retval != MDI_SUCCESS) || (pip == NULL)) {
6146 6252                          VHCI_DEBUG(2, (CE_WARN, NULL, "!vhci_ioctl:"
6147 6253                              "Unable to get a path, dip 0x%p", (void *)child));
6148 6254                          rv = ENXIO;
6149 6255                          break;
6150 6256                  }
6151 6257                  svp = (scsi_vhci_priv_t *)mdi_pi_get_vhci_private(pip);
6152      -                if (vhci_recovery_reset(svp->svp_svl,
6153      -                    &svp->svp_psd->sd_address, TRUE,
6154      -                    VHCI_DEPTH_TARGET) == 0) {
6155      -                        VHCI_DEBUG(1, (CE_NOTE, NULL,
6156      -                            "!vhci_ioctl(pip:%p): "
6157      -                            "reset failed\n", (void *)pip));
     6258 +
     6259 +                VHCI_DEBUG(2, (CE_NOTE, NULL,
     6260 +                    "!reset %s@%s on all available paths",
     6261 +                    ndi_dc_getname(dcp), ndi_dc_getaddr(dcp)));
     6262 +
     6263 +                if (vhci_scsi_reset_all_paths(&svp->svp_psd->sd_address) != 0) {
     6264 +                        VHCI_DEBUG(2, (CE_WARN, NULL,
     6265 +                            "!vhci_ioctl(pip:%p): reset failed\n",
     6266 +                            (void *)pip));
6158 6267                          rv = ENXIO;
6159 6268                  }
6160 6269                  mdi_rele_path(pip);
6161 6270                  break;
6162 6271  
6163 6272          case DEVCTL_BUS_QUIESCE:
6164 6273          case DEVCTL_BUS_UNQUIESCE:
6165 6274          case DEVCTL_BUS_RESET:
6166 6275          case DEVCTL_BUS_RESETALL:
6167 6276  #ifdef  DEBUG
↓ open down ↓ 803 lines elided ↑ open up ↑
6971 7080                  }
6972 7081                  pkt = scsi_init_pkt(&svp->svp_psd->sd_address, NULL, bp,
6973 7082                      CDB_GROUP1, sizeof (struct scsi_arq_status), 0,
6974 7083                      PKT_CONSISTENT, NULL, NULL);
6975 7084                  if (pkt) {
6976 7085                          (void) scsi_setup_cdb((union scsi_cdb *)(uintptr_t)
6977 7086                              pkt->pkt_cdbp, SCMD_READ, 1, 1, 0);
6978 7087                          pkt->pkt_flags = FLAG_NOINTR;
6979 7088  check_path_again:
6980 7089                          pkt->pkt_path_instance = mdi_pi_get_path_instance(npip);
6981      -                        pkt->pkt_time = 3*30;
     7090 +                        pkt->pkt_time = 2 * vhci_io_time;
6982 7091  
6983 7092                          if (scsi_transport(pkt) == TRAN_ACCEPT) {
6984 7093                                  switch (pkt->pkt_reason) {
6985 7094                                  case CMD_CMPLT:
6986 7095                                          switch (SCBP_C(pkt)) {
6987 7096                                          case STATUS_GOOD:
6988 7097                                                  /* Already failed over */
6989 7098                                                  activation_done = 1;
6990 7099                                                  break;
6991 7100                                          case STATUS_RESERVATION_CONFLICT:
↓ open down ↓ 1340 lines elided ↑ open up ↑
8332 8441                  scsi_free_consistent_buf(rqbp);
8333 8442                  return (-1);
8334 8443          }
8335 8444  
8336 8445          (void) scsi_setup_cdb((union scsi_cdb *)(intptr_t)rqpkt->pkt_cdbp,
8337 8446              SCMD_REQUEST_SENSE, 0, SENSE_LENGTH, 0);
8338 8447  
8339 8448          mp_uscmdp->rqbp = rqbp;
8340 8449          rqbp->b_private = mp_uscmdp;
8341 8450          rqpkt->pkt_flags |= FLAG_SENSING;
8342      -        rqpkt->pkt_time = 60;
     8451 +        rqpkt->pkt_time = vhci_io_time;
8343 8452          rqpkt->pkt_comp = vhci_uscsi_iodone;
8344 8453          rqpkt->pkt_private = mp_uscmdp;
8345 8454  
8346 8455          /*
8347 8456           * NOTE: This code path is related to MPAPI uscsi(7I), so path
8348 8457           * selection is not based on path_instance.
8349 8458           */
8350 8459          if (scsi_pkt_allocated_correctly(rqpkt))
8351 8460                  rqpkt->pkt_path_instance = 0;
8352 8461  
↓ open down ↓ 194 lines elided ↑ open up ↑
8547 8656                  VHCI_DEBUG(4, (CE_NOTE, NULL,
8548 8657                      "vhci_uscsi_iostart: rval: EINVAL"));
8549 8658                  bp->b_resid = bp->b_bcount;
8550 8659                  uscmdp->uscsi_resid = bp->b_bcount;
8551 8660                  bioerror(bp, EINVAL);
8552 8661                  biodone(bp);
8553 8662                  return (EINVAL);
8554 8663          }
8555 8664  
8556 8665          pkt->pkt_time = uscmdp->uscsi_timeout;
     8666 +        if (pkt->pkt_time == 0)
     8667 +                pkt->pkt_time = vhci_io_time;
     8668 +
8557 8669          bcopy(uscmdp->uscsi_cdb, pkt->pkt_cdbp, (size_t)uscmdp->uscsi_cdblen);
8558 8670          pkt->pkt_comp = vhci_uscsi_iodone;
8559 8671          pkt->pkt_private = mp_uscmdp;
8560 8672          if (uscmdp->uscsi_flags & USCSI_SILENT)
8561 8673                  pkt->pkt_flags |= FLAG_SILENT;
8562 8674          if (uscmdp->uscsi_flags & USCSI_ISOLATE)
8563 8675                  pkt->pkt_flags |= FLAG_ISOLATE;
8564 8676          if (uscmdp->uscsi_flags & USCSI_DIAGNOSE)
8565 8677                  pkt->pkt_flags |= FLAG_DIAGNOSE;
8566 8678          if (uscmdp->uscsi_flags & USCSI_RENEGOT) {
↓ open down ↓ 254 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX