get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.0/patches/2219436/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2219436,
    "url": "http://patchwork.ozlabs.org/api/1.0/patches/2219436/?format=api",
    "project": {
        "id": 2,
        "url": "http://patchwork.ozlabs.org/api/1.0/projects/2/?format=api",
        "name": "Linux PPC development",
        "link_name": "linuxppc-dev",
        "list_id": "linuxppc-dev.lists.ozlabs.org",
        "list_email": "linuxppc-dev@lists.ozlabs.org",
        "web_url": "https://github.com/linuxppc/wiki/wiki",
        "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git",
        "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/"
    },
    "msgid": "<20260402174925.v3.9.I897d478b4a9361d79cd5073207c1062fd4d0d0e4@changeid>",
    "date": "2026-04-03T00:49:55",
    "name": "[v3,9/9] driver core: Replace dev->offline + ->offline_disabled with DEV_FLAGs",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "ecbcbcf0df4111d1d36f68c6765c25f3f28559f6",
    "submitter": {
        "id": 9763,
        "url": "http://patchwork.ozlabs.org/api/1.0/people/9763/?format=api",
        "name": "Douglas Anderson",
        "email": "dianders@chromium.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260402174925.v3.9.I897d478b4a9361d79cd5073207c1062fd4d0d0e4@changeid/mbox/",
    "series": [
        {
            "id": 498570,
            "url": "http://patchwork.ozlabs.org/api/1.0/series/498570/?format=api",
            "date": "2026-04-03T00:49:46",
            "name": "driver core: Fix some race conditions",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/498570/mbox/"
        }
    ],
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2219436/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <linuxppc-dev+bounces-19246-incoming=patchwork.ozlabs.org@lists.ozlabs.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linuxppc-dev@lists.ozlabs.org"
        ],
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256\n header.s=google header.b=iR2WHh9H;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=2404:9400:21b9:f100::1; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev+bounces-19246-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)",
            "lists.ozlabs.org;\n arc=none smtp.remote-ip=\"2607:f8b0:4864:20::1335\"",
            "lists.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=chromium.org",
            "lists.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256\n header.s=google header.b=iR2WHh9H;\n\tdkim-atps=neutral",
            "lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=chromium.org\n (client-ip=2607:f8b0:4864:20::1335; helo=mail-dy1-x1335.google.com;\n envelope-from=dianders@chromium.org; receiver=lists.ozlabs.org)"
        ],
        "Received": [
            "from lists.ozlabs.org (lists.ozlabs.org\n [IPv6:2404:9400:21b9:f100::1])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fn0YN55yxz1yD3\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 03 Apr 2026 11:52:08 +1100 (AEDT)",
            "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4fn0YN46w1z2yfS;\n\tFri, 03 Apr 2026 11:52:08 +1100 (AEDT)",
            "from mail-dy1-x1335.google.com (mail-dy1-x1335.google.com\n [IPv6:2607:f8b0:4864:20::1335])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 4fn0YM21bJz2xQD\n\tfor <linuxppc-dev@lists.ozlabs.org>; Fri, 03 Apr 2026 11:52:07 +1100 (AEDT)",
            "by mail-dy1-x1335.google.com with SMTP id\n 5a478bee46e88-2c7e5f38b37so2036281eec.0\n        for <linuxppc-dev@lists.ozlabs.org>;\n Thu, 02 Apr 2026 17:52:07 -0700 (PDT)",
            "from dianders.sjc.corp.google.com\n ([2a00:79e0:2e7c:8:5db3:7542:a530:f43a])\n        by smtp.gmail.com with ESMTPSA id\n 5a478bee46e88-2ca78df3b84sm3630074eec.5.2026.04.02.17.52.02\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Thu, 02 Apr 2026 17:52:04 -0700 (PDT)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1775177528;\n\tcv=none;\n b=DByvDcZns7l8pB7VyoR5RvODkEI8aWnl8b2EXlG2i2nYpbO+/HFtuCqF4+GGjyRt+spXyskTtBIz29PkU9uYy+mEoQ+8JNMVCleWedBwbY0YzkeTPOWYN4gumXJv74DfjLqWw0Xc8lT0mEyoN9D7B16jWVuB7IjAVSTdIX2V6TRmSMwFcq6HqnjVZU1Ujn67z9URABd4EtV0p9rK/fJ+dET/A13ak+uau15UiIAAvpjLGe20oVuqrkXjU0gYPiD1JYmPyNTsPqu5NfIMaijObBtxWHk7eh+si3OQ7PNTyP1JmRm9H3sUCS+ceHRjmeDnjFsgShmGsIvdO3B4wkXVGQ==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1775177528; c=relaxed/relaxed;\n\tbh=VEt3hSd9EKLTT0Wo55fxgtHBJYKHT3uVPRy+V8bzYNY=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=EkPZGWkq9CB/sg0tJIU85J+AJnL3WD+JLY6M7ujVNznqq7S2JYQH4U4u7s+vTqghOj1uDaQfciN1jKEyrofDr2pvfwvZ3IxPZjEgOwLKw5l2TBl9aIEjNYC9WaNuZFHkRlIpg2Dn+92EEmcYvkcShqRgoyPE09X7TuMTMMwTRYGYf/KZD8DGCMJuo5+uiL0VFLC0YqPztZXOqPvfXwTMbk/espo4bRAERe36o0Kon4f9wm/uMqIU8loaXZkMAKBQciShp9SJV6sK0nG6gzrLAyXm/NhuefdgksLkZsr2aVKKSxjCH7+nB36zJ3GXOTbSW3E5OBMRoz570LqYj2Okog==",
        "ARC-Authentication-Results": "i=1; lists.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=chromium.org;\n dkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256\n header.s=google header.b=iR2WHh9H; dkim-atps=neutral;\n spf=pass (client-ip=2607:f8b0:4864:20::1335; helo=mail-dy1-x1335.google.com;\n envelope-from=dianders@chromium.org;\n receiver=lists.ozlabs.org) smtp.mailfrom=chromium.org",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=chromium.org; s=google; t=1775177525; x=1775782325;\n darn=lists.ozlabs.org;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=VEt3hSd9EKLTT0Wo55fxgtHBJYKHT3uVPRy+V8bzYNY=;\n        b=iR2WHh9H5p8UyuAPwbUCG39jnoECapeh++khIrT+WqVvqyfwFLMhMbNjBOu7rhIfUw\n         3t64R2WUZtu3/J0lmtEy29rQUnc5dPQI40LztqJb8oKMf0cjZTCyH+GqSWxhVXGAvSpJ\n         aPPu0FPPQFvKx2klQAn1M8l13CP9fTC9N63Hw=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1775177525; x=1775782325;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n         :to:cc:subject:date:message-id:reply-to;\n        bh=VEt3hSd9EKLTT0Wo55fxgtHBJYKHT3uVPRy+V8bzYNY=;\n        b=KPdWc/lQVK+UyxYeJFtaJpF0yEi+3zRB1tYA9gP2rGyKTyMybXrZjQxtvgBQqe2Uyu\n         hhZhBQQb7YAIWNfnTlXNKnZOMYteWAcTBaWABFhVKwwnU4BdTHVlTic/PoFXEMM7pjvy\n         y8PTq5QCBaZ56r5R2UuFD9J8qrcYhHJlBlvpXMsnf79KTv95kcKQpdfhYPvJK5zOHYpe\n         +ojIz0ZpcBIocN2hyY1ocyVdsQmKOp5vd/71xww7o+EUnflQ4pWuxwq7jePeZLVK+M8Z\n         BN/9nlVKSN+2AlunvN7V4EcFIyee41z21Saw5ucgHq0Zx1INhb2eyYDQlQQik2erjncl\n         mYow==",
        "X-Forwarded-Encrypted": "i=1;\n AJvYcCXTVBSzx5BaBbQsKrYUEGC/Iv8XhFx3Elh8RJHJ4zPtbTuiKYYX0hOscityMMwtnF8WjAtxMpVUcgF6e/M=@lists.ozlabs.org",
        "X-Gm-Message-State": "AOJu0YwXa8I58aSRAWOOAHxQKn9rg/IRo27v4483akUMw9M1gEef/NCq\n\t4WaYl/VoVfh04NlyTxzhLeserJOM0VCL26vaT5iuiQ0FmsEzL/yy0e02fO4QNN9JzA==",
        "X-Gm-Gg": "ATEYQzwQa2sICQU7mZ5cJg2PoV51QYVrrzyB0RNYsV/HLQmj93nrx8/u63i5YdGeUBR\n\tUb1GGoRZN7ASAJrdiIXfNSzK25hi/VJRwvrvSiFbgGnrImNgaTf+rrDXFW3yejczCXHOq4XnAvY\n\tEfa3Go/loRP67HFL2LbcupribnEkf2C+ggmtR7Fl5WO/2XaMaaoTO9EceBDLlBLcvXQjsNZ24li\n\tB+XWohJh2Jp5KmcXrytFXgF65Dnsas4u67FR5zzrk2N2ia5wCVnoMea0UNozcQ4YfPqjsY1VV9Q\n\tjyBHLS5lqoMvdgE/QG4InjbQc+LPTw1EyrD91zCSjJ9QEoBrdG5cG51UJTHHqBj16jdTHs7dM5n\n\trLxDxHY9Nj57AH6WAxm0TgaM+VJ7RokAhsH7I6sJMarSyTkRwQhxnpg4B/Z6SaIHIOMpfJAHB1n\n\tAd80Sjg6p+KTg8dHVUO9HmUHv45mXTkmHekFw81kFlyiVCDlJ9PBOPWBqy6R1okEHcpykA7rfUw\n\tXlY+4kUtFY=",
        "X-Received": "by 2002:a05:7022:423:b0:119:e56b:91ec with SMTP id\n a92af1059eb24-12bfb75ee38mr560487c88.29.1775177525063;\n        Thu, 02 Apr 2026 17:52:05 -0700 (PDT)",
        "From": "Douglas Anderson <dianders@chromium.org>",
        "To": "Greg Kroah-Hartman <gregkh@linuxfoundation.org>,\n\t\"Rafael J . Wysocki\" <rafael@kernel.org>,\n\tDanilo Krummrich <dakr@kernel.org>,\n\tAlan Stern <stern@rowland.harvard.edu>",
        "Cc": "Robin Murphy <robin.murphy@arm.com>,\n\tLeon Romanovsky <leon@kernel.org>,\n\tPaul Burton <paul.burton@mips.com>,\n\tSaravana Kannan <saravanak@kernel.org>,\n\tAlexander Lobakin <aleksander.lobakin@intel.com>,\n\tEric Dumazet <edumazet@google.com>,\n\tToshi Kani <toshi.kani@hp.com>,\n\tChristoph Hellwig <hch@lst.de>,\n\tAlexey Kardashevskiy <aik@ozlabs.ru>,\n\tJohan Hovold <johan@kernel.org>,\n\tDouglas Anderson <dianders@chromium.org>,\n\tardb@kernel.org,\n\tbroonie@kernel.org,\n\tcatalin.marinas@arm.com,\n\tchleroy@kernel.org,\n\tdavid@kernel.org,\n\tdriver-core@lists.linux.dev,\n\tkees@kernel.org,\n\tkevin.brodsky@arm.com,\n\tlenb@kernel.org,\n\tlinux-acpi@vger.kernel.org,\n\tlinux-arm-kernel@lists.infradead.org,\n\tlinux-cxl@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tlinux-mm@kvack.org,\n\tlinuxppc-dev@lists.ozlabs.org,\n\tmaddy@linux.ibm.com,\n\tmaz@kernel.org,\n\tmiko.lenczewski@arm.com,\n\tmpe@ellerman.id.au,\n\tnpiggin@gmail.com,\n\tosalvador@suse.de,\n\toupton@kernel.org,\n\tpeterz@infradead.org,\n\ttglx@kernel.org,\n\twill@kernel.org,\n\tyangyicong@hisilicon.com,\n\tyeoreum.yun@arm.com",
        "Subject": "[PATCH v3 9/9] driver core: Replace dev->offline + ->offline_disabled\n with DEV_FLAGs",
        "Date": "Thu,  2 Apr 2026 17:49:55 -0700",
        "Message-ID": "\n <20260402174925.v3.9.I897d478b4a9361d79cd5073207c1062fd4d0d0e4@changeid>",
        "X-Mailer": "git-send-email 2.53.0.1213.gd9a14994de-goog",
        "In-Reply-To": "<20260403005005.30424-1-dianders@chromium.org>",
        "References": "<20260403005005.30424-1-dianders@chromium.org>",
        "X-Mailing-List": "linuxppc-dev@lists.ozlabs.org",
        "List-Id": "<linuxppc-dev.lists.ozlabs.org>",
        "List-Help": "<mailto:linuxppc-dev+help@lists.ozlabs.org>",
        "List-Owner": "<mailto:linuxppc-dev+owner@lists.ozlabs.org>",
        "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>",
        "List-Archive": "<https://lore.kernel.org/linuxppc-dev/>,\n  <https://lists.ozlabs.org/pipermail/linuxppc-dev/>",
        "List-Subscribe": "<mailto:linuxppc-dev+subscribe@lists.ozlabs.org>,\n  <mailto:linuxppc-dev+subscribe-digest@lists.ozlabs.org>,\n  <mailto:linuxppc-dev+subscribe-nomail@lists.ozlabs.org>",
        "List-Unsubscribe": "<mailto:linuxppc-dev+unsubscribe@lists.ozlabs.org>",
        "Precedence": "list",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Spam-Status": "No, score=-0.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED,\n\tDKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,\n\tSPF_HELO_NONE,SPF_PASS autolearn=disabled version=4.0.1 OzLabs 8",
        "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on lists.ozlabs.org"
    },
    "content": "In C, bitfields are not necessarily safe to modify from multiple\nthreads without locking. Switch \"offline\" and \"offline_disabled\" over\nto the \"flags\" field so modifications are safe.\n\nCc: Rafael J. Wysocki <rafael@kernel.org>\nCc: Toshi Kani <toshi.kani@hp.com>\nSigned-off-by: Douglas Anderson <dianders@chromium.org>\n---\nNot fixing any known bugs; problem is theoretical and found by code\ninspection. Change is done somewhat manually and only lightly tested\n(mostly compile-time tested).\n\nChanges in v3:\n- New\n\n arch/arm64/kernel/cpufeature.c                |  2 +-\n .../platforms/pseries/hotplug-memory.c        |  4 ++--\n drivers/acpi/scan.c                           |  3 ++-\n drivers/base/core.c                           | 19 ++++++++++---------\n drivers/base/cpu.c                            |  4 ++--\n drivers/base/memory.c                         |  2 +-\n include/linux/device.h                        |  9 ++++-----\n kernel/cpu.c                                  |  4 ++--\n 8 files changed, 24 insertions(+), 23 deletions(-)",
    "diff": "diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c\nindex 32c2dbcc0c64..f6f7c35b7a93 100644\n--- a/arch/arm64/kernel/cpufeature.c\n+++ b/arch/arm64/kernel/cpufeature.c\n@@ -4042,7 +4042,7 @@ static int enable_mismatched_32bit_el0(unsigned int cpu)\n \t */\n \tlucky_winner = cpu_32bit ? cpu : cpumask_any_and(cpu_32bit_el0_mask,\n \t\t\t\t\t\t\t cpu_active_mask);\n-\tget_cpu_device(lucky_winner)->offline_disabled = true;\n+\tset_bit(DEV_FLAG_OFFLINE_DISABLED, &get_cpu_device(lucky_winner)->flags);\n \tsetup_elf_hwcaps(compat_elf_hwcaps);\n \telf_hwcap_fixup();\n \tpr_info(\"Asymmetric 32-bit EL0 support detected on CPU %u; CPU hot-unplug disabled on CPU %u\\n\",\ndiff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c\nindex b2f14db59034..d9a0a75ada46 100644\n--- a/arch/powerpc/platforms/pseries/hotplug-memory.c\n+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c\n@@ -213,9 +213,9 @@ static int dlpar_change_lmb_state(struct drmem_lmb *lmb, bool online)\n \t\treturn -EINVAL;\n \t}\n \n-\tif (online && mem_block->dev.offline)\n+\tif (online && test_bit(DEV_FLAG_OFFLINE, &mem_block->dev.flags))\n \t\trc = device_online(&mem_block->dev);\n-\telse if (!online && !mem_block->dev.offline)\n+\telse if (!online && !test_bit(DEV_FLAG_OFFLINE, &mem_block->dev.flags))\n \t\trc = device_offline(&mem_block->dev);\n \telse\n \t\trc = 0;\ndiff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c\nindex e8cdbdb46fdb..f2707b704468 100644\n--- a/drivers/acpi/scan.c\n+++ b/drivers/acpi/scan.c\n@@ -122,7 +122,8 @@ bool acpi_scan_is_offline(struct acpi_device *adev, bool uevent)\n \tmutex_lock_nested(&adev->physical_node_lock, SINGLE_DEPTH_NESTING);\n \n \tlist_for_each_entry(pn, &adev->physical_node_list, node)\n-\t\tif (device_supports_offline(pn->dev) && !pn->dev->offline) {\n+\t\tif (device_supports_offline(pn->dev) &&\n+\t\t    !test_bit(DEV_FLAG_OFFLINE, &pn->dev->flags)) {\n \t\t\tif (uevent)\n \t\t\t\tkobject_uevent_env(&pn->dev->kobj, KOBJ_CHANGE, envp);\n \ndiff --git a/drivers/base/core.c b/drivers/base/core.c\nindex a87bd40499b6..63d724ece384 100644\n--- a/drivers/base/core.c\n+++ b/drivers/base/core.c\n@@ -2789,7 +2789,7 @@ static ssize_t online_show(struct device *dev, struct device_attribute *attr,\n \tbool val;\n \n \tdevice_lock(dev);\n-\tval = !dev->offline;\n+\tval = !test_bit(DEV_FLAG_OFFLINE, &dev->flags);\n \tdevice_unlock(dev);\n \treturn sysfs_emit(buf, \"%u\\n\", val);\n }\n@@ -2914,7 +2914,7 @@ static int device_add_attrs(struct device *dev)\n \tif (error)\n \t\tgoto err_remove_type_groups;\n \n-\tif (device_supports_offline(dev) && !dev->offline_disabled) {\n+\tif (device_supports_offline(dev) && !test_bit(DEV_FLAG_OFFLINE_DISABLED, &dev->flags)) {\n \t\terror = device_create_file(dev, &dev_attr_online);\n \t\tif (error)\n \t\t\tgoto err_remove_dev_groups;\n@@ -4179,7 +4179,8 @@ static int device_check_offline(struct device *dev, void *not_used)\n \tif (ret)\n \t\treturn ret;\n \n-\treturn device_supports_offline(dev) && !dev->offline ? -EBUSY : 0;\n+\treturn device_supports_offline(dev) &&\n+\t       !test_bit(DEV_FLAG_OFFLINE, &dev->flags) ? -EBUSY : 0;\n }\n \n /**\n@@ -4197,7 +4198,7 @@ int device_offline(struct device *dev)\n {\n \tint ret;\n \n-\tif (dev->offline_disabled)\n+\tif (test_bit(DEV_FLAG_OFFLINE_DISABLED, &dev->flags))\n \t\treturn -EPERM;\n \n \tret = device_for_each_child(dev, NULL, device_check_offline);\n@@ -4206,13 +4207,13 @@ int device_offline(struct device *dev)\n \n \tdevice_lock(dev);\n \tif (device_supports_offline(dev)) {\n-\t\tif (dev->offline) {\n+\t\tif (test_bit(DEV_FLAG_OFFLINE, &dev->flags)) {\n \t\t\tret = 1;\n \t\t} else {\n \t\t\tret = dev->bus->offline(dev);\n \t\t\tif (!ret) {\n \t\t\t\tkobject_uevent(&dev->kobj, KOBJ_OFFLINE);\n-\t\t\t\tdev->offline = true;\n+\t\t\t\tset_bit(DEV_FLAG_OFFLINE, &dev->flags);\n \t\t\t}\n \t\t}\n \t}\n@@ -4237,11 +4238,11 @@ int device_online(struct device *dev)\n \n \tdevice_lock(dev);\n \tif (device_supports_offline(dev)) {\n-\t\tif (dev->offline) {\n+\t\tif (test_bit(DEV_FLAG_OFFLINE, &dev->flags)) {\n \t\t\tret = dev->bus->online(dev);\n \t\t\tif (!ret) {\n \t\t\t\tkobject_uevent(&dev->kobj, KOBJ_ONLINE);\n-\t\t\t\tdev->offline = false;\n+\t\t\t\tclear_bit(DEV_FLAG_OFFLINE, &dev->flags);\n \t\t\t}\n \t\t} else {\n \t\t\tret = 1;\n@@ -4715,7 +4716,7 @@ static int device_attrs_change_owner(struct device *dev, kuid_t kuid,\n \tif (error)\n \t\treturn error;\n \n-\tif (device_supports_offline(dev) && !dev->offline_disabled) {\n+\tif (device_supports_offline(dev) && !test_bit(DEV_FLAG_OFFLINE_DISABLED, &dev->flags)) {\n \t\t/* Change online device attributes of @dev to @kuid/@kgid. */\n \t\terror = sysfs_file_change_owner(kobj, dev_attr_online.attr.name,\n \t\t\t\t\t\tkuid, kgid);\ndiff --git a/drivers/base/cpu.c b/drivers/base/cpu.c\nindex 875abdc9942e..e4e6a399def4 100644\n--- a/drivers/base/cpu.c\n+++ b/drivers/base/cpu.c\n@@ -422,8 +422,8 @@ int register_cpu(struct cpu *cpu, int num)\n \tcpu->dev.id = num;\n \tcpu->dev.bus = &cpu_subsys;\n \tcpu->dev.release = cpu_device_release;\n-\tcpu->dev.offline_disabled = !cpu->hotpluggable;\n-\tcpu->dev.offline = !cpu_online(num);\n+\tassign_bit(DEV_FLAG_OFFLINE_DISABLED, &cpu->dev.flags, !cpu->hotpluggable);\n+\tassign_bit(DEV_FLAG_OFFLINE, &cpu->dev.flags, !cpu_online(num));\n \tcpu->dev.of_node = of_get_cpu_node(num, NULL);\n \tcpu->dev.groups = common_cpu_attr_groups;\n \tif (cpu->hotpluggable)\ndiff --git a/drivers/base/memory.c b/drivers/base/memory.c\nindex a3091924918b..7f42727dde81 100644\n--- a/drivers/base/memory.c\n+++ b/drivers/base/memory.c\n@@ -697,7 +697,7 @@ static int __add_memory_block(struct memory_block *memory)\n \tmemory->dev.id = memory->start_section_nr / sections_per_block;\n \tmemory->dev.release = memory_block_release;\n \tmemory->dev.groups = memory_memblk_attr_groups;\n-\tmemory->dev.offline = memory->state == MEM_OFFLINE;\n+\tassign_bit(DEV_FLAG_OFFLINE, &memory->dev.flags, memory->state == MEM_OFFLINE);\n \n \tret = device_register(&memory->dev);\n \tif (ret) {\ndiff --git a/include/linux/device.h b/include/linux/device.h\nindex f6ca067bacca..fd53aa04cad9 100644\n--- a/include/linux/device.h\n+++ b/include/linux/device.h\n@@ -484,6 +484,8 @@ struct device_physical_location {\n  *\t\tarchitecture supports non-coherent devices.\n  * @DEV_FLAG_OF_NODE_REUSED: Set if the device-tree node is shared with an\n  *\t\tancestor device.\n+ * @DEV_FLAG_OFFLINE_DISABLED: If set, the device is permanently online.\n+ * @DEV_FLAG_OFFLINE: Set after successful invocation of bus type's .offline().\n  */\n enum struct_device_flags {\n \tDEV_FLAG_READY_TO_PROBE,\n@@ -494,6 +496,8 @@ enum struct_device_flags {\n \tDEV_FLAG_STATE_SYNCED,\n \tDEV_FLAG_DMA_COHERENT,\n \tDEV_FLAG_OF_NODE_REUSED,\n+\tDEV_FLAG_OFFLINE_DISABLED,\n+\tDEV_FLAG_OFFLINE,\n };\n \n /**\n@@ -571,8 +575,6 @@ enum struct_device_flags {\n  *              should be set by the subsystem / bus driver that discovered\n  *              the device.\n  *\n- * @offline_disabled: If set, the device is permanently online.\n- * @offline:\tSet after successful invocation of bus type's .offline().\n  * @flags:\tDEV_FLAG_XXX flags. Use atomic bitfield operations to modify.\n  *\n  * At the lowest level, every device in a Linux system is represented by an\n@@ -677,9 +679,6 @@ struct device {\n \n \tenum device_removable\tremovable;\n \n-\tbool\t\t\toffline_disabled:1;\n-\tbool\t\t\toffline:1;\n-\n \tunsigned long\t\tflags;\n };\n \ndiff --git a/kernel/cpu.c b/kernel/cpu.c\nindex bc4f7a9ba64e..15a873ad8025 100644\n--- a/kernel/cpu.c\n+++ b/kernel/cpu.c\n@@ -2639,7 +2639,7 @@ static void cpuhp_offline_cpu_device(unsigned int cpu)\n {\n \tstruct device *dev = get_cpu_device(cpu);\n \n-\tdev->offline = true;\n+\tset_bit(DEV_FLAG_OFFLINE, &dev->flags);\n \t/* Tell user space about the state change */\n \tkobject_uevent(&dev->kobj, KOBJ_OFFLINE);\n }\n@@ -2648,7 +2648,7 @@ static void cpuhp_online_cpu_device(unsigned int cpu)\n {\n \tstruct device *dev = get_cpu_device(cpu);\n \n-\tdev->offline = false;\n+\tclear_bit(DEV_FLAG_OFFLINE, &dev->flags);\n \t/* Tell user space about the state change */\n \tkobject_uevent(&dev->kobj, KOBJ_ONLINE);\n }\n",
    "prefixes": [
        "v3",
        "9/9"
    ]
}