Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1238572pxu; Mon, 23 Nov 2020 15:37:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzqVmcRZlKanIXgQ3e3YtODxQmxuAKC7xy2Gsp1BKb0X/uTGtf0pZ/tZrLAxPJ1j3903mK3 X-Received: by 2002:a17:906:1b09:: with SMTP id o9mr1918293ejg.79.1606174628529; Mon, 23 Nov 2020 15:37:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606174628; cv=none; d=google.com; s=arc-20160816; b=YefFE8qwaGsr2G8XOisqDltSmIhgk8CZ3MmylE1Y2IvpkmdpxfTOyNpgo9XQZwlBvi GIbPS5uOhgkuUJjyfjhaZv4xpuJUEw5vPsEeEOWja8ZqrLGoeNc27FZ8wDXOGjetZAIv XxnNRNY40UuGfG2BPvl/qDuBCLFVnrIQG+r108CjTDKVh9++UAS+/dQXEhzRhKmtQ4OC iC35pmiKEWb1BhRiafGJHrC8r+G5iChXpsQUahIxoOSwbXpcC6pGBD6dOQz9yAJiAd3G yzK80Ci2sTlmS1MeeTqMgWctRjseW23CFxtsCrrFAqkpZa3GweT47SpBS1j7Wytvsj9g OpOw== 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=BOhLQElP4Rhn05/2pUt+n9WhJYoBEjBwjq9nWQseop0=; b=CHNLYdkNx6ZvWS+1D9fcsnbFj4Yyh2GJVO61SSXlUdmTCwNC3M+hG6qMqc426Z6yso 5FCSy2fjO2IbBfv3jNkZ8zGxFuz2atmN/7Dk828ZP6Ta0zz0e0hbJKfFVF05XyjF05lM WHLmuWqMGE5nQxWDR+548o6e7stniKTzT9ERGWZPGjVCeJjieqrrYfw0vqKFWdfd6CZw NYDcuh3eqWOCrF4jpAD3G3y+dvoAXnlRMLDUz34eVo9hLLEny5MqinL01pm/DQBnjWFz QEGWPm3uTN05weDmbYFggCedbiGUCiiLZyVJxVxFFStqhTnli7vYkhNuzHeeO5m5lGUJ nFiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rcg4JFDy; 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 nq7si7335971ejb.109.2020.11.23.15.36.45; Mon, 23 Nov 2020 15:37:08 -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=rcg4JFDy; 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 S1731314AbgKWMeI (ORCPT + 99 others); Mon, 23 Nov 2020 07:34:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:45756 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731292AbgKWMeB (ORCPT ); Mon, 23 Nov 2020 07:34:01 -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 DBF5B20721; Mon, 23 Nov 2020 12:34:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134841; bh=vEghcjTmP01eENT0E9XKCHKVbSfCS/6TiouyoyYG8+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rcg4JFDyjujt7NBipX5wUMlG/ExI0EdQDbWH+iBaMVoe8wqPBUJaeCIr4HoHHloB6 n8Qj+SbzwCDL32OSDNl0I3LNmKxE8XGWUtwxZTrMXLwR6HuTEyXMlUMfoz204CwNWR RfqMe3fBOZL/zVRGuy0EylWpXvfq0NBh9VNDKqcE= 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 5.4 010/158] mlxsw: core: Use variable timeout for EMAD retries Date: Mon, 23 Nov 2020 13:20:38 +0100 Message-Id: <20201123121820.436479775@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121819.943135899@linuxfoundation.org> References: <20201123121819.943135899@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 @@ -444,7 +444,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,