Re: [PATCH v3] net: davicom: dm9000: Avoid spinlock recursion during dm9000_timeout routine

From: David Miller
Date: Mon Apr 16 2018 - 11:05:08 EST


From: Liu Xiang <liu.xiang6@xxxxxxxxxx>
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.