[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1101141928210.2678@localhost6.localdomain6>
Date: Fri, 14 Jan 2011 20:47:23 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Ben Hutchings <bhutchings@...arflare.com>
cc: David Miller <davem@...emloft.net>,
Tom Herbert <therbert@...gle.com>,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
linux-net-drivers@...arflare.com
Subject: Re: [PATCH 1/2] genirq: Add IRQ affinity notifiers
On Tue, 4 Jan 2011, Ben Hutchings wrote:
> +/**
> + * struct irq_affinity_notify - context for notification of IRQ affinity changes
> + * @irq: Interrupt to which notification applies
> + * @kref: Reference count, for internal use
> + * @work: Work item, for internal use
> + * @notify: Function to be called on change. This will be
> + * called in process context.
> + * @release: Function to be called on release. This will be
> + * called in process context. Once registered, the
> + * structure must only be freed when this function is
> + * called or later.
> + */
> +struct irq_affinity_notify {
> + unsigned int irq;
> + struct kref kref;
> +#if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_HARDIRQS)
The whole affinity thing is SMP and GENERIC_HARDIRQS only anyway, so
what's the point of this ifdeffery ?
> + struct work_struct work;
> +#endif
> + void (*notify)(struct irq_affinity_notify *, const cpumask_t *mask);
> + void (*release)(struct kref *ref);
> +};
> +
> +/**
> + * irq_set_affinity_notifier - control notification of IRQ affinity changes
> + * @irq: Interrupt for which to enable/disable notification
> + * @notify: Context for notification, or %NULL to disable
> + * notification. Function pointers must be initialised;
> + * the other fields will be initialised by this function.
> + *
> + * Must be called in process context. Notification may only be enabled
> + * after the IRQ is allocated but before it is bound with request_irq()
Why? And if there is that restriction, then it needs to be
checked. But I don't see why this is necessary.
> + * and must be disabled before the IRQ is freed using free_irq().
> + */
> +#ifdef CONFIG_SMP
> + BUG_ON(desc->affinity_notify);
We should be nice here and just WARN and fixup the wreckage by
uninstalling it.
Thanks,
tglx
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists