Re: [PATCH 04/12] dma-mapping: fix DMA_OPS dependencies

2020-09-11 Thread Christoph Hellwig
On Tue, Sep 08, 2020 at 09:04:17PM +0300, Sergei Shtylyov wrote:
> Hello!
> 
> On 9/8/20 7:47 PM, Christoph Hellwig wrote:
> 
> > Driver that select DMA_OPS need to depend on HAS_DMA support to
> > work.  The vop driver was missing that dependency, so add it, and also
> > add a nother depends in DMA_OPS itself.  That won't fix the issue due
> 
>Another? :-)

Yes, fixed.


Re: [PATCH 04/12] dma-mapping: fix DMA_OPS dependencies

2020-09-11 Thread Christoph Hellwig
On Thu, Sep 10, 2020 at 01:55:37PM +0100, Robin Murphy wrote:
> AFAICS all three of these bus drivers are only proxying a struct 
> dma_map_ops * pointer around, so if they used the set_dma_ops() helper they 
> shouldn't even need these selects at all. Only INTEL_MIC_HOST appears to 
> have a logical dependency on DMA_OPS for actual functionality.
>
> However, I have a vague feeling you might not be fond of those dma_ops 
> helpers, and I have no great objection to this one-liner as-is, so (modulo 
> the couple of commit message typos),

The problem with these inherÑ–tances is that they don't actually work
for the general case.  You'd also need to inherity things like the
dma ranges, the bus limits, etc, etc.  So we need to kill them instead.
That whole mic/vop case is even worse than that with it's weird set
of chained dma ops that seems to implement some kind of device side
iommu that isn't in scope for the DMA API at all.


Re: [PATCH 04/12] dma-mapping: fix DMA_OPS dependencies

2020-09-10 Thread Robin Murphy

On 2020-09-08 17:47, Christoph Hellwig wrote:

Driver that select DMA_OPS need to depend on HAS_DMA support to
work.  The vop driver was missing that dependency, so add it, and also
add a nother depends in DMA_OPS itself.  That won't fix the issue due
to how the Kconfig dependencies work, but at least produce a warning
about unmet dependencies.

Signed-off-by: Christoph Hellwig 
---
  drivers/misc/mic/Kconfig | 1 +
  kernel/dma/Kconfig   | 1 +
  2 files changed, 2 insertions(+)

diff --git a/drivers/misc/mic/Kconfig b/drivers/misc/mic/Kconfig
index b9bb086785db48..8a7c2c5711d5f4 100644
--- a/drivers/misc/mic/Kconfig
+++ b/drivers/misc/mic/Kconfig
@@ -35,6 +35,7 @@ config SCIF_BUS
  
  config VOP_BUS

tristate "VOP Bus Driver"
+   depends on HAS_DMA
select DMA_OPS


AFAICS all three of these bus drivers are only proxying a struct 
dma_map_ops * pointer around, so if they used the set_dma_ops() helper 
they shouldn't even need these selects at all. Only INTEL_MIC_HOST 
appears to have a logical dependency on DMA_OPS for actual functionality.


However, I have a vague feeling you might not be fond of those dma_ops 
helpers, and I have no great objection to this one-liner as-is, so 
(modulo the couple of commit message typos),


Reviewed-by: Robin Murphy 

(of course the hunk below is unquestionably OK)

Robin.


help
  This option is selected by any driver which registers a
diff --git a/kernel/dma/Kconfig b/kernel/dma/Kconfig
index 0ddfb5510fe45f..e7b801649f6574 100644
--- a/kernel/dma/Kconfig
+++ b/kernel/dma/Kconfig
@@ -9,6 +9,7 @@ config HAS_DMA
default y
  
  config DMA_OPS

+   depends on HAS_DMA
bool
  
  #




Re: [PATCH 04/12] dma-mapping: fix DMA_OPS dependencies

2020-09-08 Thread Sergei Shtylyov
Hello!

On 9/8/20 7:47 PM, Christoph Hellwig wrote:

> Driver that select DMA_OPS need to depend on HAS_DMA support to
> work.  The vop driver was missing that dependency, so add it, and also
> add a nother depends in DMA_OPS itself.  That won't fix the issue due

   Another? :-)

> to how the Kconfig dependencies work, but at least produce a warning
> about unmet dependencies.
> 
> Signed-off-by: Christoph Hellwig 
[...]

MBR, Sergei