Re: [PATCH v4 07/24] coco/tdx-host: Implement firmware upload sysfs ABI for TDX Module updates

From: Xu Yilun

Date: Thu Feb 26 2026 - 22:50:58 EST


> v3:
> - clear "cancel_request" in the "prepare" phase [Binbin]
> - Don't fail the whole tdx-host device if seamldr_init() met an error
> [Yilun]

Sorry I didn't continue the discussion in that thread, but I meant to
just skip -EOPNOTSUPP, but not hide real problems.

Not sure if it makes sense to other people, if yes, some changes below:

...

> +static void seamldr_init(struct device *dev)
> +{
> + const struct tdx_sys_info *tdx_sysinfo = tdx_get_sysinfo();
> + int ret;
> +
> + if (WARN_ON_ONCE(!tdx_sysinfo))
> + return;
return -ENXIO;

> +
> + if (!tdx_supports_runtime_update(tdx_sysinfo)) {
> + pr_info("Current TDX Module cannot be updated. Consider BIOS updates\n");
> + return;
return -EOPNOTSUPP;

> + }
> +
> + tdx_fwl = firmware_upload_register(THIS_MODULE, dev, "tdx_module",
> + &tdx_fw_ops, NULL);
> + ret = PTR_ERR_OR_ZERO(tdx_fwl);
> + if (ret)
> + pr_err("failed to register module uploader %d\n", ret);

return ret;
> +}

...

> +
> +static int tdx_host_probe(struct faux_device *fdev)
> +{
> + /*
> + * P-SEAMLDR capabilities are optional. Don't fail the entire
> + * device probe if initialization fails.

I think no need the comments, all features are optional unless
explicitly required. So only exceptions need comments. Instead the code
may explain better.

> + */
> + seamldr_init(&fdev->dev);

ret = seamldr_init(&fdev->dev);
if (ret && ret != -EOPNOTSUPP)
return ret;

I imagine TDX Connect could follow the same pattern right below.

> +
> + return 0;
> +}