[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool
- To: Claire Chang <tientzu@xxxxxxxxxxxx>
- From: Christoph Hellwig <hch@xxxxxx>
- Date: Wed, 13 Jan 2021 13:42:09 +0100
- Cc: robh+dt@xxxxxxxxxx, mpe@xxxxxxxxxxxxxx, benh@xxxxxxxxxxxxxxxxxxx, paulus@xxxxxxxxx, joro@xxxxxxxxxx, will@xxxxxxxxxx, frowand.list@xxxxxxxxx, konrad.wilk@xxxxxxxxxx, boris.ostrovsky@xxxxxxxxxx, jgross@xxxxxxxx, sstabellini@xxxxxxxxxx, hch@xxxxxx, m.szyprowski@xxxxxxxxxxx, robin.murphy@xxxxxxx, grant.likely@xxxxxxx, xypron.glpk@xxxxxx, treding@xxxxxxxxxx, mingo@xxxxxxxxxx, bauerman@xxxxxxxxxxxxx, peterz@xxxxxxxxxxxxx, gregkh@xxxxxxxxxxxxxxxxxxx, saravanak@xxxxxxxxxx, rafael.j.wysocki@xxxxxxxxx, heikki.krogerus@xxxxxxxxxxxxxxx, andriy.shevchenko@xxxxxxxxxxxxxxx, rdunlap@xxxxxxxxxxxxx, dan.j.williams@xxxxxxxxx, bgolaszewski@xxxxxxxxxxxx, devicetree@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, tfiga@xxxxxxxxxxxx, drinkcat@xxxxxxxxxxxx
- Delivery-date: Wed, 13 Jan 2021 12:42:20 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
> +#ifdef CONFIG_SWIOTLB
> + struct io_tlb_mem *dma_io_tlb_mem;
> #endif
Please add a new config option for this code instead of always building
it when swiotlb is enabled.
> +static int swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start,
> + size_t size)
Can you split the refactoring in swiotlb.c into one or more prep
patches?
> +static int rmem_swiotlb_device_init(struct reserved_mem *rmem,
> + struct device *dev)
> +{
> + struct io_tlb_mem *mem = rmem->priv;
> + int ret;
> +
> + if (dev->dma_io_tlb_mem)
> + return -EBUSY;
> +
> + if (!mem) {
> + mem = kzalloc(sizeof(*mem), GFP_KERNEL);
> + if (!mem)
> + return -ENOMEM;
What is the calling convention here that allows for a NULL and non-NULL
private data?
|