提交 16fe9d74 编写于 作者: M Michael Chan 提交者: David S. Miller

[TG3]: Fix 5704 single-port mode

If the dual-port 5704 is configured as a single-port device with
only one PCI function, it would trigger a BUG() condition in
tg3_find_5704_peer(). This fixes the problem by returning its
own pdev if the peer cannot be found.
Signed-off-by: NMichael Chan <mchan@broadcom.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 6a9eba15
...@@ -10443,8 +10443,13 @@ static struct pci_dev * __devinit tg3_find_5704_peer(struct tg3 *tp) ...@@ -10443,8 +10443,13 @@ static struct pci_dev * __devinit tg3_find_5704_peer(struct tg3 *tp)
break; break;
pci_dev_put(peer); pci_dev_put(peer);
} }
if (!peer || peer == tp->pdev) /* 5704 can be configured in single-port mode, set peer to
BUG(); * tp->pdev in that case.
*/
if (!peer) {
peer = tp->pdev;
return peer;
}
/* /*
* We don't need to keep the refcount elevated; there's no way * We don't need to keep the refcount elevated; there's no way
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册