lkml.org 
[lkml]   [2022]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 5/4] ARM: footbridge: remove custom DMA address handling
From
On 2022-08-25 21:15, Arnd Bergmann wrote:
[...]
> diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c
> index 372600bc15c8..f8920d0010de 100644
> --- a/arch/arm/mach-footbridge/dc21285.c
> +++ b/arch/arm/mach-footbridge/dc21285.c
> @@ -5,6 +5,7 @@
> * Copyright (C) 1998-2001 Russell King
> * Copyright (C) 1998-2000 Phil Blundell
> */
> +#include <linux/dma-map-ops.h>
> #include <linux/kernel.h>
> #include <linux/pci.h>
> #include <linux/interrupt.h>
> @@ -241,6 +242,22 @@ static irqreturn_t dc21285_parity_irq(int irq, void *dev_id)
> return IRQ_HANDLED;
> }
>
> +static int dc21285_pci_bus_notifier(struct notifier_block *nb,
> + unsigned long action,
> + void *data)
> +{
> + if (action != BUS_NOTIFY_ADD_DEVICE)
> + return NOTIFY_DONE;
> +
> + dma_direct_set_offset(data, PHYS_OFFSET, BUS_OFFSET, SZ_256M);

FWIW I've always had it in mind that for this kind of special case the
platform could just statically allocate the dma_range_map and assign it
to all devices. However in practice that needs some kfree_const() tweaks
in the driver core, which I'm sure are out-of-scope for this series, so
I'm mostly flagging this up to help myself remember that it might be
worth doing a dma_direct_set_offset() cleanup sweep soon.

As-is the patch at least makes things a lot clearer, and presumably
there aren't likely to be enough PCI devices for the extra allocations
to have noticeable impact in the meantime.

Cheers,
Robin.

\
 
 \ /
  Last update: 2022-08-30 14:23    [W:0.114 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site