All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] amba/platform: Initialize dma_parms at the bus level
@ 2020-03-31 18:38 ` Ulf Hansson
  0 siblings, 0 replies; 15+ messages in thread
From: Ulf Hansson @ 2020-03-31 18:38 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J . Wysocki, linux-kernel
  Cc: Arnd Bergmann, Christoph Hellwig, Russell King, Linus Walleij,
	Robin Murphy, Vinod Koul, Haibo Chen, Ludovic Barre,
	linux-arm-kernel, dmaengine, Ulf Hansson

It's currently the amba/platform driver's responsibility to initialize the
pointer, dma_parms, for its corresponding struct device. The benefit with this
approach allows us to avoid the initialization and to not waste memory for the
struct device_dma_parameters, as this can be decided on a case by case basis.
    
However, it has turned out that this approach is not very practical. Not only
does it lead to open coding, but also to real errors. In principle callers of
dma_set_max_seg_size() doesn't check the error code, but just assumes it
succeeds.
    
For these reasons, this series initializes the dma_parms from the amba/platform
bus at the device registration point. This also follows the way the PCI devices
are being managed, see pci_device_add().

If it turns out that this is an acceptable solution, we probably also want the
changes for stable, but I am not sure if it applies without conflicts.

The series is based on v5.6.

Kind regards
Ulf Hansson


Ulf Hansson (2):
  driver core: platform: Initialize dma_parms for platform devices
  amba: Initialize dma_parms for amba devices

 drivers/amba/bus.c              | 1 +
 drivers/base/platform.c         | 2 ++
 include/linux/amba/bus.h        | 1 +
 include/linux/platform_device.h | 1 +
 4 files changed, 5 insertions(+)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-04-22  9:42 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-31 18:38 [PATCH v2 0/2] amba/platform: Initialize dma_parms at the bus level Ulf Hansson
2020-03-31 18:38 ` Ulf Hansson
2020-03-31 18:38 ` [PATCH v2 1/2] driver core: platform: Initialize dma_parms for platform devices Ulf Hansson
2020-03-31 18:38   ` Ulf Hansson
2020-04-01  4:06   ` BOUGH CHEN
2020-04-01  4:06     ` BOUGH CHEN
2020-04-01 14:52   ` Sasha Levin
2020-04-22  9:41   ` Arnd Bergmann
2020-04-22  9:41     ` Arnd Bergmann
2020-03-31 18:38 ` [PATCH v2 2/2] amba: Initialize dma_parms for amba devices Ulf Hansson
2020-03-31 18:38   ` Ulf Hansson
2020-04-22  9:42   ` Arnd Bergmann
2020-04-22  9:42     ` Arnd Bergmann
2020-04-17 11:51 ` [PATCH v2 0/2] amba/platform: Initialize dma_parms at the bus level Ulf Hansson
2020-04-17 11:51   ` Ulf Hansson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.