Show a cover letter.

GET /api/1.2/covers/2233786/?format=api
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2233786,
    "url": "http://patchwork.ozlabs.org/api/1.2/covers/2233786/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-pci/cover/20260506215113.851360-1-dakr@kernel.org/",
    "project": {
        "id": 28,
        "url": "http://patchwork.ozlabs.org/api/1.2/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,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260506215113.851360-1-dakr@kernel.org>",
    "list_archive_url": null,
    "date": "2026-05-06T21:50:36",
    "name": "[v2,00/25] rust: device: Higher-Ranked Lifetime Types for device drivers",
    "submitter": {
        "id": 89037,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/89037/?format=api",
        "name": "Danilo Krummrich",
        "email": "dakr@kernel.org"
    },
    "mbox": "http://patchwork.ozlabs.org/project/linux-pci/cover/20260506215113.851360-1-dakr@kernel.org/mbox/",
    "series": [
        {
            "id": 503075,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/503075/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=503075",
            "date": "2026-05-06T21:50:38",
            "name": "rust: device: Higher-Ranked Lifetime Types for device drivers",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/503075/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/covers/2233786/comments/",
    "headers": {
        "Return-Path": "\n <linux-pci+bounces-53983-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=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=DKYsJ/XU;\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-53983-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"DKYsJ/XU\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"
        ],
        "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 4g9pzG01Gtz1yJq\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 07 May 2026 07:53:13 +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 9D32A301F1A2\n\tfor <incoming@patchwork.ozlabs.org>; Wed,  6 May 2026 21:51:23 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id A3C643B27D3;\n\tWed,  6 May 2026 21:51:22 +0000 (UTC)",
            "from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D486322B6D;\n\tWed,  6 May 2026 21:51:22 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id DC4BFC2BCB0;\n\tWed,  6 May 2026 21:51:15 +0000 (UTC)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1778104282; cv=none;\n b=lYgp8ELvU+QrwvnIVULnp/A4uQlYyr8SIjEFK2GH+JwLSXAsAhd8mFDslr9Oip8cj/LJj3I1Xs1+Gg9s/lc7OVTOWAWmcbrHBd2Y4FO+Z6AgvqTNSUh2aA/TvfC9N0UfIaAHydHEf/UwzQuL0ebDOgbz86qCcoObutN/+nuNPpY=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1778104282; c=relaxed/simple;\n\tbh=eK+42iwer4stlgq5uFasabGEzh4LF2MsdeKvgd9ivO0=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type;\n b=QoHd0Z6jqDQrLfq4hKluljXItTp0qQ2PdhIB8hqYPm1UW7KjFdFRX5X8U8EqN65/qk7S3jSUHs44EPZ8oaEhCcw1hZKrTIp10eZ1Zua46spNUGbfUMtQ4LkUDvZq7idAurRQnA8EdgF1P38p860eS6YP0RsYRGfH5XpWwo0WKS8=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=DKYsJ/XU; arc=none smtp.client-ip=10.30.226.201",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1778104282;\n\tbh=eK+42iwer4stlgq5uFasabGEzh4LF2MsdeKvgd9ivO0=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=DKYsJ/XUxdPgaV3ZRzmV2hX0vsCs1rLlPTMS0wLRNL2J3LHQOZkt7FNA1vNmMWwvh\n\t kVBE9Z9+UDkhd996+krBlBmEeitBNDcatEWn8Ior+Dw1bBPmaLNmKQtZGCFF43AEJS\n\t O0Pl5fk4VDnilFtVw0/nJbH4rVNzg3v+XjjOCIfGGSOoVsalipViPL/KIHJuvwrLzK\n\t 0uL92zUuCuj1G80CxIlikg3im7NobgvpulaTbd4QHLUL7zi13td7CUuW9k/o6ULrzu\n\t 4EAKNeie9ilk78QCjjEvxqgp/pB4fLM2xSDU+1ZpwjiMdVTj59hC/ugiu5hPwXSw6E\n\t 7pyEEy25QgZtA==",
        "From": "Danilo Krummrich <dakr@kernel.org>",
        "To": "gregkh@linuxfoundation.org,\n\trafael@kernel.org,\n\tacourbot@nvidia.com,\n\taliceryhl@google.com,\n\tdavid.m.ertman@intel.com,\n\tira.weiny@intel.com,\n\tleon@kernel.org,\n\tviresh.kumar@linaro.org,\n\tm.wilczynski@samsung.com,\n\tukleinek@kernel.org,\n\tbhelgaas@google.com,\n\tkwilczynski@kernel.org,\n\tabdiel.janulgue@gmail.com,\n\trobin.murphy@arm.com,\n\tmarkus.probst@posteo.de,\n\tojeda@kernel.org,\n\tboqun@kernel.org,\n\tgary@garyguo.net,\n\tbjorn3_gh@protonmail.com,\n\tlossin@kernel.org,\n\ta.hindborg@kernel.org,\n\ttmgross@umich.edu,\n\tigor.korotin@linux.dev,\n\tdaniel.almeida@collabora.com",
        "Cc": "driver-core@lists.linux.dev,\n\tlinux-kernel@vger.kernel.org,\n\tnova-gpu@lists.linux.dev,\n\tdri-devel@lists.freedesktop.org,\n\tlinux-pm@vger.kernel.org,\n\tlinux-pwm@vger.kernel.org,\n\tlinux-pci@vger.kernel.org,\n\trust-for-linux@vger.kernel.org,\n\tDanilo Krummrich <dakr@kernel.org>",
        "Subject": "[PATCH v2 00/25] rust: device: Higher-Ranked Lifetime Types for\n device drivers",
        "Date": "Wed,  6 May 2026 23:50:36 +0200",
        "Message-ID": "<20260506215113.851360-1-dakr@kernel.org>",
        "X-Mailer": "git-send-email 2.54.0",
        "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",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit"
    },
    "content": "Currently, Rust device drivers access device resources such as PCI BAR mappings\nand I/O memory regions through Devres<T>.\n\nDevres::access() provides zero-overhead access by taking a &Device<Bound>\nreference as proof that the device is still bound. Since a &Device<Bound> is\navailable in almost all contexts by design, Devres is mostly a type-system level\nproof that the resource is valid, but it can also be used from scopes without\nthis guarantee through its try_access() accessor.\n\nThis works well in general, but has a few limitations:\n\n  - Every access to a device resource goes through Devres::access(), which\n    despite zero cost, adds boilerplate to every access site.\n\n  - Destructors do not receive a &Device<Bound>, so they must use try_access(),\n    which can fail. In practice the access succeeds if teardown ordering is\n    correct, but the type system can't express this, forcing drivers to handle a\n    failure path that should never be taken.\n\n  - Sharing a resource across components (e.g. passing a BAR to a sub-component)\n    requires Arc<Devres<T>>.\n\n  - Device references must be stored as ARef<Device> rather than plain &Device\n    borrows.\n\nThese limitations stem from the driver's bus device private data being 'static\n-- the driver struct cannot borrow from the device reference it receives in\nprobe(), even though it structurally cannot outlive the device binding.\n\nThis series introduces Higher-Ranked Lifetime Types (HRT) for Rust device\ndrivers. An HRT is a type that is generic over a lifetime -- it does not have a\nfixed lifetime, but can be instantiated with any lifetime chosen by the caller.\n\nRust does not directly support types that are generic over a lifetime as type\nparameters; the ForLt trait (contributed by Gary Guo) encodes this internally.\n\nThe module_*_driver! macros handle the wrapping, so driver authors just write\nstruct MyDriver<'a> and impl Driver<'a>.\n\nWith HRT, driver structs carry a lifetime parameter tied to the device binding\nscope -- the interval of a bus device being bound to a driver. Device resources\nlike pci::Bar<'a> and IoMem<'a> are handed out with this lifetime, so the\ncompiler enforces at build time that they do not escape the binding scope.\n\nBefore:\n\n\tstruct MyDriver {\n\t    pdev: ARef<pci::Device>,\n\t    bar: Devres<pci::Bar<BAR_SIZE>>,\n\t}\n\n\tlet io = self.bar.access(dev)?;\n\tio.read32(OFFSET);\n\nAfter:\n\n\tstruct MyDriver<'a> {\n\t    pdev: &'a pci::Device,\n\t    bar: pci::Bar<'a, BAR_SIZE>,\n\t}\n\n\tself.bar.read32(OFFSET);\n\nLifetime-parameterized device resources can be put into a Devres at any point\nvia Bar::into_devres() / IoMem::into_devres(), providing the exact same\nsemantics as before. This is useful for resources shared across subsystem\nboundaries where revocation is needed.\n\nThis also synergizes with the upcoming self-referential initialization support\nin pin-init, which allows one field of the driver struct to borrow another\nduring initialization without unsafe code.\n\nThe same pattern is applied to auxiliary device registration data as a first\nexample beyond bus device private data. Registration<F: ForLt> can hold\nlifetime-parameterized data tied to the parent driver's binding scope. Since the\nauxiliary bus guarantees that the parent remains bound while the auxiliary\ndevice is registered, the registration data can safely borrow the parent's\ndevice resources.\n\nMore generally, binding resource lifetimes to a registration scope applies to\nevery registration that is scoped to a driver binding -- auxiliary devices,\nclass devices, IRQ handlers, workqueues.\n\nA follow-up series extends this to class device registrations, starting with\nDRM, so that class device callbacks (IOCTLs, etc.) can safely access device\nresources through the separate registration data bound to the registration's\nlifetime without Devres indirection.\n\nThe series contains a few driver patches for reference, indicated by the REF\nsuffix.\n\nThanks to Gary for coming up with the ForLt implementation; thanks to Alice for\nthe early discussions around lifetime-parameterized private data that helped\nshape the direction of this work.\n\nThis series depends on [1].\n\n[1] https://lore.kernel.org/driver-core/20260505152400.3905096-1-dakr@kernel.org/\n\nChanges in v2:\n  - Add 'a bound to ForLt::Of<'a> and WithLt::Of, making the lifetime bound\n    inherent to the trait; remove all F::Of<'static>: 'static where clauses\n  - Drop \"rust: devres: add ForLt support to Devres\"; Devres itself stays\n    unchanged -- ForLt-aware access is introduced later through DevresLt in a\n    separate series\n  - Use 'bound instead of 'a; add patches to consistently use 'bound for\n    pre-existing 'a\n\nDanilo Krummrich (24):\n  rust: driver core: drop drvdata before devres release\n  rust: device: generalize drvdata methods over ForLt\n  rust: driver: make Adapter trait lifetime-parameterized\n  rust: pci: implement Sync for Device<Bound>\n  rust: platform: implement Sync for Device<Bound>\n  rust: auxiliary: implement Sync for Device<Bound>\n  rust: usb: implement Sync for Device<Bound>\n  rust: device: implement Sync for Device<Bound>\n  rust: pci: make Driver trait lifetime-parameterized\n  rust: platform: make Driver trait lifetime-parameterized\n  rust: auxiliary: make Driver trait lifetime-parameterized\n  rust: auxiliary: generalize Registration over ForLt\n  samples: rust: rust_driver_auxiliary: showcase lifetime-bound\n    registration data\n  rust: usb: make Driver trait lifetime-parameterized\n  rust: i2c: make Driver trait lifetime-parameterized\n  rust: pci: make Bar lifetime-parameterized\n  rust: io: make IoMem and ExclusiveIoMem lifetime-parameterized\n  samples: rust: rust_driver_pci: use HRT lifetime for Bar\n  rust: driver-core: rename 'a lifetime to 'bound\n  gpu: nova-core: rename 'a lifetime to 'bound\n  gpu: nova-core: use HRT lifetime for Bar\n  gpu: nova-core: unregister sysmem flush page from Drop\n  gpu: nova-core: replace ARef<Device> with &'bound Device in\n    SysmemFlush\n  gpu: drm: tyr: use HRT lifetime for IoMem\n\nGary Guo (1):\n  rust: types: add `ForLt` trait for higher-ranked lifetime support\n\n drivers/base/dd.c                        |   2 +-\n drivers/cpufreq/rcpufreq_dt.rs           |  10 +-\n drivers/gpu/drm/nova/driver.rs           |   9 +-\n drivers/gpu/drm/tyr/driver.rs            |  24 ++-\n drivers/gpu/drm/tyr/gpu.rs               |  62 +++---\n drivers/gpu/drm/tyr/regs.rs              |  21 +-\n drivers/gpu/nova-core/driver.rs          |  48 ++---\n drivers/gpu/nova-core/fb.rs              |  31 ++-\n drivers/gpu/nova-core/firmware/gsp.rs    |   8 +-\n drivers/gpu/nova-core/gpu.rs             |  38 ++--\n drivers/gpu/nova-core/gsp/commands.rs    |  10 +-\n drivers/gpu/nova-core/gsp/fw/commands.rs |   4 +-\n drivers/gpu/nova-core/nova_core.rs       |   4 +-\n drivers/pwm/pwm_th1520.rs                |  14 +-\n include/linux/device/driver.h            |   4 +-\n rust/Makefile                            |   1 +\n rust/kernel/auxiliary.rs                 | 132 +++++++++----\n rust/kernel/cpufreq.rs                   |   8 +-\n rust/kernel/device.rs                    |  79 +++++---\n rust/kernel/devres.rs                    |  16 +-\n rust/kernel/driver.rs                    |  44 +++--\n rust/kernel/i2c.rs                       | 130 +++++++-----\n rust/kernel/io/mem.rs                    | 131 ++++++------\n rust/kernel/pci.rs                       |  89 ++++++---\n rust/kernel/pci/io.rs                    |  68 ++++---\n rust/kernel/pci/irq.rs                   |  38 ++--\n rust/kernel/platform.rs                  | 120 +++++++----\n rust/kernel/types.rs                     |   4 +\n rust/kernel/types/for_lt.rs              | 117 +++++++++++\n rust/kernel/usb.rs                       |  94 +++++----\n rust/macros/for_lt.rs                    | 242 +++++++++++++++++++++++\n rust/macros/lib.rs                       |  12 ++\n samples/rust/rust_debugfs.rs             |  10 +-\n samples/rust/rust_dma.rs                 |   9 +-\n samples/rust/rust_driver_auxiliary.rs    |  53 +++--\n samples/rust/rust_driver_i2c.rs          |  18 +-\n samples/rust/rust_driver_pci.rs          |  93 ++++-----\n samples/rust/rust_driver_platform.rs     |  12 +-\n samples/rust/rust_driver_usb.rs          |  14 +-\n samples/rust/rust_i2c_client.rs          |  12 +-\n samples/rust/rust_soc.rs                 |  12 +-\n 41 files changed, 1220 insertions(+), 627 deletions(-)\n create mode 100644 rust/kernel/types/for_lt.rs\n create mode 100644 rust/macros/for_lt.rs"
}