Commit 1b0c84a3 authored by Huanhuan Wang's avatar Huanhuan Wang Committed by David S. Miller
Browse files

nfp: fix unaligned io read of capabilities word



The address of 32-bit extend capability is not qword aligned,
and may cause exception in some arch.

Fixes: 484963ce ("nfp: extend capability and control words")
Signed-off-by: default avatarHuanhuan Wang <huanhuan.wang@corigine.com>
Reviewed-by: default avatarNiklas Söderlund <niklas.soderlund@corigine.com>
Signed-off-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e0c8bccd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2509,7 +2509,7 @@ static int nfp_net_read_caps(struct nfp_net *nn)
{
	/* Get some of the read-only fields from the BAR */
	nn->cap = nn_readl(nn, NFP_NET_CFG_CAP);
	nn->cap_w1 = nn_readq(nn, NFP_NET_CFG_CAP_WORD1);
	nn->cap_w1 = nn_readl(nn, NFP_NET_CFG_CAP_WORD1);
	nn->max_mtu = nn_readl(nn, NFP_NET_CFG_MAX_MTU);

	/* ABI 4.x and ctrl vNIC always use chained metadata, in other cases