Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

IB/mthca: Fix timeout for INIT_HCA and a few other commands

Commands INIT_HCA, CLOSE_HCA, SYS_EN, SYS_DIS, and CLOSE_IB all have 1
second timeouts. For INIT_HCA this causes problems when had more than
2^18 are QPs configured, since the command takes more than 1 second to
complete.

All other commands have 60-second timeouts. This patch makes the
above commands consistent with the rest of the commands (and with the
chip documentation).

This patch is an expansion of a patch from Arthur Kepner
<akepner@sgi.com> fixing just the INIT_HCA timeout.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>

authored by

Jack Morgenstein and committed by
Roland Dreier
8531f1f1 a939b96c

+9 -7
+9 -7
drivers/infiniband/hw/mthca/mthca_cmd.c
··· 157 157 enum { 158 158 CMD_TIME_CLASS_A = (HZ + 999) / 1000 + 1, 159 159 CMD_TIME_CLASS_B = (HZ + 99) / 100 + 1, 160 - CMD_TIME_CLASS_C = (HZ + 9) / 10 + 1 160 + CMD_TIME_CLASS_C = (HZ + 9) / 10 + 1, 161 + CMD_TIME_CLASS_D = 60 * HZ 161 162 }; 162 163 #else 163 164 enum { 164 165 CMD_TIME_CLASS_A = 60 * HZ, 165 166 CMD_TIME_CLASS_B = 60 * HZ, 166 - CMD_TIME_CLASS_C = 60 * HZ 167 + CMD_TIME_CLASS_C = 60 * HZ, 168 + CMD_TIME_CLASS_D = 60 * HZ 167 169 }; 168 170 #endif 169 171 ··· 600 598 u64 out; 601 599 int ret; 602 600 603 - ret = mthca_cmd_imm(dev, 0, &out, 0, 0, CMD_SYS_EN, HZ, status); 601 + ret = mthca_cmd_imm(dev, 0, &out, 0, 0, CMD_SYS_EN, CMD_TIME_CLASS_D, status); 604 602 605 603 if (*status == MTHCA_CMD_STAT_DDR_MEM_ERR) 606 604 mthca_warn(dev, "SYS_EN DDR error: syn=%x, sock=%d, " ··· 613 611 614 612 int mthca_SYS_DIS(struct mthca_dev *dev, u8 *status) 615 613 { 616 - return mthca_cmd(dev, 0, 0, 0, CMD_SYS_DIS, HZ, status); 614 + return mthca_cmd(dev, 0, 0, 0, CMD_SYS_DIS, CMD_TIME_CLASS_C, status); 617 615 } 618 616 619 617 static int mthca_map_cmd(struct mthca_dev *dev, u16 op, struct mthca_icm *icm, ··· 1392 1390 MTHCA_PUT(inbox, param->uarc_base, INIT_HCA_UAR_CTX_BASE_OFFSET); 1393 1391 } 1394 1392 1395 - err = mthca_cmd(dev, mailbox->dma, 0, 0, CMD_INIT_HCA, HZ, status); 1393 + err = mthca_cmd(dev, mailbox->dma, 0, 0, CMD_INIT_HCA, CMD_TIME_CLASS_D, status); 1396 1394 1397 1395 mthca_free_mailbox(dev, mailbox); 1398 1396 return err; ··· 1452 1450 1453 1451 int mthca_CLOSE_IB(struct mthca_dev *dev, int port, u8 *status) 1454 1452 { 1455 - return mthca_cmd(dev, 0, port, 0, CMD_CLOSE_IB, HZ, status); 1453 + return mthca_cmd(dev, 0, port, 0, CMD_CLOSE_IB, CMD_TIME_CLASS_A, status); 1456 1454 } 1457 1455 1458 1456 int mthca_CLOSE_HCA(struct mthca_dev *dev, int panic, u8 *status) 1459 1457 { 1460 - return mthca_cmd(dev, 0, 0, panic, CMD_CLOSE_HCA, HZ, status); 1458 + return mthca_cmd(dev, 0, 0, panic, CMD_CLOSE_HCA, CMD_TIME_CLASS_C, status); 1461 1459 } 1462 1460 1463 1461 int mthca_SET_IB(struct mthca_dev *dev, struct mthca_set_ib_param *param,