Re: [patch 3/6] 2.6.18: sb1250-mac: Phylib IRQ handling fixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 3 Oct 2006 16:18:35 +0100 (BST)
"Maciej W. Rozycki" <macro@xxxxxxxxxxxxxx> wrote:

> 
> 2. The driver uses schedule_work() for handling interrupts, but does not 
>    make sure any pending work scheduled thus has been completed before 
>    driver's structures get freed from memory.  This is especially 
>    important as interrupts may keep arriving if the line is shared with 
>    another PHY.
> 
>    The solution is to ignore phy_interrupt() calls if the reported device 
>    has already been halted and calling flush_scheduled_work() from 
>    phy_stop_interrupts() (but guarded with current_is_keventd() in case 
>    the function has been called through keventd from the MAC device's 
>    close call to avoid a deadlock on the netlink lock).
> 

eww, hack.

Also not module-friendly:

WARNING: "current_is_keventd" [drivers/net/phy/libphy.ko] undefined!

Does this

static void flush_cpu_workqueue(struct cpu_workqueue_struct *cwq)
{
	if (cwq->thread == current) {
		/*
		 * Probably keventd trying to flush its own queue. So simply run
		 * it by hand rather than deadlocking.
		 */
		run_workqueue(cwq);

not work???


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux