Re: [RFC v3 07/26] um lkl: interrupt support

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

 



On Wed, 05 Feb 2020 19:47:36 +0900,
Anton Ivanov wrote:

> > +/**
> > + * This function can be called from arbitrary host threads, so do not
> > + * issue any Linux calls (e.g. prink) if lkl_cpu_get() was not issued
> > + * before.
> > + */
> > +int lkl_trigger_irq(int irq)
> > +{
> > +	int ret;
> > +
> > +	if (!irq || irq > NR_IRQS)
> > +		return -EINVAL;
> > +
> > +	ret = lkl_cpu_try_run_irq(irq);
> > +	if (ret <= 0)
> > +		return ret;
> > +
> > +	/*
> > +	 * Since this can be called from Linux context (e.g. lkl_trigger_irq ->
> > +	 * IRQ -> softirq -> lkl_trigger_irq) make sure we are actually allowed
> > +	 * to run irqs at this point
> > +	 */
> > +	if (!irqs_enabled) {
> > +		set_irq_pending(irq);
> > +		lkl_cpu_put();
> > +		return 0;
> > +	}
> > +
> > +	run_irq(irq);
> > +
> > +	lkl_cpu_put();
> > +
> > +	return 0;
> 
> Isn't that just:
> 
> 	if (irqs_enabled)
> 		run_irq(irq);
> 	else
> 		set_irq_pending(irq);
> 
> 	lkl_cpu_put();
> 
> 	return 0;

Thanks, this is much cleaner.  I will fix this in the next turn.

-- Hajime




[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux