Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2822857pxv; Sat, 3 Jul 2021 22:43:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOFSF9psVdd83ui1wbLbj+A6cneLc1bMyylK8aQymD0IDJegHCdG+JFf3IL9TG0s2R+Sh+ X-Received: by 2002:aa7:c909:: with SMTP id b9mr8710060edt.1.1625377406930; Sat, 03 Jul 2021 22:43:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625377406; cv=none; d=google.com; s=arc-20160816; b=RQfXhHEfbJFRgaWZcYAlJ6jnApwrLzyHKd8sqQrpauUfaTmebGxEGRUu9N2vhRyFBN Dn+j3fnOvcmNvVICF8mF/iKH3MkTxBI0oeRZ4m1WyDgmzMiSutrmI8N4ehG4LAHDU4TF D4lSPDY0C5L9QHFDofSztrM5qdMeDPmM9kK7JJVFfPjeKLYGZhZDjaO7ze016pcQNESy B0MAbeCMlQ2u0VwW/XfCBhT425BqhUYWPdtj/KnWt4p9p+B0q1opsgcJmC0LWbb5Kvap mEw8ONevyOT6bsOexixOGo/e+y1oE0OYQ2CAvy3g2lnFsQivbg7eUuPkXA/yRevpBAEB Y9sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject; bh=60x9LK7fBuHzMw/RIKrDbe0so40ack2aJjaD6r22fKc=; b=TEf68QdeceL7r+qZBitRw53h1K9rwpLDB7scAFJopb37OQSu4anM9pR88fvDj1psnP XxPT9rBFMn7NzxJO2urfDrkmb6UjlldTxwqeLdxr9Cf2D7vzJg2ar7umey9ADz8o9blu XkI0L8Icyd24lm1URCMH5Agk1nfwhL/Tc09x5XAhwHGFGQkY3cXnOuyO7j7VIIEmm/7S 6ax6TZiPhR7CfwdQ2MyNnHURncdRavEx7O7YzEcIqgXN+4CravW2Ph5zqV356w+M9WiQ NNSfXM1aM8tFXe785j9bYDzHLTmVyH1tYucJFWFlz5vf1BjYdYmZcPgh5IsqbTOqeCDN JMlQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb26si9302297ejc.507.2021.07.03.22.42.35; Sat, 03 Jul 2021 22:43:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229494AbhGDFjk (ORCPT + 99 others); Sun, 4 Jul 2021 01:39:40 -0400 Received: from mga14.intel.com ([192.55.52.115]:28858 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbhGDFjk (ORCPT ); Sun, 4 Jul 2021 01:39:40 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10034"; a="208679126" X-IronPort-AV: E=Sophos;i="5.83,323,1616482800"; d="scan'208";a="208679126" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2021 22:37:02 -0700 X-IronPort-AV: E=Sophos;i="5.83,323,1616482800"; d="scan'208";a="561502755" Received: from sneftin-mobl.ger.corp.intel.com (HELO [10.249.95.249]) ([10.249.95.249]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2021 22:36:58 -0700 Subject: Re: [Intel-wired-lan] [PATCH 2/2] igc: wait for the MAC copy when enabled MAC passthrough To: Aaron Ma , jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, davem@davemloft.net, kuba@kernel.org, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Edri, Michael" , "Ruinskiy, Dima" , "Neftin, Sasha" References: <20210702045120.22855-1-aaron.ma@canonical.com> <20210702045120.22855-2-aaron.ma@canonical.com> From: "Neftin, Sasha" Message-ID: <613e2106-940a-49ed-6621-0bb00bc7dca5@intel.com> Date: Sun, 4 Jul 2021 08:36:53 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210702045120.22855-2-aaron.ma@canonical.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/2/2021 07:51, Aaron Ma wrote: > Such as dock hot plug event when runtime, for hardware implementation, > the MAC copy takes less than one second when BIOS enabled MAC passthrough. > After test on Lenovo TBT4 dock, 600ms is enough to update the > MAC address. > Otherwise ethernet fails to work. > > Signed-off-by: Aaron Ma > --- > drivers/net/ethernet/intel/igc/igc_main.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c > index 606b72cb6193..c8bc5f089255 100644 > --- a/drivers/net/ethernet/intel/igc/igc_main.c > +++ b/drivers/net/ethernet/intel/igc/igc_main.c > @@ -5468,6 +5468,9 @@ static int igc_probe(struct pci_dev *pdev, > memcpy(&hw->mac.ops, ei->mac_ops, sizeof(hw->mac.ops)); > memcpy(&hw->phy.ops, ei->phy_ops, sizeof(hw->phy.ops)); > > + if (pci_is_thunderbolt_attached(pdev) > + msleep(600); I believe it is a bit fragile. I would recommend here look for another indication instead of delay. Can we poll for a 'pci_channel_io_normal' state? (igc->pdev->error_state == pci_channel_io_normal) > + > /* Initialize skew-specific constants */ > err = ei->get_invariants(hw); > if (err) > Thanks Aaron, sasha