From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3C064CE79A8 for ; Tue, 19 Sep 2023 21:30:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id C142E82205; Tue, 19 Sep 2023 21:30:09 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org C142E82205 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1695159009; bh=1vm1QBViLm483KXD5JsMYRlHrK96l76NcagWPd1zvl0=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=IGqMJpGobqYWqV6FiKTHkbWJz0Dk9h8jKXjvAQPKLhjlSrFOKyeHAO/EETuz12MrS Lm6+MXOYpHPuZoYYWvSEb5PNWNGH6t+hOwENBojKrSoc2mGniaY73z64/SmLprKt4p GB2w6gjUSwODQwgP+4FfBjEhcce1YHd+1zp/GfCAkrUp+d3VnTXYAA9Ju86jlCkqNK OpQAMpJ5nbhLe+qWWOfdPS0H+SX/ovPnwvxinMZtLGOUy6X4w8TqLk23FWmKRcV/W0 Aj9Ct2HpGq7YVXmZNybh0p5v1713SwBCK6kpfgMzTTYWFWUc3rzLe/lmO88YdXOILG ZEn7Laae70qbA== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GWW4VBCtWtBQ; Tue, 19 Sep 2023 21:30:09 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id D9FD682031; Tue, 19 Sep 2023 21:30:08 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org D9FD682031 Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id A34851BF401 for ; Tue, 19 Sep 2023 21:30:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 6CEC74179A for ; Tue, 19 Sep 2023 21:30:07 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 6CEC74179A X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id prPfz57vPAmQ for ; Tue, 19 Sep 2023 21:30:06 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by smtp2.osuosl.org (Postfix) with ESMTPS id 8C3904179D for ; Tue, 19 Sep 2023 21:30:06 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 8C3904179D X-IronPort-AV: E=McAfee;i="6600,9927,10838"; a="370371207" X-IronPort-AV: E=Sophos;i="6.02,160,1688454000"; d="scan'208";a="370371207" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Sep 2023 14:30:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10838"; a="781438589" X-IronPort-AV: E=Sophos;i="6.02,160,1688454000"; d="scan'208";a="781438589" Received: from jbrandeb-spr1.jf.intel.com ([10.166.28.233]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Sep 2023 14:30:05 -0700 From: Jesse Brandeburg To: intel-wired-lan@lists.osuosl.org Date: Tue, 19 Sep 2023 14:29:59 -0700 Message-Id: <20230919212959.1939749-1-jesse.brandeburg@intel.com> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695159006; x=1726695006; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=xmrU+1T0MIKHsMrQLcIKm6SI9n4e26Ci6nUCbS3K5ec=; b=lNk/X/Z+f44N5rcscjkPOyYC3dXm4EWmELquv8Kim3xB63e9rz02pi5+ NsO6gyn4MFUP6RWvfDDForLjvG9Ta9M/aeTOoiPKs81Zg0E8cO+ZMSktK le9qUfac2sArUmr6gntufVO+PMzcu017QeWUKEqi15BFb7f/hcm/iExoT QdBa0fHjA66xxVDQODHENXAuqxcrOu2sorsBURbBk9yxmhTc+PMQPfemK kmfJyTQNdl8BI0mLIG4JFS6/lvSdo1Jr/S6n8VD4RHWlu7sZxvRZObAhF D+yqQ+UdwHu0RJJh1malcODmdB8OSkBIsj7Q1RC4LSsp4mNcPiBdRUqls g==; X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=lNk/X/Z+ Subject: [Intel-wired-lan] [PATCH iwl-net v1] ice: reset first in crash dump kernels X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Przemek Kitszel , jkc@redhat.com, Jesse Brandeburg Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" When booting into the crash dump kernels there are cases where upon enabling the device, the system under test will panic or machine check. One such test is to - load ice driver $ modprobe ice - enable SR-IOV (2 VFs) $ echo 2 > /sys/class/net/eth0/device/sriov_num_vfs - crash echo c > /proc/sysrq-trigger - load ice driver (or happens automatically) modprobe ice - crash during pcim_enable_device() Avoid this problem by issuing a FLR to the device via PCIe config space on the crash kernel, to clear out any outstanding transactions and stop all queues and interrupts. Restore config space afterword because the driver won't load successfully otherwise. Reviewed-by: Przemek Kitszel Signed-off-by: Jesse Brandeburg --- drivers/net/ethernet/intel/ice/ice_main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index c8286adae946..6550c46e4e36 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -6,6 +6,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include +#include #include "ice.h" #include "ice_base.h" #include "ice_lib.h" @@ -5014,6 +5015,20 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent) return -EINVAL; } + /* when under a kdump kernel initiate a reset before enabling the + * device in order to clear out any pending DMA transactions. These + * transactions can cause some systems to machine check when doing + * the pcim_enable_device() below. + */ + if (is_kdump_kernel()) { + pci_save_state(pdev); + pci_clear_master(pdev); + err = pcie_flr(pdev); + if (err) + return err; + pci_restore_state(pdev); + } + /* this driver uses devres, see * Documentation/driver-api/driver-model/devres.rst */ -- 2.39.3 _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan