From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.10.208.62 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796074676; b=SW467Xz8VJs9DTRF9ecZEiW6knO+O2tQQvOc6fhz9ljryzclIxZdjFOtinTj7AaBe7wD C04rQw5evN5OOZYhgf7Jp2zLjChMsuG0ndbrPG6UOVceW1DsOLlCpdJ+ppdcenr70ndpi /9FmS/za+JBqSrSKwE8fUigtRa0AxDMfOS0v1jk/4UrgV28jK0LN3yqfwfGNqBuodf7lg dEogg/W7RamuI7mxGYRbTKbnxh0XUkTOqnL93xUCa/EmKPxJLW6UPXcIWVj2aOCeP+tn1 TpLrWpKokiFix/ZYqm8MjJn04kzEiybjxuBtG5/F3LBKarmg+RAhiR3CvMaVtWnRhtA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796074676; h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:Date: Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding: X-Rspamd-Queue-Id; bh=TiE7zBizXFg0ybVwtIaLQAHgOuusoLH1FzNxx3eyWJE=; b=4OKlcqkEUB5/8Hw/6bDEgh85jNUqQegzAi+5+J/uz8EfiawTOLumRyVWH/9n3MPeCV0l WZixSx9r0pgrxBNH5lB1tS/TK25etQ1rv2OGzD7s6/S0mtSJqha18fc8Plbf498WZQ0jj JF9ap+E2hKuOf9lUoHDnXMysSI7aigEFjO9bHNgkk9b/kS+v5Ayexbti3k79RsN0IrRJs xPh6Dmt0rDofL9JqG7acVQlnXZzE3OAaF8eSeG31iMZhBTiH0aN5fikCwFXbfO+0khaMx zD10DgUM8wGLNg17V47IP4ayNltuEh5SDyWIoctJzQCi80XGixcNUGPbCTch6dUMQdw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=mandelbit.com; spf=pass smtp.mailfrom=mandelbit.com; dkim=pass header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=fDhpOfq0; arc=none smtp.remote-ip=195.10.208.62 Received: from mout-b-202.mailbox.org (mout-b-202.mailbox.org [195.10.208.62]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F913606A338; Mon, 30 Nov 2026 21:37:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8F913606A338 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mandelbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mandelbit.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=fDhpOfq0 Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-b-202.mailbox.org (Postfix) with ESMTPS id 4jdcnP6xGKzKnFS; Mon, 30 Nov 2026 22:37:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com; s=MBO0001; t=1796074666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=TiE7zBizXFg0ybVwtIaLQAHgOuusoLH1FzNxx3eyWJE=; b=fDhpOfq0pqhBTxwakdZpDxeK9LLXABrOcEEcdGUzbc/LjTz18WXwCxiGOwPbU/ML76IMdW dcuh2JAhwESMScE4OheCgA8eMYGURkWgvDY4gxAshepnG123C7jLSX0dhqt9QBrdBZvcFJ iQdCx25+hlHyOm1eMwa6KoXXY2Np07hKwJLRliPsi/FsHmW6/Kg0NqHKmSt2a3mnO3hDf2 BAU2q6UmLyzG16Y5tG41jXuD1NDbFyspR6M25EKKS9pmX77a4IkOIbZNnFOK0TrEDPPrOB 7N3BcV3/ErSWpLw54wASd4MFkstPp0dkfvKsHgRY+g27ECBZfFmN3xX/m2+NmA== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of antonio@mandelbit.com designates 2001:67c:2050:b231:465::202 as permitted sender) smtp.mailfrom=antonio@mandelbit.com From: Antonio Quartulli To: intel-wired-lan@lists.osuosl.org Cc: Antonio Quartulli , Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Janis Edvarts Lacis , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Stanislav Fomichev , Sriram Yagnaraman , Kurt Kanzenbach , Maciej Fijalkowski , Heiner Kallweit , Joe Damato , "Rafael J. Wysocki" , Sven Auhagen , netdev@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH net v6 0/7] igb: fix runtime PM resume issues Date: Mon, 30 Nov 2026 22:37:30 +0100 Message-ID: <20261130213740.3323814-1-antonio@mandelbit.com> X-Mailer: git-send-email 2.56.1 X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4jdcnP6xGKzKnFS igb can be runtime suspended when the link goes down (with power/control set to auto). The suspend can deadlock with an RTNL holder resuming the device, e.g. ethtool (patch 1). Resuming calls functions that need RTNL without holding it (patches 3 and 5), XDP and XSK changes race with a resume or follow a failed one (patch 6), and devices that can't signal a wake-up are suspended anyway, so their port stays down when the link comes back (patch 7). Patch 2 fixes the XSK pool disable path when the device has fewer rings than the stack has queues (a single Tx queue with VFs on 82576, or none while runtime suspended); patch 4 keeps such queues while they still have a zero-copy pool, so that it can still be disabled. Tested with the 82576 emulated by QEMU, with test-only hooks to delay a runtime suspend, to make the open fail on resume, and to force MSI with a single queue on resume. Before/after this version: ethtool during a runtime suspend hangs with RTNL held / completes, and the suspend is retried; closing a zero-copy AF_XDP socket after a failed resume hangs in napi_disable() with RTNL held / completes, then removing the XDP program works and adding one fails with -ENODEV. The runtime suspend tests ran without patch 7, as QEMU's 82576 can't signal PME. Not tested: real hardware and PME wake-up, a real system sleep, PCI error recovery. Not run under KASAN. Pre-existing issues left for a follow-up: in the XSK queue disable and enable paths the Tx NAPI isn't stopped when Rx and Tx don't share a vector, a failed buffer reallocation leaves the queue half torn down, Rx wakeups fail on a queue without a Tx ring, and disabling a pool during PCI error recovery still hangs. igc has the same issues (see the notes) and also takes RTNL when runtime suspending; its fixes will be sent separately. Changes in v6: - new patch 1: don't wait for RTNL when runtime suspending (Sashiko) - patch 2: the message and comment name the runtime suspended case (Sashiko) - patch 3: the work item resumes the device first (Sashiko) - patch 4: only zero-copy pools keep a queue (Sashiko) - patch 5: don't cancel the work item in __igb_shutdown() anymore - patch 6: handle a failed resume (Sashiko) - added Janis's Reviewed-by to the unchanged patches 2 and 7 Changes in v5: - new patch 3: keep the stack's Rx queues that still have an XSK pool (Janis) - patch 4: cancel the work item before a suspend (Sashiko) - new patch 5: resume the device before changing XDP or XSK settings (Sashiko) - patch 6: check pci_dev_run_wake() when scheduling the suspend (Sashiko) Changes in v4: - patch 1: also handle queues with an Rx but no Tx ring, as with VFs: tear down the Rx ring and skip only the Tx part (Sashiko); subject changed from "don't disable rings ..." to "don't touch rings ..." Changes in v3: - new patch 1 - patch 2: set the real queue counts on system sleep resume and from a work item on runtime resume, and drop packets for queues the device doesn't have until then (Janis, Sashiko) - patch 3 (now 4): link the NAPIs from the same work item Changes in v2: - patch 2 (v2 patch 1): keep setting the queue counts in __igb_open(), only skipping them on resume (Sashiko) - mention the tested hardware in the commit messages v5: https://lore.kernel.org/netdev/20261124235723.1135808-1-antonio@mandelbit.com/ v4: https://lore.kernel.org/netdev/20261120210134.133238-1-antonio@mandelbit.com/ v3: https://lore.kernel.org/netdev/20261119140412.163202-1-antonio@mandelbit.com/ v2: https://lore.kernel.org/netdev/20261116153041.3002666-1-antonio@mandelbit.com/ v1: https://lore.kernel.org/netdev/20261113105835.3821433-1-antonio@mandelbit.com/ Antonio Quartulli (7): igb: don't wait for RTNL when runtime suspending igb: don't touch rings that don't exist when disabling an XSK pool igb: fix RTNL assertion when resuming from runtime suspend igb: keep the stack's Rx queues that still have an XSK pool igb: link queues to NAPIs under RTNL after runtime resume igb: resume the device before changing XDP or XSK settings igb: only allow runtime PM if the device can wake up drivers/net/ethernet/intel/igb/igb.h | 2 + drivers/net/ethernet/intel/igb/igb_main.c | 182 ++++++++++++++++++---- drivers/net/ethernet/intel/igb/igb_xsk.c | 42 +++-- 3 files changed, 186 insertions(+), 40 deletions(-) -- 2.56.1