Commit 5de76b18 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  be2net: fix error in rx completion processing.
  igbvf: avoid reset storms due to mailbox issues
  igb: fix handling of mailbox collisions between PF/VF
  usb: remove rare pm primitive for conversion to new API
parents 8d0e7fb9 e1187b3b
...@@ -759,7 +759,7 @@ static void be_rx_compl_process(struct be_adapter *adapter, ...@@ -759,7 +759,7 @@ static void be_rx_compl_process(struct be_adapter *adapter,
/* vlanf could be wrongly set in some cards. /* vlanf could be wrongly set in some cards.
* ignore if vtm is not set */ * ignore if vtm is not set */
if ((adapter->cap == 0x400) && !vtm) if ((adapter->cap & 0x400) && !vtm)
vlanf = 0; vlanf = 0;
skb = netdev_alloc_skb_ip_align(adapter->netdev, BE_HDR_LEN); skb = netdev_alloc_skb_ip_align(adapter->netdev, BE_HDR_LEN);
...@@ -816,7 +816,7 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter, ...@@ -816,7 +816,7 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter,
/* vlanf could be wrongly set in some cards. /* vlanf could be wrongly set in some cards.
* ignore if vtm is not set */ * ignore if vtm is not set */
if ((adapter->cap == 0x400) && !vtm) if ((adapter->cap & 0x400) && !vtm)
vlanf = 0; vlanf = 0;
skb = napi_get_frags(&eq_obj->napi); skb = napi_get_frags(&eq_obj->napi);
......
...@@ -4608,8 +4608,14 @@ static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf) ...@@ -4608,8 +4608,14 @@ static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf)
retval = igb_read_mbx(hw, msgbuf, E1000_VFMAILBOX_SIZE, vf); retval = igb_read_mbx(hw, msgbuf, E1000_VFMAILBOX_SIZE, vf);
if (retval) if (retval) {
/* if receive failed revoke VF CTS stats and restart init */
dev_err(&pdev->dev, "Error receiving message from VF\n"); dev_err(&pdev->dev, "Error receiving message from VF\n");
vf_data->flags &= ~IGB_VF_FLAG_CTS;
if (!time_after(jiffies, vf_data->last_nack + (2 * HZ)))
return;
goto out;
}
/* this is a message we already processed, do nothing */ /* this is a message we already processed, do nothing */
if (msgbuf[0] & (E1000_VT_MSGTYPE_ACK | E1000_VT_MSGTYPE_NACK)) if (msgbuf[0] & (E1000_VT_MSGTYPE_ACK | E1000_VT_MSGTYPE_NACK))
...@@ -4626,12 +4632,10 @@ static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf) ...@@ -4626,12 +4632,10 @@ static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf)
} }
if (!(vf_data->flags & IGB_VF_FLAG_CTS)) { if (!(vf_data->flags & IGB_VF_FLAG_CTS)) {
msgbuf[0] = E1000_VT_MSGTYPE_NACK; if (!time_after(jiffies, vf_data->last_nack + (2 * HZ)))
if (time_after(jiffies, vf_data->last_nack + (2 * HZ))) { return;
igb_write_mbx(hw, msgbuf, 1, vf); retval = -1;
vf_data->last_nack = jiffies; goto out;
}
return;
} }
switch ((msgbuf[0] & 0xFFFF)) { switch ((msgbuf[0] & 0xFFFF)) {
...@@ -4656,14 +4660,14 @@ static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf) ...@@ -4656,14 +4660,14 @@ static void igb_rcv_msg_from_vf(struct igb_adapter *adapter, u32 vf)
break; break;
} }
msgbuf[0] |= E1000_VT_MSGTYPE_CTS;
out:
/* notify the VF of the results of what it sent us */ /* notify the VF of the results of what it sent us */
if (retval) if (retval)
msgbuf[0] |= E1000_VT_MSGTYPE_NACK; msgbuf[0] |= E1000_VT_MSGTYPE_NACK;
else else
msgbuf[0] |= E1000_VT_MSGTYPE_ACK; msgbuf[0] |= E1000_VT_MSGTYPE_ACK;
msgbuf[0] |= E1000_VT_MSGTYPE_CTS;
igb_write_mbx(hw, msgbuf, 1, vf); igb_write_mbx(hw, msgbuf, 1, vf);
} }
......
...@@ -276,6 +276,7 @@ struct igbvf_adapter { ...@@ -276,6 +276,7 @@ struct igbvf_adapter {
unsigned long led_status; unsigned long led_status;
unsigned int flags; unsigned int flags;
unsigned long last_reset;
}; };
struct igbvf_info { struct igbvf_info {
......
...@@ -1469,6 +1469,8 @@ static void igbvf_reset(struct igbvf_adapter *adapter) ...@@ -1469,6 +1469,8 @@ static void igbvf_reset(struct igbvf_adapter *adapter)
memcpy(netdev->perm_addr, adapter->hw.mac.addr, memcpy(netdev->perm_addr, adapter->hw.mac.addr,
netdev->addr_len); netdev->addr_len);
} }
adapter->last_reset = jiffies;
} }
int igbvf_up(struct igbvf_adapter *adapter) int igbvf_up(struct igbvf_adapter *adapter)
...@@ -1812,11 +1814,15 @@ static bool igbvf_has_link(struct igbvf_adapter *adapter) ...@@ -1812,11 +1814,15 @@ static bool igbvf_has_link(struct igbvf_adapter *adapter)
s32 ret_val = E1000_SUCCESS; s32 ret_val = E1000_SUCCESS;
bool link_active; bool link_active;
/* If interface is down, stay link down */
if (test_bit(__IGBVF_DOWN, &adapter->state))
return false;
ret_val = hw->mac.ops.check_for_link(hw); ret_val = hw->mac.ops.check_for_link(hw);
link_active = !hw->mac.get_link_status; link_active = !hw->mac.get_link_status;
/* if check for link returns error we will need to reset */ /* if check for link returns error we will need to reset */
if (ret_val) if (ret_val && time_after(jiffies, adapter->last_reset + (10 * HZ)))
schedule_work(&adapter->reset_task); schedule_work(&adapter->reset_task);
return link_active; return link_active;
......
...@@ -716,7 +716,7 @@ static int kaweth_open(struct net_device *net) ...@@ -716,7 +716,7 @@ static int kaweth_open(struct net_device *net)
return 0; return 0;
err_out: err_out:
usb_autopm_enable(kaweth->intf); usb_autopm_put_interface(kaweth->intf);
return -EIO; return -EIO;
} }
...@@ -753,7 +753,7 @@ static int kaweth_close(struct net_device *net) ...@@ -753,7 +753,7 @@ static int kaweth_close(struct net_device *net)
kaweth->status &= ~KAWETH_STATUS_CLOSING; kaweth->status &= ~KAWETH_STATUS_CLOSING;
usb_autopm_enable(kaweth->intf); usb_autopm_put_interface(kaweth->intf);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment