Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1578484

Re: [PATCH 06/11] iommu: Add iommu_device_set_fwnode() interface

From Robin Murphy <robin.murphy@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH 06/11] iommu: Add iommu_device_set_fwnode() interface
Date 2017-02-10 15:20 +0100
Message-ID <t9kdj-4sU-1@gated-at.bofh.it> (permalink)
References <t8VeW-5zl-27@gated-at.bofh.it> <t8XgK-6Nm-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 09/02/17 11:32, Joerg Roedel wrote:
> From: Joerg Roedel <jroedel@suse.de>
> 
> Allow to store a fwnode in 'struct iommu_device';
> 
> Signed-off-by: Joerg Roedel <jroedel@suse.de>
> ---
>  include/linux/iommu.h | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/include/linux/iommu.h b/include/linux/iommu.h
> index bae3cfc..626c935 100644
> --- a/include/linux/iommu.h
> +++ b/include/linux/iommu.h
> @@ -214,6 +214,7 @@ struct iommu_ops {
>  struct iommu_device {
>  	struct list_head list;
>  	const struct iommu_ops *ops;
> +	struct fwnode_handle *fwnode;
>  	struct device dev;
>  };
>  
> @@ -233,6 +234,12 @@ static inline void iommu_device_set_ops(struct iommu_device *iommu,
>  	iommu->ops = ops;
>  }
>  
> +static inline void iommu_device_set_fwnode(struct iommu_device *iommu,
> +					   struct fwnode_handle *fwnode)
> +{
> +	iommu->fwnode = fwnode;
> +}

Would it make sense to simply make the ops and fwnode additional
arguments to iommu_device_register() (permitting fwnode to be NULL)?
AFAICS they should typically all have the same effective lifetime so
there doesn't seem to be any real need to handle everything separately.

Robin.

> +
>  #define IOMMU_GROUP_NOTIFY_ADD_DEVICE		1 /* Device added */
>  #define IOMMU_GROUP_NOTIFY_DEL_DEVICE		2 /* Pre Device removed */
>  #define IOMMU_GROUP_NOTIFY_BIND_DRIVER		3 /* Pre Driver bind */
> @@ -580,6 +587,11 @@ static inline void iommu_device_set_ops(struct iommu_device *iommu,
>  {
>  }
>  
> +static inline void iommu_device_set_fwnode(struct iommu_device *iommu,
> +					   struct fwnode_handle *fwnode)
> +{
> +}
> +
>  static inline void iommu_device_unregister(struct iommu_device *iommu)
>  {
>  }
> 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/11 v3] Let IOMMU core know about individual IOMMUs Joerg Roedel <joro@8bytes.org> - 2017-02-09 12:50 +0100
  [PATCH 02/11] iommu: Rename struct iommu_device Joerg Roedel <joro@8bytes.org> - 2017-02-09 12:50 +0100
  [PATCH 08/11] iommu/msm: Make use of iommu_device_register interface Joerg Roedel <joro@8bytes.org> - 2017-02-09 12:50 +0100
    Re: [PATCH 08/11] iommu/msm: Make use of iommu_device_register  interface Robin Murphy <robin.murphy@arm.com> - 2017-02-10 15:40 +0100
      Re: [PATCH 08/11] iommu/msm: Make use of iommu_device_register  interface Joerg Roedel <joro@8bytes.org> - 2017-02-10 17:00 +0100
        Re: [PATCH 08/11] iommu/msm: Make use of iommu_device_register  interface Robin Murphy <robin.murphy@arm.com> - 2017-02-10 18:40 +0100
  [PATCH 05/11] iommu: Make iommu_device_link/unlink take a struct iommu_device Joerg Roedel <joro@8bytes.org> - 2017-02-09 13:40 +0100
  [PATCH 07/11] iommu/arm-smmu: Make use of the iommu_register interface Joerg Roedel <joro@8bytes.org> - 2017-02-09 13:40 +0100
    Re: [PATCH 07/11] iommu/arm-smmu: Make use of the iommu_register  interface Robin Murphy <robin.murphy@arm.com> - 2017-02-10 15:30 +0100
      Re: [PATCH 07/11] iommu/arm-smmu: Make use of the iommu_register  interface Joerg Roedel <joro@8bytes.org> - 2017-02-10 16:40 +0100
        Re: [PATCH 07/11] iommu/arm-smmu: Make use of the iommu_register  interface Robin Murphy <robin.murphy@arm.com> - 2017-02-10 18:10 +0100
  [PATCH 04/11] iommu: Add sysfs bindings for struct iommu_device Joerg Roedel <joro@8bytes.org> - 2017-02-09 14:50 +0100
  [PATCH 03/11] iommu: Introduce new 'struct iommu_device' Joerg Roedel <joro@8bytes.org> - 2017-02-09 14:50 +0100
    Re: [PATCH 03/11] iommu: Introduce new 'struct iommu_device' kbuild test robot <lkp@intel.com> - 2017-02-09 21:50 +0100
  [PATCH 09/11] iommu/mediatek: Make use of iommu_device_register interface Joerg Roedel <joro@8bytes.org> - 2017-02-09 14:50 +0100
  [PATCH 06/11] iommu: Add iommu_device_set_fwnode() interface Joerg Roedel <joro@8bytes.org> - 2017-02-09 14:50 +0100
    Re: [PATCH 06/11] iommu: Add iommu_device_set_fwnode() interface Robin Murphy <robin.murphy@arm.com> - 2017-02-10 15:20 +0100
      Re: [PATCH 06/11] iommu: Add iommu_device_set_fwnode() interface Joerg Roedel <joro@8bytes.org> - 2017-02-10 16:30 +0100
        Re: [PATCH 06/11] iommu: Add iommu_device_set_fwnode() interface Robin Murphy <robin.murphy@arm.com> - 2017-02-10 17:10 +0100
          Re: [PATCH 06/11] iommu: Add iommu_device_set_fwnode() interface Joerg Roedel <jroedel@suse.de> - 2017-02-10 17:20 +0100
            Re: [PATCH 06/11] iommu: Add iommu_device_set_fwnode() interface Robin Murphy <robin.murphy@arm.com> - 2017-02-10 18:10 +0100
  [PATCH 01/11] iommu: Rename iommu_get_instance() Joerg Roedel <joro@8bytes.org> - 2017-02-09 14:50 +0100
    Re: [PATCH 01/11] iommu: Rename iommu_get_instance() Robin Murphy <robin.murphy@arm.com> - 2017-02-10 15:20 +0100
      Re: [PATCH 01/11] iommu: Rename iommu_get_instance() Joerg Roedel <joro@8bytes.org> - 2017-02-10 16:40 +0100

csiph-web