lkml.org 
[lkml]   [2015]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [v4 1/3] genirq: Introduce irq_set_vcpu_affinity() to target an interrupt to a VCPU
On Thu, 30 Apr 2015, Feng Wu wrote:
>
> Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>

So I assume Jiang is the author, right?

> Signed-off-by: Feng Wu <feng.wu@intel.com>

> /**
> + * irq_chip_set_vcpu_affinity_parent - Set vcpu affinity on the parent interrupt
> + * @data: Pointer to interrupt specific data
> + * @dest: The vcpu affinity information
> + */
> +int irq_chip_set_vcpu_affinity_parent(struct irq_data *data, void *vcpu_info)
> +{
> + data = data->parent_data;
> + if (data->chip->irq_set_vcpu_affinity)
> + return data->chip->irq_set_vcpu_affinity(data, vcpu_info);
> +
> + return -ENOSYS;
> +}

That needs a prototype in irq.h, methinks

> +int irq_set_vcpu_affinity(unsigned int irq, void *vcpu_info)
> +{
> + struct irq_desc *desc = irq_to_desc(irq);

irq_get_desc_lock() please

> + struct irq_chip *chip;
> + unsigned long flags;
> + int ret = -ENOSYS;
> +
> + if (!desc)
> + return -EINVAL;
> +
> + raw_spin_lock_irqsave(&desc->lock, flags);
> + chip = desc->irq_data.chip;
> + if (chip && chip->irq_set_vcpu_affinity)
> + ret = chip->irq_set_vcpu_affinity(irq_desc_get_irq_data(desc),

Above you fiddle with desc->irq_data directly. Why using the accessor here?

> + vcpu_info);
> + raw_spin_unlock_irqrestore(&desc->lock, flags);

Otherwise this looks good.

Thanks,

tglx


\
 
 \ /
  Last update: 2015-05-15 19:01    [W:0.130 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site