Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp836597pxu; Mon, 23 Nov 2020 05:32:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwR8RSJVj9EVN46/3mNtWGGd206uEOCr++9KxeXOxQY5tbrYerPHi/Ng2zNOWU2FkT04Uay X-Received: by 2002:a17:906:adcd:: with SMTP id lb13mr41832478ejb.362.1606138336980; Mon, 23 Nov 2020 05:32:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606138336; cv=none; d=google.com; s=arc-20160816; b=aBo45sHPrsCnbUe4jMb3hW36s6kSQHroqosCJZreWtsh4unF6LCtLVIZY+AOyA0+14 cmgjsxdjJ0Ykfxn/JZ+wKFEJZuru5wN3SmN3HbFVZm86QuF0JimwHrmhUJQNVVNIFNyc YbW9HlmP0s1e2Ragv5gH2CINjrsMQgqDL2N73r31EF0+zSzAR5k48Iv6DIRzSvziK41H YiBfr0PYH1UOXC1pIX059D6+L3qEvi32jKf5FihiYmRlHQ9sDLVf7vHq7r83HWSO27JY zbLa817e6VQF6OjAu+FgroCzloKMHFRgQXs4tHuP99AjnTcdfZ+Y7DJT8a4q9iQjwBmK /NlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=B/+fO9FqzaumjosU+zeYHB61erMs3htWwSclRUsGh8U=; b=rn9ne2ydt+XoKQoiDyvfPTPINDBJpVD7ayH2ZV4ATNIEbCjT1qulqmu6cQpTKiLw7M AxXoz9s5HOYapn4j8Km2QIkGqADNlfLBQxcNfKfP/fcSx2KnHEYXd3as67dLkUTN2UZA GXRXCL8foUhLGArPeT21fTOqj9Z2MLVTMu26igux1skmxqjhTZFx1QQ0RjZnyu6bYYVu g4WOPyhoHdpHg/0Az72Ck4VwA9pThUSN7NtxBa5W/uJy54/abDKCg92bNicrkocYLhfs GD4kVt+znWYxhdlpkOoqXLArkbj3HUFoMR1GipsDu995nHGCpFBvqEvKH1llg1V5Xqhm 42aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sp5CfzWw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e4si6512844ejq.356.2020.11.23.05.31.53; Mon, 23 Nov 2020 05:32:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sp5CfzWw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730826AbgKWMbM (ORCPT + 99 others); Mon, 23 Nov 2020 07:31:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:41948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730812AbgKWMbH (ORCPT ); Mon, 23 Nov 2020 07:31:07 -0500 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 7E60D20728; Mon, 23 Nov 2020 12:31:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134666; bh=vwlZFy4zbL3jhkYWPf5ntfpkxyvkxTmd7Tz9BRz0e4k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sp5CfzWwrlXlj45SbLFSJgepbzFdOG9DThCQP3STNQHHWxfOvCwunJpmUyNcJJWvy peT/pV+2AvpbrO97WYPXWIZOeCDYHg9xp8cIGPHsaumgO/VlB+OLgh7XhWCLnJglma KTE//bedb6QlbX6g61qAAzbToG2jeIiRdnp/Oz+4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Denis Yulevich , Ido Schimmel , Jiri Pirko , Jakub Kicinski Subject: [PATCH 4.19 08/91] mlxsw: core: Use variable timeout for EMAD retries Date: Mon, 23 Nov 2020 13:21:28 +0100 Message-Id: <20201123121809.710985744@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121809.285416732@linuxfoundation.org> References: <20201123121809.285416732@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: Ido Schimmel [ Upstream commit 1f492eab67bced119a0ac7db75ef2047e29a30c6 ] The driver sends Ethernet Management Datagram (EMAD) packets to the device for configuration purposes and waits for up to 200ms for a reply. A request is retried up to 5 times. When the system is under heavy load, replies are not always processed in time and EMAD transactions fail. Make the process more robust to such delays by using exponential backoff. First wait for up to 200ms, then retransmit and wait for up to 400ms and so on. Fixes: caf7297e7ab5 ("mlxsw: core: Introduce support for asynchronous EMAD register access") Reported-by: Denis Yulevich Tested-by: Denis Yulevich Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlxsw/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/mellanox/mlxsw/core.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core.c @@ -439,7 +439,8 @@ static void mlxsw_emad_trans_timeout_sch if (trans->core->fw_flash_in_progress) timeout = msecs_to_jiffies(MLXSW_EMAD_TIMEOUT_DURING_FW_FLASH_MS); - queue_delayed_work(trans->core->emad_wq, &trans->timeout_dw, timeout); + queue_delayed_work(trans->core->emad_wq, &trans->timeout_dw, + timeout << trans->retries); } static int mlxsw_emad_transmit(struct mlxsw_core *mlxsw_core,