diff options
author | Gavin Shan <gwshan@linux.vnet.ibm.com> | 2017-10-18 22:43:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-20 20:56:38 -0400 |
commit | 100ef01f3ea4badbee6479290a41f74abd0e523f (patch) | |
tree | 63e20dd96f1655865b98745c97f9360f826d4e87 /net/ncsi | |
parent | 0795fb2021f07969949f523ea33c39785bfae9d6 (diff) |
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: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ncsi')
-rw-r--r-- | net/ncsi/ncsi-manage.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c index b022deb39d31..0966eff48ce7 100644 --- a/net/ncsi/ncsi-manage.c +++ b/net/ncsi/ncsi-manage.c | |||
@@ -1005,12 +1005,15 @@ static bool ncsi_check_hwa(struct ncsi_dev_priv *ndp) | |||
1005 | struct ncsi_package *np; | 1005 | struct ncsi_package *np; |
1006 | struct ncsi_channel *nc; | 1006 | struct ncsi_channel *nc; |
1007 | unsigned int cap; | 1007 | unsigned int cap; |
1008 | bool has_channel = false; | ||
1008 | 1009 | ||
1009 | /* The hardware arbitration is disabled if any one channel | 1010 | /* The hardware arbitration is disabled if any one channel |
1010 | * doesn't support explicitly. | 1011 | * doesn't support explicitly. |
1011 | */ | 1012 | */ |
1012 | NCSI_FOR_EACH_PACKAGE(ndp, np) { | 1013 | NCSI_FOR_EACH_PACKAGE(ndp, np) { |
1013 | NCSI_FOR_EACH_CHANNEL(np, nc) { | 1014 | NCSI_FOR_EACH_CHANNEL(np, nc) { |
1015 | has_channel = true; | ||
1016 | |||
1014 | cap = nc->caps[NCSI_CAP_GENERIC].cap; | 1017 | cap = nc->caps[NCSI_CAP_GENERIC].cap; |
1015 | if (!(cap & NCSI_CAP_GENERIC_HWA) || | 1018 | if (!(cap & NCSI_CAP_GENERIC_HWA) || |
1016 | (cap & NCSI_CAP_GENERIC_HWA_MASK) != | 1019 | (cap & NCSI_CAP_GENERIC_HWA_MASK) != |
@@ -1021,8 +1024,13 @@ static bool ncsi_check_hwa(struct ncsi_dev_priv *ndp) | |||
1021 | } | 1024 | } |
1022 | } | 1025 | } |
1023 | 1026 | ||
1024 | ndp->flags |= NCSI_DEV_HWA; | 1027 | if (has_channel) { |
1025 | return true; | 1028 | ndp->flags |= NCSI_DEV_HWA; |
1029 | return true; | ||
1030 | } | ||
1031 | |||
1032 | ndp->flags &= ~NCSI_DEV_HWA; | ||
1033 | return false; | ||
1026 | } | 1034 | } |
1027 | 1035 | ||
1028 | static int ncsi_enable_hwa(struct ncsi_dev_priv *ndp) | 1036 | static int ncsi_enable_hwa(struct ncsi_dev_priv *ndp) |