[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250729170657.00005638@huawei.com>
Date: Tue, 29 Jul 2025 17:06:57 +0100
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: 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>, Samuel Ortiz <sameo@...osinc.com>, Xu Yilun
<yilun.xu@...ux.intel.com>, Suzuki K Poulose <suzuki.poulose@....com>, Aneesh
Kumar K.V <aneesh.kumar@...nel.org>
Subject: Re: [PATCH v4 10/10] samples/devsec: Add sample IDE establishment
On Thu, 17 Jul 2025 11:33:58 -0700
Dan Williams <dan.j.williams@...el.com> wrote:
> Exercise common setup and teardown flows for a sample platform TSM
> driver that implements the TSM 'connect' and 'disconnect' flows.
>
> This is both a template for platform specific implementations and a
> simple integration test for the PCI core infrastructure + ABI.
>
> Cc: Bjorn Helgaas <bhelgaas@...gle.com>
> Cc: Lukas Wunner <lukas@...ner.de>
> Cc: Samuel Ortiz <sameo@...osinc.com>
> Cc: Alexey Kardashevskiy <aik@....com>
> Cc: Xu Yilun <yilun.xu@...ux.intel.com>
> Cc: Suzuki K Poulose <suzuki.poulose@....com>
> Cc: "Aneesh Kumar K.V" <aneesh.kumar@...nel.org>
> Signed-off-by: Dan Williams <dan.j.williams@...el.com>
One really trivial comment inline.
> diff --git a/samples/devsec/tsm.c b/samples/devsec/tsm.c
> index a4705212a7e4..b93396ca0c92 100644
> --- a/samples/devsec/tsm.c
> +++ b/samples/devsec/tsm.c
>
> static void devsec_tsm_disconnect(struct pci_dev *pdev)
> {
> + struct pci_ide *ide;
> + unsigned long i;
> +
> + for_each_set_bit(i, devsec_stream_ids, NR_TSM_STREAMS)
> + if (devsec_streams[i]->pdev == pdev)
> + break;
> +
> + if (i >= NR_TSM_STREAMS)
pet irritation - why imply cases that can't occur.
if (i == NR_TSM_STREAMS)
> + return;
> +
> + ide = devsec_streams[i];
> + devsec_streams[i] = NULL;
> + pci_ide_stream_release(ide);
> + clear_bit(i, devsec_stream_ids);
> }
>
> static struct pci_tsm_ops devsec_pci_ops = {
Powered by blists - more mailing lists