From nobody Mon Feb 9 20:36:15 2026 Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) (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 4928237F72B for ; Fri, 30 Jan 2026 18:26:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769797617; cv=none; b=rmzS6UsVqOReWhMeeisu01LQlZqbnVxIFNOi5uAU2ONHtnHKadj9BGF16NOgEMLBgx2Rbl9gNsorZeulcZL7XZzWiqa/3wJc+uMSSxf51FO+6JsNMGCli1yWSBQbhZRDJBbghpp8P3PyuLGC5+k9ggaOndAY16JcGdBPBJtieNc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769797617; c=relaxed/simple; bh=h4Sr6SC+YUs8NqB2KBowcKk0rAehKNogc2lHKQ0E3wA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Repcq5tIGqTKJv0ymlPgjto4fggIADivzY/KxJYNKS+28zN++JKUKJZB0lp4MjgV7rJE0illmoUW5dclJ3wG8wu7rqdUXaReUTaAGpppE8Cv4SH0q3u/O8zjlKGk6O+RdFAfgUOGZA9IZC+J9iAU8wel2EqnExGGcavTDR/0OFA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=u.northwestern.edu; spf=pass smtp.mailfrom=u.northwestern.edu; dkim=pass (2048-bit key) header.d=u-northwestern-edu.20230601.gappssmtp.com header.i=@u-northwestern-edu.20230601.gappssmtp.com header.b=SUckfT6/; arc=none smtp.client-ip=209.85.167.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=u.northwestern.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=u.northwestern.edu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=u-northwestern-edu.20230601.gappssmtp.com header.i=@u-northwestern-edu.20230601.gappssmtp.com header.b="SUckfT6/" Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-45effa36240so1809121b6e.1 for ; Fri, 30 Jan 2026 10:26:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=u-northwestern-edu.20230601.gappssmtp.com; s=20230601; t=1769797614; x=1770402414; 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=QeoCaVUOs5r7HSAdULQW6Q0LapAIK45W0DvKg7zp3yg=; b=SUckfT6/aBoHY679tgoTBtf2kMemRbQLXx6d5F5cyQ28HmIZUrruLEoXVAoCHpJQuk Wnd1KB/4jyg24uMlnZNPROJ4YxPuHPVlH67PoQQU3aK4YqVHEOp2zFktQFK0LRRUBoGv RvQ0HQJjKTeISo40alVvNKMlsApyzf8os7wiMSYpgLYk3fhFyNfaRekpS3t726oyflJZ Mq2lpr4O35Jd+a93P03DucfYQgGGP15KkH5KwSRDddTx+ArzSBYTO+wHJkCSzaWyQl4W htmhh+K8IPAfBKconoH1xB9mH+mUwCgmvl7oxYcc/MMKcdrxP28dANAIffiFLq8yGC/k sXUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769797614; x=1770402414; 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=QeoCaVUOs5r7HSAdULQW6Q0LapAIK45W0DvKg7zp3yg=; b=wqzVhtMOmMjtn4tMQYmFa92pq2NmSqCw9HLfFPBBScmz4so6KClE6hTDAZtk8vcpVs ZuzjKVf1AmM9YUKR8H7XKuy3jyk9vG4YyKee7HoBr0OJz9eVzBkYYcjFMF1rJDmGt//w oZWBJyj0c8+IWYTR/gHU3lEljBc93aUneto+7i4LVX9W4NtixdrkQBDlxiSq97rp0oKu /ivlLEMBLSoWSvIbc8LEtU5qdzBuCQvYdthbxOjMy36IQ8aVgElDPamiFGeXXoNt48Us FgYv+cs/EtLAe3yLJm4rafxYabAbzP1TJj8reRHJ0wINAJD/Ud8mGyKiIZvnE5HD+6lS 4IPQ== X-Forwarded-Encrypted: i=1; AJvYcCVpsdqiSCvwQhqj+hCWe7KBI3cx/SLXGo6UU7I5u1NFsssfmHKGG/1PRS7wHzUAx+o/uHI0DCEifEY5BEk=@vger.kernel.org X-Gm-Message-State: AOJu0YxyjUJmDnsAAZ8iPgt1wp/UohnaZzx7nWUDoMcbeAUyViycoFxt s97L7tpFzz32QyEsCukE+osE5YmuiCVGk9tH5+/h414tB33a1ULEaByL5ZaQu6N/NT0= X-Gm-Gg: AZuq6aIMLW3dQlNDxcgAQuED4iGVgjiSffyAXDbwW215KCh5gcOBrThaxvaViZg7CeQ Tw51dmo9ZqZAQZydDfqM+voz5OGwrTNzWLfmkiYMp45fqQBOaskLf5IZcQnRBbswrKWMYyE1t61 7j9l6naU+HHmw9w794Op8DWgT2awx6HO70xsBVqMGN6s54Hja8Ka2+E1501F8dftKYNaStXBGQg 2TuQJ7/IP6x+YdpmEj407sOB/1ALTMP1IPwaFcch7/LBjnDBYfCHxrqQyRN2ICXwcHsvlu2sXOo 02G5QFr1IHoFD5pjd7Tf9KsaTfuUQfD3rlOra5NjKKkWKCez58flzO0luh+j/dM8DK67JIabF9y 4DSgzlEZuQKNWA5uRGefF6/699uA1OoyvauNasEl+GwZbrpRb3pMAPYt2UgAlF1KOMemx0mZVJ3 1YI1i2GGhQDQFQNCl0d49WqYDiEmeOoYjJIyJaVDjNS6KJ2d8BchFYQBYjlB6D65UBtL/R/OMS1 bc12IqAz2ATE8QnFUaDh2pd06YrgZwHia+H2WWzTA== X-Received: by 2002:a05:6808:320f:b0:45a:5584:b0fa with SMTP id 5614622812f47-45f34baae01mr2375078b6e.28.1769797613953; Fri, 30 Jan 2026 10:26:53 -0800 (PST) Received: from security.cs.northwestern.edu (security.cs.northwestern.edu. [165.124.184.136]) by smtp.gmail.com with ESMTPSA id 5614622812f47-45f37e0d283sm1561728b6e.13.2026.01.30.10.26.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jan 2026 10:26:53 -0800 (PST) From: Ziyi Guo To: Bartosz Golaszewski Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Ziyi Guo Subject: [PATCH] power: pwrseq: fix missing state_lock in pwrseq_power_on() error path Date: Fri, 30 Jan 2026 18:26:51 +0000 Message-Id: <20260130182651.1576579-1-n7l8m4@u.northwestern.edu> X-Mailer: git-send-email 2.34.1 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" pwrseq_power_on() calls pwrseq_unit_disable() when the post_enable callback fails. However, this call is outside the scoped_guard(mutex, &pwrseq->state_lock) block that ends. pwrseq_unit_disable() has lockdep_assert_held(&pwrseq->state_lock), which will fail when called from this error path. Add the scoped_guard block to cover the post_enable callback and its error handling to ensure the lock is held when pwrseq_unit_disable() is called. Signed-off-by: Ziyi Guo --- drivers/power/sequencing/core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/power/sequencing/core.c b/drivers/power/sequencing/cor= e.c index 190564e55988..1fcf0af7cc0b 100644 --- a/drivers/power/sequencing/core.c +++ b/drivers/power/sequencing/core.c @@ -914,8 +914,10 @@ int pwrseq_power_on(struct pwrseq_desc *desc) if (target->post_enable) { ret =3D target->post_enable(pwrseq); if (ret) { - pwrseq_unit_disable(pwrseq, unit); - desc->powered_on =3D false; + scoped_guard(mutex, &pwrseq->state_lock) { + pwrseq_unit_disable(pwrseq, unit); + desc->powered_on =3D false; + } } } =20 --=20 2.34.1