From patchwork Mon Apr 11 13:45:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Marciniszyn X-Patchwork-Id: 698111 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3BDsPDl013736 for ; Mon, 11 Apr 2011 13:54:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751238Ab1DKNyW (ORCPT ); Mon, 11 Apr 2011 09:54:22 -0400 Received: from [198.186.4.11] ([198.186.4.11]:56599 "EHLO kop-dev-sles11-04.qlogic.org" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750969Ab1DKNyW (ORCPT ); Mon, 11 Apr 2011 09:54:22 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 11 Apr 2011 13:54:26 +0000 (UTC) X-Greylist: delayed 543 seconds by postgrey-1.27 at vger.kernel.org; Mon, 11 Apr 2011 09:54:22 EDT Received: from kop-dev-sles11-04.qlogic.org (localhost [127.0.0.1]) by kop-dev-sles11-04.qlogic.org (Postfix) with ESMTP id 22A4427E2C6; Mon, 11 Apr 2011 09:45:18 -0400 (EDT) Subject: [PATCH] IB/qib: Prevent driver hang with unprogrammed boards To: roland@purestorage.com From: Mike Marciniszyn Cc: linux-rdma@vger.kernel.org Date: Mon, 11 Apr 2011 09:45:17 -0400 Message-ID: <20110411134517.3720.3633.stgit@kop-dev-sles11-04.qlogic.org> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Mitko Haralanov The time limit test now correctly checks the against current jiffies to avoid the hang. Signed-off-by: Mitko Haralanov Signed-off-by: Mike Marciniszyn --- drivers/infiniband/hw/qib/qib_iba7322.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/infiniband/hw/qib/qib_iba7322.c b/drivers/infiniband/hw/qib/qib_iba7322.c index 4df08b8..30bbea2 100644 --- a/drivers/infiniband/hw/qib/qib_iba7322.c +++ b/drivers/infiniband/hw/qib/qib_iba7322.c @@ -7545,7 +7545,8 @@ static int serdes_7322_init_new(struct qib_pportdata *ppd) ibsd_wr_allchans(ppd, 4, (1 << 10), BMASK(10, 10)); tstart = get_jiffies_64(); while (chan_done && - !time_after64(tstart, tstart + msecs_to_jiffies(500))) { + !time_after64(get_jiffies_64(), + tstart + msecs_to_jiffies(500))) { msleep(20); for (chan = 0; chan < SERDES_CHANS; ++chan) { rxcaldone = ahb_mod(ppd->dd, IBSD(ppd->hw_pidx),