public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: laurent.pinchart@ideasonboard.com (Laurent Pinchart)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 01/10] iommu/ipmmu-vmsa: Refactor micro-TLB lookup
Date: Thu, 10 Jul 2014 12:37:57 +0200	[thread overview]
Message-ID: <1474559.zFUJiypt1j@avalon> (raw)
In-Reply-To: <53BDD84E.4090206@renesas.com>

On Thursday 10 July 2014 09:03:26 Khiem Nguyen wrote:
> On 5/15/2014 7:40 PM, Laurent Pinchart wrote:
> > Cache the micro-TLB number in archdata allocated in the .add_device
> > handler instead of looking it up when the deviced is attached and
> > detached. This simplifies the .attach_dev and .detach_dev operations and
> > prepares for DT support.
> 
> [snip]
> 
> > Signed-off-by: Laurent Pinchart
> > <laurent.pinchart+renesas@ideasonboard.com>
> 
> [snip]
> 
> > +static int ipmmu_find_utlb(struct ipmmu_vmsa_device *mmu, struct device
> > *dev)
> > +{
> > +	const struct ipmmu_vmsa_master *master = mmu->pdata->masters;
> > +	const char *devname = dev_name(dev);
> > +	unsigned int i;
> > +
> > +	for (i = 0; i < mmu->pdata->num_masters; ++i, ++master) {
> > +		if (strcmp(master->name, devname) == 0)
> > +			return master->utlb;
> > +	}
> > +
> > +	return -1;
> > +}
> 
> [snip]
> 
> >  static int ipmmu_add_device(struct device *dev)
> 
> [snip]
> 
> >  	list_for_each_entry(mmu, &ipmmu_devices, list) {
> > -		master = ipmmu_find_master(mmu, dev);
> > -		if (master) {
> > +		utlb = ipmmu_find_utlb(mmu, dev);
> > +		if (utlb >= 0) {
> >  			/*
> > -			 * TODO Take a reference to the master to protect
> > +			 * TODO Take a reference to the MMU to protect
> >  			 * against device removal.
> >  			 */
> >  			break;
> 
> [snip]
> 
> > +	archdata->mmu = mmu;
> > +	archdata->utlb = utlb;
> 
> [snip]
> 
> I have one question for ipmmu_add_device().
> 
> In my understanding, your code will find utlb for device
> base on device name.
> For any device, it will /only/ return utlb number of first match.
> 
> How about the case that a device name connected with more than 1 utlb ?
> e.g DU device (rcar-du-r8a7790) in Lager
> 
> Was that case already covered in your code ?

For the DU case, the R8A7790 contains two DU devices, each connected to a 
single utlb. The IPMMU driver will thus work fine in that case.

I agree that this is a problem in general though, other devices (such as the 
DMAC) are connected to more than one utlb. This is currently not supported by 
the driver.

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2014-07-10 10:37 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-15 10:40 [PATCH v2 00/10] Renesas ipmmu-vmsa: Miscellaneous cleanups and fixes Laurent Pinchart
2014-05-15 10:40 ` [PATCH v2 01/10] iommu/ipmmu-vmsa: Refactor micro-TLB lookup Laurent Pinchart
2014-07-10  0:03   ` Khiem Nguyen
2014-07-10 10:37     ` Laurent Pinchart [this message]
2014-07-14  0:19       ` Khiem Nguyen
2014-07-14  9:01         ` Laurent Pinchart
2014-07-14  9:15           ` Khiem Nguyen
2014-05-15 10:40 ` [PATCH v2 02/10] iommu/ipmmu-vmsa: Cleanup failures of ARM mapping creation or attachment Laurent Pinchart
2014-05-26  9:23   ` Joerg Roedel
2014-05-26 10:08     ` Laurent Pinchart
2014-05-26 11:31       ` Joerg Roedel
2014-05-26 11:35         ` Laurent Pinchart
2014-06-16 15:11       ` Joerg Roedel
2014-06-17 23:20         ` Laurent Pinchart
2014-05-15 10:40 ` [PATCH v2 03/10] iommu/ipmmu-vmsa: Fix the supported page sizes Laurent Pinchart
2014-05-15 10:40 ` [PATCH v2 04/10] iommu/ipmmu-vmsa: Define driver-specific page directory sizes Laurent Pinchart
2014-05-15 10:40 ` [PATCH v2 05/10] iommu/ipmmu-vmsa: Set the PTE contiguous hint bit when possible Laurent Pinchart
2014-05-15 10:40 ` [PATCH v2 06/10] iommu/ipmmu-vmsa: PMD is never folded, PUD always is Laurent Pinchart
2014-05-15 10:40 ` [PATCH v2 07/10] iommu/ipmmu-vmsa: Rewrite page table management Laurent Pinchart
2014-05-15 10:40 ` [PATCH v2 08/10] iommu/ipmmu-vmsa: Support 2MB mappings Laurent Pinchart
2014-05-15 10:40 ` [PATCH v2 09/10] iommu/ipmmu-vmsa: Remove stage 2 PTE bits definitions Laurent Pinchart
2014-05-15 10:40 ` [PATCH v2 10/10] iommu/ipmmu-vmsa: Support clearing mappings Laurent Pinchart
2014-05-21 16:11 ` [PATCH v2 00/10] Renesas ipmmu-vmsa: Miscellaneous cleanups and fixes 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=1474559.zFUJiypt1j@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox