From nobody Fri Sep 25 17:45:14 2026 Received: from mail-ed2-f12.google.com (mail-ed2-f12.google.com [74.125.228.76]) (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 96DC834750D for ; Thu, 10 Sep 2026 02:46:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.228.76 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789008395; cv=none; b=XfNrwkGWMySPJF4rAn3JWgFxRYfpGk5gygsBgsn6NkbGQAkN+RtO+HDudwUAVF6OVkWf11Jf54K9uA1iAw1t+thbooQcGYLsGInxMnTifE3ocL6lVS0xBkb75z0ui8joI/EQuHI1wO7+sgTq1jMTzwIJdOs3Jm+BBJ/JxUMJCWg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789008395; c=relaxed/simple; bh=5plLy/akUgnW+2omHUcDOEnJjRaaas6WdXfuN0Z4nP0=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=soUZWqHBZfjjfWJGdONuOa9E33ZcIJOMJs3HnbWsWgo0JtAxmKgFmHQ03+o3dDXpmSXPV5QPllhl2KY9YrURQ+DN30gdt7i+MDLUEeafeacHHG3qvIU28zw8XWdlHTh94z1JxSe47PMXIxCq+HaPs9LMnAP5BC3PV97VMOLTWw0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=AP0t3lNC; arc=none smtp.client-ip=74.125.228.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="AP0t3lNC" Received: by mail-ed2-f12.google.com with SMTP id 4fb4d7f45d1cf-6a996c8adf3so2211691a12.1 for ; Wed, 09 Sep 2026 19:46:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1789008392; x=1789613192; darn=vger.kernel.org; h=user-agent:content-disposition:content-type:mime-version:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=RGo0BucmWwjHY/M/mqoExTi1Uj0ClHrt9derWN+gAl8=; b=AP0t3lNChJ+/TnMVFnpsWHoh37Pd8wHsacbBixmxZ+hcHJlwibN9+gtxWfDhAVHJcy dC+B9H8iuts2NYiy1/50EAjFtEbzjJhmS7mxDWpCiyEMqQ8c68jFmlS/8Rdz6J9S4gcZ L5BLXy6aRXEKoZDHwI7bT1zTXJXlUTYguRwoCaiyvK8TtW67AEVEg++T5oQ865Q/w9mG 44zM3oWjIomisQylcXZs42H2iXQyX2XLvxTWdYYmsT3L+qI2ON3rgERWr9TAAfzgi9Yl 92pfQOYxE0ceaujFzOR7+UEVRcpMtkEFKanZIuPFFMIGv54Hf0zq+9WEiqTVnGiWFMq5 4l5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789008392; x=1789613192; h=user-agent:content-disposition:content-type:mime-version:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=RGo0BucmWwjHY/M/mqoExTi1Uj0ClHrt9derWN+gAl8=; b=hmiPpgrsaLcYFz60/lhobc+kyeRhAA/xt/RSG/CK8xDVbl/2KHn/1q4GFolYaXMChY pXpgBzyw/oeOyhgAateTr8le7XepybFpF4LCU09yhQwq/9kvpyubrnDIkJMT21MUKuql xtEHhqG9jP0gUzbylsvq6eCTT3E8vSP3cWAf7VxOohLFM4GXeZOZqPLfTfA+dr8kythJ POEdQ0kkcqGXYCeVrbCGo8toaZxa8qw7rfezQDtcJjf5JyzNeGn/gGldNZI0s3/CWmU4 n+6v8YreK5yGt9eJCcpS9Eg2EpGpA6f2IwXx/Mq3U1QiwrJUaLpapTV/gyu2o+I2alFe yCiQ== X-Forwarded-Encrypted: i=1; AKwUvBzJNAC7af1YVL+lQVt2EC8Q3OJnKkvjXFV15MynD2sz8PUTtyAw2pujy24KtSwrbGx6pr69VzrAx25TMuw=@vger.kernel.org X-Gm-Message-State: AFuF++khyoZdECjM+wVkpHLXZomkHHUINoqHJY1G6FuHRzQ47xYFqWbM 2OeJ5tjLVAIhldCX9b6xAOxTGI5Kg/zrGPpwEyP0T2U1IM+yCil9l+jN2rlBWx32cbk= X-Gm-Gg: AYBFou2xkwhr6l5Xp6LPNk7AzRxvHPUG88u+SSWz9nwR/BkU+qRAkeXqW7Kr1rF6jjL o0RKSA+oIEIQpbiRnIehvDFEFkgGCyoXL5IgM2r1XxMIWgggDw20rEAWC+a1Ms8NmPeVhXc7/3d ufHtssV0tSoGzQN6sIwU8VCOPD7jLxnHmyMkfbSx6yWNX4KOGUqmK6CimAPYt6VmMhugcFhkSC7 limlumHNMVOUzh0XN8kgPiTp1bxkQ//PoVGqkjc1m/tOWckXEYxI6pAX/dzhlwTi3bBAXLuayeV DWPi1y30k+xV/4osPAdwnp2yCI9ekVApsLs5bxyKDKZiKXrmbBhTClboija/Scy/tuOXPAXWsCj keJ/z4+jMTNFvgibTQdcUqzzz5sHf77T/GoHVb8ZvC9xh/a0Tud0LBFQwMzGRs9cP4zPVPUmMEt OePGTNkWZTT1es4weoNgeLeWvsaD4yytxMN2JmUx56hobVJZ/rOsJ2urkcQlHAT07VVMbMCeygb nKUXTUQ9iS1yc+c27TYpxGQ0JZb X-Received: by 2002:a05:6402:c44:b0:6a8:3962:2b85 with SMTP id 4fb4d7f45d1cf-6a98df800c7mr7115034a12.3.1789008391853; Wed, 09 Sep 2026 19:46:31 -0700 (PDT) Received: from r1chard ([2401:e180:8d23:5f05:2c5b:a1bb:33f1:a712]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-39d770bc2e1sm2641321a91.1.2026.09.09.19.46.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 19:46:30 -0700 (PDT) Date: Thu, 10 Sep 2026 10:46:26 +0800 From: Richard Lyu To: jarkko@kernel.org Cc: fourier.thomas@gmail.com, jgg@ziepe.ca, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, peterhuewe@gmx.de, richard.lyu@suse.com Subject: [PATCH v2] tpm: Remove ineffective wmb() from tpm_pm_resume() Message-ID: <20260910024624.41195-1-richard.lyu@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email 2.51.0 User-Agent: Mutt/2.2.16 (2025-11-22) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The comment above the wmb() in tpm_pm_resume() states that the barrier guarantees TPM_CHIP_FLAG_SUSPENDED is written last, so that hwrng does not activate before the chip has been fully resumed. It cannot do so: it is placed after the store that clears the flag, and therefore does not order the preceding resume work before that store. It also has nothing to pair with, as tpm_try_get_ops() contains no matching read barrier. Drop the barrier along with the comment rather than leave a no-op behind. Should such ordering turn out to be needed, it would require paired barriers or locking. Link: https://lore.kernel.org/all/a62fc816-259a-4d28-a265-e425bc17ed50@gmai= l.com/ Signed-off-by: Richard Lyu --- v2: - Drop the Fixes tag: this is a cleanup, not a bug fix. - Link to v1: https://lore.kernel.org/all/aqIVn0cDBvIYKggE@r1chard/ --- drivers/char/tpm/tpm-interface.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interf= ace.c index b4e749e70b02..0bab78c8767c 100644 --- a/drivers/char/tpm/tpm-interface.c +++ b/drivers/char/tpm/tpm-interface.c @@ -497,12 +497,6 @@ int tpm_pm_resume(struct device *dev) =20 chip->flags &=3D ~TPM_CHIP_FLAG_SUSPENDED; =20 - /* - * Guarantee that SUSPENDED is written last, so that hwrng does not - * activate before the chip has been fully resumed. - */ - wmb(); - return 0; } EXPORT_SYMBOL_GPL(tpm_pm_resume); --=20 2.51.0