[<prev] [next>] [day] [month] [year] [list]
Message-ID: <546E7C2D.4040301@zytor.com>
Date: Thu, 20 Nov 2014 15:41:33 -0800
From: "H. Peter Anvin" <hpa@...or.com>
To: nick <xerofoify@...il.com>, tglx@...utronix.de
CC: mingo@...hat.com, x86@...nel.org, luto@...capital.net,
rafael.j.wysocki@...el.com, michael.opdenacker@...e-electrons.com,
feng.tang@...el.com, srivatsa.bhat@...ux.vnet.ibm.com,
stefani@...bold.ne, linux-kernel@...r.kernel.org
Subject: Re: Fix Me in hpet.c
On 11/19/2014 06:58 PM, nick wrote:
> Greeting Thomas and other kernel coders,
> I am wondering about the fix in the code below and whether this is still valid as reading it seems to may no sense as
> we are using completion variables and therefore the delayed version of schedule_work_on seems much better in this
> case. Further more I am pasting the code below from vim in order to make it easier for you.
> Cheers Nick
> static int hpet_cpuhp_notify(struct notifier_block *n,
> unsigned long action, void *hcpu)
> {
> unsigned long cpu = (unsigned long)hcpu;
> struct hpet_work_struct work;
> struct hpet_dev *hdev = per_cpu(cpu_hpet_dev, cpu);
>
> switch (action & 0xf) {
> case CPU_ONLINE:
> INIT_DELAYED_WORK_ONSTACK(&work.work, hpet_work);
> init_completion(&work.complete);
> /* FIXME: add schedule_work_on() */
> schedule_delayed_work_on(cpu, &work.work, 0);
> wait_for_completion(&work.complete);
> destroy_delayed_work_on_stack(&work.work);
> break;
> case CPU_DEAD:
> if (hdev) {
> free_irq(hdev->irq, hdev);
> hdev->flags &= ~HPET_DEV_USED;
> per_cpu(cpu_hpet_dev, cpu) = NULL;
> }
> break;
> }
> return NOTIFY_OK;
> }
>
Looks obsolete to me. It might be interesting to look at the "git
blame" output for this code.
-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists