From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 077D9C4363D for ; Fri, 25 Sep 2020 12:57:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB76C206DB for ; Fri, 25 Sep 2020 12:57:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601038677; bh=Jj10ls3O0nnpW9rQmod1La/8TeoBAluz096y6T0bLO8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=2pLhRGUPlu19/n3bi/5BgfI+5WmZCFeIYeH5Nh14ut/XAnrZGIzQcWF75K/PhKNuX 4s/YC9dbWMMz4r5kByiV5IhZZVsBzDjVOKiqx5xyOjLOM84dCoFrAO5GN2ViFeevgT u4mhuTbaj6+mIM9KkSoJSBKb1WtmVDGUlZ3Xciog= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728999AbgIYMuD (ORCPT ); Fri, 25 Sep 2020 08:50:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:53790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728534AbgIYMt7 (ORCPT ); Fri, 25 Sep 2020 08:49:59 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 76B1D21741; Fri, 25 Sep 2020 12:49:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601038199; bh=Jj10ls3O0nnpW9rQmod1La/8TeoBAluz096y6T0bLO8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OrUrtqyCji7NfmHEM0xrP5uTc3YRRmfTAxRq/TZB3iT1Y+eHIejzlnOGV06jrL4RE HbFWwb4zAOLgF5Z0a8wJ25fVNSFHuWF1eyArF/+3dBbach35XODAkX26CJ8wf4SY3w A9J7IVPriOexbz656Dqialz9L/sPXAW4mPfCZNDI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Luo bin , Jakub Kicinski Subject: [PATCH 5.8 10/56] hinic: bump up the timeout of SET_FUNC_STATE cmd Date: Fri, 25 Sep 2020 14:48:00 +0200 Message-Id: <20200925124729.369708985@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200925124727.878494124@linuxfoundation.org> References: <20200925124727.878494124@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Luo bin [ Upstream commit 4e4269ebe7e18038fffacf113e2dd5ded6d49942 ] We free memory regardless of the return value of SET_FUNC_STATE cmd in hinic_close function to avoid memory leak and this cmd may timeout when fw is busy with handling other cmds, so we bump up the timeout of this cmd to ensure it won't return failure. Fixes: 00e57a6d4ad3 ("net-next/hinic: Add Tx operation") Signed-off-by: Luo bin Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) --- a/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.c @@ -45,6 +45,8 @@ #define MGMT_MSG_TIMEOUT 5000 +#define SET_FUNC_PORT_MBOX_TIMEOUT 30000 + #define SET_FUNC_PORT_MGMT_TIMEOUT 25000 #define mgmt_to_pfhwdev(pf_mgmt) \ @@ -358,16 +360,20 @@ int hinic_msg_to_mgmt(struct hinic_pf_to return -EINVAL; } - if (cmd == HINIC_PORT_CMD_SET_FUNC_STATE) - timeout = SET_FUNC_PORT_MGMT_TIMEOUT; + if (HINIC_IS_VF(hwif)) { + if (cmd == HINIC_PORT_CMD_SET_FUNC_STATE) + 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; + 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)