Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3231544imc; Wed, 13 Mar 2019 12:14:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWEbbjC4NZ6a7eadZDGYTStRanQRcyznDdEj1GfZLjLm9M8t4KEx5gNpm+ieFTdM9pBrC7 X-Received: by 2002:a65:62c2:: with SMTP id m2mr41378179pgv.348.1552504440462; Wed, 13 Mar 2019 12:14:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552504440; cv=none; d=google.com; s=arc-20160816; b=mNfKVlVg+LYlGOL2Uc7TXWDKdHibc6Jx7zPiRXIzFe634dT4MdKiwlzL9acBv0DItm MFvb7tqBW5rg6wbFLRI3xEAhOnuMzWz3B2TPDVZAct2NeOAOhXyWN5+YMmsKy+vz0D47 dUMzpc6Z4fMWgiistTghZUoGHjWPMWn9AWpePQc6E9cs7GEa/1L51vM5uQD7lTfP59LG s02eDh7u2NQzDclf2MbkvYY7NkJObX5LBnaxTyHaD0Xgg5y2rIQGi6lmUFPpuqhXkqls wGUjNmh8Fu1GoyeoYslwLvFwpbz3HzXgEyjj3u4PmpHL86YH6PdxThRb+ZNP+CQfvkHE yn5Q== 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=Jomc6Bp8FHpGAa5REMWkuLDC+Ms3f7hNlMUMi/Bxc9I=; b=oGk7o57/u0RzRyVto+WThwnZ95pe4e0DtHmsPDhemBqsR8bc82xAGEaZKL6pQSw1Cp TP1rXPwUT7Zt2N4Dligays2lRm9JsGN3Y47uDB6CadZNmEM7tnc8ZIcAL4Fui/GainIu emove/lT/z2svfVt6Hop10d4QhzuAxND2W8c0layhdq4VIrIWEPtwF03BeVWlyoB7GGi NfsHmMlVhjO1v2Hwy4VsDr+eHjg3us4hOGRYUiI0JsQEgSM8678VnGDJeiTcxs2kLCjb G2nGgwv12Sho07oxkGIokkjA+d1iLg9lwwOIRwqJEXPRuz9Oc8UVM9r6Pcc/++5i/SNC g3vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KIYC2BuF; 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 c11si10962004pga.350.2019.03.13.12.13.44; Wed, 13 Mar 2019 12:14: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=KIYC2BuF; 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 S1727804AbfCMTMm (ORCPT + 99 others); Wed, 13 Mar 2019 15:12:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:43282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727287AbfCMTMl (ORCPT ); Wed, 13 Mar 2019 15:12:41 -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 DDEB82177E; Wed, 13 Mar 2019 19:12:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552504361; bh=doyardt0JggkJhDO07+14ipJytUL+xswS+WNkZwYiVA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KIYC2BuF9J50pQICE6SdC4FUHFfybYbtIgB4xwxPlMkuQboxqSpAj4OSTFe+5aQH4 +xGP0Zacpn8oSeTaG/QDvkQmynaVRSHVuZsNvtYInMVpJYTMJ1ib7/5ybOpoeruJ3m aTk2uZBvnYcidbDfLe06WQxcwY+u2p7Fs/ZE6h3I= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Michael Chan , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.20 57/60] bnxt_en: Wait longer for the firmware message response to complete. Date: Wed, 13 Mar 2019 15:10:18 -0400 Message-Id: <20190313191021.158171-57-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190313191021.158171-1-sashal@kernel.org> References: <20190313191021.158171-1-sashal@kernel.org> MIME-Version: 1.0 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: Michael Chan [ Upstream commit 0000b81a063b5f3ab82fa18041c28327ce72c312 ] The code waits up to 20 usec for the firmware response to complete once we've seen the valid response header in the buffer. It turns out that in some scenarios, this wait time is not long enough. Extend it to 150 usec and use usleep_range() instead of udelay(). Fixes: 9751e8e71487 ("bnxt_en: reduce timeout on initial HWRM calls") Signed-off-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 938ea8ada0da..7fbba28bc488 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -3867,7 +3867,7 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len, dma_rmb(); if (*valid) break; - udelay(1); + usleep_range(1, 5); } if (j >= HWRM_VALID_BIT_DELAY_USEC) { diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h index 3030931ccaf8..7bb9b4d8bf52 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h @@ -583,7 +583,7 @@ struct nqe_cn { (HWRM_SHORT_TIMEOUT_COUNTER * HWRM_SHORT_MIN_TIMEOUT + \ ((n) - HWRM_SHORT_TIMEOUT_COUNTER) * HWRM_MIN_TIMEOUT)) -#define HWRM_VALID_BIT_DELAY_USEC 20 +#define HWRM_VALID_BIT_DELAY_USEC 150 #define BNXT_RX_EVENT 1 #define BNXT_AGG_EVENT 2 -- 2.19.1