Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1475608ybl; Thu, 22 Aug 2019 15:26:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyV42jY7KuwoQoCkppSuk85NbCQIXRckf8eSZ0mLqsf4UL26J7PK34ZSR671F4ItD8KMI+v X-Received: by 2002:a62:e516:: with SMTP id n22mr1620715pff.105.1566512814133; Thu, 22 Aug 2019 15:26:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566512814; cv=none; d=google.com; s=arc-20160816; b=wR/E25U2N0VKPYBOrZ7d5KzAaGYBBI10DaHzB0EtDZQ2tbbTA3tgzKRSLq40t/cGxR TWFG5oBcMHCYRTYJG9yzKwtSwrR1Q1DB0kXZZhbNlmS/x1nsKiPm5lOFLssYpk6U8JRJ fe13jGbys/rylVN7o5wREqOx0tWlnk36XIMT4fnhJAv3NfgZKfoDqQW3iMAmo+84vH1v vEAAjtSEMgtyZ2KT6ZrwhnKb+LQr71ZSIQQFZxtaDwk1ZZwvCXBpAlhSoq0TP+fFCMof Uzo6wGg+oNxpZ5s8E4tDIXssGyFpmSY66GOi0yFlTfwMagNvv8OMkulN76mczpWhZGBs cu6w== 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=+D9JHodsNaTQvxR2DQIjw+viME4Nkuzymk5us03DuXk=; b=S1LOSvtn6kYh5Ni4Khgm6VUI2xfpiPG4oUHRTf/ELzFPew2gXweyRJeDVhTaV6AkWf 6lIIAu6YWT7bi3/EiHMZFCjYww2BzUwcH/a8t2zGj4YH861f5jH+UjnqydHAmd6JO3Ca oBS81aMjcQeuG61bm3oI6JS11k9FONR+HgxNS8DjpgB5HQSDy7PG2VK7hN66/M10ma8s 5JbzMJj7OWVEQyGc8hqpZGVuw6zek7JkGy8waB8ICtvS7meBMTaETHvTwidPQ5wrxEAH 3lFEBJUZ6minxO5+T0zrimV2GAqTdfD9JcKWxuS2Y+AvmbQEyAU5DYyfMzuk1YMKL9Tk H/pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WDQ8WDvr; 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 t26si737404pfh.275.2019.08.22.15.26.39; Thu, 22 Aug 2019 15:26:54 -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=WDQ8WDvr; 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 S2387484AbfHVRJd (ORCPT + 99 others); Thu, 22 Aug 2019 13:09:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:59506 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390732AbfHVRJU (ORCPT ); Thu, 22 Aug 2019 13:09:20 -0400 Received: from sasha-vm.mshome.net (wsip-184-188-36-2.sd.sd.cox.net [184.188.36.2]) (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 6C1322342F; Thu, 22 Aug 2019 17:09:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566493759; bh=4qbaXH5sM+XOTj+157enUJeOpnIDsLrcUa+ZqSU4zWM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WDQ8WDvrLwBFH54VvDCNwIun9FmBxYXX6mewZNMtzQER7FYR4GmQ65rkRzItoM2Ao RrvlAJQ10OGtIIaNU6EVi5z4eykhjRw+6K6hI5SRfxXnRzNeBvDoeUCWxIi/WrLV1+ dIv1XVs8qduqdGIm8ZnyzAtdTGR3w/qgFIXRyIDk= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Vasundhara Volam , Michael Chan , "David S . Miller" , Greg Kroah-Hartman Subject: [PATCH 5.2 121/135] bnxt_en: Fix handling FRAG_ERR when NVM_INSTALL_UPDATE cmd fails Date: Thu, 22 Aug 2019 13:07:57 -0400 Message-Id: <20190822170811.13303-122-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190822170811.13303-1-sashal@kernel.org> References: <20190822170811.13303-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.2.10-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.2.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.2.10-rc1 X-KernelTest-Deadline: 2019-08-24T17:07+00:00 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: Vasundhara Volam [ Upstream commit dd2ebf3404c7c295014bc025dea23960960ceb1a ] If FW returns FRAG_ERR in response error code, driver is resending the command only when HWRM command returns success. Fix the code to resend NVM_INSTALL_UPDATE command with DEFRAG install flags, if FW returns FRAG_ERR in its response error code. Fixes: cb4d1d626145 ("bnxt_en: Retry failed NVM_INSTALL_UPDATE with defragmentation flag enabled.") Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c index a6c7baf38036a..b761a2e28a101 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -2016,21 +2016,19 @@ static int bnxt_flash_package_from_file(struct net_device *dev, mutex_lock(&bp->hwrm_cmd_lock); hwrm_err = _hwrm_send_message(bp, &install, sizeof(install), INSTALL_PACKAGE_TIMEOUT); - if (hwrm_err) - goto flash_pkg_exit; - - if (resp->error_code) { + if (hwrm_err) { u8 error_code = ((struct hwrm_err_output *)resp)->cmd_err; - if (error_code == NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR) { + if (resp->error_code && error_code == + NVM_INSTALL_UPDATE_CMD_ERR_CODE_FRAG_ERR) { install.flags |= cpu_to_le16( NVM_INSTALL_UPDATE_REQ_FLAGS_ALLOWED_TO_DEFRAG); hwrm_err = _hwrm_send_message(bp, &install, sizeof(install), INSTALL_PACKAGE_TIMEOUT); - if (hwrm_err) - goto flash_pkg_exit; } + if (hwrm_err) + goto flash_pkg_exit; } if (resp->result) { -- 2.20.1