Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3835557ybb; Mon, 6 Apr 2020 17:09:01 -0700 (PDT) X-Google-Smtp-Source: APiQypIB2aL8c30m8p715Ci3e3nbhlKGO8zIhsnyxH8luxaXUZWwRJcXnWAkTqppKfwMKN7WlOLy X-Received: by 2002:a9d:6ad8:: with SMTP id m24mr1460779otq.66.1586218140869; Mon, 06 Apr 2020 17:09:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586218140; cv=none; d=google.com; s=arc-20160816; b=zIK+m4DZhcey13JZfzoKJRWMfU1e9w3hJIyOIH8SzSgCEgsCOSi3ZiL2C7Z4tlElAv tDyp06FWxItcmbLNEgUKlv5HCOsFwlAzHAQdpm6peqxqVGRDMGoiYMh/fWzDBW7TnqcG HJgu4pi4e3ddjwmPasdBToAbvupuB0L75lsoJaELCV/rkjh0awt+yGrpyumDDCa6Jxbv XT1eWTyvMrzfXzwuxY68s9hAUDid+eHupKuSfCsNOx586cMtAD7aZQ6CnWQIJ/8aAdUZ 5o3Rnj9yzEZWzYlm0AHNwUIuIl5ow/Y2cB9VJGbpThO50L99yNukysf4oZgKc96vm7n8 MwzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=n1aJkGDoQkYa2hEri/vxQS5scjj3F6Sg0wk56C/L7jI=; b=N3T0e4zqX4YXYqNhln9Gj9eJEK7X9cRL7mbGunAeRB00HmIOUgZrlU9DW5yE0Nd3rs Ifa6DnHQY/n65c8otCt2CWe0zZcHSxe9iKd0zdVhKJgRAHYyOVRMa5elJSme22OVkIzU x/W59dg6UdvfppxoFPpum5Y7i4VutkeX2cICo41J/zMao1Oxfrxz/CCuZ/reI/XoootO fZXYXKn4c5gjui8TOqEXIlfhSJZLDvI35ABPRZiXh11zy8fH083cazDqS8sSImb0l513 RWZZUnl2jOGHyos4J91TWOITXaPhuzKGTh5UIZSYNO+1IbhHqRhrNnV8iBFPS/f/Rk81 ey9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ph9lOFff; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h22si491205otq.243.2020.04.06.17.08.48; Mon, 06 Apr 2020 17:09:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ph9lOFff; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728048AbgDGAIX (ORCPT + 99 others); Mon, 6 Apr 2020 20:08:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:34448 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726899AbgDGAB2 (ORCPT ); Mon, 6 Apr 2020 20:01:28 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6606C20801; Tue, 7 Apr 2020 00:01:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586217688; bh=11vf19ynF9ce2u3AKITi0k04euLov3bRklA1vKBe+5M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ph9lOFffokhkq3/c9amMIj7u9VWRjeWRQKtx9I7y1WmTv47wZE4ACoQzOveLVcR2+ NBdGOZvzHUd7csgk2EQKSV+zhwEc9ZTBsgADAH8kqrH/bSDHpozq+au+ADUs9N95Sq x0takZWiv9OssE7U05FU31tQVTMWTZMMBr1sFRF0= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Luo bin , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.5 23/35] hinic: fix wrong para of wait_for_completion_timeout Date: Mon, 6 Apr 2020 20:00:45 -0400 Message-Id: <20200407000058.16423-23-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200407000058.16423-1-sashal@kernel.org> References: <20200407000058.16423-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Luo bin [ Upstream commit 0da7c322f116210ebfdda59c7da663a6fc5e9cc8 ] the second input parameter of wait_for_completion_timeout should be jiffies instead of millisecond Signed-off-by: Luo bin Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c | 3 ++- drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c index 33f93cc25193a..5f2d57d1b2d37 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c @@ -389,7 +389,8 @@ static int cmdq_sync_cmd_direct_resp(struct hinic_cmdq *cmdq, spin_unlock_bh(&cmdq->cmdq_lock); - if (!wait_for_completion_timeout(&done, CMDQ_TIMEOUT)) { + if (!wait_for_completion_timeout(&done, + msecs_to_jiffies(CMDQ_TIMEOUT))) { spin_lock_bh(&cmdq->cmdq_lock); if (cmdq->errcode[curr_prod_idx] == &errcode) diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c index c1a6be6bf6a8c..8995e32dd1c00 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c @@ -43,7 +43,7 @@ #define MSG_NOT_RESP 0xFFFF -#define MGMT_MSG_TIMEOUT 1000 +#define MGMT_MSG_TIMEOUT 5000 #define mgmt_to_pfhwdev(pf_mgmt) \ container_of(pf_mgmt, struct hinic_pfhwdev, pf_to_mgmt) @@ -267,7 +267,8 @@ static int msg_to_mgmt_sync(struct hinic_pf_to_mgmt *pf_to_mgmt, goto unlock_sync_msg; } - if (!wait_for_completion_timeout(recv_done, MGMT_MSG_TIMEOUT)) { + if (!wait_for_completion_timeout(recv_done, + msecs_to_jiffies(MGMT_MSG_TIMEOUT))) { dev_err(&pdev->dev, "MGMT timeout, MSG id = %d\n", msg_id); err = -ETIMEDOUT; goto unlock_sync_msg; -- 2.20.1