Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp6390348ybh; Wed, 7 Aug 2019 23:13:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwExLojlUlSNt6B1ZMXFFiV3FrjX62JkJA3qjSfHFV4kLv/zUk1M8YVw90HoRReqtU/UC1/ X-Received: by 2002:a62:7641:: with SMTP id r62mr13511270pfc.35.1565244811271; Wed, 07 Aug 2019 23:13:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565244811; cv=none; d=google.com; s=arc-20160816; b=Pghyp6HdSSLlk+hRr7G2WSUO6ZL8M9LweTVGjO4DxyXDrsiwmaD0doIOzIcbhOiAjf WtYaDkD6+ltnNwIW3LM3q4aECk7HS9w8eCz2pZscGLMYZKIhHGlK4mQq5YXa8lSqr3Se Qj8KPuYBTkR5di87N15UlV9kQw4rnpuztfkmzPmpwwqj8DDWhN95NB9CPc0Oy9twGJB6 T64rb25VEY5FYXPvIbcC35VIoUR0n4JNoLioLkbJgLEUDb/i4NxV0puG8Ysk/DwoWt0o q7z+rzRsq+9IM5nDQEAwAZ5eY0LrvjvA3CRjl8ORxRVOituIGry94taOuoCDXtTC/F/o s6WA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=BydnD5qOrcLWkKICgScWxlC6YIpbOm6QLLob1ala5lw=; b=knXTAPO9gZpaiOGU4fFTTFkLE4ioBd/6hxGYP/lFD8gFWFj9seDGrsqh9pNULKW1Qs Hj+J8naFpFIh4nV2c6okJwzi8a5zDV6HkID2q0JM9pOYXUFgMmL0M3gPqvlm3Siprj+V qpcdYMpew0T7EcjWSUMPZhIJ9cddsNWUkKI79SAWBf9MX9uM+zYugGByh476lmoY0FqI K1wV2biMzBcR4SnTm+CNaFYZoqu1IJPA8IE1gtszn8rOg++wK41Ufr4A0Nts+8sON30X riFQUAHBlIxOabi20+1WRertq+vDCjfp9n3JtaCSx5CU0xwTNT1kFQyiwoDVtGg6HeM2 7pMA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si2619979ple.275.2019.08.07.23.13.15; Wed, 07 Aug 2019 23:13:31 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730759AbfHHGKt (ORCPT + 99 others); Thu, 8 Aug 2019 02:10:49 -0400 Received: from mga02.intel.com ([134.134.136.20]:20028 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725817AbfHHGKt (ORCPT ); Thu, 8 Aug 2019 02:10:49 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Aug 2019 23:10:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,360,1559545200"; d="scan'208";a="186248110" Received: from sneftin-mobl1.ger.corp.intel.com (HELO [10.185.23.132]) ([10.185.23.132]) by orsmga002.jf.intel.com with ESMTP; 07 Aug 2019 23:10:43 -0700 Subject: Re: [Intel-wired-lan] MDI errors during resume from ACPI S3 (suspend to ram) To: Paul Menzel , Jeff Kirsher Cc: Mario Limonciello , intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org References: <81004059-6d91-d8be-c80e-70c52359350d@molgen.mpg.de> <2277f25bc44c4aebaac59942de2e24bb@AUSX13MPC105.AMER.DELL.COM> <47977dc7-d53a-427c-bbaa-9c665287cb47@molgen.mpg.de> From: "Neftin, Sasha" Message-ID: Date: Thu, 8 Aug 2019 09:10:43 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <47977dc7-d53a-427c-bbaa-9c665287cb47@molgen.mpg.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/7/2019 17:55, Paul Menzel wrote: > > Dear Sasha, > > > On 07.08.19 09:23, Neftin, Sasha wrote: >> On 8/6/2019 18:53, Mario.Limonciello@dell.com wrote: >>>> -----Original Message----- >>>> From: Paul Menzel >>>> Sent: Tuesday, August 6, 2019 10:36 AM >>>> To: Jeff Kirsher >>>> Cc: intel-wired-lan@lists.osuosl.org; Linux Kernel Mailing List; Limonciello, Mario >>>> Subject: MDI errors during resume from ACPI S3 (suspend to ram) >>>> >>>> Dear Linux folks, >>>> >>>> >>>> Trying to decrease the resume time of Linux 5.3-rc3 on the Dell OptiPlex >>>> 5040 with the device below >>>> >>>>      $ lspci -nn -s 00:1f.6 >>>>      00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (2) >>>> I219-V [8086:15b8] (rev 31) >>>> >>>> pm-graph’s script `sleepgraph.py` shows, that the driver *e1000e* takes >>>> around 400 ms, which is quite a lot. The call graph trace shows that >>>> `e1000e_read_phy_reg_mdic()` is responsible for a lot of those. From >>>> `drivers/net/ethernet/intel/e1000e/phy.c` [1]: >>>> >>>>          for (i = 0; i < (E1000_GEN_POLL_TIMEOUT * 3); i++) { >>>>                  udelay(50); >>>>                  mdic = er32(MDIC); >>>>                  if (mdic & E1000_MDIC_READY) >>>>                          break; >>>>          } >>>>          if (!(mdic & E1000_MDIC_READY)) { >>>>                  e_dbg("MDI Read did not complete\n"); >>>>                  return -E1000_ERR_PHY; >>>>          } >>>>          if (mdic & E1000_MDIC_ERROR) { >>>>                  e_dbg("MDI Error\n"); >>>>                  return -E1000_ERR_PHY; >>>>          } >>>> >>>> Unfortunately, errors are not logged if dynamic debug is disabled, >>>> so rebuilding the Linux kernel with `CONFIG_DYNAMIC_DEBUG`, and >>>> >>>>      echo "file drivers/net/ethernet/* +p" | sudo tee >>>> /sys/kernel/debug/dynamic_debug/control >>>> >>>> I got the messages below. >>>> >>>>      [ 4159.204192] e1000e 0000:00:1f.6 net00: MDI Error >>>>      [ 4160.267950] e1000e 0000:00:1f.6 net00: MDI Write did not complete >>>>      [ 4160.359855] e1000e 0000:00:1f.6 net00: MDI Error >>>> >>>> Can you please shed a little more light into these errors? Please >>>> find the full log attached. > >>>> [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/ethernet/intel/e1000e/phy.c#n206 >>> >>> Strictly as a reference point you may consider trying the out-of-tree driver to see if these >>> behaviors persist. >>> >>> https://sourceforge.net/projects/e1000/ > > I can try that in the next days. > >> We are using external PHY. Required ~200 ms to complete MDIC >> transaction (depended on the project). > > Are you referring to the out-of-tree driver? > I believe the out of tree driver have a same approach to MDIC access. >> You need to take to consider this time before access to the PHY. I do >> not recommend decrease timer in a 'e1000e_read_phy_reg_mdic()' >> method. We could hit on wrong MDI access. > My point was more, if you know that more time is needed, before the MDI > setting(?) will succeed, why try it anyway and go into the error paths? > Isn’t there some polling possible to find out, when MDI can be set up? > e1000e is very old driver and serve pretty lot of 1G clients. Each 1Gbe MAC/PHY controller have a different configuration depend platform. > > Kind regards, > > Paul > Hello Paul, Let me back later with more information specific your device. I will try find out more details with design team.