lkml.org 
[lkml]   [2013]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 10/27] genirq: Split __irq_reserve_irqs from irq_alloc_descs
On Mon, Jun 10, 2013 at 12:16:16PM -0700, Yinghai Lu wrote:
> On Mon, Jun 10, 2013 at 6:51 AM, Alexander Gordeev <agordeev@redhat.com> wrote:
> >> +/**
> >> + * irq_alloc_descs - allocate and initialize a range of irq descriptors
> >> + * @irq: Allocate for specific irq number if irq >= 0
> >> + * @from: Start the search from this irq number
> >> + * @cnt: Number of consecutive irqs to allocate.
> >> + * @node: Preferred node on which the irq descriptor should be allocated
> >> + * @owner: Owning module (can be NULL)
> >> + *
> >> + * Returns the first irq number or error code
> >> + */
> >> +int __ref
> >> +__irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node,
> >> + struct module *owner)
> >> +{
> >> + int start;
> >> +
> >> + start = __irq_reserve_irqs(irq, from, cnt);
> >> +
> >> + if (start < 0)
> >> + return start;
> >> +
> >> + return alloc_descs(start, cnt, node, owner);
> >
> > I think alloc_descs() fail path is needed before return.
>
> __irq_reserve_irqs already return -EEXIST etc,
>
> old kernel is like:
>
> >> @@ -380,12 +377,36 @@ __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node,
>
> bitmap_set(allocated_irqs, start, cnt);
> mutex_unlock(&sparse_irq_lock);
> return alloc_descs(start, cnt, node, owner);
>
> err:
> mutex_unlock(&sparse_irq_lock);
> return ret;
>
> so i don't change the fail path handling.

I rather meant the bits should be unset in case alloc_descs() failed.
But I failed to notice alloc_descs() does it. Therefore..

Reviewed-by: Alexander Gordeev <agordeev@redhat.com>

> Thanks
>
> Yinghai

--
Regards,
Alexander Gordeev
agordeev@redhat.com


\
 
 \ /
  Last update: 2013-06-10 22:01    [W:0.053 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site