Re: [PATCH 2/3] cnic: Don't take cnic_dev_lock in cnic_alloc_uio_rings()
From: Michael Chan <mchan@broadcom.com>
Date: 2014-06-01 00:07:56
From: Michael Chan <mchan@broadcom.com>
Date: 2014-06-01 00:07:56
On Sat, 2014-05-31 at 09:07 -0400, Neil Horman wrote:
On Fri, May 30, 2014 at 04:18:42PM -0700, Michael Chan wrote:quoted
We are allocating memory with GFP_KERNEL under spinlock. Since this is the only call manipulating the cnic_udev_list and it is always under rtnl_lock, cnic_dev_lock can be safely removed.I don't think this is accurate. cnic_alloc_uio_rings seems to protect the list with cnic_dev_lock, but has several paths (those calling ->alloc_resc()), that never hold the rtnl_lock.
->alloc_resc() is called by cnic_start_hw(). cnic_start_hw() is called from 2 paths. One is from netdev events which always hold rtnl_lock. The other path is from bnx2/bnx2x with CNIC_CTL_START_CMD. In bnx2, this is called during bnx2_netif_start() which is always under rtnl_lock. In bnx2x, it is called during bnx2x_nic_load() which is also under rtnl_lock(). Thanks.