diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-08-27 20:01:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-08-27 20:01:54 -0400 |
commit | fff4e7a0e680b29bb8006cc37921562ef4b8e8df (patch) | |
tree | 45a840c09d77b4a0c7e97f974c78fe24d202105d | |
parent | a8b169afbf06a678437632709caac98e16f99263 (diff) | |
parent | 0eb46345364d7318b11068c46e8a68d5dc10f65e (diff) |
Merge tag 'ntb-4.13-bugfixes' of git://github.com/jonmason/ntb
Pull NTB fixes from Jon Mason:
"NTB bug fixes to address an incorrect ntb_mw_count reference in the
NTB transport, improperly bringing down the link if SPADs are
corrupted, and an out-of-order issue regarding link negotiation and
data passing"
* tag 'ntb-4.13-bugfixes' of git://github.com/jonmason/ntb:
ntb: ntb_test: ensure the link is up before trying to configure the mws
ntb: transport shouldn't disable link due to bogus values in SPADs
ntb: use correct mw_count function in ntb_tool and ntb_transport
-rw-r--r-- | drivers/ntb/ntb_transport.c | 6 | ||||
-rw-r--r-- | drivers/ntb/test/ntb_tool.c | 2 | ||||
-rwxr-xr-x | tools/testing/selftests/ntb/ntb_test.sh | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c index 9a03c5871efe..f58d8e305323 100644 --- a/drivers/ntb/ntb_transport.c +++ b/drivers/ntb/ntb_transport.c | |||
@@ -924,10 +924,8 @@ out1: | |||
924 | ntb_free_mw(nt, i); | 924 | ntb_free_mw(nt, i); |
925 | 925 | ||
926 | /* if there's an actual failure, we should just bail */ | 926 | /* if there's an actual failure, we should just bail */ |
927 | if (rc < 0) { | 927 | if (rc < 0) |
928 | ntb_link_disable(ndev); | ||
929 | return; | 928 | return; |
930 | } | ||
931 | 929 | ||
932 | out: | 930 | out: |
933 | if (ntb_link_is_up(ndev, NULL, NULL) == 1) | 931 | if (ntb_link_is_up(ndev, NULL, NULL) == 1) |
@@ -1059,7 +1057,7 @@ static int ntb_transport_probe(struct ntb_client *self, struct ntb_dev *ndev) | |||
1059 | int node; | 1057 | int node; |
1060 | int rc, i; | 1058 | int rc, i; |
1061 | 1059 | ||
1062 | mw_count = ntb_mw_count(ndev, PIDX); | 1060 | mw_count = ntb_peer_mw_count(ndev); |
1063 | 1061 | ||
1064 | if (!ndev->ops->mw_set_trans) { | 1062 | if (!ndev->ops->mw_set_trans) { |
1065 | dev_err(&ndev->dev, "Inbound MW based NTB API is required\n"); | 1063 | dev_err(&ndev->dev, "Inbound MW based NTB API is required\n"); |
diff --git a/drivers/ntb/test/ntb_tool.c b/drivers/ntb/test/ntb_tool.c index f002bf48a08d..a69815c45ce6 100644 --- a/drivers/ntb/test/ntb_tool.c +++ b/drivers/ntb/test/ntb_tool.c | |||
@@ -959,7 +959,7 @@ static int tool_probe(struct ntb_client *self, struct ntb_dev *ntb) | |||
959 | tc->ntb = ntb; | 959 | tc->ntb = ntb; |
960 | init_waitqueue_head(&tc->link_wq); | 960 | init_waitqueue_head(&tc->link_wq); |
961 | 961 | ||
962 | tc->mw_count = min(ntb_mw_count(tc->ntb, PIDX), MAX_MWS); | 962 | tc->mw_count = min(ntb_peer_mw_count(tc->ntb), MAX_MWS); |
963 | for (i = 0; i < tc->mw_count; i++) { | 963 | for (i = 0; i < tc->mw_count; i++) { |
964 | rc = tool_init_mw(tc, i); | 964 | rc = tool_init_mw(tc, i); |
965 | if (rc) | 965 | if (rc) |
diff --git a/tools/testing/selftests/ntb/ntb_test.sh b/tools/testing/selftests/ntb/ntb_test.sh index 1c12b5855e4f..5fc7ad359e21 100755 --- a/tools/testing/selftests/ntb/ntb_test.sh +++ b/tools/testing/selftests/ntb/ntb_test.sh | |||
@@ -333,6 +333,10 @@ function ntb_tool_tests() | |||
333 | link_test $LOCAL_TOOL $REMOTE_TOOL | 333 | link_test $LOCAL_TOOL $REMOTE_TOOL |
334 | link_test $REMOTE_TOOL $LOCAL_TOOL | 334 | link_test $REMOTE_TOOL $LOCAL_TOOL |
335 | 335 | ||
336 | #Ensure the link is up on both sides before continuing | ||
337 | write_file Y $LOCAL_TOOL/link_event | ||
338 | write_file Y $REMOTE_TOOL/link_event | ||
339 | |||
336 | for PEER_TRANS in $(ls $LOCAL_TOOL/peer_trans*); do | 340 | for PEER_TRANS in $(ls $LOCAL_TOOL/peer_trans*); do |
337 | PT=$(basename $PEER_TRANS) | 341 | PT=$(basename $PEER_TRANS) |
338 | write_file $MW_SIZE $LOCAL_TOOL/$PT | 342 | write_file $MW_SIZE $LOCAL_TOOL/$PT |