All of lore.kernel.org
 help / color / mirror / Atom feed
From: Timur Tabi <timur-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
To: Varun Sethi <Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Cc: scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.org,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 4/4 v6] iommu/fsl: Freescale PAMU driver and IOMMU API implementation.
Date: Mon, 3 Dec 2012 14:02:55 -0600	[thread overview]
Message-ID: <50BD056F.7070701@freescale.com> (raw)
In-Reply-To: <1354360921-20850-1-git-send-email-Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>

Varun Sethi wrote:

> +	out_be32(&pamu_regs->ppbah, ((u64)ppaact_phys) >> 32);
> +	out_be32(&pamu_regs->ppbal, ppaact_phys);
> +	ppaact_phys = ppaact_phys + PAACT_SIZE;
> +	out_be32(&pamu_regs->pplah, ((u64)ppaact_phys) >> 32);
> +	out_be32(&pamu_regs->pplal, ppaact_phys);

Instead of  ((u64)ppaact_phys) >> 32, use upper_32_bits() and lower_32_bits().

> +#define PAACE_NUMBER_ENTRIES    0xFF

This is going to break with large LIODNs.  Instead of hard-coding the size
of the PPAACT, you need to scan the device tree for the largest LIODN, and
make the array dynamically sized.

-- 
Timur Tabi
Linux kernel developer at Freescale

WARNING: multiple messages have this Message-ID (diff)
From: Timur Tabi <timur@freescale.com>
To: Varun Sethi <Varun.Sethi@freescale.com>
Cc: scottwood@freescale.com, joerg.roedel@amd.com,
	iommu@lists.linux-foundation.org, linuxppc-dev@lists.ozlabs.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4 v6] iommu/fsl: Freescale PAMU driver and IOMMU API implementation.
Date: Mon, 3 Dec 2012 14:02:55 -0600	[thread overview]
Message-ID: <50BD056F.7070701@freescale.com> (raw)
In-Reply-To: <1354360921-20850-1-git-send-email-Varun.Sethi@freescale.com>

Varun Sethi wrote:

> +	out_be32(&pamu_regs->ppbah, ((u64)ppaact_phys) >> 32);
> +	out_be32(&pamu_regs->ppbal, ppaact_phys);
> +	ppaact_phys = ppaact_phys + PAACT_SIZE;
> +	out_be32(&pamu_regs->pplah, ((u64)ppaact_phys) >> 32);
> +	out_be32(&pamu_regs->pplal, ppaact_phys);

Instead of  ((u64)ppaact_phys) >> 32, use upper_32_bits() and lower_32_bits().

> +#define PAACE_NUMBER_ENTRIES    0xFF

This is going to break with large LIODNs.  Instead of hard-coding the size
of the PPAACT, you need to scan the device tree for the largest LIODN, and
make the array dynamically sized.

-- 
Timur Tabi
Linux kernel developer at Freescale

WARNING: multiple messages have this Message-ID (diff)
From: Timur Tabi <timur@freescale.com>
To: Varun Sethi <Varun.Sethi@freescale.com>
Cc: <joerg.roedel@amd.com>, <iommu@lists.linux-foundation.org>,
	<linuxppc-dev@lists.ozlabs.org>, <linux-kernel@vger.kernel.org>,
	<scottwood@freescale.com>
Subject: Re: [PATCH 4/4 v6] iommu/fsl: Freescale PAMU driver and IOMMU API implementation.
Date: Mon, 3 Dec 2012 14:02:55 -0600	[thread overview]
Message-ID: <50BD056F.7070701@freescale.com> (raw)
In-Reply-To: <1354360921-20850-1-git-send-email-Varun.Sethi@freescale.com>

Varun Sethi wrote:

> +	out_be32(&pamu_regs->ppbah, ((u64)ppaact_phys) >> 32);
> +	out_be32(&pamu_regs->ppbal, ppaact_phys);
> +	ppaact_phys = ppaact_phys + PAACT_SIZE;
> +	out_be32(&pamu_regs->pplah, ((u64)ppaact_phys) >> 32);
> +	out_be32(&pamu_regs->pplal, ppaact_phys);

Instead of  ((u64)ppaact_phys) >> 32, use upper_32_bits() and lower_32_bits().

> +#define PAACE_NUMBER_ENTRIES    0xFF

This is going to break with large LIODNs.  Instead of hard-coding the size
of the PPAACT, you need to scan the device tree for the largest LIODN, and
make the array dynamically sized.

-- 
Timur Tabi
Linux kernel developer at Freescale


  parent reply	other threads:[~2012-12-03 20:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-01 11:22 [PATCH 4/4 v6] iommu/fsl: Freescale PAMU driver and IOMMU API implementation Varun Sethi
2012-12-01 11:22 ` Varun Sethi
2012-12-01 22:58 ` Tabi Timur-B04825
2012-12-01 22:58   ` Tabi Timur-B04825
     [not found] ` <1354360921-20850-1-git-send-email-Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-12-03 20:02   ` Timur Tabi [this message]
2012-12-03 20:02     ` Timur Tabi
2012-12-03 20:02     ` Timur Tabi
     [not found]     ` <50BD056F.7070701-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-12-04 12:11       ` Sethi Varun-B16395
2012-12-04 12:11         ` Sethi Varun-B16395
2012-12-04 12:11         ` Sethi Varun-B16395
     [not found]         ` <C5ECD7A89D1DC44195F34B25E172658D2B715D-RL0Hj/+nBVDYdknt8GnhQq4g8xLGJsHaLnY5E4hWTkheoWH0uzbU5w@public.gmane.org>
2012-12-04 12:29           ` Tabi Timur-B04825
2012-12-04 12:29             ` Tabi Timur-B04825
2012-12-04 12:29             ` Tabi Timur-B04825

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=50BD056F.7070701@freescale.com \
    --to=timur-kzfg59tc24xl57midrcfdg@public.gmane.org \
    --cc=Varun.Sethi-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.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 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.