Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1966299ybl; Sat, 24 Aug 2019 07:45:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqzmm4h0VNy+yVBSflkWLFhznYH7hfq6CxBMmfG+9qsDmtZUG/MJlaJJ0evIutU9yeA0k93w X-Received: by 2002:a65:64ce:: with SMTP id t14mr8339484pgv.137.1566657934716; Sat, 24 Aug 2019 07:45:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566657934; cv=none; d=google.com; s=arc-20160816; b=FVq+a82UaQqgxCNh7K4uGjb39lqrE7IP5gtMdMArFdupgVFXckvksGrcKY3xkokYhn +0RhAkO0LHsxSdC0XTgNrguns/v73kVfhsZwEmurF4zev8JFnzuqjU+i7/8FBa5OYA6y 4UCg8ZL2JQ8vD5ump77XPU/tvRJZ13mBNLG+nQHTpzb0y1XbtB15A2m9SPes9VT3/pxe 2fsmwOSWavlGT7XPur36SYYxbEwkylNpKh1Q8fQUCxw4UD6ckS5m3XzIq/pzgvKRYpCy kFdzmIHN9kuOZ1sQXRVdwJ+mGMqdV4QhzyJmqtiuasiyK4cpUQ4R53XN8BgM5fOVL5U3 UCxA== 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=pEILVukBnwSvE9LJ1p03UAxkL6xs8QnqEBzVMxhYiBs=; b=u/kqz8wDmyyEMA/czi0g8OXMJ2QkeFpFpBU6d2NgYwigHdX9FdFOKDFylTsvhT1PIe xiGpYHn8FKUZKIlxNbbcprgocPBv2Q5mqTSNDtwS7917Clw1BaB4SuMGdkXiZV8BHpNG /pShd6qvnlrpib5H3MznSG5ks0gyFGr/lIyOP+hIVF7FXWODpQcuzU0DUEyyx06nTLw0 EMpeL/JTzNlppOkXgZzLkT5aaAaOKMzY8efXPFbbo5KfKefOgUEdxii0ndomNwEJhm6z cRSoqyLQEs4E847cbisJ36DNaa0t9IjkJh/P8Znq+1YaQcb8VGVZFgS85wojtVH6kwn5 qsig== 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 90si2682611ple.168.2019.08.24.07.44.41; Sat, 24 Aug 2019 07:45:34 -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 S1727747AbfHXOkv (ORCPT + 99 others); Sat, 24 Aug 2019 10:40:51 -0400 Received: from mga12.intel.com ([192.55.52.136]:3204 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727604AbfHXOku (ORCPT ); Sat, 24 Aug 2019 10:40:50 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Aug 2019 07:40:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,425,1559545200"; d="scan'208";a="379164198" Received: from sneftin-mobl1.ger.corp.intel.com (HELO [10.249.93.120]) ([10.249.93.120]) by fmsmga005.fm.intel.com with ESMTP; 24 Aug 2019 07:40:47 -0700 Subject: Re: [PATCH] igb/igc: Don't warn on fatal read failures when the device is removed To: Lyude Paul , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org Cc: Feng Tang , Jeff Kirsher , "David S. Miller" , linux-kernel@vger.kernel.org References: <20190822183318.27634-1-lyude@redhat.com> From: "Neftin, Sasha" Message-ID: <0e601456-58c3-b6ed-3be2-3eb5eec12eb4@intel.com> Date: Sat, 24 Aug 2019 17:40:45 +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: <20190822183318.27634-1-lyude@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/22/2019 21:33, Lyude Paul wrote: > Fatal read errors are worth warning about, unless of course the device > was just unplugged from the machine - something that's a rather normal > occurence when the igb/igc adapter is located on a Thunderbolt dock. So, > let's only WARN() if there's a fatal read error while the device is > still present. > > This fixes the following WARN splat that's been appearing whenever I > unplug my Caldigit TS3 Thunderbolt dock from my laptop: > > igb 0000:09:00.0 enp9s0: PCIe link lost > ------------[ cut here ]------------ > igb: Failed to read reg 0x18! > WARNING: CPU: 7 PID: 516 at > drivers/net/ethernet/intel/igb/igb_main.c:756 igb_rd32+0x57/0x6a [igb] > Modules linked in: igb dca thunderbolt fuse vfat fat elan_i2c mei_wdt > mei_hdcp i915 wmi_bmof intel_wmi_thunderbolt iTCO_wdt > iTCO_vendor_support x86_pkg_temp_thermal intel_powerclamp joydev > coretemp crct10dif_pclmul crc32_pclmul i2c_algo_bit ghash_clmulni_intel > intel_cstate drm_kms_helper intel_uncore syscopyarea sysfillrect > sysimgblt fb_sys_fops intel_rapl_perf intel_xhci_usb_role_switch mei_me > drm roles idma64 i2c_i801 ucsi_acpi typec_ucsi mei intel_lpss_pci > processor_thermal_device typec intel_pch_thermal intel_soc_dts_iosf > intel_lpss int3403_thermal thinkpad_acpi wmi int340x_thermal_zone > ledtrig_audio int3400_thermal acpi_thermal_rel acpi_pad video > pcc_cpufreq ip_tables serio_raw nvme nvme_core crc32c_intel uas > usb_storage e1000e i2c_dev > CPU: 7 PID: 516 Comm: kworker/u16:3 Not tainted 5.2.0-rc1Lyude-Test+ #14 > Hardware name: LENOVO 20L8S2N800/20L8S2N800, BIOS N22ET35W (1.12 ) 04/09/2018 > Workqueue: kacpi_hotplug acpi_hotplug_work_fn > RIP: 0010:igb_rd32+0x57/0x6a [igb] > Code: 87 b8 fc ff ff 48 c7 47 08 00 00 00 00 48 c7 c6 33 42 9b c0 4c 89 > c7 e8 47 45 cd dc 89 ee 48 c7 c7 43 42 9b c0 e8 c1 94 71 dc <0f> 0b eb > 08 8b 00 ff c0 75 b0 eb c8 44 89 e0 5d 41 5c c3 0f 1f 44 > RSP: 0018:ffffba5801cf7c48 EFLAGS: 00010286 > RAX: 0000000000000000 RBX: ffff9e7956608840 RCX: 0000000000000007 > RDX: 0000000000000000 RSI: ffffba5801cf7b24 RDI: ffff9e795e3d6a00 > RBP: 0000000000000018 R08: 000000009dec4a01 R09: ffffffff9e61018f > R10: 0000000000000000 R11: ffffba5801cf7ae5 R12: 00000000ffffffff > R13: ffff9e7956608840 R14: ffff9e795a6f10b0 R15: 0000000000000000 > FS: 0000000000000000(0000) GS:ffff9e795e3c0000(0000) knlGS:0000000000000000 > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > CR2: 0000564317bc4088 CR3: 000000010e00a006 CR4: 00000000003606e0 > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 > Call Trace: > igb_release_hw_control+0x1a/0x30 [igb] > igb_remove+0xc5/0x14b [igb] > pci_device_remove+0x3b/0x93 > device_release_driver_internal+0xd7/0x17e > pci_stop_bus_device+0x36/0x75 > pci_stop_bus_device+0x66/0x75 > pci_stop_bus_device+0x66/0x75 > pci_stop_and_remove_bus_device+0xf/0x19 > trim_stale_devices+0xc5/0x13a > ? __pm_runtime_resume+0x6e/0x7b > trim_stale_devices+0x103/0x13a > ? __pm_runtime_resume+0x6e/0x7b > trim_stale_devices+0x103/0x13a > acpiphp_check_bridge+0xd8/0xf5 > acpiphp_hotplug_notify+0xf7/0x14b > ? acpiphp_check_bridge+0xf5/0xf5 > acpi_device_hotplug+0x357/0x3b5 > acpi_hotplug_work_fn+0x1a/0x23 > process_one_work+0x1a7/0x296 > worker_thread+0x1a8/0x24c > ? process_scheduled_works+0x2c/0x2c > kthread+0xe9/0xee > ? kthread_destroy_worker+0x41/0x41 > ret_from_fork+0x35/0x40 > ---[ end trace 252bf10352c63d22 ]--- > > Signed-off-by: Lyude Paul > Fixes: 47e16692b26b ("igb/igc: warn when fatal read failure happens") > Cc: Feng Tang > Cc: Sasha Neftin > Cc: Jeff Kirsher > Cc: intel-wired-lan@lists.osuosl.org > --- > drivers/net/ethernet/intel/igb/igb_main.c | 3 ++- > drivers/net/ethernet/intel/igc/igc_main.c | 3 ++- > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c > index e5b7e638df28..1a7f7cd28df9 100644 > --- a/drivers/net/ethernet/intel/igb/igb_main.c > +++ b/drivers/net/ethernet/intel/igb/igb_main.c > @@ -753,7 +753,8 @@ u32 igb_rd32(struct e1000_hw *hw, u32 reg) > struct net_device *netdev = igb->netdev; > hw->hw_addr = NULL; > netdev_err(netdev, "PCIe link lost\n"); > - WARN(1, "igb: Failed to read reg 0x%x!\n", reg); > + WARN(pci_device_is_present(igb->pdev), > + "igb: Failed to read reg 0x%x!\n", reg); > } > > return value; > diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c > index 28072b9aa932..f873a4b35eaf 100644 > --- a/drivers/net/ethernet/intel/igc/igc_main.c > +++ b/drivers/net/ethernet/intel/igc/igc_main.c > @@ -3934,7 +3934,8 @@ u32 igc_rd32(struct igc_hw *hw, u32 reg) > hw->hw_addr = NULL; > netif_device_detach(netdev); > netdev_err(netdev, "PCIe link lost, device now detached\n"); > - WARN(1, "igc: Failed to read reg 0x%x!\n", reg); > + WARN(pci_device_is_present(igc->pdev), > + "igc: Failed to read reg 0x%x!\n", reg); > } > > return value; > Thanks, for igc Acked-by: Sasha Neftin