Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2233265/?format=api
{ "id": 2233265, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2233265/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260505234327.716630-1-skhawaja@google.com/", "project": { "id": 28, "url": "http://patchwork.ozlabs.org/api/1.1/projects/28/?format=api", "name": "Linux PCI development", "link_name": "linux-pci", "list_id": "linux-pci.vger.kernel.org", "list_email": "linux-pci@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null }, "msgid": "<20260505234327.716630-1-skhawaja@google.com>", "date": "2026-05-05T23:43:27", "name": "[v2] PCI: Init temporary pci device in new_id_store()", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "c5f198b2b12998a6931aced5ffe96b149886dd82", "submitter": { "id": 91295, "url": "http://patchwork.ozlabs.org/api/1.1/people/91295/?format=api", "name": "Samiullah Khawaja", "email": "skhawaja@google.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260505234327.716630-1-skhawaja@google.com/mbox/", "series": [ { "id": 502912, "url": "http://patchwork.ozlabs.org/api/1.1/series/502912/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=502912", "date": "2026-05-05T23:43:27", "name": "[v2] PCI: Init temporary pci device in new_id_store()", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/502912/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2233265/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2233265/checks/", "tags": {}, "headers": { "Return-Path": "\n <linux-pci+bounces-53816-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-pci@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256\n header.s=20251104 header.b=lWP/Xk8J;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-pci+bounces-53816-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=google.com header.i=@google.com\n header.b=\"lWP/Xk8J\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.210.201", "smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=google.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=flex--skhawaja.bounces.google.com" ], "Received": [ "from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g9FTf0BYmz1yJx\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 06 May 2026 09:44:05 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id EA1093011F13\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 5 May 2026 23:43:48 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 6472D33A02B;\n\tTue, 5 May 2026 23:43:48 +0000 (UTC)", "from mail-pf1-f201.google.com (mail-pf1-f201.google.com\n [209.85.210.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 15A2D33987E\n\tfor <linux-pci@vger.kernel.org>; Tue, 5 May 2026 23:43:46 +0000 (UTC)", "by mail-pf1-f201.google.com with SMTP id\n d2e1a72fcca58-8354503d9acso3494424b3a.1\n for <linux-pci@vger.kernel.org>; Tue, 05 May 2026 16:43:46 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1778024628; cv=none;\n b=Nuf5xEOV3NQ1wOJZUUkMYzBMemwxg2oBoMJbZSXG4ITmKTC/wFr8SlOedAC6j4wokbJ2LEpybThPbg3rC3w/MdtybiYZEzLlFM5AFK8u9gQ/mf57KUTVmZTbFk/8k6yZxDKhZ3B5haopSs/mffhatfAX0KGiRDQgh5CfH94kf0E=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1778024628; c=relaxed/simple;\n\tbh=5NTiSaDfrs9AGN5yp3XlSx0CLvr1x9GJvDeuDPc3dtc=;\n\th=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type;\n b=WY8j4f1+IEJpqD2r85W4tPCHOhgPVWwpuFACgHh5+eOSORxeAxWwttNp2aRm63vdnuKfaDXNj0gzrJtM/ZInzn0OCcIb/mMNhup/FhWzDUllsJoBiX5dnNf81r6tA8A3Vea3+EtYs/IGch0DWPcABD3qehETU1AUD636E4hSvVI=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=google.com;\n spf=pass smtp.mailfrom=flex--skhawaja.bounces.google.com;\n dkim=pass (2048-bit key) header.d=google.com header.i=@google.com\n header.b=lWP/Xk8J; arc=none smtp.client-ip=209.85.210.201", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=google.com; s=20251104; t=1778024626; x=1778629426;\n darn=vger.kernel.org;\n h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject\n :date:message-id:reply-to;\n bh=vLifBCcvpeoNaalw5dhl6uu6/26Oav0q3n95ZKVqY6I=;\n b=lWP/Xk8J3xYzzYLbJgnmyFrwa1XJwMFx5NGEbEOW85CKOlMvtvwTU6rCwiW+Z9Zvpy\n THnk0lERD34cSSMzcEUlpT8n8LNpnl3tlPElgjgy6U1pYU/DnWlcI/nKMpaSIQXNmxeW\n ITo4+PP3R6JNkhBoTmJAFiW2kRgyHDyq1OAdIuJihEEWdNaR+kLaewzkN9Ui0xcZDZ31\n fg36Ip5nJE9KtBle8ZSfkW+x1SKQ8zImmbsPjLICYc/hyfm0Vhg6w8vNhjChR6VL3AQb\n x988dl7Ee8b0Oyncnp9WfpqAwPwC2DNwBCbRarFCkwAlcqBHPzJcZwu3WKPs8BXtamuo\n K3Bg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1778024626; x=1778629426;\n h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state\n :from:to:cc:subject:date:message-id:reply-to;\n bh=vLifBCcvpeoNaalw5dhl6uu6/26Oav0q3n95ZKVqY6I=;\n b=DxlxcqmypDGc1wUs+QSVkJ3iEKhfmOcjsCvnId52wXGzf2qJgJ42aLVQPEITqZ4yMz\n uAWNc8ZYndZ7ppugj2ZEGYplLmHS6iYIulJrHTGTCnn/D6VYF7tHa9NP6F1fdqyzmecn\n jhU/7O5SCo5RoAf3qx6K1WRvPDS/gjNUNnnXsWrw4aM2r5h6Kb1Lb8TOhKipdMBv+8h4\n Bwdxu5pUheSqvIiw+Raz+lxHKLudPRZtON+6VJmBhgJmrzwKpkls2ct69PBz21hzHwv7\n rKOFYy8NhQRYAGeTP6HWXw53fw1VQDgnztq4DGZqFWD8ccGUJ3ssPXo5I5i+YrgBmUtp\n OMUQ==", "X-Forwarded-Encrypted": "i=1;\n AFNElJ+tT/WYV+4uGmyF/HK7qT2RlrtCU9yU2W/hShrc0VUo1AeUNwYHZPob2nbTisl8KBgqF5a84yThiw0=@vger.kernel.org", "X-Gm-Message-State": "AOJu0YztYLAMrgV/O/WdR9JOnYGB5zbO7OEACBvqEUaFvcAiXWbRpcFP\n\t7RX+Z5OeY5Sds3KyaWECto8zPLyWCc0NlP886BKG4Bud94JuYgnhNjxW8FWepGGEKvQtvZcpEy0\n\tY9DqN2IQ+R/dXhg==", "X-Received": "from pfbcr15.prod.google.com\n ([2002:a05:6a00:f0f:b0:82f:5b50:db30])\n (user=skhawaja job=prod-delivery.src-stubby-dispatcher) by\n 2002:a05:6a00:4514:b0:82f:355a:857e with SMTP id\n d2e1a72fcca58-83a5ea421f2mr766773b3a.47.1778024626170;\n Tue, 05 May 2026 16:43:46 -0700 (PDT)", "Date": "Tue, 5 May 2026 23:43:27 +0000", "Precedence": "bulk", "X-Mailing-List": "linux-pci@vger.kernel.org", "List-Id": "<linux-pci.vger.kernel.org>", "List-Subscribe": "<mailto:linux-pci+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-pci+unsubscribe@vger.kernel.org>", "Mime-Version": "1.0", "X-Mailer": "git-send-email 2.54.0.545.g6539524ca2-goog", "Message-ID": "<20260505234327.716630-1-skhawaja@google.com>", "Subject": "[PATCH v2] PCI: Init temporary pci device in new_id_store()", "From": "Samiullah Khawaja <skhawaja@google.com>", "To": "Bjorn Helgaas <bhelgaas@google.com>", "Cc": "skhawaja@google.com, Danilo Krummrich <dakr@kernel.org>,\n Bandan Das <bsd@redhat.com>,\n\tGui-Dong Han <hanguidong02@gmail.com>,\n Greg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\tAlex Williamson <alex@shazbot.org>, linux-pci@vger.kernel.org,\n linux-kernel@vger.kernel.org", "Content-Type": "text/plain; charset=\"UTF-8\"" }, "content": "When setting new_id of a PCI device driver using sysfs a lockdep splat\noccurs. This is because the new_id function new_id_store() checks for\ndriver_override by creating temporary pci_dev structs.\n\nSince the newly added driver_override spinlock is not init for temporary\npci_dev structs, the lockdep splat complains about it.\n\nInitialize the temporary pci device to fix this.\n\n[ 4.464296] INFO: trying to register non-static key.\n[ 4.466207] The code is fine but needs lockdep annotation, or maybe\n[ 4.468487] you didn't initialize this object before use?\n[ 4.470486] turning off the locking correctness validator.\n[ 4.472494] CPU: 2 UID: 0 PID: 177 Comm: liveupdate-iomm Not tainted 7.0.0+ #9 PREEMPT(full)\n[ 4.472497] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014\n[ 4.472498] Call Trace:\n[ 4.472501] <TASK>\n[ 4.472503] dump_stack_lvl+0x5d/0x80\n[ 4.472508] register_lock_class+0x77e/0x790\n[ 4.472512] ? check_prev_add+0xf4/0xd30\n[ 4.472513] ? check_prev_add+0xf4/0xd30\n[ 4.472515] __lock_acquire+0x3b4/0x1b80\n[ 4.472518] ? raw_irqentry_exit_cond_resched+0x20/0x50\n[ 4.472556] lock_acquire+0xbf/0x2e0\n[ 4.472558] ? pci_match_device+0x24/0x180\n[ 4.472563] _raw_spin_lock+0x30/0x40\n[ 4.472567] ? pci_match_device+0x24/0x180\n[ 4.472569] pci_match_device+0x24/0x180\n[ 4.472571] new_id_store+0x189/0x1d0\n[ 4.472574] kernfs_fop_write_iter+0x14f/0x210\n[ 4.472578] vfs_write+0x263/0x5e0\n[ 4.472583] ksys_write+0x79/0xf0\n[ 4.472585] do_syscall_64+0x117/0xf80\n[ 4.472587] ? clear_bhb_loop+0x40/0x90\n[ 4.472590] entry_SYSCALL_64_after_hwframe+0x77/0x7f\n[ 4.472592] RIP: 0033:0x7fe7bc0beeb2\n[ 4.472595] Code: 18 41 8b 93 08 03 00 00 59 5e 48 83 f8 fc 75 1a 83 e2 39 83 fa 08 75 12 e8 2b ff ff ff 0f 1f 00 49 89 ca 48 8b 44 24 20 0f 05 <48> 83 c4 18 c3 66 0f 1f 84 00 00 00 00 00 48 83 ec 10 ff 74 24 18\n[ 4.472596] RSP: 002b:00007ffcdbb1ed80 EFLAGS: 00000202 ORIG_RAX: 0000000000000001\n[ 4.472598] RAX: ffffffffffffffda RBX: 00007fe7bc2415c0 RCX: 00007fe7bc0beeb2\n[ 4.472599] RDX: 000000000000000a RSI: 00005580955433c0 RDI: 0000000000000001\n[ 4.472600] RBP: 000000000000000a R08: 0000000000000000 R09: 0000000000000000\n[ 4.472601] R10: 0000000000000000 R11: 0000000000000202 R12: 000000000000000a\n[ 4.472602] R13: 00005580955433c0 R14: 000055805932493e R15: 0000558095545490\n[ 4.472605] </TASK>\n\nFixes: 10a4206a2401 (\"PCI: use generic driver_override infrastructure\")\nFixes: 8895d3bcb8ba (\"PCI: Fail new_id for vendor/device values already built into driver\")\nSigned-off-by: Samiullah Khawaja <skhawaja@google.com>\n\n---\n\nv2:\n - Use device_initialize instead of spinlock init\n - Set release cb and call put_device to release\n - Add Fixes tag for the commit that added temporary pci device without\n initialize.\n---\n drivers/pci/pci-driver.c | 9 ++++++++-\n 1 file changed, 8 insertions(+), 1 deletion(-)\n\n\nbase-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731", "diff": "diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c\nindex d10ece0889f0..e3f59001785a 100644\n--- a/drivers/pci/pci-driver.c\n+++ b/drivers/pci/pci-driver.c\n@@ -179,6 +179,11 @@ static const struct pci_device_id *pci_match_device(struct pci_driver *drv,\n \treturn NULL;\n }\n \n+static void _pci_free_device(struct device *dev)\n+{\n+\tkfree(to_pci_dev(dev));\n+}\n+\n /**\n * new_id_store - sysfs frontend to pci_add_dynid()\n * @driver: target device driver\n@@ -214,11 +219,13 @@ static ssize_t new_id_store(struct device_driver *driver, const char *buf,\n \t\tpdev->subsystem_vendor = subvendor;\n \t\tpdev->subsystem_device = subdevice;\n \t\tpdev->class = class;\n+\t\tpdev->dev.release = _pci_free_device;\n \n+\t\tdevice_initialize(&pdev->dev);\n \t\tif (pci_match_device(pdrv, pdev))\n \t\t\tretval = -EEXIST;\n \n-\t\tkfree(pdev);\n+\t\tput_device(&pdev->dev);\n \n \t\tif (retval)\n \t\t\treturn retval;\n", "prefixes": [ "v2" ] }