[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200201092320.10a3381b@cakuba.hsd1.ca.comcast.net>
Date: Sat, 1 Feb 2020 09:23:20 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Taehee Yoo <ap420073@...il.com>
Cc: David Miller <davem@...emloft.net>, Netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net v2 2/6] netdevsim: disable devlink reload when
resources are being used
On Sat, 1 Feb 2020 18:37:58 +0900, Taehee Yoo wrote:
> > > + mutex_lock(&nsim_bus_dev_ops_lock);
> >
> > Not sure why we have to lock the big lock here?
>
> The reason for using this lock is to protect "nsim_dev".
> nsim_dev_take_snapshot_write() uses nsim_dev.
> So if nsim_dev is removed while this function is being used,
> panic will occur.
> nsim_dev is protected by nsim_bus_dev_ops_lock.
> So, this lock should be used.
I see.
> But, I found deadlock because of this lock.
> Structurally, this lock couldn't be used in snapshot_write().
> So, I will find another way.
Could we perhaps use the lock in struct device? Seems like it would
be a good fit for protecting nsim_dev?
Powered by blists - more mailing lists