Received: by 10.192.165.156 with SMTP id m28csp1120361imm; Wed, 11 Apr 2018 12:49:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+a/I0z11AfTCP0xq27D+NbcOaBDP6/jM3+oGgqxr7qjrWBksEWWRT/h2rdZjgo4lEevp/w X-Received: by 2002:a17:902:2884:: with SMTP id f4-v6mr6422601plb.153.1523476188079; Wed, 11 Apr 2018 12:49:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523476188; cv=none; d=google.com; s=arc-20160816; b=p3pStCuTZ3kqYOrSlpR8DwJ4stmTg1zffCWhrjGrm40mDM7NZ2Quril5w1V2N8he+j NoL8rRTnhkv4z+5zllUzB7JOFyiY9SoBjVrHa7FPCN30IbhCeO469YbqVdTdIs6IiB1w hnYKrCsMHBdwbMbopHPNU2aXxLyXBhkrbx40Hjc4kiiWtDq+mqpnX1sICSyR8sSxAKHA NoRSygEVbB2UHDQ9mzA933oF0U9tdklX2d1DDx3PF6nvu3MYXo5B58kztU6HKmTIuwfw VVVhwbD8WoahzL5Usg8XSlmRYsUKqqO+HXJyYNEcERvLoJN/qrBPfAymzsdDCnysBxHo H1EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Eo2ug4AEVp8Zhb0QmXPITzvRsnJlpvxlLt24EgnQBsc=; b=VEHWakwjXDVhpuBZ28SXDDQX2O+R4z6t+UwVRG8HxeU0WgOhQ1irZqREK3K9OmY1Vf 7alwWNSd4A+impHlMo78hPPjRJuWab1YMTMsSe4UAOn4JxT55jfmJMnpOAb1v4ELjelP 5kuaAygFzHaGA1JuJdI6v+zZYIDUQfaHq3uzjV7fZsE7W5L56O9zH8JPoh6L91Zq/09K cs4N6SUKaVfBfxBE+RpwipAGMTaHaTVln+WlCfZPIzlFxprsawxb4VsLSUDj/lpWsjtH bbPrH9+mHZpsXppQ+5TUNhzewGxzyBq50j/iaGHfJiV3IMuhgoGi8uBbCYwlTyErPCjD uIWQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t2si1169600pgr.117.2018.04.11.12.49.11; Wed, 11 Apr 2018 12:49:48 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756594AbeDKS7v (ORCPT + 99 others); Wed, 11 Apr 2018 14:59:51 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37518 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756576AbeDKS7q (ORCPT ); Wed, 11 Apr 2018 14:59:46 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 48F1FB9E; Wed, 11 Apr 2018 18:59:45 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arjun Vynipadath , Casey Leedom , Ganesh Goudar , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 158/310] cxgb4: FW upgrade fixes Date: Wed, 11 Apr 2018 20:34:57 +0200 Message-Id: <20180411183629.196465448@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arjun Vynipadath [ Upstream commit 26747211486c5bc7dd014c3caab206576e00c0d0 ] Disable FW_OK flag while flashing Firmware. This will help to fix any potential mailbox timeouts during Firmware flash. Grab new devlog parameters after Firmware restart. When we FLASH new Firmware onto an adapter, the new Firmware may have the Firmware Device Log located at a different memory address or have a different size for it. Signed-off-by: Arjun Vynipadath Signed-off-by: Casey Leedom Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) --- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c @@ -6185,13 +6185,18 @@ int t4_fw_upgrade(struct adapter *adap, if (!t4_fw_matches_chip(adap, fw_hdr)) return -EINVAL; + /* Disable FW_OK flag so that mbox commands with FW_OK flag set + * wont be sent when we are flashing FW. + */ + adap->flags &= ~FW_OK; + ret = t4_fw_halt(adap, mbox, force); if (ret < 0 && !force) - return ret; + goto out; ret = t4_load_fw(adap, fw_data, size); if (ret < 0) - return ret; + goto out; /* * Older versions of the firmware don't understand the new @@ -6202,7 +6207,17 @@ int t4_fw_upgrade(struct adapter *adap, * its header flags to see if it advertises the capability. */ reset = ((be32_to_cpu(fw_hdr->flags) & FW_HDR_FLAGS_RESET_HALT) == 0); - return t4_fw_restart(adap, mbox, reset); + ret = t4_fw_restart(adap, mbox, reset); + + /* Grab potentially new Firmware Device Log parameters so we can see + * how healthy the new Firmware is. It's okay to contact the new + * Firmware for these parameters even though, as far as it's + * concerned, we've never said "HELLO" to it ... + */ + (void)t4_init_devlog_params(adap); +out: + adap->flags |= FW_OK; + return ret; } /**