Re: [PATCH 06/14] powerpc/vas: Setup fault handler per VAS instance

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

 



>  
> +struct task_struct *fault_handler;
> +
> +void vas_wakeup_fault_handler(int virq, void *arg)
> +{
> +	struct vas_instance *vinst = arg;
> +
> +	atomic_inc(&vinst->pending_fault);
> +	wake_up(&vinst->fault_wq);
> +}
> +
> +/*
> + * Fault handler thread for each VAS instance and process fault CRBs.
> + */
> +static int fault_handler_func(void *arg)
> +{
> +	struct vas_instance *vinst = (struct vas_instance *)arg;
> +
> +	do {
> +		if (signal_pending(current))
> +			flush_signals(current);
> +
> +		wait_event_interruptible(vinst->fault_wq,
> +					atomic_read(&vinst->pending_fault) ||
> +					kthread_should_stop());
> +
> +		if (kthread_should_stop())
> +			break;
> +
> +		atomic_dec(&vinst->pending_fault);
> +	} while (!kthread_should_stop());
> +
> +	return 0;
> +}

Pleae use threaded interrupts instead of reinventing them badly.



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux