Received: by 2002:a05:6512:3d0e:0:0:0:0 with SMTP id d14csp54713lfv; Tue, 12 Apr 2022 17:03:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+xyBHwxppgZbLhdN6aFdiJyJqFyPkQOHGkogvKwyuXR2YRpxlZ3h29rlp3tPim+ymx+gS X-Received: by 2002:a65:6813:0:b0:384:b288:8702 with SMTP id l19-20020a656813000000b00384b2888702mr32850170pgt.275.1649808233801; Tue, 12 Apr 2022 17:03:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649808233; cv=none; d=google.com; s=arc-20160816; b=T8dCPgFM1HV8gKP6HQDTeyluEmA7LNwZIXsDv+IYEsLhJOBbGMKp6HThZoIqP8gBZH KlYgLjbNNBp8+14cpGsl08EaGNLa+fnAcDJoI+8ycXQDaZXxs+aImfeWZT0BbrKzt2hN X+u53K7KJm/gcVACBV2Y8ivcBTSLWgT6afitcl4Kg6JVPwh9/IV2IPCCRMnS9bcGtUvV J+U08N5LVWe4r040bawYYArgYLmKpSQ2xgDk7fbQoyec8vf+RhuKnS8Fw1PVNP8YT+/q JxO7mYkCVFSO/0doNxn9gZO6E0tjF6KwRtE7BurrEnciX9W0Z+8A/rddmvYzw/8Tg3qr qs5g== 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=uCWopA9hnbEvBiszTgjtyFptjnmh2ucZ1yMo1SFUIEQ=; b=Ey7q+ZjW746Ui2SulUmgluhS+PS3VWzC/RcLE1X12CQoUYOYevwVUnYilqOgR/3uBJ 9nkFuCXQUvHgqgMWo9sOsKiQgtMxVK+d+yGGDJyL7OLBWkqD31NYpSTzjm6/VUCPQAXp OpHPJso74Oym8AzQ93zS3aAaOvqIyBC+SrTYH+Mf0KBd2+MYFbK9bJpNqr1L1y+kJEtF 4RXh2kJDiYhPGUW6l4FqWuHqjy0p5RBoGqF9Xb2EHaYZN2nn0m3XRU5awqm/YWp1TBSJ ZzndoexCu3zfVTicireeT8Mw5jxdgbyuR3VLxtt4qzFrj/WJRt7tjVS9WTDwuacAFpEW Ko/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IgeMVV1T; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id v7-20020a056a00148700b00505c06abccasi7341017pfu.255.2022.04.12.17.03.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 17:03:53 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IgeMVV1T; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6D2C1C9B69; Tue, 12 Apr 2022 15:00:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357570AbiDLQ1D (ORCPT + 99 others); Tue, 12 Apr 2022 12:27:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235689AbiDLQ1A (ORCPT ); Tue, 12 Apr 2022 12:27:00 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EBB538192; Tue, 12 Apr 2022 09:24:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649780682; x=1681316682; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UeSHKiFD9MWQD9/lwoZzgM1WMiX/Uf+MCYGmOWbS/MQ=; b=IgeMVV1TefkVsW0SmgHxJRH+NyZFscL9F9bdji2rv8JrIej68zf9DmYm otsDeyHUHO6CZ/UM8wAIDTtj1UKHkMM1cnUuA4R7qFZ0TLpkZy0nCEwkk lNsLeeGKZqtAgFKQbmoPyQ6KUVnj9ef2+ZA9hCbHVgiNiYRVFJONnnDQd YUW1GTva3e9lYnYw3suUOi5MKihzrm47Yw3TfrDd1aGt9nEGYHW25hXYv 55qi6Gxr8fnhIXI9n3Dr9nbKObcGrTnf+3mBVN5fv5W8pCdqgwr3q1+E/ ii1VOss+KOFZG8X3rYiaRF3+B/2I2BIvhQbpMTx7o7VEl5GJW6UQLrtl9 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10315"; a="242362658" X-IronPort-AV: E=Sophos;i="5.90,254,1643702400"; d="scan'208";a="242362658" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2022 09:11:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,254,1643702400"; d="scan'208";a="655174943" Received: from irvmail001.ir.intel.com ([10.43.11.63]) by fmsmga002.fm.intel.com with ESMTP; 12 Apr 2022 09:11:21 -0700 Received: from newjersey.igk.intel.com (newjersey.igk.intel.com [10.102.20.203]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id 23CGBKdH010632; Tue, 12 Apr 2022 17:11:20 +0100 From: Alexander Lobakin To: Petr Oros Cc: Alexander Lobakin , netdev@vger.kernel.org, ivecera@redhat.com, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net Subject: Re: [Intel-wired-lan] [PATCH] ice: wait for EMP reset after firmware flash Date: Tue, 12 Apr 2022 18:08:56 +0200 Message-Id: <20220412160856.1027597-1-alexandr.lobakin@intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220412102753.670867-1-poros@redhat.com> References: <20220412102753.670867-1-poros@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: Petr Oros Date: Tue, 12 Apr 2022 12:27:53 +0200 > We need to wait for EMP reset after firmware flash. > Code was extracted from OOT driver and without this wait fw_activate let > card in inconsistent state recoverable only by second flash/activate > > 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 don'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 > > 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..90ea2203cdc763 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 5000 Ooof, 5 sec is a lot! Is there any way to poll the device readiness? Does it really need the whole 5 sec? > 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); > } > > err = ice_init_all_ctrlq(hw); > -- > 2.35.1 Thanks, Al