Skip to content

Commit

Permalink
Merge tag 'timers-conversion-next2' of https://git.kernel.org/pub/scm…
Browse files Browse the repository at this point in the history
…/linux/kernel/git/kees/linux into timers/core

Pull the next batch of timer conversions from Kees Cook:

 - Second batch of scsi conversions that have been Reviewed and/or Acked.
 - Various *_on_stack() changes for USB, Acked by Greg.
 - DRM conversion that was declared too late for drm's tree, but Acked for timers.
 - RAS driver conversion, Acked.
  • Loading branch information
Thomas Gleixner committed Nov 1, 2017
2 parents 00ed87d + 856ec53 commit da2963e
Show file tree
Hide file tree
Showing 52 changed files with 271 additions and 339 deletions.
8 changes: 3 additions & 5 deletions drivers/gpu/drm/gma500/psb_lid.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
#include "psb_intel_reg.h"
#include <linux/spinlock.h>

static void psb_lid_timer_func(unsigned long data)
static void psb_lid_timer_func(struct timer_list *t)
{
struct drm_psb_private * dev_priv = (struct drm_psb_private *)data;
struct drm_psb_private *dev_priv = from_timer(dev_priv, t, lid_timer);
struct drm_device *dev = (struct drm_device *)dev_priv->dev;
struct timer_list *lid_timer = &dev_priv->lid_timer;
unsigned long irq_flags;
Expand Down Expand Up @@ -77,10 +77,8 @@ void psb_lid_timer_init(struct drm_psb_private *dev_priv)
spin_lock_init(&dev_priv->lid_lock);
spin_lock_irqsave(&dev_priv->lid_lock, irq_flags);

init_timer(lid_timer);
timer_setup(lid_timer, psb_lid_timer_func, 0);

lid_timer->data = (unsigned long)dev_priv;
lid_timer->function = psb_lid_timer_func;
lid_timer->expires = jiffies + PSB_LID_DELAY;

add_timer(lid_timer);
Expand Down
8 changes: 3 additions & 5 deletions drivers/ras/cec.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,9 @@ static void cec_mod_timer(struct timer_list *t, unsigned long interval)
mod_timer(t, round_jiffies(iv));
}

static void cec_timer_fn(unsigned long data)
static void cec_timer_fn(struct timer_list *unused)
{
struct ce_array *ca = (struct ce_array *)data;

do_spring_cleaning(ca);
do_spring_cleaning(&ce_arr);

cec_mod_timer(&cec_timer, timer_interval);
}
Expand Down Expand Up @@ -509,7 +507,7 @@ void __init cec_init(void)
if (create_debugfs_nodes())
return;

setup_timer(&cec_timer, cec_timer_fn, (unsigned long)&ce_arr);
timer_setup(&cec_timer, cec_timer_fn, 0);
cec_mod_timer(&cec_timer, CEC_TIMER_DEFAULT_INTERVAL);

pr_info("Correctable Errors collector initialized.\n");
Expand Down
5 changes: 1 addition & 4 deletions drivers/scsi/aic7xxx/aic79xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -1046,8 +1046,6 @@ typedef enum {

typedef uint8_t ahd_mode_state;

typedef void ahd_callback_t (void *);

struct ahd_completion
{
uint16_t tag;
Expand Down Expand Up @@ -1122,8 +1120,7 @@ struct ahd_softc {
/*
* Timer handles for timer driven callbacks.
*/
ahd_timer_t reset_timer;
ahd_timer_t stat_timer;
struct timer_list stat_timer;

/*
* Statistics.
Expand Down
29 changes: 8 additions & 21 deletions drivers/scsi/aic7xxx/aic79xx_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ static void ahd_add_scb_to_free_list(struct ahd_softc *ahd,
static u_int ahd_rem_wscb(struct ahd_softc *ahd, u_int scbid,
u_int prev, u_int next, u_int tid);
static void ahd_reset_current_bus(struct ahd_softc *ahd);
static ahd_callback_t ahd_stat_timer;
static void ahd_stat_timer(struct timer_list *t);
#ifdef AHD_DUMP_SEQ
static void ahd_dumpseq(struct ahd_softc *ahd);
#endif
Expand Down Expand Up @@ -6104,8 +6104,7 @@ ahd_alloc(void *platform_arg, char *name)
ahd->bugs = AHD_BUGNONE;
ahd->flags = AHD_SPCHK_ENB_A|AHD_RESET_BUS_A|AHD_TERM_ENB_A
| AHD_EXTENDED_TRANS_A|AHD_STPWLEVEL_A;
ahd_timer_init(&ahd->reset_timer);
ahd_timer_init(&ahd->stat_timer);
timer_setup(&ahd->stat_timer, ahd_stat_timer, 0);
ahd->int_coalescing_timer = AHD_INT_COALESCING_TIMER_DEFAULT;
ahd->int_coalescing_maxcmds = AHD_INT_COALESCING_MAXCMDS_DEFAULT;
ahd->int_coalescing_mincmds = AHD_INT_COALESCING_MINCMDS_DEFAULT;
Expand Down Expand Up @@ -6235,8 +6234,7 @@ ahd_shutdown(void *arg)
/*
* Stop periodic timer callbacks.
*/
ahd_timer_stop(&ahd->reset_timer);
ahd_timer_stop(&ahd->stat_timer);
del_timer_sync(&ahd->stat_timer);

/* This will reset most registers to 0, but not all */
ahd_reset(ahd, /*reinit*/FALSE);
Expand Down Expand Up @@ -7039,20 +7037,11 @@ static const char *termstat_strings[] = {
};

/***************************** Timer Facilities *******************************/
#define ahd_timer_init init_timer
#define ahd_timer_stop del_timer_sync
typedef void ahd_linux_callback_t (u_long);

static void
ahd_timer_reset(ahd_timer_t *timer, int usec, ahd_callback_t *func, void *arg)
ahd_timer_reset(struct timer_list *timer, int usec)
{
struct ahd_softc *ahd;

ahd = (struct ahd_softc *)arg;
del_timer(timer);
timer->data = (u_long)arg;
timer->expires = jiffies + (usec * HZ)/1000000;
timer->function = (ahd_linux_callback_t*)func;
add_timer(timer);
}

Expand Down Expand Up @@ -7279,8 +7268,7 @@ ahd_init(struct ahd_softc *ahd)
}
init_done:
ahd_restart(ahd);
ahd_timer_reset(&ahd->stat_timer, AHD_STAT_UPDATE_US,
ahd_stat_timer, ahd);
ahd_timer_reset(&ahd->stat_timer, AHD_STAT_UPDATE_US);
return (0);
}

Expand Down Expand Up @@ -8878,9 +8866,9 @@ ahd_reset_channel(struct ahd_softc *ahd, char channel, int initiate_reset)

/**************************** Statistics Processing ***************************/
static void
ahd_stat_timer(void *arg)
ahd_stat_timer(struct timer_list *t)
{
struct ahd_softc *ahd = arg;
struct ahd_softc *ahd = from_timer(ahd, t, stat_timer);
u_long s;
int enint_coal;

Expand All @@ -8907,8 +8895,7 @@ ahd_stat_timer(void *arg)
ahd->cmdcmplt_bucket = (ahd->cmdcmplt_bucket+1) & (AHD_STAT_BUCKETS-1);
ahd->cmdcmplt_total -= ahd->cmdcmplt_counts[ahd->cmdcmplt_bucket];
ahd->cmdcmplt_counts[ahd->cmdcmplt_bucket] = 0;
ahd_timer_reset(&ahd->stat_timer, AHD_STAT_UPDATE_US,
ahd_stat_timer, ahd);
ahd_timer_reset(&ahd->stat_timer, AHD_STAT_UPDATE_US);
ahd_unlock(ahd, &s);
}

Expand Down
7 changes: 0 additions & 7 deletions drivers/scsi/aic7xxx/aic79xx_osm.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,6 @@ int ahd_dmamap_unload(struct ahd_softc *, bus_dma_tag_t, bus_dmamap_t);
*/
#define ahd_dmamap_sync(ahd, dma_tag, dmamap, offset, len, op)

/************************** Timer DataStructures ******************************/
typedef struct timer_list ahd_timer_t;

/********************************** Includes **********************************/
#ifdef CONFIG_AIC79XX_REG_PRETTY_PRINT
#define AIC_DEBUG_REGISTERS 1
Expand All @@ -214,10 +211,6 @@ typedef struct timer_list ahd_timer_t;
#endif
#include "aic79xx.h"

/***************************** Timer Facilities *******************************/
#define ahd_timer_init init_timer
#define ahd_timer_stop del_timer_sync

/***************************** SMP support ************************************/
#include <linux/spinlock.h>

Expand Down
15 changes: 6 additions & 9 deletions drivers/scsi/csiostor/csio_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -3347,9 +3347,10 @@ csio_mberr_worker(void *data)
*
**/
static void
csio_hw_mb_timer(uintptr_t data)
csio_hw_mb_timer(struct timer_list *t)
{
struct csio_hw *hw = (struct csio_hw *)data;
struct csio_mbm *mbm = from_timer(mbm, t, timer);
struct csio_hw *hw = mbm->hw;
struct csio_mb *mbp = NULL;

spin_lock_irq(&hw->lock);
Expand Down Expand Up @@ -3715,9 +3716,9 @@ csio_mgmt_req_lookup(struct csio_mgmtm *mgmtm, struct csio_ioreq *io_req)
* Return - none.
*/
static void
csio_mgmt_tmo_handler(uintptr_t data)
csio_mgmt_tmo_handler(struct timer_list *t)
{
struct csio_mgmtm *mgmtm = (struct csio_mgmtm *) data;
struct csio_mgmtm *mgmtm = from_timer(mgmtm, t, mgmt_timer);
struct list_head *tmp;
struct csio_ioreq *io_req;

Expand Down Expand Up @@ -3797,11 +3798,7 @@ csio_mgmtm_cleanup(struct csio_mgmtm *mgmtm)
static int
csio_mgmtm_init(struct csio_mgmtm *mgmtm, struct csio_hw *hw)
{
struct timer_list *timer = &mgmtm->mgmt_timer;

init_timer(timer);
timer->function = csio_mgmt_tmo_handler;
timer->data = (unsigned long)mgmtm;
timer_setup(&mgmtm->mgmt_timer, csio_mgmt_tmo_handler, 0);

INIT_LIST_HEAD(&mgmtm->active_q);
INIT_LIST_HEAD(&mgmtm->cbfn_q);
Expand Down
9 changes: 3 additions & 6 deletions drivers/scsi/csiostor/csio_mb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1644,13 +1644,10 @@ csio_mb_cancel_all(struct csio_hw *hw, struct list_head *cbfn_q)
*/
int
csio_mbm_init(struct csio_mbm *mbm, struct csio_hw *hw,
void (*timer_fn)(uintptr_t))
void (*timer_fn)(struct timer_list *))
{
struct timer_list *timer = &mbm->timer;

init_timer(timer);
timer->function = timer_fn;
timer->data = (unsigned long)hw;
mbm->hw = hw;
timer_setup(&mbm->timer, timer_fn, 0);

INIT_LIST_HEAD(&mbm->req_q);
INIT_LIST_HEAD(&mbm->cbfn_q);
Expand Down
3 changes: 2 additions & 1 deletion drivers/scsi/csiostor/csio_mb.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ struct csio_mbm {
uint32_t a_mbox; /* Async mbox num */
uint32_t intr_idx; /* Interrupt index */
struct timer_list timer; /* Mbox timer */
struct csio_hw *hw; /* Hardware pointer */
struct list_head req_q; /* Mbox request queue */
struct list_head cbfn_q; /* Mbox completion q */
struct csio_mb *mcurrent; /* Current mailbox */
Expand Down Expand Up @@ -252,7 +253,7 @@ void csio_mb_process_portparams_rsp(struct csio_hw *hw, struct csio_mb *mbp,

/* MB module functions */
int csio_mbm_init(struct csio_mbm *, struct csio_hw *,
void (*)(uintptr_t));
void (*)(struct timer_list *));
void csio_mbm_exit(struct csio_mbm *);
void csio_mb_intr_enable(struct csio_hw *);
void csio_mb_intr_disable(struct csio_hw *);
Expand Down
8 changes: 4 additions & 4 deletions drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,10 +545,10 @@ static int act_open_rpl_status_to_errno(int status)
}
}

static void act_open_retry_timer(unsigned long data)
static void act_open_retry_timer(struct timer_list *t)
{
struct cxgbi_sock *csk = from_timer(csk, t, retry_timer);
struct sk_buff *skb;
struct cxgbi_sock *csk = (struct cxgbi_sock *)data;

log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_SOCK,
"csk 0x%p,%u,0x%lx,%u.\n",
Expand Down Expand Up @@ -586,8 +586,8 @@ static int do_act_open_rpl(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
cxgbi_sock_get(csk);
spin_lock_bh(&csk->lock);
if (rpl->status == CPL_ERR_CONN_EXIST &&
csk->retry_timer.function != act_open_retry_timer) {
csk->retry_timer.function = act_open_retry_timer;
csk->retry_timer.function != (TIMER_FUNC_TYPE)act_open_retry_timer) {
csk->retry_timer.function = (TIMER_FUNC_TYPE)act_open_retry_timer;
mod_timer(&csk->retry_timer, jiffies + HZ / 2);
} else
cxgbi_sock_fail_act_open(csk,
Expand Down
8 changes: 4 additions & 4 deletions drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,10 +872,10 @@ static int act_open_rpl_status_to_errno(int status)
}
}

static void csk_act_open_retry_timer(unsigned long data)
static void csk_act_open_retry_timer(struct timer_list *t)
{
struct sk_buff *skb = NULL;
struct cxgbi_sock *csk = (struct cxgbi_sock *)data;
struct cxgbi_sock *csk = from_timer(csk, t, retry_timer);
struct cxgb4_lld_info *lldi = cxgbi_cdev_priv(csk->cdev);
void (*send_act_open_func)(struct cxgbi_sock *, struct sk_buff *,
struct l2t_entry *);
Expand Down Expand Up @@ -963,8 +963,8 @@ static void do_act_open_rpl(struct cxgbi_device *cdev, struct sk_buff *skb)
spin_lock_bh(&csk->lock);

if (status == CPL_ERR_CONN_EXIST &&
csk->retry_timer.function != csk_act_open_retry_timer) {
csk->retry_timer.function = csk_act_open_retry_timer;
csk->retry_timer.function != (TIMER_FUNC_TYPE)csk_act_open_retry_timer) {
csk->retry_timer.function = (TIMER_FUNC_TYPE)csk_act_open_retry_timer;
mod_timer(&csk->retry_timer, jiffies + HZ / 2);
} else
cxgbi_sock_fail_act_open(csk,
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/cxgbi/libcxgbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ static struct cxgbi_sock *cxgbi_sock_create(struct cxgbi_device *cdev)
kref_init(&csk->refcnt);
skb_queue_head_init(&csk->receive_queue);
skb_queue_head_init(&csk->write_queue);
setup_timer(&csk->retry_timer, NULL, (unsigned long)csk);
timer_setup(&csk->retry_timer, NULL, 0);
rwlock_init(&csk->callback_lock);
csk->cdev = cdev;
csk->flags = 0;
Expand Down
1 change: 0 additions & 1 deletion drivers/scsi/hisi_sas/hisi_sas.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ struct hisi_sas_phy {
struct hisi_sas_port *port;
struct asd_sas_phy sas_phy;
struct sas_identify identify;
struct timer_list timer;
struct work_struct phyup_ws;
u64 port_id; /* from hw */
u64 dev_sas_addr;
Expand Down
14 changes: 6 additions & 8 deletions drivers/scsi/hisi_sas/hisi_sas_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,6 @@ static void hisi_sas_phy_init(struct hisi_hba *hisi_hba, int phy_no)

phy->hisi_hba = hisi_hba;
phy->port = NULL;
init_timer(&phy->timer);
sas_phy->enabled = (phy_no < hisi_hba->n_phy) ? 1 : 0;
sas_phy->class = SAS;
sas_phy->iproto = SAS_PROTOCOL_ALL;
Expand Down Expand Up @@ -792,9 +791,10 @@ static void hisi_sas_task_done(struct sas_task *task)
complete(&task->slow_task->completion);
}

static void hisi_sas_tmf_timedout(unsigned long data)
static void hisi_sas_tmf_timedout(struct timer_list *t)
{
struct sas_task *task = (struct sas_task *)data;
struct sas_task_slow *slow = from_timer(slow, t, timer);
struct sas_task *task = slow->task;
unsigned long flags;

spin_lock_irqsave(&task->task_state_lock, flags);
Expand Down Expand Up @@ -833,8 +833,7 @@ static int hisi_sas_exec_internal_tmf_task(struct domain_device *device,
}
task->task_done = hisi_sas_task_done;

task->slow_task->timer.data = (unsigned long) task;
task->slow_task->timer.function = hisi_sas_tmf_timedout;
task->slow_task->timer.function = (TIMER_FUNC_TYPE)hisi_sas_tmf_timedout;
task->slow_task->timer.expires = jiffies + TASK_TIMEOUT*HZ;
add_timer(&task->slow_task->timer);

Expand Down Expand Up @@ -1447,8 +1446,7 @@ hisi_sas_internal_task_abort(struct hisi_hba *hisi_hba,
task->dev = device;
task->task_proto = device->tproto;
task->task_done = hisi_sas_task_done;
task->slow_task->timer.data = (unsigned long)task;
task->slow_task->timer.function = hisi_sas_tmf_timedout;
task->slow_task->timer.function = (TIMER_FUNC_TYPE)hisi_sas_tmf_timedout;
task->slow_task->timer.expires = jiffies + msecs_to_jiffies(110);
add_timer(&task->slow_task->timer);

Expand Down Expand Up @@ -1877,7 +1875,7 @@ static struct Scsi_Host *hisi_sas_shost_alloc(struct platform_device *pdev,
hisi_hba->shost = shost;
SHOST_TO_SAS_HA(shost) = &hisi_hba->sha;

init_timer(&hisi_hba->timer);
timer_setup(&hisi_hba->timer, NULL, 0);

if (hisi_sas_get_fw_info(hisi_hba) < 0)
goto err_out;
Expand Down
6 changes: 3 additions & 3 deletions drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,9 +807,9 @@ static void phy_hard_reset_v1_hw(struct hisi_hba *hisi_hba, int phy_no)
start_phy_v1_hw(hisi_hba, phy_no);
}

static void start_phys_v1_hw(unsigned long data)
static void start_phys_v1_hw(struct timer_list *t)
{
struct hisi_hba *hisi_hba = (struct hisi_hba *)data;
struct hisi_hba *hisi_hba = from_timer(hisi_hba, t, timer);
int i;

for (i = 0; i < hisi_hba->n_phy; i++) {
Expand All @@ -828,7 +828,7 @@ static void phys_init_v1_hw(struct hisi_hba *hisi_hba)
hisi_sas_phy_read32(hisi_hba, i, CHL_INT2_MSK);
}

setup_timer(timer, start_phys_v1_hw, (unsigned long)hisi_hba);
timer_setup(timer, start_phys_v1_hw, 0);
mod_timer(timer, jiffies + HZ);
}

Expand Down
Loading

0 comments on commit da2963e

Please sign in to comment.