[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6893cf4d5788d_55f0910022@dwillia2-xfh.jf.intel.com.notmuch>
Date: Wed, 6 Aug 2025 14:55:25 -0700
From: <dan.j.williams@...el.com>
To: Jonathan Cameron <Jonathan.Cameron@...wei.com>, Dan Williams
<dan.j.williams@...el.com>
CC: <linux-coco@...ts.linux.dev>, <linux-pci@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <bhelgaas@...gle.com>, <aik@....com>,
<lukas@...ner.de>
Subject: Re: [PATCH v4 09/10] PCI/TSM: Report active IDE streams
Jonathan Cameron wrote:
> On Thu, 17 Jul 2025 11:33:57 -0700
> Dan Williams <dan.j.williams@...el.com> wrote:
>
> > Given that the platform TSM owns IDE Stream ID allocation, report the
> > active streams via the TSM class device. Establish a symlink from the
> > class device to the PCI endpoint device consuming the stream, named by
> > the Stream ID.
> >
> > Signed-off-by: Dan Williams <dan.j.williams@...el.com>
> Trivial stuff only
> Reviewed-by: Jonathan Cameron <jonathan.cameron@...wei.com>
[..]
> > diff --git a/drivers/virt/coco/tsm-core.c b/drivers/virt/coco/tsm-core.c
> > index 093824dc68dd..b0ef9089e0f2 100644
> > --- a/drivers/virt/coco/tsm-core.c
> > +++ b/drivers/virt/coco/tsm-core.c
>
> > +/* must be invoked between tsm_register / tsm_unregister */
> > +int tsm_ide_stream_register(struct pci_ide *ide)
> > +{
> > + struct pci_dev *pdev = ide->pdev;
> > + struct pci_tsm *tsm = pdev->tsm;
> > + struct tsm_dev *tsm_dev = tsm->ops->owner;
> > + int rc;
> > +
> > + rc = sysfs_create_link(&tsm_dev->dev.kobj, &pdev->dev.kobj,
> > + ide->name);
>
> Fits on one line under 80 chars (just)
clang-format agrees.
> > + if (rc == 0)
> > + ide->tsm_dev = tsm_dev;
>
> I'd prefer
>
> if (rc)
> return rc;
>
> ide->tsm_dev = tsm_dev;
>
> return 0;
>
> but don't care that much.
Switched to that.
>
> > + return rc;
> > +}
> > +EXPORT_SYMBOL_GPL(tsm_ide_stream_register);
> > +
> > +void tsm_ide_stream_unregister(struct pci_ide *ide)
> > +{
> > + struct tsm_dev *tsm_dev = ide->tsm_dev;
> > +
> > + sysfs_remove_link(&tsm_dev->dev.kobj, ide->name);
> > + ide->tsm_dev = NULL;
> > +}
> > +EXPORT_SYMBOL_GPL(tsm_ide_stream_unregister);
>
> > diff --git a/include/linux/tsm.h b/include/linux/tsm.h
> > index ce95589a5d5b..4eba45a754ec 100644
> > --- a/include/linux/tsm.h
> > +++ b/include/linux/tsm.h
> > @@ -120,4 +120,8 @@ const char *tsm_name(const struct tsm_dev *tsm_dev);
> > struct tsm_dev *find_tsm_dev(int id);
> > const struct pci_tsm_ops *tsm_pci_ops(const struct tsm_dev *tsm_dev);
> > const struct attribute_group *tsm_pci_group(const struct tsm_dev *tsm_dev);
> > +struct pci_dev;
>
> Not used.
Good catch, missed cleaning that up during development.
Powered by blists - more mailing lists