提交 100ef01f 编写于 作者: G Gavin Shan 提交者: David S. Miller

net/ncsi: Disable HWA mode when no channels are found

When there are no NCSI channels probed, HWA (Hardware Arbitration)
mode is enabled. It's not correct because HWA depends on the fact:
NCSI channels exist and all of them support HWA mode. This disables
HWA when no channels are probed.
Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: NSamuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 0795fb20
...@@ -1005,12 +1005,15 @@ static bool ncsi_check_hwa(struct ncsi_dev_priv *ndp) ...@@ -1005,12 +1005,15 @@ static bool ncsi_check_hwa(struct ncsi_dev_priv *ndp)
struct ncsi_package *np; struct ncsi_package *np;
struct ncsi_channel *nc; struct ncsi_channel *nc;
unsigned int cap; unsigned int cap;
bool has_channel = false;
/* The hardware arbitration is disabled if any one channel /* The hardware arbitration is disabled if any one channel
* doesn't support explicitly. * doesn't support explicitly.
*/ */
NCSI_FOR_EACH_PACKAGE(ndp, np) { NCSI_FOR_EACH_PACKAGE(ndp, np) {
NCSI_FOR_EACH_CHANNEL(np, nc) { NCSI_FOR_EACH_CHANNEL(np, nc) {
has_channel = true;
cap = nc->caps[NCSI_CAP_GENERIC].cap; cap = nc->caps[NCSI_CAP_GENERIC].cap;
if (!(cap & NCSI_CAP_GENERIC_HWA) || if (!(cap & NCSI_CAP_GENERIC_HWA) ||
(cap & NCSI_CAP_GENERIC_HWA_MASK) != (cap & NCSI_CAP_GENERIC_HWA_MASK) !=
...@@ -1021,8 +1024,13 @@ static bool ncsi_check_hwa(struct ncsi_dev_priv *ndp) ...@@ -1021,8 +1024,13 @@ static bool ncsi_check_hwa(struct ncsi_dev_priv *ndp)
} }
} }
ndp->flags |= NCSI_DEV_HWA; if (has_channel) {
return true; ndp->flags |= NCSI_DEV_HWA;
return true;
}
ndp->flags &= ~NCSI_DEV_HWA;
return false;
} }
static int ncsi_enable_hwa(struct ncsi_dev_priv *ndp) static int ncsi_enable_hwa(struct ncsi_dev_priv *ndp)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册