diff options
author | Chien Tung <chien.tin.tung@intel.com> | 2010-03-09 16:50:40 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2010-04-21 18:46:40 -0400 |
commit | ce6e74f23d8018f50609f694b6177c139486ebe5 (patch) | |
tree | 5d7f07be071eae07a1c047f8f0ba322a44abd8db /drivers/infiniband/hw/nes/nes_hw.c | |
parent | 0eddb519b9127c73d53db4bf3ec1d45b13f844d1 (diff) |
RDMA/nes: Make nesadapter->phy_lock usage consistent
nes_{read,write}_1G_phy_reg() are using phy_lock while
nes_{read,write}_10G_phy_reg() leave that to the caller.
Remove phy_lock from 1G routines and leave the locking to the caller.
Add additional phy_lock calls around 1G read/write.
Signed-off-by: Chien Tung <chien.tin.tung@intel.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/nes/nes_hw.c')
-rw-r--r-- | drivers/infiniband/hw/nes/nes_hw.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c index c36a3f514929..8b67207c7076 100644 --- a/drivers/infiniband/hw/nes/nes_hw.c +++ b/drivers/infiniband/hw/nes/nes_hw.c | |||
@@ -2458,7 +2458,6 @@ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number) | |||
2458 | return; | 2458 | return; |
2459 | } | 2459 | } |
2460 | nesadapter->mac_sw_state[mac_number] = NES_MAC_SW_INTERRUPT; | 2460 | nesadapter->mac_sw_state[mac_number] = NES_MAC_SW_INTERRUPT; |
2461 | spin_unlock_irqrestore(&nesadapter->phy_lock, flags); | ||
2462 | 2461 | ||
2463 | /* ack the MAC interrupt */ | 2462 | /* ack the MAC interrupt */ |
2464 | mac_status = nes_read_indexed(nesdev, NES_IDX_MAC_INT_STATUS + (mac_index * 0x200)); | 2463 | mac_status = nes_read_indexed(nesdev, NES_IDX_MAC_INT_STATUS + (mac_index * 0x200)); |
@@ -2469,11 +2468,9 @@ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number) | |||
2469 | 2468 | ||
2470 | if (mac_status & (NES_MAC_INT_LINK_STAT_CHG | NES_MAC_INT_XGMII_EXT)) { | 2469 | if (mac_status & (NES_MAC_INT_LINK_STAT_CHG | NES_MAC_INT_XGMII_EXT)) { |
2471 | nesdev->link_status_interrupts++; | 2470 | nesdev->link_status_interrupts++; |
2472 | if (0 == (++nesadapter->link_interrupt_count[mac_index] % ((u16)NES_MAX_LINK_INTERRUPTS))) { | 2471 | if (0 == (++nesadapter->link_interrupt_count[mac_index] % ((u16)NES_MAX_LINK_INTERRUPTS))) |
2473 | spin_lock_irqsave(&nesadapter->phy_lock, flags); | ||
2474 | nes_reset_link(nesdev, mac_index); | 2472 | nes_reset_link(nesdev, mac_index); |
2475 | spin_unlock_irqrestore(&nesadapter->phy_lock, flags); | 2473 | |
2476 | } | ||
2477 | /* read the PHY interrupt status register */ | 2474 | /* read the PHY interrupt status register */ |
2478 | if ((nesadapter->OneG_Mode) && | 2475 | if ((nesadapter->OneG_Mode) && |
2479 | (nesadapter->phy_type[mac_index] != NES_PHY_TYPE_PUMA_1G)) { | 2476 | (nesadapter->phy_type[mac_index] != NES_PHY_TYPE_PUMA_1G)) { |
@@ -2587,6 +2584,7 @@ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number) | |||
2587 | break; | 2584 | break; |
2588 | } | 2585 | } |
2589 | } | 2586 | } |
2587 | spin_unlock_irqrestore(&nesadapter->phy_lock, flags); | ||
2590 | 2588 | ||
2591 | if (phy_data & 0x0004) { | 2589 | if (phy_data & 0x0004) { |
2592 | if (wide_ppm_offset && | 2590 | if (wide_ppm_offset && |