diff options
author | Mike Marciniszyn <mike.marciniszyn@qlogic.com> | 2011-11-09 13:36:08 -0500 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2012-01-03 23:52:12 -0500 |
commit | 8482d5d1bc18c17429a89ad37f8b74d5a16de239 (patch) | |
tree | 4d2f952d8960b198234d5f7f09efac30d96ff1a2 /drivers/infiniband | |
parent | 865b64be86ed6e3e6137ce6506f31051097bf9cb (diff) |
IB/qib: Eliminate 64-bit jiffies use
The qib driver makes use of the the 64-bit jiffies API.
Code inspection reveals that that version of the API is not really
required. This patch converts to use the "normal" jiffies.
Reviewed-by: Ram Vepa <ram.vepa@qlogic.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/qib/qib_7220.h | 2 | ||||
-rw-r--r-- | drivers/infiniband/hw/qib/qib_iba7220.c | 6 | ||||
-rw-r--r-- | drivers/infiniband/hw/qib/qib_iba7322.c | 32 | ||||
-rw-r--r-- | drivers/infiniband/hw/qib/qib_qsfp.h | 2 |
4 files changed, 20 insertions, 22 deletions
diff --git a/drivers/infiniband/hw/qib/qib_7220.h b/drivers/infiniband/hw/qib/qib_7220.h index 21f374aa0631..a5356cb4252e 100644 --- a/drivers/infiniband/hw/qib/qib_7220.h +++ b/drivers/infiniband/hw/qib/qib_7220.h | |||
@@ -97,7 +97,7 @@ struct qib_chippport_specific { | |||
97 | u64 iblnkerrsnap; | 97 | u64 iblnkerrsnap; |
98 | u64 ibcctrl; /* kr_ibcctrl shadow */ | 98 | u64 ibcctrl; /* kr_ibcctrl shadow */ |
99 | u64 ibcddrctrl; /* kr_ibcddrctrl shadow */ | 99 | u64 ibcddrctrl; /* kr_ibcddrctrl shadow */ |
100 | u64 chase_end; | 100 | unsigned long chase_end; |
101 | u32 last_delay_mult; | 101 | u32 last_delay_mult; |
102 | }; | 102 | }; |
103 | 103 | ||
diff --git a/drivers/infiniband/hw/qib/qib_iba7220.c b/drivers/infiniband/hw/qib/qib_iba7220.c index 439d3c503cd5..9dd886cc633a 100644 --- a/drivers/infiniband/hw/qib/qib_iba7220.c +++ b/drivers/infiniband/hw/qib/qib_iba7220.c | |||
@@ -1051,7 +1051,7 @@ static void reenable_7220_chase(unsigned long opaque) | |||
1051 | static void handle_7220_chase(struct qib_pportdata *ppd, u64 ibcst) | 1051 | static void handle_7220_chase(struct qib_pportdata *ppd, u64 ibcst) |
1052 | { | 1052 | { |
1053 | u8 ibclt; | 1053 | u8 ibclt; |
1054 | u64 tnow; | 1054 | unsigned long tnow; |
1055 | 1055 | ||
1056 | ibclt = (u8)SYM_FIELD(ibcst, IBCStatus, LinkTrainingState); | 1056 | ibclt = (u8)SYM_FIELD(ibcst, IBCStatus, LinkTrainingState); |
1057 | 1057 | ||
@@ -1066,9 +1066,9 @@ static void handle_7220_chase(struct qib_pportdata *ppd, u64 ibcst) | |||
1066 | case IB_7220_LT_STATE_CFGWAITRMT: | 1066 | case IB_7220_LT_STATE_CFGWAITRMT: |
1067 | case IB_7220_LT_STATE_TXREVLANES: | 1067 | case IB_7220_LT_STATE_TXREVLANES: |
1068 | case IB_7220_LT_STATE_CFGENH: | 1068 | case IB_7220_LT_STATE_CFGENH: |
1069 | tnow = get_jiffies_64(); | 1069 | tnow = jiffies; |
1070 | if (ppd->cpspec->chase_end && | 1070 | if (ppd->cpspec->chase_end && |
1071 | time_after64(tnow, ppd->cpspec->chase_end)) { | 1071 | time_after(tnow, ppd->cpspec->chase_end)) { |
1072 | ppd->cpspec->chase_end = 0; | 1072 | ppd->cpspec->chase_end = 0; |
1073 | qib_set_ib_7220_lstate(ppd, | 1073 | qib_set_ib_7220_lstate(ppd, |
1074 | QLOGIC_IB_IBCC_LINKCMD_DOWN, | 1074 | QLOGIC_IB_IBCC_LINKCMD_DOWN, |
diff --git a/drivers/infiniband/hw/qib/qib_iba7322.c b/drivers/infiniband/hw/qib/qib_iba7322.c index 1d5895941e19..abd218d429fe 100644 --- a/drivers/infiniband/hw/qib/qib_iba7322.c +++ b/drivers/infiniband/hw/qib/qib_iba7322.c | |||
@@ -615,8 +615,8 @@ struct qib_chippport_specific { | |||
615 | u64 ibmalfsnap; | 615 | u64 ibmalfsnap; |
616 | u64 ibcctrl_a; /* krp_ibcctrl_a shadow */ | 616 | u64 ibcctrl_a; /* krp_ibcctrl_a shadow */ |
617 | u64 ibcctrl_b; /* krp_ibcctrl_b shadow */ | 617 | u64 ibcctrl_b; /* krp_ibcctrl_b shadow */ |
618 | u64 qdr_dfe_time; | 618 | unsigned long qdr_dfe_time; |
619 | u64 chase_end; | 619 | unsigned long chase_end; |
620 | u32 autoneg_tries; | 620 | u32 autoneg_tries; |
621 | u32 recovery_init; | 621 | u32 recovery_init; |
622 | u32 qdr_dfe_on; | 622 | u32 qdr_dfe_on; |
@@ -1672,7 +1672,8 @@ static void reenable_chase(unsigned long opaque) | |||
1672 | QLOGIC_IB_IBCC_LINKINITCMD_POLL); | 1672 | QLOGIC_IB_IBCC_LINKINITCMD_POLL); |
1673 | } | 1673 | } |
1674 | 1674 | ||
1675 | static void disable_chase(struct qib_pportdata *ppd, u64 tnow, u8 ibclt) | 1675 | static void disable_chase(struct qib_pportdata *ppd, unsigned long tnow, |
1676 | u8 ibclt) | ||
1676 | { | 1677 | { |
1677 | ppd->cpspec->chase_end = 0; | 1678 | ppd->cpspec->chase_end = 0; |
1678 | 1679 | ||
@@ -1688,7 +1689,7 @@ static void disable_chase(struct qib_pportdata *ppd, u64 tnow, u8 ibclt) | |||
1688 | static void handle_serdes_issues(struct qib_pportdata *ppd, u64 ibcst) | 1689 | static void handle_serdes_issues(struct qib_pportdata *ppd, u64 ibcst) |
1689 | { | 1690 | { |
1690 | u8 ibclt; | 1691 | u8 ibclt; |
1691 | u64 tnow; | 1692 | unsigned long tnow; |
1692 | 1693 | ||
1693 | ibclt = (u8)SYM_FIELD(ibcst, IBCStatusA_0, LinkTrainingState); | 1694 | ibclt = (u8)SYM_FIELD(ibcst, IBCStatusA_0, LinkTrainingState); |
1694 | 1695 | ||
@@ -1703,9 +1704,9 @@ static void handle_serdes_issues(struct qib_pportdata *ppd, u64 ibcst) | |||
1703 | case IB_7322_LT_STATE_CFGWAITRMT: | 1704 | case IB_7322_LT_STATE_CFGWAITRMT: |
1704 | case IB_7322_LT_STATE_TXREVLANES: | 1705 | case IB_7322_LT_STATE_TXREVLANES: |
1705 | case IB_7322_LT_STATE_CFGENH: | 1706 | case IB_7322_LT_STATE_CFGENH: |
1706 | tnow = get_jiffies_64(); | 1707 | tnow = jiffies; |
1707 | if (ppd->cpspec->chase_end && | 1708 | if (ppd->cpspec->chase_end && |
1708 | time_after64(tnow, ppd->cpspec->chase_end)) | 1709 | time_after(tnow, ppd->cpspec->chase_end)) |
1709 | disable_chase(ppd, tnow, ibclt); | 1710 | disable_chase(ppd, tnow, ibclt); |
1710 | else if (!ppd->cpspec->chase_end) | 1711 | else if (!ppd->cpspec->chase_end) |
1711 | ppd->cpspec->chase_end = tnow + QIB_CHASE_TIME; | 1712 | ppd->cpspec->chase_end = tnow + QIB_CHASE_TIME; |
@@ -2714,7 +2715,7 @@ static noinline void unknown_7322_gpio_intr(struct qib_devdata *dd) | |||
2714 | pins >>= SYM_LSB(EXTStatus, GPIOIn); | 2715 | pins >>= SYM_LSB(EXTStatus, GPIOIn); |
2715 | if (!(pins & mask)) { | 2716 | if (!(pins & mask)) { |
2716 | ++handled; | 2717 | ++handled; |
2717 | qd->t_insert = get_jiffies_64(); | 2718 | qd->t_insert = jiffies; |
2718 | queue_work(ib_wq, &qd->work); | 2719 | queue_work(ib_wq, &qd->work); |
2719 | } | 2720 | } |
2720 | } | 2721 | } |
@@ -4794,7 +4795,7 @@ static void qib_get_7322_faststats(unsigned long opaque) | |||
4794 | (ppd->lflags & (QIBL_LINKINIT | QIBL_LINKARMED | | 4795 | (ppd->lflags & (QIBL_LINKINIT | QIBL_LINKARMED | |
4795 | QIBL_LINKACTIVE)) && | 4796 | QIBL_LINKACTIVE)) && |
4796 | ppd->cpspec->qdr_dfe_time && | 4797 | ppd->cpspec->qdr_dfe_time && |
4797 | time_after64(get_jiffies_64(), ppd->cpspec->qdr_dfe_time)) { | 4798 | time_is_before_jiffies(ppd->cpspec->qdr_dfe_time)) { |
4798 | ppd->cpspec->qdr_dfe_on = 0; | 4799 | ppd->cpspec->qdr_dfe_on = 0; |
4799 | 4800 | ||
4800 | qib_write_kreg_port(ppd, krp_static_adapt_dis(2), | 4801 | qib_write_kreg_port(ppd, krp_static_adapt_dis(2), |
@@ -5240,7 +5241,7 @@ static int qib_7322_ib_updown(struct qib_pportdata *ppd, int ibup, u64 ibcs) | |||
5240 | /* schedule the qsfp refresh which should turn the link | 5241 | /* schedule the qsfp refresh which should turn the link |
5241 | off */ | 5242 | off */ |
5242 | if (ppd->dd->flags & QIB_HAS_QSFP) { | 5243 | if (ppd->dd->flags & QIB_HAS_QSFP) { |
5243 | qd->t_insert = get_jiffies_64(); | 5244 | qd->t_insert = jiffies; |
5244 | queue_work(ib_wq, &qd->work); | 5245 | queue_work(ib_wq, &qd->work); |
5245 | } | 5246 | } |
5246 | spin_lock_irqsave(&ppd->sdma_lock, flags); | 5247 | spin_lock_irqsave(&ppd->sdma_lock, flags); |
@@ -5592,7 +5593,7 @@ static void qsfp_7322_event(struct work_struct *work) | |||
5592 | { | 5593 | { |
5593 | struct qib_qsfp_data *qd; | 5594 | struct qib_qsfp_data *qd; |
5594 | struct qib_pportdata *ppd; | 5595 | struct qib_pportdata *ppd; |
5595 | u64 pwrup; | 5596 | unsigned long pwrup; |
5596 | unsigned long flags; | 5597 | unsigned long flags; |
5597 | int ret; | 5598 | int ret; |
5598 | u32 le2; | 5599 | u32 le2; |
@@ -5620,8 +5621,7 @@ static void qsfp_7322_event(struct work_struct *work) | |||
5620 | * to insertion. | 5621 | * to insertion. |
5621 | */ | 5622 | */ |
5622 | while (1) { | 5623 | while (1) { |
5623 | u64 now = get_jiffies_64(); | 5624 | if (time_is_before_jiffies(pwrup)) |
5624 | if (time_after64(now, pwrup)) | ||
5625 | break; | 5625 | break; |
5626 | msleep(20); | 5626 | msleep(20); |
5627 | } | 5627 | } |
@@ -7506,7 +7506,7 @@ static int serdes_7322_init_old(struct qib_pportdata *ppd) | |||
7506 | 7506 | ||
7507 | static int serdes_7322_init_new(struct qib_pportdata *ppd) | 7507 | static int serdes_7322_init_new(struct qib_pportdata *ppd) |
7508 | { | 7508 | { |
7509 | u64 tstart; | 7509 | unsigned long tend; |
7510 | u32 le_val, rxcaldone; | 7510 | u32 le_val, rxcaldone; |
7511 | int chan, chan_done = (1 << SERDES_CHANS) - 1; | 7511 | int chan, chan_done = (1 << SERDES_CHANS) - 1; |
7512 | 7512 | ||
@@ -7611,10 +7611,8 @@ static int serdes_7322_init_new(struct qib_pportdata *ppd) | |||
7611 | msleep(20); | 7611 | msleep(20); |
7612 | /* Start Calibration */ | 7612 | /* Start Calibration */ |
7613 | ibsd_wr_allchans(ppd, 4, (1 << 10), BMASK(10, 10)); | 7613 | ibsd_wr_allchans(ppd, 4, (1 << 10), BMASK(10, 10)); |
7614 | tstart = get_jiffies_64(); | 7614 | tend = jiffies + msecs_to_jiffies(500); |
7615 | while (chan_done && | 7615 | while (chan_done && !time_is_before_jiffies(tend)) { |
7616 | !time_after64(get_jiffies_64(), | ||
7617 | tstart + msecs_to_jiffies(500))) { | ||
7618 | msleep(20); | 7616 | msleep(20); |
7619 | for (chan = 0; chan < SERDES_CHANS; ++chan) { | 7617 | for (chan = 0; chan < SERDES_CHANS; ++chan) { |
7620 | rxcaldone = ahb_mod(ppd->dd, IBSD(ppd->hw_pidx), | 7618 | rxcaldone = ahb_mod(ppd->dd, IBSD(ppd->hw_pidx), |
diff --git a/drivers/infiniband/hw/qib/qib_qsfp.h b/drivers/infiniband/hw/qib/qib_qsfp.h index 46002a9417c0..91908f533a2b 100644 --- a/drivers/infiniband/hw/qib/qib_qsfp.h +++ b/drivers/infiniband/hw/qib/qib_qsfp.h | |||
@@ -177,7 +177,7 @@ struct qib_qsfp_data { | |||
177 | struct qib_pportdata *ppd; | 177 | struct qib_pportdata *ppd; |
178 | struct work_struct work; | 178 | struct work_struct work; |
179 | struct qib_qsfp_cache cache; | 179 | struct qib_qsfp_cache cache; |
180 | u64 t_insert; | 180 | unsigned long t_insert; |
181 | u8 modpresent; | 181 | u8 modpresent; |
182 | }; | 182 | }; |
183 | 183 | ||