lkml.org 
[lkml]   [2018]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3] net: davicom: dm9000: Avoid spinlock recursion during dm9000_timeout routine
From
From: Liu Xiang <liu.xiang6@zte.com.cn>
Date: Sat, 14 Apr 2018 16:50:34 +0800

> +static bool dm9000_current_in_timeout(struct board_info *db)
> +{
> + bool ret = false;
> +
> + preempt_disable();
> + ret = (db->timeout_cpu == smp_processor_id());
> + preempt_enable();

This doesn't work.

As soon as you do preempt_enable(), smp_processor_id() can change.

\
 
 \ /
  Last update: 2018-04-16 17:05    [W:0.037 / U:7.124 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site