qlge: Fix lock/mutex warnings.
Get rid of spinlock and private mutex usage for exclusive access to the HW semaphore register. rtnl_lock already creates exclusive access to this register in all driver API. Add rtnl to firmware worker threads that also use the HW semaphore register. Signed-off-by: Ron Mercer <ron.mercer@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
5ee22a5aa9
commit
86aaf9ad82
@ -34,7 +34,6 @@
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/ethtool.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/rtnetlink.h>
|
||||
#include <linux/if_vlan.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/mm.h>
|
||||
@ -1926,12 +1925,10 @@ static void ql_vlan_rx_add_vid(struct net_device *ndev, u16 vid)
|
||||
status = ql_sem_spinlock(qdev, SEM_MAC_ADDR_MASK);
|
||||
if (status)
|
||||
return;
|
||||
spin_lock(&qdev->hw_lock);
|
||||
if (ql_set_mac_addr_reg
|
||||
(qdev, (u8 *) &enable_bit, MAC_ADDR_TYPE_VLAN, vid)) {
|
||||
QPRINTK(qdev, IFUP, ERR, "Failed to init vlan address.\n");
|
||||
}
|
||||
spin_unlock(&qdev->hw_lock);
|
||||
ql_sem_unlock(qdev, SEM_MAC_ADDR_MASK);
|
||||
}
|
||||
|
||||
@ -1945,12 +1942,10 @@ static void ql_vlan_rx_kill_vid(struct net_device *ndev, u16 vid)
|
||||
if (status)
|
||||
return;
|
||||
|
||||
spin_lock(&qdev->hw_lock);
|
||||
if (ql_set_mac_addr_reg
|
||||
(qdev, (u8 *) &enable_bit, MAC_ADDR_TYPE_VLAN, vid)) {
|
||||
QPRINTK(qdev, IFUP, ERR, "Failed to clear vlan address.\n");
|
||||
}
|
||||
spin_unlock(&qdev->hw_lock);
|
||||
ql_sem_unlock(qdev, SEM_MAC_ADDR_MASK);
|
||||
|
||||
}
|
||||
@ -3587,7 +3582,6 @@ static void qlge_set_multicast_list(struct net_device *ndev)
|
||||
status = ql_sem_spinlock(qdev, SEM_RT_IDX_MASK);
|
||||
if (status)
|
||||
return;
|
||||
spin_lock(&qdev->hw_lock);
|
||||
/*
|
||||
* Set or clear promiscuous mode if a
|
||||
* transition is taking place.
|
||||
@ -3664,7 +3658,6 @@ static void qlge_set_multicast_list(struct net_device *ndev)
|
||||
}
|
||||
}
|
||||
exit:
|
||||
spin_unlock(&qdev->hw_lock);
|
||||
ql_sem_unlock(qdev, SEM_RT_IDX_MASK);
|
||||
}
|
||||
|
||||
@ -3684,10 +3677,8 @@ static int qlge_set_mac_address(struct net_device *ndev, void *p)
|
||||
status = ql_sem_spinlock(qdev, SEM_MAC_ADDR_MASK);
|
||||
if (status)
|
||||
return status;
|
||||
spin_lock(&qdev->hw_lock);
|
||||
status = ql_set_mac_addr_reg(qdev, (u8 *) ndev->dev_addr,
|
||||
MAC_ADDR_TYPE_CAM_MAC, qdev->func * MAX_CQ);
|
||||
spin_unlock(&qdev->hw_lock);
|
||||
if (status)
|
||||
QPRINTK(qdev, HW, ERR, "Failed to load MAC address.\n");
|
||||
ql_sem_unlock(qdev, SEM_MAC_ADDR_MASK);
|
||||
@ -3930,7 +3921,6 @@ static int __devinit ql_init_device(struct pci_dev *pdev,
|
||||
INIT_DELAYED_WORK(&qdev->mpi_work, ql_mpi_work);
|
||||
INIT_DELAYED_WORK(&qdev->mpi_port_cfg_work, ql_mpi_port_cfg_work);
|
||||
INIT_DELAYED_WORK(&qdev->mpi_idc_work, ql_mpi_idc_work);
|
||||
mutex_init(&qdev->mpi_mutex);
|
||||
init_completion(&qdev->ide_completion);
|
||||
|
||||
if (!cards_found) {
|
||||
|
Reference in New Issue
Block a user