From: Jarkko Sakkinen <jarkko@kernel.org>
To: Zhouyi Zhou <zhouzhouyi@gmail.com>
Cc: peterhuewe@gmx.de, lance@osuosl.org, rcu@vger.kernel.org,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
"Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
"Ritesh Harjani (IBM)" <ritesh.list@gmail.com>,
Shrikanth Hegde <sshegde@linux.ibm.com>,
Jason Gunthorpe <jgg@ziepe.ca>,
linuxppc-dev@lists.ozlabs.org, linux-integrity@vger.kernel.org,
Li Jun <lijun01@kylinos.cn>
Subject: Re: [PATCH] tpm: ibmvtpm: Fix unused suspend callback with CONFIG_PM_SLEEP=n
Date: Fri, 27 Nov 2026 06:42:17 +0200 [thread overview]
Message-ID: <awkKKfv4ZrVYy0Ky@kernel.org> (raw)
In-Reply-To: <20261127010124.848125-1-zhouzhouyi@gmail.com>
On Fri, Nov 27, 2026 at 01:01:24AM +0000, Zhouyi Zhou wrote:
> Discovered in the Open Source Lab of Oregon State University when running
> RCU torture.sh on a ppc64le VM.
>
> With CONFIG_TCG_IBMVTPM=y and CONFIG_PM_SLEEP disabled, SIMPLE_DEV_PM_OPS()
> omits the references to the system sleep callbacks. This leaves
> tpm_ibmvtpm_suspend() unused and produces the following warning:
>
> warning: 'tpm_ibmvtpm_suspend' defined but not used [-Wunused-function]
>
> Use DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() so that the compiler
> sees the callback references and can discard the unused PM code when
> system sleep is disabled. Preserve tpm_ibmvtpm_resume(), which is also
> called directly from tpm_ibmvtpm_send().
>
> Tested on PPC VM of the Open Source Lab
> of Oregon State University.
>
> Fixes: fc0ddb3174b0 ("char: tpm: Use SIMPLE_DEV_PM_OPS for ibmvtpm power management")
>
nit: should not have empty line here.
> Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
> ---
> drivers/char/tpm/tpm_ibmvtpm.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c
> index 51c7e2add3d2..9840d0ebe6a3 100644
> --- a/drivers/char/tpm/tpm_ibmvtpm.c
> +++ b/drivers/char/tpm/tpm_ibmvtpm.c
> @@ -462,7 +462,8 @@ static const struct tpm_class_ops tpm_ibmvtpm = {
> .req_canceled = tpm_ibmvtpm_req_canceled,
> };
>
> -static SIMPLE_DEV_PM_OPS(tpm_ibmvtpm_pm_ops, tpm_ibmvtpm_suspend, tpm_ibmvtpm_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(tpm_ibmvtpm_pm_ops,
> + tpm_ibmvtpm_suspend, tpm_ibmvtpm_resume);
I'd keep these in same line.
>
> /**
> * ibmvtpm_crq_get_next - Get next responded crq
> @@ -714,7 +715,7 @@ static struct vio_driver ibmvtpm_driver = {
> .remove = tpm_ibmvtpm_remove,
> .get_desired_dma = tpm_ibmvtpm_get_desired_dma,
> .name = tpm_ibmvtpm_driver_name,
> - .pm = &tpm_ibmvtpm_pm_ops,
> + .pm = pm_sleep_ptr(&tpm_ibmvtpm_pm_ops),
> };
>
> /**
>
> base-commit: 5f22fb20497f4983094131f00a734362300d22d2
Otherwise, it's good.
Br, Jarkko
next prev parent reply other threads:[~2026-11-27 4:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 1:01 [PATCH] tpm: ibmvtpm: Fix unused suspend callback with CONFIG_PM_SLEEP=n Zhouyi Zhou
2026-11-27 4:42 ` Jarkko Sakkinen [this message]
2026-11-27 4:54 ` Zhouyi Zhou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=awkKKfv4ZrVYy0Ky@kernel.org \
--to=jarkko@kernel.org \
--cc=chleroy@kernel.org \
--cc=jgg@ziepe.ca \
--cc=lance@osuosl.org \
--cc=lijun01@kylinos.cn \
--cc=linux-integrity@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=peterhuewe@gmx.de \
--cc=rcu@vger.kernel.org \
--cc=ritesh.list@gmail.com \
--cc=sshegde@linux.ibm.com \
--cc=zhouzhouyi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.