All of lore.kernel.org
 help / color / mirror / Atom feed
* two small DMA-related Kconfig cleanups for x86
@ 2019-04-10  8:02 Christoph Hellwig
  2019-04-10  8:02 ` [PATCH 1/2] x86: Remove the unused X86_DMA_REMAP kconfig symbol Christoph Hellwig
  2019-04-10  8:02 ` [PATCH 2/2] x86/pci: Clean up usage of X86_DEV_DMA_OPS Christoph Hellwig
  0 siblings, 2 replies; 12+ messages in thread
From: Christoph Hellwig @ 2019-04-10  8:02 UTC (permalink / raw)
  To: x86; +Cc: linux-kernel

Just cleaning up the Kconfig files for some of the changes happening
over the last years..



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

* [PATCH 1/2] x86: Remove the unused X86_DMA_REMAP kconfig symbol
  2019-04-10  8:02 two small DMA-related Kconfig cleanups for x86 Christoph Hellwig
@ 2019-04-10  8:02 ` Christoph Hellwig
  2019-04-10  8:48   ` [tip:x86/cleanups] x86/Kconfig: Remove the unused X86_DMA_REMAP KConfig symbol tip-bot for Christoph Hellwig
  2019-04-10  8:02 ` [PATCH 2/2] x86/pci: Clean up usage of X86_DEV_DMA_OPS Christoph Hellwig
  1 sibling, 1 reply; 12+ messages in thread
From: Christoph Hellwig @ 2019-04-10  8:02 UTC (permalink / raw)
  To: x86; +Cc: linux-kernel

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/x86/Kconfig | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 5ad92419be19..38c62ff8a3f0 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -704,7 +704,6 @@ config STA2X11
 	depends on X86_32_NON_STANDARD && PCI
 	select ARCH_HAS_PHYS_TO_DMA
 	select X86_DEV_DMA_OPS
-	select X86_DMA_REMAP
 	select SWIOTLB
 	select MFD_STA2X11
 	select GPIOLIB
@@ -2880,10 +2879,6 @@ config X86_DEV_DMA_OPS
 	bool
 	depends on X86_64 || STA2X11
 
-config X86_DMA_REMAP
-	bool
-	depends on STA2X11
-
 config HAVE_GENERIC_GUP
 	def_bool y
 
-- 
2.20.1


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

* [PATCH 2/2] x86/pci: Clean up usage of X86_DEV_DMA_OPS
  2019-04-10  8:02 two small DMA-related Kconfig cleanups for x86 Christoph Hellwig
  2019-04-10  8:02 ` [PATCH 1/2] x86: Remove the unused X86_DMA_REMAP kconfig symbol Christoph Hellwig
@ 2019-04-10  8:02 ` Christoph Hellwig
  2019-04-10  8:16   ` Ingo Molnar
  2019-04-24 12:37   ` [tip:x86/cleanups] " tip-bot for Christoph Hellwig
  1 sibling, 2 replies; 12+ messages in thread
From: Christoph Hellwig @ 2019-04-10  8:02 UTC (permalink / raw)
  To: x86; +Cc: linux-kernel

We have supported per-device dma_map_ops in generic code for a long
time, and this symbol just guards the inclusion of the dma_map_ops
registry used for vmd.  Stop enabling it for anything but vmd.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/x86/Kconfig               | 3 ---
 drivers/misc/mic/Kconfig       | 4 ++--
 drivers/pci/controller/Kconfig | 1 +
 drivers/pci/controller/vmd.c   | 7 -------
 4 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 38c62ff8a3f0..d8e2e6519a61 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -28,7 +28,6 @@ config X86_64
 	select MODULES_USE_ELF_RELA
 	select NEED_DMA_MAP_STATE
 	select SWIOTLB
-	select X86_DEV_DMA_OPS
 	select ARCH_HAS_SYSCALL_WRAPPER
 
 #
@@ -703,7 +702,6 @@ config STA2X11
 	bool "STA2X11 Companion Chip Support"
 	depends on X86_32_NON_STANDARD && PCI
 	select ARCH_HAS_PHYS_TO_DMA
-	select X86_DEV_DMA_OPS
 	select SWIOTLB
 	select MFD_STA2X11
 	select GPIOLIB
@@ -2877,7 +2875,6 @@ config HAVE_ATOMIC_IOMAP
 
 config X86_DEV_DMA_OPS
 	bool
-	depends on X86_64 || STA2X11
 
 config HAVE_GENERIC_GUP
 	def_bool y
diff --git a/drivers/misc/mic/Kconfig b/drivers/misc/mic/Kconfig
index 242dcee14689..6736f72cc14a 100644
--- a/drivers/misc/mic/Kconfig
+++ b/drivers/misc/mic/Kconfig
@@ -4,7 +4,7 @@ comment "Intel MIC Bus Driver"
 
 config INTEL_MIC_BUS
 	tristate "Intel MIC Bus Driver"
-	depends on 64BIT && PCI && X86 && X86_DEV_DMA_OPS
+	depends on 64BIT && PCI && X86
 	help
 	  This option is selected by any driver which registers a
 	  device or driver on the MIC Bus, such as CONFIG_INTEL_MIC_HOST,
@@ -21,7 +21,7 @@ comment "SCIF Bus Driver"
 
 config SCIF_BUS
 	tristate "SCIF Bus Driver"
-	depends on 64BIT && PCI && X86 && X86_DEV_DMA_OPS
+	depends on 64BIT && PCI && X86
 	help
 	  This option is selected by any driver which registers a
 	  device or driver on the SCIF Bus, such as CONFIG_INTEL_MIC_HOST
diff --git a/drivers/pci/controller/Kconfig b/drivers/pci/controller/Kconfig
index 6012f3059acd..011c57cae4b0 100644
--- a/drivers/pci/controller/Kconfig
+++ b/drivers/pci/controller/Kconfig
@@ -267,6 +267,7 @@ config PCIE_TANGO_SMP8759
 
 config VMD
 	depends on PCI_MSI && X86_64 && SRCU
+	select X86_DEV_DMA_OPS
 	tristate "Intel Volume Management Device Driver"
 	---help---
 	  Adds support for the Intel Volume Management Device (VMD). VMD is a
diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index cf6816b55b5e..999a5509e57e 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -95,10 +95,8 @@ struct vmd_dev {
 	struct irq_domain	*irq_domain;
 	struct pci_bus		*bus;
 
-#ifdef CONFIG_X86_DEV_DMA_OPS
 	struct dma_map_ops	dma_ops;
 	struct dma_domain	dma_domain;
-#endif
 };
 
 static inline struct vmd_dev *vmd_from_bus(struct pci_bus *bus)
@@ -293,7 +291,6 @@ static struct msi_domain_info vmd_msi_domain_info = {
 	.chip		= &vmd_msi_controller,
 };
 
-#ifdef CONFIG_X86_DEV_DMA_OPS
 /*
  * VMD replaces the requester ID with its own.  DMA mappings for devices in a
  * VMD domain need to be mapped for the VMD, not the device requiring
@@ -438,10 +435,6 @@ static void vmd_setup_dma_ops(struct vmd_dev *vmd)
 	add_dma_domain(domain);
 }
 #undef ASSIGN_VMD_DMA_OPS
-#else
-static void vmd_teardown_dma_ops(struct vmd_dev *vmd) {}
-static void vmd_setup_dma_ops(struct vmd_dev *vmd) {}
-#endif
 
 static char __iomem *vmd_cfg_addr(struct vmd_dev *vmd, struct pci_bus *bus,
 				  unsigned int devfn, int reg, int len)
-- 
2.20.1


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

* Re: [PATCH 2/2] x86/pci: Clean up usage of X86_DEV_DMA_OPS
  2019-04-10  8:02 ` [PATCH 2/2] x86/pci: Clean up usage of X86_DEV_DMA_OPS Christoph Hellwig
@ 2019-04-10  8:16   ` Ingo Molnar
  2019-04-10 21:45     ` Bjorn Helgaas
  2019-04-24 12:37   ` [tip:x86/cleanups] " tip-bot for Christoph Hellwig
  1 sibling, 1 reply; 12+ messages in thread
From: Ingo Molnar @ 2019-04-10  8:16 UTC (permalink / raw)
  To: Christoph Hellwig, Bjorn Helgaas, linux-pci; +Cc: x86, linux-kernel



(+Cc. Patch quoted below. Acked-by from an x86 perspective.)

* Christoph Hellwig <hch@lst.de> wrote:

> We have supported per-device dma_map_ops in generic code for a long
> time, and this symbol just guards the inclusion of the dma_map_ops
> registry used for vmd.  Stop enabling it for anything but vmd.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  arch/x86/Kconfig               | 3 ---
>  drivers/misc/mic/Kconfig       | 4 ++--
>  drivers/pci/controller/Kconfig | 1 +
>  drivers/pci/controller/vmd.c   | 7 -------
>  4 files changed, 3 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 38c62ff8a3f0..d8e2e6519a61 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -28,7 +28,6 @@ config X86_64
>  	select MODULES_USE_ELF_RELA
>  	select NEED_DMA_MAP_STATE
>  	select SWIOTLB
> -	select X86_DEV_DMA_OPS
>  	select ARCH_HAS_SYSCALL_WRAPPER
>  
>  #
> @@ -703,7 +702,6 @@ config STA2X11
>  	bool "STA2X11 Companion Chip Support"
>  	depends on X86_32_NON_STANDARD && PCI
>  	select ARCH_HAS_PHYS_TO_DMA
> -	select X86_DEV_DMA_OPS
>  	select SWIOTLB
>  	select MFD_STA2X11
>  	select GPIOLIB
> @@ -2877,7 +2875,6 @@ config HAVE_ATOMIC_IOMAP
>  
>  config X86_DEV_DMA_OPS
>  	bool
> -	depends on X86_64 || STA2X11
>  
>  config HAVE_GENERIC_GUP
>  	def_bool y
> diff --git a/drivers/misc/mic/Kconfig b/drivers/misc/mic/Kconfig
> index 242dcee14689..6736f72cc14a 100644
> --- a/drivers/misc/mic/Kconfig
> +++ b/drivers/misc/mic/Kconfig
> @@ -4,7 +4,7 @@ comment "Intel MIC Bus Driver"
>  
>  config INTEL_MIC_BUS
>  	tristate "Intel MIC Bus Driver"
> -	depends on 64BIT && PCI && X86 && X86_DEV_DMA_OPS
> +	depends on 64BIT && PCI && X86
>  	help
>  	  This option is selected by any driver which registers a
>  	  device or driver on the MIC Bus, such as CONFIG_INTEL_MIC_HOST,
> @@ -21,7 +21,7 @@ comment "SCIF Bus Driver"
>  
>  config SCIF_BUS
>  	tristate "SCIF Bus Driver"
> -	depends on 64BIT && PCI && X86 && X86_DEV_DMA_OPS
> +	depends on 64BIT && PCI && X86
>  	help
>  	  This option is selected by any driver which registers a
>  	  device or driver on the SCIF Bus, such as CONFIG_INTEL_MIC_HOST
> diff --git a/drivers/pci/controller/Kconfig b/drivers/pci/controller/Kconfig
> index 6012f3059acd..011c57cae4b0 100644
> --- a/drivers/pci/controller/Kconfig
> +++ b/drivers/pci/controller/Kconfig
> @@ -267,6 +267,7 @@ config PCIE_TANGO_SMP8759
>  
>  config VMD
>  	depends on PCI_MSI && X86_64 && SRCU
> +	select X86_DEV_DMA_OPS
>  	tristate "Intel Volume Management Device Driver"
>  	---help---
>  	  Adds support for the Intel Volume Management Device (VMD). VMD is a
> diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
> index cf6816b55b5e..999a5509e57e 100644
> --- a/drivers/pci/controller/vmd.c
> +++ b/drivers/pci/controller/vmd.c
> @@ -95,10 +95,8 @@ struct vmd_dev {
>  	struct irq_domain	*irq_domain;
>  	struct pci_bus		*bus;
>  
> -#ifdef CONFIG_X86_DEV_DMA_OPS
>  	struct dma_map_ops	dma_ops;
>  	struct dma_domain	dma_domain;
> -#endif
>  };
>  
>  static inline struct vmd_dev *vmd_from_bus(struct pci_bus *bus)
> @@ -293,7 +291,6 @@ static struct msi_domain_info vmd_msi_domain_info = {
>  	.chip		= &vmd_msi_controller,
>  };
>  
> -#ifdef CONFIG_X86_DEV_DMA_OPS
>  /*
>   * VMD replaces the requester ID with its own.  DMA mappings for devices in a
>   * VMD domain need to be mapped for the VMD, not the device requiring
> @@ -438,10 +435,6 @@ static void vmd_setup_dma_ops(struct vmd_dev *vmd)
>  	add_dma_domain(domain);
>  }
>  #undef ASSIGN_VMD_DMA_OPS
> -#else
> -static void vmd_teardown_dma_ops(struct vmd_dev *vmd) {}
> -static void vmd_setup_dma_ops(struct vmd_dev *vmd) {}
> -#endif
>  
>  static char __iomem *vmd_cfg_addr(struct vmd_dev *vmd, struct pci_bus *bus,
>  				  unsigned int devfn, int reg, int len)
> -- 
> 2.20.1
> 

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

* [tip:x86/cleanups] x86/Kconfig: Remove the unused X86_DMA_REMAP KConfig symbol
  2019-04-10  8:02 ` [PATCH 1/2] x86: Remove the unused X86_DMA_REMAP kconfig symbol Christoph Hellwig
@ 2019-04-10  8:48   ` tip-bot for Christoph Hellwig
  0 siblings, 0 replies; 12+ messages in thread
From: tip-bot for Christoph Hellwig @ 2019-04-10  8:48 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: tglx, mingo, torvalds, hch, peterz, hpa, linux-kernel

Commit-ID:  a5881bea88616e3aacf521dbdbe0e323257aaba1
Gitweb:     https://git.kernel.org/tip/a5881bea88616e3aacf521dbdbe0e323257aaba1
Author:     Christoph Hellwig <hch@lst.de>
AuthorDate: Wed, 10 Apr 2019 10:02:19 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 10 Apr 2019 10:17:24 +0200

x86/Kconfig: Remove the unused X86_DMA_REMAP KConfig symbol

Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20190410080220.21705-2-hch@lst.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/Kconfig | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index c1f9b3cf437c..7f93e013e6db 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -704,7 +704,6 @@ config STA2X11
 	depends on X86_32_NON_STANDARD && PCI
 	select ARCH_HAS_PHYS_TO_DMA
 	select X86_DEV_DMA_OPS
-	select X86_DMA_REMAP
 	select SWIOTLB
 	select MFD_STA2X11
 	select GPIOLIB
@@ -2886,10 +2885,6 @@ config X86_DEV_DMA_OPS
 	bool
 	depends on X86_64 || STA2X11
 
-config X86_DMA_REMAP
-	bool
-	depends on STA2X11
-
 config HAVE_GENERIC_GUP
 	def_bool y
 

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

* Re: [PATCH 2/2] x86/pci: Clean up usage of X86_DEV_DMA_OPS
  2019-04-10  8:16   ` Ingo Molnar
@ 2019-04-10 21:45     ` Bjorn Helgaas
  2019-04-10 22:03       ` Derrick, Jonathan
  2019-04-11  5:18       ` Christoph Hellwig
  0 siblings, 2 replies; 12+ messages in thread
From: Bjorn Helgaas @ 2019-04-10 21:45 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Christoph Hellwig, linux-pci, x86, linux-kernel, Keith Busch,
	Jonathan Derrick

[+cc Keith, Jonathan (VMD guys)]

I'm OK with this from a PCI perspective.  It would be nice if

  dma_domain_list
  dma_domain_list_lock
  add_dma_domain()
  del_dma_domain()
  set_dma_domain_ops()

could all be moved to vmd.c, since they're really only used there.

But we don't really have a good way to call host bridge-specific code
like set_dma_domain_ops() except via pcibios_add_device().  Someday
maybe pcibios_add_device() will become a host bridge method.

Acked-by: Bjorn Helgaas <bhelgaas@google.com>


On Wed, Apr 10, 2019 at 10:16:17AM +0200, Ingo Molnar wrote:
> (+Cc. Patch quoted below. Acked-by from an x86 perspective.)
> 
> * Christoph Hellwig <hch@lst.de> wrote:
> 
> > We have supported per-device dma_map_ops in generic code for a long
> > time, and this symbol just guards the inclusion of the dma_map_ops
> > registry used for vmd.  Stop enabling it for anything but vmd.
> > 
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
> > ---
> >  arch/x86/Kconfig               | 3 ---
> >  drivers/misc/mic/Kconfig       | 4 ++--
> >  drivers/pci/controller/Kconfig | 1 +
> >  drivers/pci/controller/vmd.c   | 7 -------
> >  4 files changed, 3 insertions(+), 12 deletions(-)
> > 
> > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> > index 38c62ff8a3f0..d8e2e6519a61 100644
> > --- a/arch/x86/Kconfig
> > +++ b/arch/x86/Kconfig
> > @@ -28,7 +28,6 @@ config X86_64
> >  	select MODULES_USE_ELF_RELA
> >  	select NEED_DMA_MAP_STATE
> >  	select SWIOTLB
> > -	select X86_DEV_DMA_OPS
> >  	select ARCH_HAS_SYSCALL_WRAPPER
> >  
> >  #
> > @@ -703,7 +702,6 @@ config STA2X11
> >  	bool "STA2X11 Companion Chip Support"
> >  	depends on X86_32_NON_STANDARD && PCI
> >  	select ARCH_HAS_PHYS_TO_DMA
> > -	select X86_DEV_DMA_OPS
> >  	select SWIOTLB
> >  	select MFD_STA2X11
> >  	select GPIOLIB
> > @@ -2877,7 +2875,6 @@ config HAVE_ATOMIC_IOMAP
> >  
> >  config X86_DEV_DMA_OPS
> >  	bool
> > -	depends on X86_64 || STA2X11
> >  
> >  config HAVE_GENERIC_GUP
> >  	def_bool y
> > diff --git a/drivers/misc/mic/Kconfig b/drivers/misc/mic/Kconfig
> > index 242dcee14689..6736f72cc14a 100644
> > --- a/drivers/misc/mic/Kconfig
> > +++ b/drivers/misc/mic/Kconfig
> > @@ -4,7 +4,7 @@ comment "Intel MIC Bus Driver"
> >  
> >  config INTEL_MIC_BUS
> >  	tristate "Intel MIC Bus Driver"
> > -	depends on 64BIT && PCI && X86 && X86_DEV_DMA_OPS
> > +	depends on 64BIT && PCI && X86
> >  	help
> >  	  This option is selected by any driver which registers a
> >  	  device or driver on the MIC Bus, such as CONFIG_INTEL_MIC_HOST,
> > @@ -21,7 +21,7 @@ comment "SCIF Bus Driver"
> >  
> >  config SCIF_BUS
> >  	tristate "SCIF Bus Driver"
> > -	depends on 64BIT && PCI && X86 && X86_DEV_DMA_OPS
> > +	depends on 64BIT && PCI && X86
> >  	help
> >  	  This option is selected by any driver which registers a
> >  	  device or driver on the SCIF Bus, such as CONFIG_INTEL_MIC_HOST
> > diff --git a/drivers/pci/controller/Kconfig b/drivers/pci/controller/Kconfig
> > index 6012f3059acd..011c57cae4b0 100644
> > --- a/drivers/pci/controller/Kconfig
> > +++ b/drivers/pci/controller/Kconfig
> > @@ -267,6 +267,7 @@ config PCIE_TANGO_SMP8759
> >  
> >  config VMD
> >  	depends on PCI_MSI && X86_64 && SRCU
> > +	select X86_DEV_DMA_OPS
> >  	tristate "Intel Volume Management Device Driver"
> >  	---help---
> >  	  Adds support for the Intel Volume Management Device (VMD). VMD is a
> > diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
> > index cf6816b55b5e..999a5509e57e 100644
> > --- a/drivers/pci/controller/vmd.c
> > +++ b/drivers/pci/controller/vmd.c
> > @@ -95,10 +95,8 @@ struct vmd_dev {
> >  	struct irq_domain	*irq_domain;
> >  	struct pci_bus		*bus;
> >  
> > -#ifdef CONFIG_X86_DEV_DMA_OPS
> >  	struct dma_map_ops	dma_ops;
> >  	struct dma_domain	dma_domain;
> > -#endif
> >  };
> >  
> >  static inline struct vmd_dev *vmd_from_bus(struct pci_bus *bus)
> > @@ -293,7 +291,6 @@ static struct msi_domain_info vmd_msi_domain_info = {
> >  	.chip		= &vmd_msi_controller,
> >  };
> >  
> > -#ifdef CONFIG_X86_DEV_DMA_OPS
> >  /*
> >   * VMD replaces the requester ID with its own.  DMA mappings for devices in a
> >   * VMD domain need to be mapped for the VMD, not the device requiring
> > @@ -438,10 +435,6 @@ static void vmd_setup_dma_ops(struct vmd_dev *vmd)
> >  	add_dma_domain(domain);
> >  }
> >  #undef ASSIGN_VMD_DMA_OPS
> > -#else
> > -static void vmd_teardown_dma_ops(struct vmd_dev *vmd) {}
> > -static void vmd_setup_dma_ops(struct vmd_dev *vmd) {}
> > -#endif
> >  
> >  static char __iomem *vmd_cfg_addr(struct vmd_dev *vmd, struct pci_bus *bus,
> >  				  unsigned int devfn, int reg, int len)
> > -- 
> > 2.20.1
> > 

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

* Re: [PATCH 2/2] x86/pci: Clean up usage of X86_DEV_DMA_OPS
  2019-04-10 21:45     ` Bjorn Helgaas
@ 2019-04-10 22:03       ` Derrick, Jonathan
  2019-04-11  5:18       ` Christoph Hellwig
  1 sibling, 0 replies; 12+ messages in thread
From: Derrick, Jonathan @ 2019-04-10 22:03 UTC (permalink / raw)
  To: mingo, helgaas; +Cc: hch, linux-kernel, linux-pci, Busch, Keith, x86

[-- Attachment #1: Type: text/plain, Size: 5530 bytes --]

On Wed, 2019-04-10 at 16:45 -0500, Bjorn Helgaas wrote:
> [+cc Keith, Jonathan (VMD guys)]
> 
> I'm OK with this from a PCI perspective.  It would be nice if
> 
>   dma_domain_list
>   dma_domain_list_lock
>   add_dma_domain()
>   del_dma_domain()
>   set_dma_domain_ops()
> 
> could all be moved to vmd.c, since they're really only used there.
> 
> But we don't really have a good way to call host bridge-specific code
> like set_dma_domain_ops() except via pcibios_add_device().  Someday
> maybe pcibios_add_device() will become a host bridge method.
I think these could have been contained to vmd.c with the host bridge
add_device callback [1] but I can't seem to find whatever came about
that discussion

[1] https://marc.info/?l=linux-pci&m=153337765811720&w=2



Either way, this looks fine
Reviewed-by: Jon Derrick <jonathan.derrick@intel.com>


> 
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> 
> 
> On Wed, Apr 10, 2019 at 10:16:17AM +0200, Ingo Molnar wrote:
> > (+Cc. Patch quoted below. Acked-by from an x86 perspective.)
> > 
> > * Christoph Hellwig <hch@lst.de> wrote:
> > 
> > > We have supported per-device dma_map_ops in generic code for a
> > > long
> > > time, and this symbol just guards the inclusion of the
> > > dma_map_ops
> > > registry used for vmd.  Stop enabling it for anything but vmd.
> > > 
> > > Signed-off-by: Christoph Hellwig <hch@lst.de>
> > > ---
> > >  arch/x86/Kconfig               | 3 ---
> > >  drivers/misc/mic/Kconfig       | 4 ++--
> > >  drivers/pci/controller/Kconfig | 1 +
> > >  drivers/pci/controller/vmd.c   | 7 -------
> > >  4 files changed, 3 insertions(+), 12 deletions(-)
> > > 
> > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> > > index 38c62ff8a3f0..d8e2e6519a61 100644
> > > --- a/arch/x86/Kconfig
> > > +++ b/arch/x86/Kconfig
> > > @@ -28,7 +28,6 @@ config X86_64
> > >  	select MODULES_USE_ELF_RELA
> > >  	select NEED_DMA_MAP_STATE
> > >  	select SWIOTLB
> > > -	select X86_DEV_DMA_OPS
> > >  	select ARCH_HAS_SYSCALL_WRAPPER
> > >  
> > >  #
> > > @@ -703,7 +702,6 @@ config STA2X11
> > >  	bool "STA2X11 Companion Chip Support"
> > >  	depends on X86_32_NON_STANDARD && PCI
> > >  	select ARCH_HAS_PHYS_TO_DMA
> > > -	select X86_DEV_DMA_OPS
> > >  	select SWIOTLB
> > >  	select MFD_STA2X11
> > >  	select GPIOLIB
> > > @@ -2877,7 +2875,6 @@ config HAVE_ATOMIC_IOMAP
> > >  
> > >  config X86_DEV_DMA_OPS
> > >  	bool
> > > -	depends on X86_64 || STA2X11
> > >  
> > >  config HAVE_GENERIC_GUP
> > >  	def_bool y
> > > diff --git a/drivers/misc/mic/Kconfig b/drivers/misc/mic/Kconfig
> > > index 242dcee14689..6736f72cc14a 100644
> > > --- a/drivers/misc/mic/Kconfig
> > > +++ b/drivers/misc/mic/Kconfig
> > > @@ -4,7 +4,7 @@ comment "Intel MIC Bus Driver"
> > >  
> > >  config INTEL_MIC_BUS
> > >  	tristate "Intel MIC Bus Driver"
> > > -	depends on 64BIT && PCI && X86 && X86_DEV_DMA_OPS
> > > +	depends on 64BIT && PCI && X86
> > >  	help
> > >  	  This option is selected by any driver which registers a
> > >  	  device or driver on the MIC Bus, such as
> > > CONFIG_INTEL_MIC_HOST,
> > > @@ -21,7 +21,7 @@ comment "SCIF Bus Driver"
> > >  
> > >  config SCIF_BUS
> > >  	tristate "SCIF Bus Driver"
> > > -	depends on 64BIT && PCI && X86 && X86_DEV_DMA_OPS
> > > +	depends on 64BIT && PCI && X86
> > >  	help
> > >  	  This option is selected by any driver which registers a
> > >  	  device or driver on the SCIF Bus, such as
> > > CONFIG_INTEL_MIC_HOST
> > > diff --git a/drivers/pci/controller/Kconfig
> > > b/drivers/pci/controller/Kconfig
> > > index 6012f3059acd..011c57cae4b0 100644
> > > --- a/drivers/pci/controller/Kconfig
> > > +++ b/drivers/pci/controller/Kconfig
> > > @@ -267,6 +267,7 @@ config PCIE_TANGO_SMP8759
> > >  
> > >  config VMD
> > >  	depends on PCI_MSI && X86_64 && SRCU
> > > +	select X86_DEV_DMA_OPS
> > >  	tristate "Intel Volume Management Device Driver"
> > >  	---help---
> > >  	  Adds support for the Intel Volume Management Device (VMD).
> > > VMD is a
> > > diff --git a/drivers/pci/controller/vmd.c
> > > b/drivers/pci/controller/vmd.c
> > > index cf6816b55b5e..999a5509e57e 100644
> > > --- a/drivers/pci/controller/vmd.c
> > > +++ b/drivers/pci/controller/vmd.c
> > > @@ -95,10 +95,8 @@ struct vmd_dev {
> > >  	struct irq_domain	*irq_domain;
> > >  	struct pci_bus		*bus;
> > >  
> > > -#ifdef CONFIG_X86_DEV_DMA_OPS
> > >  	struct dma_map_ops	dma_ops;
> > >  	struct dma_domain	dma_domain;
> > > -#endif
> > >  };
> > >  
> > >  static inline struct vmd_dev *vmd_from_bus(struct pci_bus *bus)
> > > @@ -293,7 +291,6 @@ static struct msi_domain_info
> > > vmd_msi_domain_info = {
> > >  	.chip		= &vmd_msi_controller,
> > >  };
> > >  
> > > -#ifdef CONFIG_X86_DEV_DMA_OPS
> > >  /*
> > >   * VMD replaces the requester ID with its own.  DMA mappings for
> > > devices in a
> > >   * VMD domain need to be mapped for the VMD, not the device
> > > requiring
> > > @@ -438,10 +435,6 @@ static void vmd_setup_dma_ops(struct vmd_dev
> > > *vmd)
> > >  	add_dma_domain(domain);
> > >  }
> > >  #undef ASSIGN_VMD_DMA_OPS
> > > -#else
> > > -static void vmd_teardown_dma_ops(struct vmd_dev *vmd) {}
> > > -static void vmd_setup_dma_ops(struct vmd_dev *vmd) {}
> > > -#endif
> > >  
> > >  static char __iomem *vmd_cfg_addr(struct vmd_dev *vmd, struct
> > > pci_bus *bus,
> > >  				  unsigned int devfn, int reg, int len)
> > > -- 
> > > 2.20.1
> > > 

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3278 bytes --]

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

* Re: [PATCH 2/2] x86/pci: Clean up usage of X86_DEV_DMA_OPS
  2019-04-10 21:45     ` Bjorn Helgaas
  2019-04-10 22:03       ` Derrick, Jonathan
@ 2019-04-11  5:18       ` Christoph Hellwig
  2019-04-11 13:35         ` Bjorn Helgaas
  1 sibling, 1 reply; 12+ messages in thread
From: Christoph Hellwig @ 2019-04-11  5:18 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Ingo Molnar, Christoph Hellwig, linux-pci, x86, linux-kernel,
	Keith Busch, Jonathan Derrick

On Wed, Apr 10, 2019 at 04:45:01PM -0500, Bjorn Helgaas wrote:
> [+cc Keith, Jonathan (VMD guys)]
> 
> I'm OK with this from a PCI perspective.  It would be nice if
> 
>   dma_domain_list
>   dma_domain_list_lock
>   add_dma_domain()
>   del_dma_domain()
>   set_dma_domain_ops()
> 
> could all be moved to vmd.c, since they're really only used there.

I have another patch to eventually kill that, but it will need a little
more prep work and thus be delayed to the next merge window.

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

* Re: [PATCH 2/2] x86/pci: Clean up usage of X86_DEV_DMA_OPS
  2019-04-11  5:18       ` Christoph Hellwig
@ 2019-04-11 13:35         ` Bjorn Helgaas
  2019-04-24  5:38           ` Christoph Hellwig
  0 siblings, 1 reply; 12+ messages in thread
From: Bjorn Helgaas @ 2019-04-11 13:35 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Ingo Molnar, linux-pci, x86, linux-kernel, Keith Busch, Jonathan Derrick

On Thu, Apr 11, 2019 at 07:18:49AM +0200, Christoph Hellwig wrote:
> On Wed, Apr 10, 2019 at 04:45:01PM -0500, Bjorn Helgaas wrote:
> > [+cc Keith, Jonathan (VMD guys)]
> > 
> > I'm OK with this from a PCI perspective.  It would be nice if
> > 
> >   dma_domain_list
> >   dma_domain_list_lock
> >   add_dma_domain()
> >   del_dma_domain()
> >   set_dma_domain_ops()
> > 
> > could all be moved to vmd.c, since they're really only used there.
> 
> I have another patch to eventually kill that, but it will need a little
> more prep work and thus be delayed to the next merge window.

Awesome, thanks!  I really appreciate all the global cleanup work you do.

Bjorn

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

* Re: [PATCH 2/2] x86/pci: Clean up usage of X86_DEV_DMA_OPS
  2019-04-11 13:35         ` Bjorn Helgaas
@ 2019-04-24  5:38           ` Christoph Hellwig
  2019-04-24 11:12             ` Ingo Molnar
  0 siblings, 1 reply; 12+ messages in thread
From: Christoph Hellwig @ 2019-04-24  5:38 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Christoph Hellwig, Ingo Molnar, linux-pci, x86, linux-kernel,
	Keith Busch, Jonathan Derrick

Is anyone going to pick this patch up?

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

* Re: [PATCH 2/2] x86/pci: Clean up usage of X86_DEV_DMA_OPS
  2019-04-24  5:38           ` Christoph Hellwig
@ 2019-04-24 11:12             ` Ingo Molnar
  0 siblings, 0 replies; 12+ messages in thread
From: Ingo Molnar @ 2019-04-24 11:12 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Bjorn Helgaas, linux-pci, x86, linux-kernel, Keith Busch,
	Jonathan Derrick


* Christoph Hellwig <hch@lst.de> wrote:

> Is anyone going to pick this patch up?

Sure, I've picked it up with Bjorn's Acked-by and will push it out after 
a bit of testing.

Thanks,

	Ingo

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

* [tip:x86/cleanups] x86/pci: Clean up usage of X86_DEV_DMA_OPS
  2019-04-10  8:02 ` [PATCH 2/2] x86/pci: Clean up usage of X86_DEV_DMA_OPS Christoph Hellwig
  2019-04-10  8:16   ` Ingo Molnar
@ 2019-04-24 12:37   ` tip-bot for Christoph Hellwig
  1 sibling, 0 replies; 12+ messages in thread
From: tip-bot for Christoph Hellwig @ 2019-04-24 12:37 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: mingo, tglx, bhelgaas, bp, linux-kernel, torvalds, hch, hpa, peterz

Commit-ID:  15854edd193ae5d9daf8f50ce5f9f1724cebe344
Gitweb:     https://git.kernel.org/tip/15854edd193ae5d9daf8f50ce5f9f1724cebe344
Author:     Christoph Hellwig <hch@lst.de>
AuthorDate: Wed, 10 Apr 2019 10:02:20 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 24 Apr 2019 13:12:05 +0200

x86/pci: Clean up usage of X86_DEV_DMA_OPS

We have supported per-device dma_map_ops in generic code for a long
time, and this symbol just guards the inclusion of the dma_map_ops
registry used for vmd.  Stop enabling it for anything but vmd.

No change in functionality intended.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20190410080220.21705-3-hch@lst.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/Kconfig               | 3 ---
 drivers/misc/mic/Kconfig       | 4 ++--
 drivers/pci/controller/Kconfig | 1 +
 drivers/pci/controller/vmd.c   | 7 -------
 4 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 7f93e013e6db..60f6459344bc 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -28,7 +28,6 @@ config X86_64
 	select MODULES_USE_ELF_RELA
 	select NEED_DMA_MAP_STATE
 	select SWIOTLB
-	select X86_DEV_DMA_OPS
 	select ARCH_HAS_SYSCALL_WRAPPER
 
 #
@@ -703,7 +702,6 @@ config STA2X11
 	bool "STA2X11 Companion Chip Support"
 	depends on X86_32_NON_STANDARD && PCI
 	select ARCH_HAS_PHYS_TO_DMA
-	select X86_DEV_DMA_OPS
 	select SWIOTLB
 	select MFD_STA2X11
 	select GPIOLIB
@@ -2883,7 +2881,6 @@ config HAVE_ATOMIC_IOMAP
 
 config X86_DEV_DMA_OPS
 	bool
-	depends on X86_64 || STA2X11
 
 config HAVE_GENERIC_GUP
 	def_bool y
diff --git a/drivers/misc/mic/Kconfig b/drivers/misc/mic/Kconfig
index 242dcee14689..6736f72cc14a 100644
--- a/drivers/misc/mic/Kconfig
+++ b/drivers/misc/mic/Kconfig
@@ -4,7 +4,7 @@ comment "Intel MIC Bus Driver"
 
 config INTEL_MIC_BUS
 	tristate "Intel MIC Bus Driver"
-	depends on 64BIT && PCI && X86 && X86_DEV_DMA_OPS
+	depends on 64BIT && PCI && X86
 	help
 	  This option is selected by any driver which registers a
 	  device or driver on the MIC Bus, such as CONFIG_INTEL_MIC_HOST,
@@ -21,7 +21,7 @@ comment "SCIF Bus Driver"
 
 config SCIF_BUS
 	tristate "SCIF Bus Driver"
-	depends on 64BIT && PCI && X86 && X86_DEV_DMA_OPS
+	depends on 64BIT && PCI && X86
 	help
 	  This option is selected by any driver which registers a
 	  device or driver on the SCIF Bus, such as CONFIG_INTEL_MIC_HOST
diff --git a/drivers/pci/controller/Kconfig b/drivers/pci/controller/Kconfig
index 6012f3059acd..011c57cae4b0 100644
--- a/drivers/pci/controller/Kconfig
+++ b/drivers/pci/controller/Kconfig
@@ -267,6 +267,7 @@ config PCIE_TANGO_SMP8759
 
 config VMD
 	depends on PCI_MSI && X86_64 && SRCU
+	select X86_DEV_DMA_OPS
 	tristate "Intel Volume Management Device Driver"
 	---help---
 	  Adds support for the Intel Volume Management Device (VMD). VMD is a
diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index cf6816b55b5e..999a5509e57e 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -95,10 +95,8 @@ struct vmd_dev {
 	struct irq_domain	*irq_domain;
 	struct pci_bus		*bus;
 
-#ifdef CONFIG_X86_DEV_DMA_OPS
 	struct dma_map_ops	dma_ops;
 	struct dma_domain	dma_domain;
-#endif
 };
 
 static inline struct vmd_dev *vmd_from_bus(struct pci_bus *bus)
@@ -293,7 +291,6 @@ static struct msi_domain_info vmd_msi_domain_info = {
 	.chip		= &vmd_msi_controller,
 };
 
-#ifdef CONFIG_X86_DEV_DMA_OPS
 /*
  * VMD replaces the requester ID with its own.  DMA mappings for devices in a
  * VMD domain need to be mapped for the VMD, not the device requiring
@@ -438,10 +435,6 @@ static void vmd_setup_dma_ops(struct vmd_dev *vmd)
 	add_dma_domain(domain);
 }
 #undef ASSIGN_VMD_DMA_OPS
-#else
-static void vmd_teardown_dma_ops(struct vmd_dev *vmd) {}
-static void vmd_setup_dma_ops(struct vmd_dev *vmd) {}
-#endif
 
 static char __iomem *vmd_cfg_addr(struct vmd_dev *vmd, struct pci_bus *bus,
 				  unsigned int devfn, int reg, int len)

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

end of thread, other threads:[~2019-04-24 12:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-10  8:02 two small DMA-related Kconfig cleanups for x86 Christoph Hellwig
2019-04-10  8:02 ` [PATCH 1/2] x86: Remove the unused X86_DMA_REMAP kconfig symbol Christoph Hellwig
2019-04-10  8:48   ` [tip:x86/cleanups] x86/Kconfig: Remove the unused X86_DMA_REMAP KConfig symbol tip-bot for Christoph Hellwig
2019-04-10  8:02 ` [PATCH 2/2] x86/pci: Clean up usage of X86_DEV_DMA_OPS Christoph Hellwig
2019-04-10  8:16   ` Ingo Molnar
2019-04-10 21:45     ` Bjorn Helgaas
2019-04-10 22:03       ` Derrick, Jonathan
2019-04-11  5:18       ` Christoph Hellwig
2019-04-11 13:35         ` Bjorn Helgaas
2019-04-24  5:38           ` Christoph Hellwig
2019-04-24 11:12             ` Ingo Molnar
2019-04-24 12:37   ` [tip:x86/cleanups] " tip-bot for Christoph Hellwig

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.