]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
IB/qib: Prevent driver hang with unprogrammed boards
authorMitko Haralanov <mitko@qlogic.com>
Tue, 10 May 2011 05:07:31 +0000 (22:07 -0700)
committerRoland Dreier <roland@purestorage.com>
Tue, 10 May 2011 05:07:31 +0000 (22:07 -0700)
The time limit test now correctly checks against current jiffies to
avoid the hang.

Signed-off-by: Mitko Haralanov <mitko@qlogic.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/qib/qib_iba7322.c

index 6bab3eaea70f3588f31de57c69703ac5da736935..9f53e68a096a329f499cbb1c9d63b6800b5add55 100644 (file)
@@ -7534,7 +7534,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),