Re: [Intel-gfx] [PATCH v3 0/6] Convert the intel iommu driver to the dma-iommu api

2020-09-20 Thread Lu Baolu

Hi Logan,

On 2020/9/19 4:47, Logan Gunthorpe wrote:

Hi Lu,

On 2020-09-11 9:21 p.m., Lu Baolu wrote:

Tom Murphy has almost done all the work. His latest patch series was
posted here.

https://lore.kernel.org/linux-iommu/20200903201839.7327-1-murph...@tcd.ie/

Thanks a lot!

This series is a follow-up with below changes:

1. Add a quirk for the i915 driver issue described in Tom's cover
letter.
2. Fix several bugs in patch "iommu: Allow the dma-iommu api to use
bounce buffers" to make the bounce buffer work for untrusted devices.
3. Several cleanups in iommu/vt-d driver after the conversion.



I'm trying to test this on an old Sandy Bridge, but found that I get
spammed with warnings on boot. I've put a sample of a few of them below.
They all seem to be related to ioat.

I had the same issue with Tom's v2 but never saw this on his v1.


Have you verified whether this could be reproduced with the lasted
upstream kernel (without this patch series)?

Best regards,
baolu
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH 14/18] drm/exynos: Consolidate IOMMU mapping code

2020-09-20 Thread Inki Dae


20. 8. 21. 오전 12:08에 Robin Murphy 이(가) 쓴 글:
> Now that arch/arm is wired up for default domains and iommu-dma, we can
> consolidate the shared mapping code onto the generic IOMMU API version,
> and retire the arch-specific implementation.
> 
> Signed-off-by: Robin Murphy 
> 
> ---
> This is a cheeky revert of 07dc3678bacc ("drm/exynos: Fix cleanup of
> IOMMU related objects"), plus removal of the remaining arm_iommu_*
> references on top.

Thanks for cleanup.

Acked-by: Inki Dae 

Thanks,
Inki Dae

> ---
>  drivers/gpu/drm/exynos/exynos5433_drm_decon.c |  5 +-
>  drivers/gpu/drm/exynos/exynos7_drm_decon.c|  5 +-
>  drivers/gpu/drm/exynos/exynos_drm_dma.c   | 61 +++
>  drivers/gpu/drm/exynos/exynos_drm_drv.h   |  6 +-
>  drivers/gpu/drm/exynos/exynos_drm_fimc.c  |  5 +-
>  drivers/gpu/drm/exynos/exynos_drm_fimd.c  |  5 +-
>  drivers/gpu/drm/exynos/exynos_drm_g2d.c   |  5 +-
>  drivers/gpu/drm/exynos/exynos_drm_gsc.c   |  5 +-
>  drivers/gpu/drm/exynos/exynos_drm_rotator.c   |  5 +-
>  drivers/gpu/drm/exynos/exynos_drm_scaler.c|  6 +-
>  drivers/gpu/drm/exynos/exynos_mixer.c |  7 +--
>  11 files changed, 29 insertions(+), 86 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c 
> b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> index 1f79bc2a881e..8428ae12dfa5 100644
> --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> @@ -55,7 +55,6 @@ static const char * const decon_clks_name[] = {
>  struct decon_context {
>   struct device   *dev;
>   struct drm_device   *drm_dev;
> - void*dma_priv;
>   struct exynos_drm_crtc  *crtc;
>   struct exynos_drm_plane planes[WINDOWS_NR];
>   struct exynos_drm_plane_config  configs[WINDOWS_NR];
> @@ -645,7 +644,7 @@ static int decon_bind(struct device *dev, struct device 
> *master, void *data)
>  
>   decon_clear_channels(ctx->crtc);
>  
> - return exynos_drm_register_dma(drm_dev, dev, >dma_priv);
> + return exynos_drm_register_dma(drm_dev, dev);
>  }
>  
>  static void decon_unbind(struct device *dev, struct device *master, void 
> *data)
> @@ -655,7 +654,7 @@ static void decon_unbind(struct device *dev, struct 
> device *master, void *data)
>   decon_atomic_disable(ctx->crtc);
>  
>   /* detach this sub driver from iommu mapping if supported. */
> - exynos_drm_unregister_dma(ctx->drm_dev, ctx->dev, >dma_priv);
> + exynos_drm_unregister_dma(ctx->drm_dev, ctx->dev);
>  }
>  
>  static const struct component_ops decon_component_ops = {
> diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c 
> b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> index f2d87a7445c7..e7b58097ccdc 100644
> --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> @@ -40,7 +40,6 @@
>  struct decon_context {
>   struct device   *dev;
>   struct drm_device   *drm_dev;
> - void*dma_priv;
>   struct exynos_drm_crtc  *crtc;
>   struct exynos_drm_plane planes[WINDOWS_NR];
>   struct exynos_drm_plane_config  configs[WINDOWS_NR];
> @@ -128,13 +127,13 @@ static int decon_ctx_initialize(struct decon_context 
> *ctx,
>  
>   decon_clear_channels(ctx->crtc);
>  
> - return exynos_drm_register_dma(drm_dev, ctx->dev, >dma_priv);
> + return exynos_drm_register_dma(drm_dev, ctx->dev);
>  }
>  
>  static void decon_ctx_remove(struct decon_context *ctx)
>  {
>   /* detach this sub driver from iommu mapping if supported. */
> - exynos_drm_unregister_dma(ctx->drm_dev, ctx->dev, >dma_priv);
> + exynos_drm_unregister_dma(ctx->drm_dev, ctx->dev);
>  }
>  
>  static u32 decon_calc_clkdiv(struct decon_context *ctx,
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_dma.c 
> b/drivers/gpu/drm/exynos/exynos_drm_dma.c
> index 58b89ec11b0e..fd5f9bcf1857 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_dma.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_dma.c
> @@ -14,19 +14,6 @@
>  
>  #include "exynos_drm_drv.h"
>  
> -#if defined(CONFIG_ARM_DMA_USE_IOMMU)
> -#include 
> -#else
> -#define arm_iommu_create_mapping(...)({ NULL; })
> -#define arm_iommu_attach_device(...) ({ -ENODEV; })
> -#define arm_iommu_release_mapping(...)   ({ })
> -#define arm_iommu_detach_device(...) ({ })
> -#define to_dma_iommu_mapping(dev) NULL
> -#endif
> -
> -#if !defined(CONFIG_IOMMU_DMA)
> -#define iommu_dma_init_domain(...) ({ -EINVAL; })
> -#endif
>  
>  #define EXYNOS_DEV_ADDR_START0x2000
>  #define EXYNOS_DEV_ADDR_SIZE 0x4000
> @@ -58,7 +45,7 @@ static inline void clear_dma_max_seg_size(struct device 
> *dev)
>   * mapping.
>   */
>  static int drm_iommu_attach_device(struct drm_device *drm_dev,
> - struct device *subdrv_dev, void **dma_priv)
> +