From nobody Thu Apr 16 09:02:38 2026 Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B558F430BA3 for ; Sun, 1 Mar 2026 01:22:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772328175; cv=none; b=BpgKDovhT5MgX5MXHfv0QLPl/VJTGLhK/B//6/spK+vNPo+hh6o0EiZxhEzD2IkC293qIhn2QIwKnExoghTN2xOXAbKkbyazoiavjlPMysfASrtWZfr7DDuUQxFI1R8d+6esnJqkD6WYW1s/L5Bq26P93gQxISwzyNKLbpL2RdQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772328175; c=relaxed/simple; bh=5VQs+T8f7khh8eOV4deOnguWCwT6pfmhUkB6VESq+Uc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ADgZzlArzpQg0HDOMKVZ9I6S2JLdL+jJZwn5lP4KK4B2blXotgpApcWhCtTbVVx9cI22dS7t93yC+WtF1PH31pHHJ4M9qLjEs1Yj9TD3Gok+qdUKtvkCZFp5GdmnNtMAknra4R+1nXqsDJYMVW781I9m7vY+eZkWZabrP7Z3uMA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lPdOMzwX; arc=none smtp.client-ip=209.85.222.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lPdOMzwX" Received: by mail-qk1-f182.google.com with SMTP id af79cd13be357-8cb40277a8bso350186985a.1 for ; Sat, 28 Feb 2026 17:22:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772328172; x=1772932972; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=QeI8Yu4HVZ542Nhlzz+UATCil4zR4DMccKGQpRBKyFs=; b=lPdOMzwXrCLDOG7G25CzxvrH/wNPGxFnzZN9+mfm9TLsbbXo5pnGvnWbvTPQn618lL vNxHT5ls3rh6bJLY6CISp+EBv+XDDY/L0Hf4Nf8djpbegtjFcp4nUM2uhPxfNgOz0SD2 7UNzln40Sx7BfrrZPjsLimJVvIS3r/75PF9iKe/9FTYxaognIPObk50JlqAzOC6NVfxI ZpQFWe7gFoUKMdb0N4GgcGQC07gXEm8qdPRpHSSH4+VNpY6D0/oxH9e7fx3wJpDYa4HA +3NZt8N27mW2FSROpjaCt6nHuiuiifC56SAs2vsMPCOKyLwJicLMjZkbyYSIVZWGZml5 CX7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772328172; x=1772932972; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=QeI8Yu4HVZ542Nhlzz+UATCil4zR4DMccKGQpRBKyFs=; b=Vfon6Ybg1+MFLTrOV6WEF3G4e6izN5f29LBgzVyLkv6gNSj+w7pqHea/b2j1g7Tlqg VYSuF1fI5qgDsSi9YazIF4+2aVKuOLvnmZ9ogX2LgWAPhFWEyZkT6chZ5x1bwaMSIu9w dXfn63AwoOIsQKD/BkqrNosWYRTEjrKQdvUcF4j+x6fUlKeLcl4mOAnWIu/qYK8BYIMt VKz+yBqkDW6BWuk821JySxht0FXqOYfHxDKYCsl90uoVu4qjdUStCYWh6A3FoqTwJ+14 e2k3Ibx0Wr51T1rQjVSYTQ4j0iR6+oVdN42eH7FCU18WDE3wP5PHEqaKipAPYjOXbexJ 4l3Q== X-Forwarded-Encrypted: i=1; AJvYcCUNI/rPWgfbNvzVg8OSK5BzoZuxc0IfxpaP+N8kAQ4oIzNcLdWt2/kPzNaQgC/J+QqZP4f+v5q0C6JtUgc=@vger.kernel.org X-Gm-Message-State: AOJu0YzgxDz9xYyMVoTw4PK/kgmEYUZ18zzd8dG3Pj+CiTLgC5nkSecK Zzu9CsS6hcdIDbweeht6fHnMSJ/nQxbt3BuuR71oJsZIsWrQOKP18BrR X-Gm-Gg: ATEYQzwvtnRm2dZztwDYRZPQHXWL19ZfVMx9LLRwC0Yv1aE9plxWcK2k4kphy4vppca NB/+2WsjzW8EvvHajq9wL8t8n/7kmLy0m6hS6rLo0eEzfD+uOEFiXfr/OguD7XTaWNt1N/X4or3 imAST+n0MovcAUJ0iF/vGPBZCEWIPmqyVsBGR1ktVNZLgwYqlKGT5unbhghi+xzSo7sKBcAu5E+ oLfoMlQs1zi7IbSPifxBDOPfj99oxvjcFnTw/nutkt68+gf6Yfc+l8HZ5eFjg1Tgfv+w+D7+O3T GNALtvdTLcQvaXxJ1zjl5TrIY4RfvTp2QW46Ecu0O8MMcxNi41y9DHq41kAm5PyZfPFimA2e29p Z/bltIyM1b1UM4mxoEbH4PVdhe+Is96du2qI2iv6yU2rR90EQ8V1HQrHPS/8IPeItdXNKlrfMSn QPcY0N7WKw69Wt+uHWNGZilkc+xPYbtS6O9JKsiCXiew== X-Received: by 2002:a05:620a:3711:b0:8b1:728f:952e with SMTP id af79cd13be357-8cbc8dedcdfmr924185985a.31.1772328171609; Sat, 28 Feb 2026 17:22:51 -0800 (PST) Received: from localhost.localdomain ([50.21.71.60]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8cbbf717301sm814409985a.36.2026.02.28.17.22.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 28 Feb 2026 17:22:51 -0800 (PST) From: Neel Bullywon To: rafael@kernel.org Cc: jic23@kernel.org, paul@crapouillou.net, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Neel Bullywon Subject: [PATCH] PM: runtime: add system sleep callbacks to EXPORT_*_RUNTIME_DEV_PM_OPS() Date: Sat, 28 Feb 2026 20:22:46 -0500 Message-ID: <20260301012246.66404-1-neelb2403@gmail.com> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" DEFINE_RUNTIME_DEV_PM_OPS() sets pm_runtime_force_suspend() and pm_runtime_force_resume() as system sleep callbacks via _DEFINE_DEV_PM_OPS(), but the exported variants (EXPORT_RUNTIME_DEV_PM_OPS, EXPORT_GPL_RUNTIME_DEV_PM_OPS, EXPORT_NS_RUNTIME_DEV_PM_OPS, EXPORT_NS_GPL_RUNTIME_DEV_PM_OPS) only set RUNTIME_PM_OPS() and omit SYSTEM_SLEEP_PM_OPS(). This means drivers using the export macros do not get system sleep support, contrary to what the documentation suggests. Add SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) to all four export variants to match the behavior of DEFINE_RUNTIME_DEV_PM_OPS(). All current users of these macros are IIO drivers (bme680, bmp280, kxsd9, mpl115, bmi088-accel) and none implement custom system sleep callbacks, so this change is safe for all existing callers. Suggested-by: Jonathan Cameron Suggested-by: Paul Cercueil Signed-off-by: Neel Bullywon --- include/linux/pm_runtime.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 41037c513f06..c6a6a0569b11 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h @@ -42,18 +42,26 @@ =20 #define EXPORT_RUNTIME_DEV_PM_OPS(name, suspend_fn, resume_fn, idle_fn) \ EXPORT_DEV_PM_OPS(name) =3D { \ + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, \ + pm_runtime_force_resume) \ RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ } #define EXPORT_GPL_RUNTIME_DEV_PM_OPS(name, suspend_fn, resume_fn, idle_fn= ) \ EXPORT_GPL_DEV_PM_OPS(name) =3D { \ + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, \ + pm_runtime_force_resume) \ RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ } #define EXPORT_NS_RUNTIME_DEV_PM_OPS(name, suspend_fn, resume_fn, idle_fn,= ns) \ EXPORT_NS_DEV_PM_OPS(name, ns) =3D { \ + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, \ + pm_runtime_force_resume) \ RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ } #define EXPORT_NS_GPL_RUNTIME_DEV_PM_OPS(name, suspend_fn, resume_fn, idle= _fn, ns) \ EXPORT_NS_GPL_DEV_PM_OPS(name, ns) =3D { \ + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, \ + pm_runtime_force_resume) \ RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ } =20 --=20 2.44.0