Re: [RFC PATCH 5/7] coco/tdx-host: Configure an IDE stream
From: Chao Gao
Date: Mon Nov 30 2026 - 08:01:17 EST
On Sat, Nov 28, 2026 at 09:17:11PM +0800, Xu Yilun wrote:
>> + /* Configure IDE capability for RP & get stream_id */
>> + ret = tdx_ide_stream_create(tlink, ide);
>> + if (ret)
>> + goto out_pci_ide_stream_free;
>> +
>> + ide->stream_id = tlink->stream_id;
>
>Nits:
>
>Maybe we don't save stream_id in tlink, it can later be accessed by
>tlink->ide->stream_id.
>
>And the function could be like:
>
> ret = tdx_ide_stream_create(tlink, ide, &stream_id);
>
>which aligns better with the comment "get stream_id".
Looks good to me. Caching the stream_id in tlink needs a justification,
and I don't see a good one.
As I said in [1], I plan to drop func_id as well, because it can be
derived from the pci_dev at runtime.
[1]: https://lore.kernel.org/all/awzkWJ3aM6buVQm1@xxxxxxxxx/