Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1223774pxb; Thu, 14 Apr 2022 00:50:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzB6SJMi9x3fgJnqwWfxwpK7n3bDpk52ogxPapiwCEb3i2aDkoGNilqy1oiUlRPK4iVjmZe X-Received: by 2002:a17:907:9622:b0:6e0:b38b:df18 with SMTP id gb34-20020a170907962200b006e0b38bdf18mr1262946ejc.182.1649922651692; Thu, 14 Apr 2022 00:50:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649922651; cv=none; d=google.com; s=arc-20160816; b=pxThuoKGPwM3V07+LZRfPcy9qTC0xJVfdwcZJDI/uGLNacanZJUNyleRfpYZF1gYBZ aN4OE7MN2ADxVtFyiRASEozdeGSXlLm5FLcQhQPVUMN3r7VTai8XqK1Fx68VhB5uXaHy +0cslwLDHMNXdKLiqRqowGGHqTnzaz2RLLW18Kfln89ULOXgV5m67bY63e9ereWX1JLW 7WXGUJUo7x4jYzArlg4tS1lEO0rJkoQRdwn4G68QefvxjeZJUdscyhfMMCVP+OtDj8gO mh9awdY9+48h/vl3hYvLMHy4xXYiNLFRFB1fjVOH13KsqxF3EPOoRqzfrEIwMxHVLgW4 EEQw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sLekYFBHk6vmdPrvSejYiiFxxEyq7KZDxaB/jClyyLg=; b=o50WFqOAzy83fM2Q9VO6OaNfBVq+PF2mpJD2ueJnx6fZHHkjg7oMfVkC4jRspl/n+Y B/3mYQU/K2Cay/6Wv0Y4PFcKN+CjubQdQcJCYPRUrk5LtxekGE5GEsJ6LkstyEFSEOfn SdE+LVokePXq5sRJ5jTYUuTLMx+GdJKlTKyM0ghInb8Fdus5z6BHBKB8F3YIejITUY6E kJ/UmWLtjgo+kI+W9E6J9JPAJwC8J2FJotuS89iKIYpx6pdQ+7P8PjPmN0MpyWovMF2N /+CC0c7uolI+LsX2R7hsmWSNpZ3aBqsvS7qSIyZ+y9l11TRaXVd5Hdp61PoK244JIMQB t1Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=U1rp9SRe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e21-20020a50a695000000b00418c2b5bf37si3184507edc.537.2022.04.14.00.50.23; Thu, 14 Apr 2022 00:50:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=U1rp9SRe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236597AbiDMPkT (ORCPT + 99 others); Wed, 13 Apr 2022 11:40:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236594AbiDMPkR (ORCPT ); Wed, 13 Apr 2022 11:40:17 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EF590654BE for ; Wed, 13 Apr 2022 08:37:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649864275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sLekYFBHk6vmdPrvSejYiiFxxEyq7KZDxaB/jClyyLg=; b=U1rp9SRehMSqtuEyE9+YpEohnsJ7lrcXVUrvfTfVz/QSPysQOLk/RMnAwIrHJxBYvFkbSj 69fsDC64R7Llz5xgl9nvYVJhi0uvQlJeUzfmcculFcjma2Mf0FRuVH8RYGyjc54ro5Oj13 4GUF1v45rCdq8WBQLgEGGKKK+pBTxAo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-537-HI2ChDyCPO-K0g7Y-EmT8A-1; Wed, 13 Apr 2022 11:37:50 -0400 X-MC-Unique: HI2ChDyCPO-K0g7Y-EmT8A-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0ECAB1014A6A; Wed, 13 Apr 2022 15:37:50 +0000 (UTC) Received: from horn.redhat.com (unknown [10.40.193.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 524AC40D1B98; Wed, 13 Apr 2022 15:37:47 +0000 (UTC) From: Petr Oros To: netdev@vger.kernel.org Cc: jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, jacob.e.keller@intel.com, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org, ivecera@redhat.com, pmenzel@molgen.mpg.de, alexandr.lobakin@intel.com Subject: [PATCH v2] ice: wait 5 s for EMP reset after firmware flash Date: Wed, 13 Apr 2022 17:37:45 +0200 Message-Id: <20220413153745.1125674-1-poros@redhat.com> In-Reply-To: <20220412102753.670867-1-poros@redhat.com> References: <20220412102753.670867-1-poros@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We need to wait 5 s for EMP reset after firmware flash. Code was extracted from OOT driver (ice v1.8.3 downloaded from sourceforge). Without this wait, fw_activate let card in inconsistent state and recoverable only by second flash/activate. Flash was tested on these fw's: From -> To 3.00 -> 3.10/3.20 3.10 -> 3.00/3.20 3.20 -> 3.00/3.10 Reproducer: [root@host ~]# devlink dev flash pci/0000:ca:00.0 file E810_XXVDA4_FH_O_SEC_FW_1p6p1p9_NVM_3p10_PLDMoMCTP_0.11_8000AD7B.bin Preparing to flash [fw.mgmt] Erasing [fw.mgmt] Erasing done [fw.mgmt] Flashing 100% [fw.mgmt] Flashing done 100% [fw.undi] Erasing [fw.undi] Erasing done [fw.undi] Flashing 100% [fw.undi] Flashing done 100% [fw.netlist] Erasing [fw.netlist] Erasing done [fw.netlist] Flashing 100% [fw.netlist] Flashing done 100% Activate new firmware by devlink reload [root@host ~]# devlink dev reload pci/0000:ca:00.0 action fw_activate reload_actions_performed: fw_activate [root@host ~]# ip link show ens7f0 71: ens7f0: mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000 link/ether b4:96:91:dc:72:e0 brd ff:ff:ff:ff:ff:ff altname enp202s0f0 dmesg after flash: [ 55.120788] ice: Copyright (c) 2018, Intel Corporation. [ 55.274734] ice 0000:ca:00.0: Get PHY capabilities failed status = -5, continuing anyway [ 55.569797] ice 0000:ca:00.0: The DDP package was successfully loaded: ICE OS Default Package version 1.3.28.0 [ 55.603629] ice 0000:ca:00.0: Get PHY capability failed. [ 55.608951] ice 0000:ca:00.0: ice_init_nvm_phy_type failed: -5 [ 55.647348] ice 0000:ca:00.0: PTP init successful [ 55.675536] ice 0000:ca:00.0: DCB is enabled in the hardware, max number of TCs supported on this port are 8 [ 55.685365] ice 0000:ca:00.0: FW LLDP is disabled, DCBx/LLDP in SW mode. [ 55.692179] ice 0000:ca:00.0: Commit DCB Configuration to the hardware [ 55.701382] ice 0000:ca:00.0: 126.024 Gb/s available PCIe bandwidth, limited by 16.0 GT/s PCIe x8 link at 0000:c9:02.0 (capable of 252.048 Gb/s with 16.0 GT/s PCIe x16 link) Reboot doesn’t help, only second flash/activate with OOT or patched driver put card back in consistent state. After patch: [root@host ~]# devlink dev flash pci/0000:ca:00.0 file E810_XXVDA4_FH_O_SEC_FW_1p6p1p9_NVM_3p10_PLDMoMCTP_0.11_8000AD7B.bin Preparing to flash [fw.mgmt] Erasing [fw.mgmt] Erasing done [fw.mgmt] Flashing 100% [fw.mgmt] Flashing done 100% [fw.undi] Erasing [fw.undi] Erasing done [fw.undi] Flashing 100% [fw.undi] Flashing done 100% [fw.netlist] Erasing [fw.netlist] Erasing done [fw.netlist] Flashing 100% [fw.netlist] Flashing done 100% Activate new firmware by devlink reload [root@host ~]# devlink dev reload pci/0000:ca:00.0 action fw_activate reload_actions_performed: fw_activate [root@host ~]# ip link show ens7f0 19: ens7f0: mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000 link/ether b4:96:91:dc:72:e0 brd ff:ff:ff:ff:ff:ff altname enp202s0f0 v2 changes: - fixed format issues - added info about fw and OOT driver versions - added time in the commit message summary - appended the unit to the macro name Fixes: 399e27dbbd9e94 ("ice: support immediate firmware activation via devlink reload") Signed-off-by: Petr Oros --- drivers/net/ethernet/intel/ice/ice_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index d768925785ca79..38825ed2ecd1de 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -6931,12 +6931,15 @@ static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type) dev_dbg(dev, "rebuilding PF after reset_type=%d\n", reset_type); +#define ICE_EMP_RESET_SLEEP_MS 5000 if (reset_type == ICE_RESET_EMPR) { /* If an EMP reset has occurred, any previously pending flash * update will have completed. We no longer know whether or * not the NVM update EMP reset is restricted. */ pf->fw_emp_reset_disabled = false; + + msleep(ICE_EMP_RESET_SLEEP_MS); } err = ice_init_all_ctrlq(hw); -- 2.35.1