The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Guangshuo Li <lgs201920130244@gmail.com>,
	"David E. Box" <david.e.box@linux.intel.com>
Cc: "Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] platform/x86/intel/vsec: reset state before re-enumerating
Date: Wed, 8 Jul 2026 11:33:07 +0200	[thread overview]
Message-ID: <ak4ZUw92pn_F7Z4u@wunner.de> (raw)
In-Reply-To: <20260708032647.712412-1-lgs201920130244@gmail.com>

On Wed, Jul 08, 2026 at 11:26:47AM +0800, Guangshuo Li wrote:
> +++ b/drivers/platform/x86/intel/vsec.c
> @@ -51,6 +51,13 @@ struct vsec_priv {
>  	unsigned long found_caps;
>  };
>  
> +static void intel_vsec_reset_state(struct vsec_priv *priv)
> +{
> +	memset(priv->suppliers, 0, sizeof(priv->suppliers));
> +	memset(priv->state, 0, sizeof(priv->state));
> +	priv->found_caps = 0;
> +}

Seems fragile to selectively zero only portions of struct vsec_priv.
If the struct is amended later on with additional fields, it's quite
possible that nobody thinks about zeroing them here.

It's probably more robust to zero the entire struct and re-populate
the info field.

I also don't think a separate function to reset the struct is necessary
as I don't expect additional callers down the road.  So I suggest
zeroing the struct inline in intel_vsec_pci_slot_reset().

@David Box:  I've asked off-list for reset recovery to be tested,
I'm hereby renewing that request.  See section "Software error injection"
in: Documentation/PCI/pcieaer-howto.rst

Thanks,

Lukas

  reply	other threads:[~2026-07-08  9:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08  3:26 [PATCH] platform/x86/intel/vsec: reset state before re-enumerating Guangshuo Li
2026-07-08  9:33 ` Lukas Wunner [this message]
2026-07-09 17:57   ` David Box

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=ak4ZUw92pn_F7Z4u@wunner.de \
    --to=lukas@wunner.de \
    --cc=david.e.box@linux.intel.com \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=lgs201920130244@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /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