Re: [PATCH v4 04/10] PCI/TSM: Authenticate devices via platform TSM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Xu Yilun wrote:
[..]
> > +	for_each_pci_dev(pdev)
> > +		if (is_pci_tsm_pf0(pdev))
> > +			pf0_sysfs_enable(pdev);
> 
> Now the tsm attributes are exposed to user before ops->probe(), from
> user's POV, tsm link operation for this device is already ready ...
> 
> > +	return 0;
> > +}
> > +EXPORT_SYMBOL_GPL(pci_tsm_register);
> 
> [...]
> 
> > +struct pci_tsm_ops {
> > +	/*
> > +	 * struct pci_tsm_link_ops - Manage physical link and the TSM/DSM session
> > +	 * @probe: probe device for tsm link operation readiness, setup
> 
> So I think the probe callback is losing the meaning of readiness check.
> Users see the 'connect/disconnect', they write 'connect' and found
> errors no matter ->probe() fails or ->connect() fails.
> 
> Maybe just remove the responsibility of readiness check from ->probe(),
> I found it simplifies code when implementing tdx-tsm driver.

Oh true, that comment is now stale with this new organization as probe
is only about setting up any context to allow future operations. Any
"readiness" is determined in those follow-on operations, not probe.
Updated the comment to:

        /*
         * struct pci_tsm_link_ops - Manage physical link and the TSM/DSM session
         * @probe: allocate context (wrap 'struct pci_tsm') for follow-on link
         *         operations
         * @remove: destroy link operations context 




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux