OSDN Git Service

ntb_hw_switchtec: Force down the link before initializing
authorLogan Gunthorpe <logang@deltatee.com>
Mon, 4 Dec 2017 17:57:21 +0000 (10:57 -0700)
committerJon Mason <jdmason@kudzu.us>
Mon, 29 Jan 2018 03:17:23 +0000 (22:17 -0500)
commitd04be142b8b61ffb3c9cc5c6d1abda8fc59a16c9
treeac62252c3e7724979c0baf852743dd79f5f750be
parent270d32e63c70c808a91449da24324e0009827c5f
ntb_hw_switchtec: Force down the link before initializing

If one host crashes and soft reboots, the other host may not see a
link down event. Then when the crashed host comes back up, the
surviving host may not know the link was reset and the NTB clients
may not work without being reset.

To solve this, we send a LINK_FORCE_DOWN message to each peer every
time we come up, before we register the NTB device. If a surviving
host still thinks the link is up it will take it down immediately.
In this way, once the crashed host comes up fully, it will send a
regular link up event as per usual and the link will be properly
restarted.

While we are in the area, this also fixes the MSG_LINK_UP message that
was in the link down function that was reported by Doug Meyers.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Reported-by: ThanhTuThai <cruisethai@gmail.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
drivers/ntb/hw/mscc/ntb_hw_switchtec.c