lkml.org 
[lkml]   [2021]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 20/39] irqdomain: Protect the linear revmap with RCU
Date
On Thu, May 20 2021 at 17:37, Marc Zyngier wrote:
> static void irq_domain_clear_mapping(struct irq_domain *domain,
> @@ -902,12 +901,12 @@ unsigned int irq_find_mapping(struct irq_domain *domain,
> return 0;
> }
>
> + rcu_read_lock();
> /* Check if the hwirq is in the linear revmap. */
> if (hwirq < domain->revmap_size)
> - return domain->revmap[hwirq]->irq;
> -
> - rcu_read_lock();
> - data = radix_tree_lookup(&domain->revmap_tree, hwirq);
> + data = rcu_dereference(domain->revmap[hwirq]);
> + else
> + data = radix_tree_lookup(&domain->revmap_tree, hwirq);
> rcu_read_unlock();
> return data ? data->irq : 0;

This is wrong and was wrong before. This wants to be:

irq = data ? data->irq : 0;
rcu_read_unlock();
return irq;

Thanks,

tglx

\
 
 \ /
  Last update: 2021-06-19 13:38    [W:0.205 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site