Re: [PATCH v2 30/31] coco/tdx-host: Implement IDE stream setup/teardown
From: Ackerley Tng
Date: Mon Jul 06 2026 - 16:05:47 EST
Xu Yilun <yilun.xu@xxxxxxxxxxxxxxx> writes:
>
> [...snip...]
>
> static int tdx_tsm_link_connect(struct pci_dev *pdev)
> {
> struct tdx_tsm_link *tlink = to_tdx_tsm_link(pdev->tsm);
> @@ -362,7 +579,15 @@ static int tdx_tsm_link_connect(struct pci_dev *pdev)
> return PTR_ERR(tlink_spdm);
> }
>
> + struct tdx_tsm_link *tlink_ide __free(tdx_ide_stream_teardown) =
> + tdx_ide_stream_setup(tlink);
> + if (IS_ERR(tlink_ide)) {
> + pci_err(pdev, "fail to setup ide stream\n");
> + return PTR_ERR(tlink_ide);
> + }
> +
> retain_and_null_ptr(tlink_spdm);
> + retain_and_null_ptr(tlink_ide);
>
> return 0;
> }
Would it be possible to define .connect = tdx_tsm_link_connect in the
patch that sets up spdm, and then update tdx_tsm_link_connect in this
patch?
I think it would help in showing how the spdm is associated with
tdx_tsm_link_ops.
Would it also be possible to bring the definition of .probe in
tdx_tsm_link_ops till after this patch too?
> @@ -371,6 +596,7 @@ static void tdx_tsm_link_disconnect(struct pci_dev *pdev)
> {
> struct tdx_tsm_link *tlink = to_tdx_tsm_link(pdev->tsm);
>
> + tdx_ide_stream_teardown(tlink);
> tdx_spdm_session_teardown(tlink);
> }
>
> --
> 2.25.1