mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Winiarska, Iwona" <iwona.winiarska@intel.com>
To: "runyu.xiao@seu.edu.cn" <runyu.xiao@seu.edu.cn>,
	"andrew@codeconstruct.com.au" <andrew@codeconstruct.com.au>
Cc: "avifishman70@gmail.com" <avifishman70@gmail.com>,
	"jianhao.xu@seu.edu.cn" <jianhao.xu@seu.edu.cn>,
	"benjaminfair@google.com" <benjaminfair@google.com>,
	"tmaimon77@gmail.com" <tmaimon77@gmail.com>,
	"yuenn@google.com" <yuenn@google.com>,
	"venture@google.com" <venture@google.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"tali.perry1@gmail.com" <tali.perry1@gmail.com>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"openbmc@lists.ozlabs.org" <openbmc@lists.ozlabs.org>
Subject: Re: [PATCH] peci: npcm: Initialize state before requesting IRQ
Date: Thu, 17 Sep 2026 20:54:26 +0000	[thread overview]
Message-ID: <58aebcfcaba4c18bdfb34d47e3cd11d7250a7436.camel@intel.com> (raw)
In-Reply-To: <20260902152256.3591658-1-runyu.xiao@seu.edu.cn>

On Wed, 2026-09-02 at 23:22 +0800, Runyu Xiao wrote:
> The PECI interrupt handler uses the lock and completion object as soon as
> the interrupt is delivered. Initialize both before registering the
> handler so an early interrupt cannot access uninitialized state.
> 
> Fixes: 3e16184a1bd8 ("peci: Add peci-npcm controller driver")
> Cc: stable@vger.kernel.org
> Assisted-by: Codex:GPT-5
> Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>

Reviewed-by: Iwona Winiarska <iwona.winiarska@intel.com>

Thanks
-Iwona

> ---
>  drivers/peci/controller/peci-npcm.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/peci/controller/peci-npcm.c
> b/drivers/peci/controller/peci-npcm.c
> index 931868991..3cc4e959a 100644
> --- a/drivers/peci/controller/peci-npcm.c
> +++ b/drivers/peci/controller/peci-npcm.c
> @@ -253,14 +253,14 @@ static int npcm_peci_probe(struct platform_device *pdev)
>  	if (priv->irq < 0)
>  		return priv->irq;
>  
> +	init_completion(&priv->xfer_complete);
> +	spin_lock_init(&priv->lock);
> +
>  	ret = devm_request_irq(&pdev->dev, priv->irq, npcm_peci_irq_handler,
>  			       0, "peci-npcm-irq", priv);
>  	if (ret)
>  		return ret;
>  
> -	init_completion(&priv->xfer_complete);
> -	spin_lock_init(&priv->lock);
> -
>  	ret = npcm_peci_init_ctrl(priv);
>  	if (ret)
>  		return ret;

      reply	other threads:[~2026-09-17 20:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02 15:22 Runyu Xiao
2026-09-17 20:54 ` Winiarska, Iwona [this message]

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=58aebcfcaba4c18bdfb34d47e3cd11d7250a7436.camel@intel.com \
    --to=iwona.winiarska@intel.com \
    --cc=andrew@codeconstruct.com.au \
    --cc=avifishman70@gmail.com \
    --cc=benjaminfair@google.com \
    --cc=jianhao.xu@seu.edu.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openbmc@lists.ozlabs.org \
    --cc=runyu.xiao@seu.edu.cn \
    --cc=stable@vger.kernel.org \
    --cc=tali.perry1@gmail.com \
    --cc=tmaimon77@gmail.com \
    --cc=venture@google.com \
    --cc=yuenn@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®