Skip to content

Commit

Permalink
Merge branch 'timer_setup' into for-next
Browse files Browse the repository at this point in the history
Conflicts:
	drivers/infiniband/hw/cxgb4/cm.c
	drivers/infiniband/hw/qib/qib_driver.c
	drivers/infiniband/hw/qib/qib_mad.c

There were minor fixups needed in these files.  Just minor context diffs
due to patches from independent sources touching the same basic area.

Signed-off-by: Doug Ledford <dledford@redhat.com>
  • Loading branch information
dledford committed Oct 18, 2017
2 parents 754137a + a9346ab commit 894b82c
Show file tree
Hide file tree
Showing 43 changed files with 158 additions and 192 deletions.
12 changes: 5 additions & 7 deletions drivers/infiniband/hw/cxgb3/iwch_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static struct workqueue_struct *workq;
static struct sk_buff_head rxq;

static struct sk_buff *get_skb(struct sk_buff *skb, int len, gfp_t gfp);
static void ep_timeout(unsigned long arg);
static void ep_timeout(struct timer_list *t);
static void connect_reply_upcall(struct iwch_ep *ep, int status);

static void start_ep_timer(struct iwch_ep *ep)
Expand All @@ -119,8 +119,6 @@ static void start_ep_timer(struct iwch_ep *ep)
} else
get_ep(&ep->com);
ep->timer.expires = jiffies + ep_timeout_secs * HZ;
ep->timer.data = (unsigned long)ep;
ep->timer.function = ep_timeout;
add_timer(&ep->timer);
}

Expand Down Expand Up @@ -1399,7 +1397,7 @@ static int pass_accept_req(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
child_ep->l2t = l2t;
child_ep->dst = dst;
child_ep->hwtid = hwtid;
init_timer(&child_ep->timer);
timer_setup(&child_ep->timer, ep_timeout, 0);
cxgb3_insert_tid(tdev, &t3c_client, child_ep, hwtid);
accept_cr(child_ep, req->peer_ip, skb);
goto out;
Expand Down Expand Up @@ -1719,9 +1717,9 @@ static int ec_status(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
return CPL_RET_BUF_DONE;
}

static void ep_timeout(unsigned long arg)
static void ep_timeout(struct timer_list *t)
{
struct iwch_ep *ep = (struct iwch_ep *)arg;
struct iwch_ep *ep = from_timer(ep, t, timer);
struct iwch_qp_attributes attrs;
unsigned long flags;
int abort = 1;
Expand Down Expand Up @@ -1899,7 +1897,7 @@ int iwch_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
err = -ENOMEM;
goto out;
}
init_timer(&ep->timer);
timer_setup(&ep->timer, ep_timeout, 0);
ep->plen = conn_param->private_data_len;
if (ep->plen)
memcpy(ep->mpa_pkt + sizeof(struct mpa_message),
Expand Down
1 change: 0 additions & 1 deletion drivers/infiniband/hw/cxgb3/iwch_provider.c
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,6 @@ static struct ib_qp *iwch_create_qp(struct ib_pd *pd,
insert_mmap(ucontext, mm2);
}
qhp->ibqp.qp_num = qhp->wq.qpid;
init_timer(&(qhp->timer));
pr_debug("%s sq_num_entries %d, rq_num_entries %d qpid 0x%0x qhp %p dma_addr 0x%llx size %d rq_addr 0x%x\n",
__func__, qhp->attr.sq_num_entries, qhp->attr.rq_num_entries,
qhp->wq.qpid, qhp, (unsigned long long)qhp->wq.dma_addr,
Expand Down
1 change: 0 additions & 1 deletion drivers/infiniband/hw/cxgb3/iwch_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ struct iwch_qp {
atomic_t refcnt;
wait_queue_head_t wait;
enum IWCH_QP_FLAGS flags;
struct timer_list timer;
};

static inline int qp_quiesced(struct iwch_qp *qhp)
Expand Down
13 changes: 5 additions & 8 deletions drivers/infiniband/hw/cxgb4/cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ static struct workqueue_struct *workq;
static struct sk_buff_head rxq;

static struct sk_buff *get_skb(struct sk_buff *skb, int len, gfp_t gfp);
static void ep_timeout(unsigned long arg);
static void ep_timeout(struct timer_list *t);
static void connect_reply_upcall(struct c4iw_ep *ep, int status);
static int sched(struct c4iw_dev *dev, struct sk_buff *skb);

Expand Down Expand Up @@ -185,8 +185,6 @@ static void start_ep_timer(struct c4iw_ep *ep)
clear_bit(TIMEOUT, &ep->com.flags);
c4iw_get_ep(&ep->com);
ep->timer.expires = jiffies + ep_timeout_secs * HZ;
ep->timer.data = (unsigned long)ep;
ep->timer.function = ep_timeout;
add_timer(&ep->timer);
}

Expand Down Expand Up @@ -2103,7 +2101,6 @@ static int c4iw_reconnect(struct c4iw_ep *ep)
__u8 *ra;

pr_debug("qp %p cm_id %p\n", ep->com.qp, ep->com.cm_id);
init_timer(&ep->timer);
c4iw_init_wr_wait(ep->com.wr_waitp);

/* When MPA revision is different on nodes, the node with MPA_rev=2
Expand Down Expand Up @@ -2581,7 +2578,7 @@ static int pass_accept_req(struct c4iw_dev *dev, struct sk_buff *skb)
pr_debug("tx_chan %u smac_idx %u rss_qid %u\n",
child_ep->tx_chan, child_ep->smac_idx, child_ep->rss_qid);

init_timer(&child_ep->timer);
timer_setup(&child_ep->timer, ep_timeout, 0);
cxgb4_insert_tid(t, child_ep, hwtid,
child_ep->com.local_addr.ss_family);
insert_ep_tid(child_ep);
Expand Down Expand Up @@ -3206,7 +3203,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
goto fail1;
}

init_timer(&ep->timer);
timer_setup(&ep->timer, ep_timeout, 0);
ep->plen = conn_param->private_data_len;
if (ep->plen)
memcpy(ep->mpa_pkt + sizeof(struct mpa_message),
Expand Down Expand Up @@ -4116,9 +4113,9 @@ static void process_work(struct work_struct *work)

static DECLARE_WORK(skb_work, process_work);

static void ep_timeout(unsigned long arg)
static void ep_timeout(struct timer_list *t)
{
struct c4iw_ep *ep = (struct c4iw_ep *)arg;
struct c4iw_ep *ep = from_timer(ep, t, timer);
int kickit = 0;

spin_lock(&timeout_lock);
Expand Down
1 change: 0 additions & 1 deletion drivers/infiniband/hw/cxgb4/iw_cxgb4.h
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,6 @@ struct c4iw_qp {
struct mutex mutex;
struct kref kref;
wait_queue_head_t wait;
struct timer_list timer;
int sq_sig_all;
struct work_struct free_work;
struct c4iw_ucontext *ucontext;
Expand Down
1 change: 0 additions & 1 deletion drivers/infiniband/hw/cxgb4/qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1929,7 +1929,6 @@ struct ib_qp *c4iw_create_qp(struct ib_pd *pd, struct ib_qp_init_attr *attrs,
qhp->ucontext = ucontext;
}
qhp->ibqp.qp_num = qhp->wq.sq.qid;
init_timer(&(qhp->timer));
INIT_LIST_HEAD(&qhp->db_fc_entry);
pr_debug("sq id %u size %u memsize %zu num_entries %u rq id %u size %u memsize %zu num_entries %u\n",
qhp->wq.sq.qid, qhp->wq.sq.size, qhp->wq.sq.memsize,
Expand Down
7 changes: 3 additions & 4 deletions drivers/infiniband/hw/hfi1/aspm.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ static inline void aspm_ctx_disable(struct hfi1_ctxtdata *rcd)
}

/* Timer function for re-enabling ASPM in the absence of interrupt activity */
static inline void aspm_ctx_timer_function(unsigned long data)
static inline void aspm_ctx_timer_function(struct timer_list *t)
{
struct hfi1_ctxtdata *rcd = (struct hfi1_ctxtdata *)data;
struct hfi1_ctxtdata *rcd = from_timer(rcd, t, aspm_timer);
unsigned long flags;

spin_lock_irqsave(&rcd->aspm_lock, flags);
Expand Down Expand Up @@ -281,8 +281,7 @@ static inline void aspm_enable_all(struct hfi1_devdata *dd)
static inline void aspm_ctx_init(struct hfi1_ctxtdata *rcd)
{
spin_lock_init(&rcd->aspm_lock);
setup_timer(&rcd->aspm_timer, aspm_ctx_timer_function,
(unsigned long)rcd);
timer_setup(&rcd->aspm_timer, aspm_ctx_timer_function, 0);
rcd->aspm_intr_supported = rcd->dd->aspm_supported &&
aspm_mode == ASPM_MODE_DYNAMIC &&
rcd->ctxt < rcd->dd->first_dyn_alloc_ctxt;
Expand Down
19 changes: 8 additions & 11 deletions drivers/infiniband/hw/hfi1/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -5538,9 +5538,9 @@ static void handle_cce_err(struct hfi1_devdata *dd, u32 unused, u64 reg)
* associated with them.
*/
#define RCVERR_CHECK_TIME 10
static void update_rcverr_timer(unsigned long opaque)
static void update_rcverr_timer(struct timer_list *t)
{
struct hfi1_devdata *dd = (struct hfi1_devdata *)opaque;
struct hfi1_devdata *dd = from_timer(dd, t, rcverr_timer);
struct hfi1_pportdata *ppd = dd->pport;
u32 cur_ovfl_cnt = read_dev_cntr(dd, C_RCV_OVF, CNTR_INVALID_VL);

Expand All @@ -5559,17 +5559,16 @@ static void update_rcverr_timer(unsigned long opaque)

static int init_rcverr(struct hfi1_devdata *dd)
{
setup_timer(&dd->rcverr_timer, update_rcverr_timer, (unsigned long)dd);
timer_setup(&dd->rcverr_timer, update_rcverr_timer, 0);
/* Assume the hardware counter has been reset */
dd->rcv_ovfl_cnt = 0;
return mod_timer(&dd->rcverr_timer, jiffies + HZ * RCVERR_CHECK_TIME);
}

static void free_rcverr(struct hfi1_devdata *dd)
{
if (dd->rcverr_timer.data)
if (dd->rcverr_timer.function)
del_timer_sync(&dd->rcverr_timer);
dd->rcverr_timer.data = 0;
}

static void handle_rxe_err(struct hfi1_devdata *dd, u32 unused, u64 reg)
Expand Down Expand Up @@ -12108,9 +12107,8 @@ static void free_cntrs(struct hfi1_devdata *dd)
struct hfi1_pportdata *ppd;
int i;

if (dd->synth_stats_timer.data)
if (dd->synth_stats_timer.function)
del_timer_sync(&dd->synth_stats_timer);
dd->synth_stats_timer.data = 0;
ppd = (struct hfi1_pportdata *)(dd + 1);
for (i = 0; i < dd->num_pports; i++, ppd++) {
kfree(ppd->cntrs);
Expand Down Expand Up @@ -12386,9 +12384,9 @@ static void do_update_synth_timer(struct work_struct *work)
}
}

static void update_synth_timer(unsigned long opaque)
static void update_synth_timer(struct timer_list *t)
{
struct hfi1_devdata *dd = (struct hfi1_devdata *)opaque;
struct hfi1_devdata *dd = from_timer(dd, t, synth_stats_timer);

queue_work(dd->update_cntr_wq, &dd->update_cntr_work);
mod_timer(&dd->synth_stats_timer, jiffies + HZ * SYNTH_CNT_TIME);
Expand All @@ -12406,8 +12404,7 @@ static int init_cntrs(struct hfi1_devdata *dd)
const int bit_type_32_sz = strlen(bit_type_32);

/* set up the stats timer; the add_timer is done at the end */
setup_timer(&dd->synth_stats_timer, update_synth_timer,
(unsigned long)dd);
timer_setup(&dd->synth_stats_timer, update_synth_timer, 0);

/***********************/
/* per device counters */
Expand Down
7 changes: 3 additions & 4 deletions drivers/infiniband/hw/hfi1/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1258,9 +1258,9 @@ void shutdown_led_override(struct hfi1_pportdata *ppd)
write_csr(dd, DCC_CFG_LED_CNTRL, 0);
}

static void run_led_override(unsigned long opaque)
static void run_led_override(struct timer_list *t)
{
struct hfi1_pportdata *ppd = (struct hfi1_pportdata *)opaque;
struct hfi1_pportdata *ppd = from_timer(ppd, t, led_override_timer);
struct hfi1_devdata *dd = ppd->dd;
unsigned long timeout;
int phase_idx;
Expand Down Expand Up @@ -1304,8 +1304,7 @@ void hfi1_start_led_override(struct hfi1_pportdata *ppd, unsigned int timeon,
* timeout so the handler will be called soon to look at our request.
*/
if (!timer_pending(&ppd->led_override_timer)) {
setup_timer(&ppd->led_override_timer, run_led_override,
(unsigned long)ppd);
timer_setup(&ppd->led_override_timer, run_led_override, 0);
ppd->led_override_timer.expires = jiffies + 1;
add_timer(&ppd->led_override_timer);
atomic_set(&ppd->led_override_timer_active, 1);
Expand Down
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/hfi1/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ static void stop_timers(struct hfi1_devdata *dd)

for (pidx = 0; pidx < dd->num_pports; ++pidx) {
ppd = dd->pport + pidx;
if (ppd->led_override_timer.data) {
if (ppd->led_override_timer.function) {
del_timer_sync(&ppd->led_override_timer);
atomic_set(&ppd->led_override_timer_active, 0);
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/infiniband/hw/hfi1/mad.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,9 @@ static void send_trap(struct hfi1_ibport *ibp, struct trap_node *trap)
ib_free_send_mad(send_buf);
}

void hfi1_handle_trap_timer(unsigned long data)
void hfi1_handle_trap_timer(struct timer_list *t)
{
struct hfi1_ibport *ibp = (struct hfi1_ibport *)data;
struct hfi1_ibport *ibp = from_timer(ibp, t, rvp.trap_timer);
struct trap_node *trap = NULL;
unsigned long flags;
int i;
Expand Down
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/hfi1/mad.h
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,6 @@ struct sc2vlnt {
COUNTER_MASK(1, 4))

void hfi1_event_pkey_change(struct hfi1_devdata *dd, u8 port);
void hfi1_handle_trap_timer(unsigned long data);
void hfi1_handle_trap_timer(struct timer_list *t);

#endif /* _HFI1_MAD_H */
8 changes: 4 additions & 4 deletions drivers/infiniband/hw/hfi1/sdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,10 +491,10 @@ static void sdma_err_progress_check_schedule(struct sdma_engine *sde)
}
}

static void sdma_err_progress_check(unsigned long data)
static void sdma_err_progress_check(struct timer_list *t)
{
unsigned index;
struct sdma_engine *sde = (struct sdma_engine *)data;
struct sdma_engine *sde = from_timer(sde, t, err_progress_check_timer);

dd_dev_err(sde->dd, "SDE progress check event\n");
for (index = 0; index < sde->dd->num_sdma; index++) {
Expand Down Expand Up @@ -1453,8 +1453,8 @@ int sdma_init(struct hfi1_devdata *dd, u8 port)

sde->progress_check_head = 0;

setup_timer(&sde->err_progress_check_timer,
sdma_err_progress_check, (unsigned long)sde);
timer_setup(&sde->err_progress_check_timer,
sdma_err_progress_check, 0);

sde->descq = dma_zalloc_coherent(
&dd->pcidev->dev,
Expand Down
9 changes: 4 additions & 5 deletions drivers/infiniband/hw/hfi1/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,9 +670,9 @@ void hfi1_16B_rcv(struct hfi1_packet *packet)
* This is called from a timer to check for QPs
* which need kernel memory in order to send a packet.
*/
static void mem_timer(unsigned long data)
static void mem_timer(struct timer_list *t)
{
struct hfi1_ibdev *dev = (struct hfi1_ibdev *)data;
struct hfi1_ibdev *dev = from_timer(dev, t, mem_timer);
struct list_head *list = &dev->memwait;
struct rvt_qp *qp = NULL;
struct iowait *wait;
Expand Down Expand Up @@ -1620,8 +1620,7 @@ static void init_ibport(struct hfi1_pportdata *ppd)

for (i = 0; i < RVT_MAX_TRAP_LISTS ; i++)
INIT_LIST_HEAD(&ibp->rvp.trap_lists[i].list);
setup_timer(&ibp->rvp.trap_timer, hfi1_handle_trap_timer,
(unsigned long)ibp);
timer_setup(&ibp->rvp.trap_timer, hfi1_handle_trap_timer, 0);

spin_lock_init(&ibp->rvp.lock);
/* Set the prefix to the default value (see ch. 4.1.1) */
Expand Down Expand Up @@ -1828,7 +1827,7 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)

/* Only need to initialize non-zero fields. */

setup_timer(&dev->mem_timer, mem_timer, (unsigned long)dev);
timer_setup(&dev->mem_timer, mem_timer, 0);

seqlock_init(&dev->iowait_lock);
seqlock_init(&dev->txwait_lock);
Expand Down
7 changes: 3 additions & 4 deletions drivers/infiniband/hw/i40iw/i40iw_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1188,15 +1188,15 @@ static void i40iw_handle_close_entry(struct i40iw_cm_node *cm_node, u32 rem_node
* i40iw_cm_timer_tick - system's timer expired callback
* @pass: Pointing to cm_core
*/
static void i40iw_cm_timer_tick(unsigned long pass)
static void i40iw_cm_timer_tick(struct timer_list *t)
{
unsigned long nexttimeout = jiffies + I40IW_LONG_TIME;
struct i40iw_cm_node *cm_node;
struct i40iw_timer_entry *send_entry, *close_entry;
struct list_head *list_core_temp;
struct i40iw_sc_vsi *vsi;
struct list_head *list_node;
struct i40iw_cm_core *cm_core = (struct i40iw_cm_core *)pass;
struct i40iw_cm_core *cm_core = from_timer(cm_core, t, tcp_timer);
u32 settimer = 0;
unsigned long timetosend;
unsigned long flags;
Expand Down Expand Up @@ -3201,8 +3201,7 @@ void i40iw_setup_cm_core(struct i40iw_device *iwdev)
INIT_LIST_HEAD(&cm_core->connected_nodes);
INIT_LIST_HEAD(&cm_core->listen_nodes);

setup_timer(&cm_core->tcp_timer, i40iw_cm_timer_tick,
(unsigned long)cm_core);
timer_setup(&cm_core->tcp_timer, i40iw_cm_timer_tick, 0);

spin_lock_init(&cm_core->ht_lock);
spin_lock_init(&cm_core->listen_list_lock);
Expand Down
1 change: 1 addition & 0 deletions drivers/infiniband/hw/i40iw/i40iw_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -4873,6 +4873,7 @@ enum i40iw_status_code i40iw_vsi_stats_init(struct i40iw_sc_vsi *vsi, struct i40

vsi->pestat = info->pestat;
vsi->pestat->hw = vsi->dev->hw;
vsi->pestat->vsi = vsi;

if (info->stats_initialize) {
i40iw_hw_stats_init(vsi->pestat, fcn_id, true);
Expand Down
1 change: 1 addition & 0 deletions drivers/infiniband/hw/i40iw/i40iw_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ struct i40iw_vsi_pestat {
struct i40iw_dev_hw_stats last_read_hw_stats;
struct i40iw_dev_hw_stats_offsets hw_stats_offsets;
struct timer_list stats_timer;
struct i40iw_sc_vsi *vsi;
spinlock_t lock; /* rdma stats lock */
};

Expand Down
Loading

0 comments on commit 894b82c

Please sign in to comment.