[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPPcxxRnbE8Ldbm=JQxf=0xLf4VmFBDKrf+UqUUy2KS=qigbZg@mail.gmail.com>
Date: Sat, 15 Jul 2017 16:56:40 +0800
From: xiang fei <liuxiang1999@...il.com>
To: David Miller <davem@...emloft.net>
Cc: liu.xiang6@....com.cn, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] net: davicom: dm9000: Avoid spinlock recursion during
dm9000_timeout routine
Hi,
In this patch, I don't change the routine of dm9000_phy_write().
I just abstract the real phy operation from dm9000_phy_write()
to make a new function dm9000_phy_write_reg(),
which contains no lock.
It is called in dm9000_phy_write() or dm9000_init_dm9000().
Since dm9000_timeout() holds the main spinlock through the
entire routine, dm9000_phy_write_reg() called in this routine is
protected from another thread. I think there is no need to
acquire any locks.
The only problem is dm9000_init_dm9000() may be called
in dm9000_open(). If another thread calls dm9000_open()
in timeout may cause race condition.
dm9000_init_dm9000() needs lock to avoid race condition,
did you mean that?
Thanks!
Powered by blists - more mailing lists