From: Hans de Goede <hdegoede@redhat.com>
To: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
markgross@kernel.org, ilpo.jarvinen@linux.intel.com,
andriy.shevchenko@linux.intel.com
Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/5] platform/x86/intel/tpmi: Don't create devices for disabled features
Date: Mon, 4 Dec 2023 15:03:53 +0100 [thread overview]
Message-ID: <38aedeab-f307-42a8-84d8-782c355f021f@redhat.com> (raw)
In-Reply-To: <20231130214751.3100418-2-srinivas.pandruvada@linux.intel.com>
Hi,
On 11/30/23 22:47, Srinivas Pandruvada wrote:
> If some TPMI features are disabled, don't create auxiliary devices. In
> this way feature drivers will not load.
>
> While creating auxiliary devices, call tpmi_read_feature_status() to
> check feature state and return if the feature is disabled without
> creating a device.
>
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
> ---
> v2
> - Add comment for returning -EOPNOTSUPP
>
> drivers/platform/x86/intel/tpmi.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/intel/tpmi.c b/drivers/platform/x86/intel/tpmi.c
> index c89aa4d14bea..868067ff966e 100644
> --- a/drivers/platform/x86/intel/tpmi.c
> +++ b/drivers/platform/x86/intel/tpmi.c
> @@ -604,9 +604,21 @@ static int tpmi_create_device(struct intel_tpmi_info *tpmi_info,
> struct intel_vsec_device *vsec_dev = tpmi_info->vsec_dev;
> char feature_id_name[TPMI_FEATURE_NAME_LEN];
> struct intel_vsec_device *feature_vsec_dev;
> + struct tpmi_feature_state feature_state;
> struct resource *res, *tmp;
> const char *name;
> - int i;
> + int i, ret;
> +
> + ret = tpmi_read_feature_status(tpmi_info, pfs->pfs_header.tpmi_id, &feature_state);
> + if (ret)
> + return ret;
> +
> + /*
> + * If not enabled, continue to look at other features in the PFS, so return -EOPNOTSUPP.
> + * This will not cause failure of loading of this driver.
> + */
> + if (!feature_state.enabled)
> + return -EOPNOTSUPP;
>
> name = intel_tpmi_name(pfs->pfs_header.tpmi_id);
> if (!name)
next prev parent reply other threads:[~2023-12-04 14:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-30 21:47 [PATCH v2 0/5] TPMI update for permissions Srinivas Pandruvada
2023-11-30 21:47 ` [PATCH v2 1/5] platform/x86/intel/tpmi: Don't create devices for disabled features Srinivas Pandruvada
2023-12-04 14:03 ` Hans de Goede [this message]
2023-12-04 14:14 ` Ilpo Järvinen
2023-11-30 21:47 ` [PATCH v2 2/5] platform/x86/intel/tpmi: Modify external interface to get read/write state Srinivas Pandruvada
2023-11-30 21:47 ` [PATCH v2 3/5] platform/x86/intel/tpmi: Move TPMI ID definition Srinivas Pandruvada
2023-11-30 21:47 ` [PATCH v2 4/5] platform/x86: ISST: Process read/write blocked feature status Srinivas Pandruvada
2023-12-04 14:06 ` Hans de Goede
2023-12-04 14:11 ` Ilpo Järvinen
2023-12-04 14:19 ` Hans de Goede
2023-11-30 21:47 ` [PATCH v2 5/5] platform/x86/intel-uncore-freq: " Srinivas Pandruvada
2023-11-30 23:24 ` [PATCH v2 0/5] TPMI update for permissions srinivas pandruvada
2023-12-04 14:06 ` Hans de Goede
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=38aedeab-f307-42a8-84d8-782c355f021f@redhat.com \
--to=hdegoede@redhat.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markgross@kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=srinivas.pandruvada@linux.intel.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®