]> asedeno.scripts.mit.edu Git - linux.git/commit
NTB: ntb_hw_switchtec: Fix peer BAR bug in switchtec_ntb_init_shared_mw
authorDoug Meyer <dmeyer@gigaio.com>
Tue, 17 Oct 2017 20:22:53 +0000 (13:22 -0700)
committerJon Mason <jdmason@kudzu.us>
Mon, 29 Jan 2018 03:17:22 +0000 (22:17 -0500)
commit140eb5227767c6754742020a16d2691222b9c19b
tree909750d61425a3b94b1427dcb31291fa92b67acc
parentd8a5b80568a9cb66810e75b182018e9edb68e8ff
NTB: ntb_hw_switchtec: Fix peer BAR bug in switchtec_ntb_init_shared_mw

This resolves a bug which may incorrectly configure the peer host's
LUT for shared memory window access. The code was using the local
host's first BAR number, rather than the peer hosts's first BAR
number, to determine what peer NT control register to program.

The bug will cause the Switchtec NTB link to work only if both peers
have the same first NTB BAR configured. In all other configurations,
the link will not come up, failing silently.

When both hosts have the same first BAR, the configuration works only
because the first BAR numbers happent to be the same. When the hosts
do not have the same first BAR, then the LUT translation will not be
configured in the correct peer LUT and will not give the peer the
shared memory window access required for the link to operate.

Signed-off-by: Doug Meyer <dmeyer@gigaio.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Fixes: 678784a44ae8 ("NTB: switchtec_ntb: Initialize hardware for memory windows")
Signed-off-by: Jon Mason <jdmason@kudzu.us>
drivers/ntb/hw/mscc/ntb_hw_switchtec.c