[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 05/16] swiotlb: Add restricted DMA pool initialization
- To: Claire Chang <tientzu@xxxxxxxxxxxx>
- From: Steven Price <steven.price@xxxxxxx>
- Date: Wed, 28 Apr 2021 10:50:24 +0100
- Cc: Joerg Roedel <joro@xxxxxxxxxx>, Will Deacon <will@xxxxxxxxxx>, Frank Rowand <frowand.list@xxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, boris.ostrovsky@xxxxxxxxxx, jgross@xxxxxxxx, Christoph Hellwig <hch@xxxxxx>, Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>, benh@xxxxxxxxxxxxxxxxxxx, paulus@xxxxxxxxx, "list@xxxxxxx:IOMMU DRIVERS" <iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx>, sstabellini@xxxxxxxxxx, Robin Murphy <robin.murphy@xxxxxxx>, grant.likely@xxxxxxx, xypron.glpk@xxxxxx, Thierry Reding <treding@xxxxxxxxxx>, mingo@xxxxxxxxxx, bauerman@xxxxxxxxxxxxx, peterz@xxxxxxxxxxxxx, Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx>, Saravana Kannan <saravanak@xxxxxxxxxx>, "Rafael J . Wysocki" <rafael.j.wysocki@xxxxxxxxx>, heikki.krogerus@xxxxxxxxxxxxxxx, Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>, Randy Dunlap <rdunlap@xxxxxxxxxxxxx>, Dan Williams <dan.j.williams@xxxxxxxxx>, Bartosz Golaszewski <bgolaszewski@xxxxxxxxxxxx>, linux-devicetree <devicetree@xxxxxxxxxxxxxxx>, lkml <linux-kernel@xxxxxxxxxxxxxxx>, linuxppc-dev@xxxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, Nicolas Boichat <drinkcat@xxxxxxxxxxxx>, Jim Quinlan <james.quinlan@xxxxxxxxxxxx>, Tomasz Figa <tfiga@xxxxxxxxxxxx>, bskeggs@xxxxxxxxxx, Bjorn Helgaas <bhelgaas@xxxxxxxxxx>, chris@xxxxxxxxxxxxxxxxxx, Daniel Vetter <daniel@xxxxxxxx>, airlied@xxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx, intel-gfx@xxxxxxxxxxxxxxxxxxxxx, jani.nikula@xxxxxxxxxxxxxxx, Jianxiong Gao <jxgao@xxxxxxxxxx>, joonas.lahtinen@xxxxxxxxxxxxxxx, linux-pci@xxxxxxxxxxxxxxx, maarten.lankhorst@xxxxxxxxxxxxxxx, matthew.auld@xxxxxxxxx, nouveau@xxxxxxxxxxxxxxxxxxxxx, rodrigo.vivi@xxxxxxxxx, thomas.hellstrom@xxxxxxxxxxxxxxx
- Delivery-date: Wed, 28 Apr 2021 09:50:39 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 26/04/2021 17:37, Claire Chang wrote:
On Fri, Apr 23, 2021 at 7:34 PM Steven Price <steven.price@xxxxxxx> wrote:
[...]
But even then if it's not and we have the situation where debugfs==NULL
then the debugfs_create_dir() here will cause a subsequent attempt in
swiotlb_create_debugfs() to fail (directory already exists) leading to
mem->debugfs being assigned an error value. I suspect the creation of
the debugfs directory needs to be separated from io_tlb_default_mem
being set.
debugfs creation should move into the if (!mem) {...} above to avoid
duplication.
I think having a separated struct dentry pointer for the default
debugfs should be enough?
if (!debugfs)
debugfs = debugfs_create_dir("swiotlb", NULL);
swiotlb_create_debugfs(mem, rmem->name, debugfs);
Yes that looks like a good solution to me. Although I'd name the
variable something a bit more descriptive than just "debugfs" e.g.
"debugfs_dir" or "debugfs_root".
Thanks,
Steve
|