From: Scott Wood <scottwood@freescale.com>
To: Minghuan Lian <Minghuan.Lian@freescale.com>
Cc: Minghuan Lian <Minghuan.Lian@freescale.com>,
linuxppc-dev@lists.ozlabs.org,
Zang Roy-R61911 <r61911@freescale.com>
Subject: Re: [PATCH 2/5] powerpc/fsl_msi: add MSIIR1 support for MPIC v4.3
Date: Fri, 14 Jun 2013 17:09:11 -0500 [thread overview]
Message-ID: <1371247751.2996.16@snotra> (raw)
In-Reply-To: <1371194159-17332-2-git-send-email-Minghuan.Lian@freescale.com> (from Minghuan.Lian@freescale.com on Fri Jun 14 02:15:56 2013)
On 06/14/2013 02:15:56 AM, Minghuan Lian wrote:
> @@ -421,10 +440,29 @@ static int fsl_of_msi_probe(struct =20
> platform_device *dev)
> }
> msi->msiir_offset =3D
> features->msiir_offset + (res.start & 0xfffff);
> +
> + /*
> + * First read the MSIIR/MSIIR1 offset from dts
> + * If failure use the hardcode MSIIR offset
"On failure"
> + */
> + if (of_address_to_resource(dev->dev.of_node, 1, &msiir))
> + msi->msiir_offset =3D features->msiir_offset +
> + (res.start & =20
> MSIIR_OFFSET_MASK);
> + else
> + msi->msiir_offset =3D msiir.start & =20
> MSIIR_OFFSET_MASK;
> }
>=20
> msi->feature =3D features->fsl_pic_ip;
>=20
> + if (of_device_is_compatible(dev->dev.of_node, =20
> "fsl,mpic-msi-v4.3")) {
> + msi->srs_shift =3D MSIIR1_SRS_SHIFT;
> + msi->ibs_shift =3D MSIIR1_IBS_SHIFT;
> +
> + } else {
> + msi->srs_shift =3D MSIIR_SRS_SHIFT;
> + msi->ibs_shift =3D MSIIR_IBS_SHIFT;
> + }
Remove the blank line just before the "} else {".
> diff --git a/arch/powerpc/sysdev/fsl_msi.h =20
> b/arch/powerpc/sysdev/fsl_msi.h
> index 8225f86..43a9d99 100644
> --- a/arch/powerpc/sysdev/fsl_msi.h
> +++ b/arch/powerpc/sysdev/fsl_msi.h
> @@ -16,7 +16,7 @@
> #include <linux/of.h>
> #include <asm/msi_bitmap.h>
>=20
> -#define NR_MSI_REG 8
> +#define NR_MSI_REG 16
> #define IRQS_PER_MSI_REG 32
> #define NR_MSI_IRQS (NR_MSI_REG * IRQS_PER_MSI_REG)
I don't see where you update all_avail in fsl_of_msi_probe.
We should also be bounds-checking the contents of msi-available-ranges.
Currently it looks like we just silently overrun the bitmap if we get =20
bad
input from the device tree.
-Scott=
next prev parent reply other threads:[~2013-06-14 22:09 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-14 7:15 [PATCH 1/5] powerpc/dts: add MPIC v4.3 dts node Minghuan Lian
2013-06-14 7:15 ` [PATCH 2/5] powerpc/fsl_msi: add MSIIR1 support for MPIC v4.3 Minghuan Lian
2013-06-14 22:09 ` Scott Wood [this message]
2013-06-17 3:00 ` Lian Minghuan-b31939
2013-06-18 0:15 ` Scott Wood
2013-06-18 2:34 ` Lian Minghuan-b31939
2013-06-18 18:08 ` Scott Wood
2013-06-14 7:15 ` [PATCH 3/5] powerpc/dts: update MSI bindings doc " Minghuan Lian
2013-06-14 22:06 ` Scott Wood
2013-06-17 5:07 ` Lian Minghuan-b31939
2013-06-18 0:28 ` Scott Wood
2013-06-18 0:42 ` Scott Wood
2013-06-18 2:49 ` Lian Minghuan-b31939
2013-06-18 16:21 ` Scott Wood
2013-06-14 7:15 ` [PATCH 4/5] powerpc/dts: remove msi-available-ranges property Minghuan Lian
2013-06-14 22:10 ` Scott Wood
2013-06-17 5:15 ` Lian Minghuan-b31939
2013-06-18 0:13 ` Scott Wood
2013-06-14 7:15 ` [PATCH 5/5] powerpc/fsl_msi: add 'msiregs' kernel parameter Minghuan Lian
2013-06-14 22:13 ` Scott Wood
2013-06-17 5:36 ` Lian Minghuan-b31939
2013-06-18 0:18 ` Scott Wood
2013-06-18 3:10 ` Lian Minghuan-b31939
2013-06-18 16:22 ` Scott Wood
2013-06-14 20:39 ` [PATCH 1/5] powerpc/dts: add MPIC v4.3 dts node Scott Wood
2013-06-14 21:53 ` Scott Wood
2013-06-17 2:23 ` Lian Minghuan-b31939
2013-06-18 0:18 ` Scott Wood
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=1371247751.2996.16@snotra \
--to=scottwood@freescale.com \
--cc=Minghuan.Lian@freescale.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=r61911@freescale.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.