All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Magnus Damm <magnus.damm@gmail.com>,
	iommu@lists.linux-foundation.org,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Linux-sh list <linux-sh@vger.kernel.org>,
	Joerg Roedel <joro@8bytes.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Simon Horman <horms+renesas@verge.net.au>
Subject: Re: [PATCH 03/06] iommu/ipmmu-vmsa: Break out utlb control function
Date: Tue, 29 Dec 2015 02:05:17 +0200	[thread overview]
Message-ID: <1823351.xcsKyrzciK@avalon> (raw)
In-Reply-To: <CAMuHMdXYzO=+xuH2UwOUzDPoiyW-fBBaby91Ywr_Moa9bi17YQ@mail.gmail.com>

Hi Magnus,

On Tuesday 15 December 2015 16:48:42 Geert Uytterhoeven wrote:
> On Tue, Dec 15, 2015 at 1:02 PM, Magnus Damm <magnus.damm@gmail.com> wrote:
> > --- 0004/drivers/iommu/ipmmu-vmsa.c
> > +++ work/drivers/iommu/ipmmu-vmsa.c     2015-12-15 13:17:40.580513000
> > +0900
> > @@ -279,9 +279,18 @@ static void ipmmu_utlb_enable(struct ipm
> >  static void ipmmu_utlb_disable(struct ipmmu_vmsa_domain *domain,
> >                                unsigned int utlb)
> >  {
> > -       struct ipmmu_vmsa_device *mmu = domain->mmu;
> > +       ipmmu_write(domain->mmu, IMUCTR(utlb), 0);
> > +}
> > +
> > +static void ipmmu_utlb_ctrl(struct ipmmu_vmsa_domain *domain,
> > +                           void (*fn)(struct ipmmu_vmsa_domain *,
> > +                                      unsigned int utlb), struct device
> > *dev)
> > +{
> > +       struct ipmmu_vmsa_dev_data *dev_data = get_dev_data(dev);
> > +       unsigned int i;
> > 
> > -       ipmmu_write(mmu, IMUCTR(utlb), 0);
> > +       for (i = 0; i < dev_data->num_utlbs; ++i)
> > +               fn(domain, dev_data->utlbs[i]);
> > 
> >  }
> 
> Unless you have further plans with the "fn" parameter, I would simply pass
> a bool enable/disable flag instead of a function pointer.

I agree with Geert. What's your plan here ?

-- 
Regards,

Laurent Pinchart


WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Magnus Damm <magnus.damm@gmail.com>,
	iommu@lists.linux-foundation.org,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Linux-sh list <linux-sh@vger.kernel.org>,
	Joerg Roedel <joro@8bytes.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Simon Horman <horms+renesas@verge.net.au>
Subject: Re: [PATCH 03/06] iommu/ipmmu-vmsa: Break out utlb control function
Date: Tue, 29 Dec 2015 00:05:17 +0000	[thread overview]
Message-ID: <1823351.xcsKyrzciK@avalon> (raw)
In-Reply-To: <CAMuHMdXYzO=+xuH2UwOUzDPoiyW-fBBaby91Ywr_Moa9bi17YQ@mail.gmail.com>

Hi Magnus,

On Tuesday 15 December 2015 16:48:42 Geert Uytterhoeven wrote:
> On Tue, Dec 15, 2015 at 1:02 PM, Magnus Damm <magnus.damm@gmail.com> wrote:
> > --- 0004/drivers/iommu/ipmmu-vmsa.c
> > +++ work/drivers/iommu/ipmmu-vmsa.c     2015-12-15 13:17:40.580513000
> > +0900
> > @@ -279,9 +279,18 @@ static void ipmmu_utlb_enable(struct ipm
> >  static void ipmmu_utlb_disable(struct ipmmu_vmsa_domain *domain,
> >                                unsigned int utlb)
> >  {
> > -       struct ipmmu_vmsa_device *mmu = domain->mmu;
> > +       ipmmu_write(domain->mmu, IMUCTR(utlb), 0);
> > +}
> > +
> > +static void ipmmu_utlb_ctrl(struct ipmmu_vmsa_domain *domain,
> > +                           void (*fn)(struct ipmmu_vmsa_domain *,
> > +                                      unsigned int utlb), struct device
> > *dev)
> > +{
> > +       struct ipmmu_vmsa_dev_data *dev_data = get_dev_data(dev);
> > +       unsigned int i;
> > 
> > -       ipmmu_write(mmu, IMUCTR(utlb), 0);
> > +       for (i = 0; i < dev_data->num_utlbs; ++i)
> > +               fn(domain, dev_data->utlbs[i]);
> > 
> >  }
> 
> Unless you have further plans with the "fn" parameter, I would simply pass
> a bool enable/disable flag instead of a function pointer.

I agree with Geert. What's your plan here ?

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2015-12-29  0:05 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-15 12:02 [PATCH 00/06] iommu/ipmmu-vmsa: IPMMU multi-arch update Magnus Damm
2015-12-15 12:02 ` Magnus Damm
2015-12-15 12:02 ` [PATCH 01/06] iommu/ipmmu-vmsa: Remove platform data handling Magnus Damm
2015-12-15 12:02   ` Magnus Damm
2015-12-29  0:00   ` Laurent Pinchart
2015-12-29  0:00     ` Laurent Pinchart
2015-12-15 12:02 ` [PATCH 02/06] iommu/ipmmu-vmsa: Convert to dev_data Magnus Damm
2015-12-15 12:02   ` Magnus Damm
2015-12-29  0:04   ` Laurent Pinchart
2015-12-29  0:04     ` Laurent Pinchart
2015-12-15 12:02 ` [PATCH 03/06] iommu/ipmmu-vmsa: Break out utlb control function Magnus Damm
2015-12-15 12:02   ` Magnus Damm
2015-12-15 12:02   ` Magnus Damm
2015-12-15 15:48   ` Geert Uytterhoeven
2015-12-15 15:48     ` Geert Uytterhoeven
2015-12-29  0:05     ` Laurent Pinchart [this message]
2015-12-29  0:05       ` Laurent Pinchart
2015-12-15 12:02 ` [PATCH 04/06] iommu/ipmmu-vmsa: Rework interrupt code and use bitmap for context Magnus Damm
2015-12-15 12:02   ` Magnus Damm
2015-12-15 12:02   ` Magnus Damm
2015-12-29  0:14   ` Laurent Pinchart
2015-12-29  0:14     ` Laurent Pinchart
2016-03-15  2:36     ` Magnus Damm
2016-03-15  2:36       ` Magnus Damm
2015-12-15 12:02 ` [PATCH 05/06] iommu/ipmmu-vmsa: Break out 32-bit ARM mapping code Magnus Damm
2015-12-15 12:02   ` Magnus Damm
2015-12-15 12:02   ` Magnus Damm
2015-12-29  0:26   ` Laurent Pinchart
2015-12-29  0:26     ` Laurent Pinchart
2015-12-15 12:03 ` [PATCH 06/06] iommu/ipmmu-vmsa: Drop LPAE Kconfig dependency Magnus Damm
2015-12-15 12:03   ` Magnus Damm
2015-12-15 12:03   ` Magnus Damm
2015-12-29  0:26   ` Laurent Pinchart
2015-12-29  0:26     ` Laurent Pinchart
2015-12-29  0:26     ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1823351.xcsKyrzciK@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=horms+renesas@verge.net.au \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.