Skip to content

Commit

Permalink
Merge tag 'timers-conversion-next3' 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 3rd batch of timer conversions from Kees Cook:

 - various per-architecture conversions
 - several driver conversions not picked up by a specific maintainer
 - other Acked/Reviewed conversions to go through tip
  • Loading branch information
Thomas Gleixner committed Nov 2, 2017
2 parents 6082a6e + 25b42fa commit c7c2f3d
Show file tree
Hide file tree
Showing 44 changed files with 215 additions and 249 deletions.
26 changes: 8 additions & 18 deletions arch/arm/mach-footbridge/dc21285.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,14 @@ struct pci_ops dc21285_ops = {
static struct timer_list serr_timer;
static struct timer_list perr_timer;

static void dc21285_enable_error(unsigned long __data)
static void dc21285_enable_error(struct timer_list *timer)
{
switch (__data) {
case IRQ_PCI_SERR:
del_timer(&serr_timer);
break;

case IRQ_PCI_PERR:
del_timer(&perr_timer);
break;
}
del_timer(timer);

enable_irq(__data);
if (timer == &serr_timer)
enable_irq(IRQ_PCI_SERR)
else if (timer == &perr_timer)
enable_irq(IRQ_PCI_PERR);
}

/*
Expand Down Expand Up @@ -323,13 +318,8 @@ void __init dc21285_preinit(void)
*CSR_PCICMD = (*CSR_PCICMD & 0xffff) | PCICMD_ERROR_BITS;
}

init_timer(&serr_timer);
init_timer(&perr_timer);

serr_timer.data = IRQ_PCI_SERR;
serr_timer.function = dc21285_enable_error;
perr_timer.data = IRQ_PCI_PERR;
perr_timer.function = dc21285_enable_error;
timer_setup(&serr_timer, dc21285_enable_error, 0);
timer_setup(&perr_timer, dc21285_enable_error, 0);

/*
* We don't care if these fail.
Expand Down
15 changes: 6 additions & 9 deletions arch/arm/mach-pxa/lubbock.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,14 +381,11 @@ static struct pxafb_mach_info sharp_lm8v31 = {

#define MMC_POLL_RATE msecs_to_jiffies(1000)

static void lubbock_mmc_poll(unsigned long);
static irq_handler_t mmc_detect_int;
static void *mmc_detect_int_data;
static struct timer_list mmc_timer;

static struct timer_list mmc_timer = {
.function = lubbock_mmc_poll,
};

static void lubbock_mmc_poll(unsigned long data)
static void lubbock_mmc_poll(struct timer_list *unused)
{
unsigned long flags;

Expand All @@ -401,7 +398,7 @@ static void lubbock_mmc_poll(unsigned long data)
if (LUB_IRQ_SET_CLR & (1 << 0))
mod_timer(&mmc_timer, jiffies + MMC_POLL_RATE);
else {
(void) mmc_detect_int(LUBBOCK_SD_IRQ, (void *)data);
(void) mmc_detect_int(LUBBOCK_SD_IRQ, mmc_detect_int_data);
enable_irq(LUBBOCK_SD_IRQ);
}
}
Expand All @@ -421,8 +418,8 @@ static int lubbock_mci_init(struct device *dev,
{
/* detect card insert/eject */
mmc_detect_int = detect_int;
init_timer(&mmc_timer);
mmc_timer.data = (unsigned long) data;
mmc_detect_int_data = data;
timer_setup(&mmc_timer, lubbock_mmc_poll, 0);
return request_irq(LUBBOCK_SD_IRQ, lubbock_detect_int,
0, "lubbock-sd-detect", data);
}
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/mach-pxa/sharpsl_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ static void sharpsl_charge_toggle(struct work_struct *private_)
sharpsl_pm.charge_start_time = jiffies;
}

static void sharpsl_ac_timer(unsigned long data)
static void sharpsl_ac_timer(struct timer_list *unused)
{
int acin = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN);

Expand All @@ -366,7 +366,7 @@ static irqreturn_t sharpsl_ac_isr(int irq, void *dev_id)
return IRQ_HANDLED;
}

static void sharpsl_chrg_full_timer(unsigned long data)
static void sharpsl_chrg_full_timer(struct timer_list *unused)
{
dev_dbg(sharpsl_pm.dev, "Charge Full at time: %lx\n", jiffies);

Expand Down Expand Up @@ -841,9 +841,9 @@ static int sharpsl_pm_probe(struct platform_device *pdev)
sharpsl_pm.charge_mode = CHRG_OFF;
sharpsl_pm.flags = 0;

setup_timer(&sharpsl_pm.ac_timer, sharpsl_ac_timer, 0UL);
timer_setup(&sharpsl_pm.ac_timer, sharpsl_ac_timer, 0);

setup_timer(&sharpsl_pm.chrg_full_timer, sharpsl_chrg_full_timer, 0UL);
timer_setup(&sharpsl_pm.chrg_full_timer, sharpsl_chrg_full_timer, 0);

led_trigger_register_simple("sharpsl-charge", &sharpsl_charge_led_trigger);

Expand Down
4 changes: 3 additions & 1 deletion arch/ia64/include/asm/sn/bte.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <asm/sn/types.h>
#include <asm/sn/shub_mmr.h>

struct nodepda_s;

#define IBCT_NOTIFY (0x1UL << 4)
#define IBCT_ZFIL_MODE (0x1UL << 0)

Expand Down Expand Up @@ -210,7 +212,7 @@ struct bteinfo_s {
*/
extern bte_result_t bte_copy(u64, u64, u64, u64, void *);
extern bte_result_t bte_unaligned_copy(u64, u64, u64, u64);
extern void bte_error_handler(unsigned long);
extern void bte_error_handler(struct nodepda_s *);

#define bte_zero(dest, len, mode, notification) \
bte_copy(0, dest, len, ((mode) | BTE_ZERO_FILL), notification)
Expand Down
8 changes: 4 additions & 4 deletions arch/ia64/kernel/mca.c
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@ ia64_mca_cmc_int_caller(int cmc_irq, void *arg)
*
*/
static void
ia64_mca_cmc_poll (unsigned long dummy)
ia64_mca_cmc_poll (struct timer_list *unused)
{
/* Trigger a CMC interrupt cascade */
platform_send_ipi(cpumask_first(cpu_online_mask), IA64_CMCP_VECTOR,
Expand Down Expand Up @@ -1590,7 +1590,7 @@ ia64_mca_cpe_int_caller(int cpe_irq, void *arg)
*
*/
static void
ia64_mca_cpe_poll (unsigned long dummy)
ia64_mca_cpe_poll (struct timer_list *unused)
{
/* Trigger a CPE interrupt cascade */
platform_send_ipi(cpumask_first(cpu_online_mask), IA64_CPEP_VECTOR,
Expand Down Expand Up @@ -2098,7 +2098,7 @@ ia64_mca_late_init(void)
return 0;

/* Setup the CMCI/P vector and handler */
setup_timer(&cmc_poll_timer, ia64_mca_cmc_poll, 0UL);
timer_setup(&cmc_poll_timer, ia64_mca_cmc_poll, 0);

/* Unmask/enable the vector */
cmc_polling_enabled = 0;
Expand All @@ -2109,7 +2109,7 @@ ia64_mca_late_init(void)
#ifdef CONFIG_ACPI
/* Setup the CPEI/P vector and handler */
cpe_vector = acpi_request_vector(ACPI_INTERRUPT_CPEI);
setup_timer(&cpe_poll_timer, ia64_mca_cpe_poll, 0UL);
timer_setup(&cpe_poll_timer, ia64_mca_cpe_poll, 0);

{
unsigned int irq;
Expand Down
5 changes: 2 additions & 3 deletions arch/ia64/kernel/salinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ salinfo_timeout_check(struct salinfo_data *data)
}

static void
salinfo_timeout (unsigned long arg)
salinfo_timeout(struct timer_list *unused)
{
ia64_mlogbuf_dump();
salinfo_timeout_check(salinfo_data + SAL_INFO_TYPE_MCA);
Expand Down Expand Up @@ -623,9 +623,8 @@ salinfo_init(void)

*sdir++ = salinfo_dir;

init_timer(&salinfo_timer);
timer_setup(&salinfo_timer, salinfo_timeout, 0);
salinfo_timer.expires = jiffies + SALINFO_TIMER_DELAY;
salinfo_timer.function = &salinfo_timeout;
add_timer(&salinfo_timer);

i = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "ia64/salinfo:online",
Expand Down
12 changes: 8 additions & 4 deletions arch/ia64/sn/kernel/bte.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ bte_result_t bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification)
BTE_LNSTAT_LOAD(bte), *bte->most_rcnt_na) );
bte->bte_error_count++;
bte->bh_error = IBLS_ERROR;
bte_error_handler((unsigned long)NODEPDA(bte->bte_cnode));
bte_error_handler(NODEPDA(bte->bte_cnode));
*bte->most_rcnt_na = BTE_WORD_AVAILABLE;
goto retry_bteop;
}
Expand Down Expand Up @@ -414,6 +414,12 @@ EXPORT_SYMBOL(bte_unaligned_copy);
* Block Transfer Engine initialization functions.
*
***********************************************************************/
static void bte_recovery_timeout(struct timer_list *t)
{
struct nodepda_s *nodepda = from_timer(nodepda, t, bte_recovery_timer);

bte_error_handler(nodepda);
}

/*
* bte_init_node(nodepda, cnode)
Expand All @@ -436,9 +442,7 @@ void bte_init_node(nodepda_t * mynodepda, cnodeid_t cnode)
* will point at this one bte_recover structure to get the lock.
*/
spin_lock_init(&mynodepda->bte_recovery_lock);
init_timer(&mynodepda->bte_recovery_timer);
mynodepda->bte_recovery_timer.function = bte_error_handler;
mynodepda->bte_recovery_timer.data = (unsigned long)mynodepda;
timer_setup(&mynodepda->bte_recovery_timer, bte_recovery_timeout, 0);

for (i = 0; i < BTES_PER_NODE; i++) {
u64 *base_addr;
Expand Down
17 changes: 6 additions & 11 deletions arch/ia64/sn/kernel/bte_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,12 @@
* transfers to be queued.
*/

void bte_error_handler(unsigned long);

/*
* Wait until all BTE related CRBs are completed
* and then reset the interfaces.
*/
int shub1_bte_error_handler(unsigned long _nodepda)
static int shub1_bte_error_handler(struct nodepda_s *err_nodepda)
{
struct nodepda_s *err_nodepda = (struct nodepda_s *)_nodepda;
struct timer_list *recovery_timer = &err_nodepda->bte_recovery_timer;
nasid_t nasid;
int i;
Expand Down Expand Up @@ -131,9 +128,8 @@ int shub1_bte_error_handler(unsigned long _nodepda)
* Wait until all BTE related CRBs are completed
* and then reset the interfaces.
*/
int shub2_bte_error_handler(unsigned long _nodepda)
static int shub2_bte_error_handler(struct nodepda_s *err_nodepda)
{
struct nodepda_s *err_nodepda = (struct nodepda_s *)_nodepda;
struct timer_list *recovery_timer = &err_nodepda->bte_recovery_timer;
struct bteinfo_s *bte;
nasid_t nasid;
Expand Down Expand Up @@ -170,9 +166,8 @@ int shub2_bte_error_handler(unsigned long _nodepda)
* Wait until all BTE related CRBs are completed
* and then reset the interfaces.
*/
void bte_error_handler(unsigned long _nodepda)
void bte_error_handler(struct nodepda_s *err_nodepda)
{
struct nodepda_s *err_nodepda = (struct nodepda_s *)_nodepda;
spinlock_t *recovery_lock = &err_nodepda->bte_recovery_lock;
int i;
unsigned long irq_flags;
Expand All @@ -199,12 +194,12 @@ void bte_error_handler(unsigned long _nodepda)
}

if (is_shub1()) {
if (shub1_bte_error_handler(_nodepda)) {
if (shub1_bte_error_handler(err_nodepda)) {
spin_unlock_irqrestore(recovery_lock, irq_flags);
return;
}
} else {
if (shub2_bte_error_handler(_nodepda)) {
if (shub2_bte_error_handler(err_nodepda)) {
spin_unlock_irqrestore(recovery_lock, irq_flags);
return;
}
Expand Down Expand Up @@ -255,6 +250,6 @@ bte_crb_error_handler(cnodeid_t cnode, int btenum,

BTE_PRINTK(("Got an error on cnode %d bte %d: HW error type 0x%x\n",
bte->bte_cnode, bte->bte_num, ioe->ie_errortype));
bte_error_handler((unsigned long) NODEPDA(cnode));
bte_error_handler(NODEPDA(cnode));
}

2 changes: 1 addition & 1 deletion arch/ia64/sn/kernel/huberror.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static irqreturn_t hub_eint_handler(int irq, void *arg)
if ((int)ret_stuff.v0)
panic("%s: Fatal TIO Error", __func__);
} else
bte_error_handler((unsigned long)NODEPDA(nasid_to_cnodeid(nasid)));
bte_error_handler(NODEPDA(nasid_to_cnodeid(nasid)));

return IRQ_HANDLED;
}
Expand Down
5 changes: 2 additions & 3 deletions arch/ia64/sn/kernel/mca.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,16 @@ static void sn_cpei_handler(int irq, void *devid, struct pt_regs *regs)
ia64_sn_plat_cpei_handler();
}

static void sn_cpei_timer_handler(unsigned long dummy)
static void sn_cpei_timer_handler(struct timer_list *unused)
{
sn_cpei_handler(-1, NULL, NULL);
mod_timer(&sn_cpei_timer, jiffies + CPEI_INTERVAL);
}

void sn_init_cpei_timer(void)
{
init_timer(&sn_cpei_timer);
timer_setup(&sn_cpei_timer, sn_cpei_timer_handler, 0);
sn_cpei_timer.expires = jiffies + CPEI_INTERVAL;
sn_cpei_timer.function = sn_cpei_timer_handler;
add_timer(&sn_cpei_timer);
}

Expand Down
26 changes: 12 additions & 14 deletions arch/mips/sgi-ip22/ip22-reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#define PANIC_FREQ (HZ / 8)

static struct timer_list power_timer, blink_timer, debounce_timer;
static unsigned long blink_timer_timeout;

#define MACHINE_PANICED 1
#define MACHINE_SHUTTING_DOWN 2
Expand Down Expand Up @@ -81,21 +82,21 @@ static void __noreturn sgi_machine_halt(void)
ArcEnterInteractiveMode();
}

static void power_timeout(unsigned long data)
static void power_timeout(struct timer_list *unused)
{
sgi_machine_power_off();
}

static void blink_timeout(unsigned long data)
static void blink_timeout(struct timer_list *unused)
{
/* XXX fix this for fullhouse */
sgi_ioc_reset ^= (SGIOC_RESET_LC0OFF|SGIOC_RESET_LC1OFF);
sgioc->reset = sgi_ioc_reset;

mod_timer(&blink_timer, jiffies + data);
mod_timer(&blink_timer, jiffies + blink_timer_timeout);
}

static void debounce(unsigned long data)
static void debounce(struct timer_list *unused)
{
del_timer(&debounce_timer);
if (sgint->istat1 & SGINT_ISTAT1_PWR) {
Expand Down Expand Up @@ -128,11 +129,10 @@ static inline void power_button(void)
}

machine_state |= MACHINE_SHUTTING_DOWN;
blink_timer.data = POWERDOWN_FREQ;
blink_timeout(POWERDOWN_FREQ);
blink_timer_timeout = POWERDOWN_FREQ;
blink_timeout(&blink_timer);

init_timer(&power_timer);
power_timer.function = power_timeout;
timer_setup(&power_timer, power_timeout, 0);
power_timer.expires = jiffies + POWERDOWN_TIMEOUT * HZ;
add_timer(&power_timer);
}
Expand All @@ -147,8 +147,7 @@ static irqreturn_t panel_int(int irq, void *dev_id)
if (sgint->istat1 & SGINT_ISTAT1_PWR) {
/* Wait until interrupt goes away */
disable_irq_nosync(SGI_PANEL_IRQ);
init_timer(&debounce_timer);
debounce_timer.function = debounce;
timer_setup(&debounce_timer, debounce, 0);
debounce_timer.expires = jiffies + 5;
add_timer(&debounce_timer);
}
Expand All @@ -171,8 +170,8 @@ static int panic_event(struct notifier_block *this, unsigned long event,
return NOTIFY_DONE;
machine_state |= MACHINE_PANICED;

blink_timer.data = PANIC_FREQ;
blink_timeout(PANIC_FREQ);
blink_timer_timeout = PANIC_FREQ;
blink_timeout(&blink_timer);

return NOTIFY_DONE;
}
Expand All @@ -195,8 +194,7 @@ static int __init reboot_setup(void)
return res;
}

init_timer(&blink_timer);
blink_timer.function = blink_timeout;
timer_setup(&blink_timer, blink_timeout, 0);
atomic_notifier_chain_register(&panic_notifier_list, &panic_block);

return 0;
Expand Down
Loading

0 comments on commit c7c2f3d

Please sign in to comment.