Commit 02146a93 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'hinic-BugFixes'



Luo bin says:

====================
hinic: BugFixes

The bugs fixed in this patchset have been present since the following
commits:
patch #1: Fixes: 00e57a6d ("net-next/hinic: Add Tx operation")
patch #2: Fixes: 5e126e7c ("hinic: add firmware update support")
====================

Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents cc8e58f8 0c97ee5f
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -47,8 +47,12 @@

#define MGMT_MSG_TIMEOUT                5000

#define SET_FUNC_PORT_MBOX_TIMEOUT	30000

#define SET_FUNC_PORT_MGMT_TIMEOUT	25000

#define UPDATE_FW_MGMT_TIMEOUT		20000

#define mgmt_to_pfhwdev(pf_mgmt)        \
		container_of(pf_mgmt, struct hinic_pfhwdev, pf_to_mgmt)

@@ -361,17 +365,23 @@ int hinic_msg_to_mgmt(struct hinic_pf_to_mgmt *pf_to_mgmt,
		return -EINVAL;
	}

	if (HINIC_IS_VF(hwif)) {
		if (cmd == HINIC_PORT_CMD_SET_FUNC_STATE)
		timeout = SET_FUNC_PORT_MGMT_TIMEOUT;
			timeout = SET_FUNC_PORT_MBOX_TIMEOUT;

	if (HINIC_IS_VF(hwif))
		return hinic_mbox_to_pf(pf_to_mgmt->hwdev, mod, cmd, buf_in,
					in_size, buf_out, out_size, 0);
	else
					in_size, buf_out, out_size, timeout);
	} else {
		if (cmd == HINIC_PORT_CMD_SET_FUNC_STATE)
			timeout = SET_FUNC_PORT_MGMT_TIMEOUT;
		else if (cmd == HINIC_PORT_CMD_UPDATE_FW)
			timeout = UPDATE_FW_MGMT_TIMEOUT;

		return msg_to_mgmt_sync(pf_to_mgmt, mod, cmd, buf_in, in_size,
				buf_out, out_size, MGMT_DIRECT_SEND,
				MSG_NOT_RESP, timeout);
	}
}

static void recv_mgmt_msg_work_handler(struct work_struct *work)
{