* [PATCH] pci: Provide support for parsing PCI DT ranges property
@ 2012-12-12 16:37 Andrew Murray
2012-12-13 9:13 ` Thierry Reding
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Andrew Murray @ 2012-12-12 16:37 UTC (permalink / raw)
To: linux-pci
Cc: Michal Simek, devicetree-discuss, Thierry Reding, Liviu Dudau,
Rob Herring, Rob Herring, linuxppc-dev
DT bindings for PCI host bridges often use the ranges property to describe
memory and IO ranges - this binding tends to be the same across architectur=
es
yet several parsing implementations exist, e.g. arch/mips/pci/pci.c,
arch/powerpc/kernel/pci-common.c, arch/sparc/kernel/pci.c and
arch/microblaze/pci/pci-common.c (clone of PPC). Some of these duplicate
functionality provided by drivers/of/address.c.
This patch provides a common iterator-based parser for the ranges property,=
it
is hoped this will reduce DT representation differences between architectur=
es
and that architectures will migrate in part to this new parser.
It is also hoped (and the motativation for the patch) that this patch will
reduce duplication of code when writing host bridge drivers that are suppor=
ted
by multiple architectures.
This patch provides struct resources from a device tree node, e.g.:
=09u32 *last =3D NULL;
=09struct resource res;
=09while ((last =3D of_pci_process_ranges(np, res, last))) {
=09=09//do something with res
=09}
Platforms with quirks can then do what they like with the resource or migra=
te
common quirk handling to the parser. In an ideal world drivers can just req=
uest
the obtained resources and pass them on (e.g. pci_add_resource_offset).
Signed-off-by: Andrew Murray <Andrew.Murray@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
---
drivers/of/address.c | 53 ++++++++++++++++++++++++++++++++++++++++=
+++-
include/linux/of_address.h | 7 +++++
2 files changed, 59 insertions(+), 1 deletions(-)
diff --git a/drivers/of/address.c b/drivers/of/address.c
index 7e262a6..03bfe61 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -219,6 +219,57 @@ int of_pci_address_to_resource(struct device_node *dev=
, int bar,
=09return __of_address_to_resource(dev, addrp, size, flags, NULL, r);
}
EXPORT_SYMBOL_GPL(of_pci_address_to_resource);
+
+const __be32 *of_pci_process_ranges(struct device_node *node,
+=09=09=09=09 struct resource *res, const __be32 *from)
+{
+=09const __be32 *start, *end;
+=09int na, ns, np, pna;
+=09int rlen;
+=09struct of_bus *bus;
+=09WARN_ON(!res);
+
+=09bus =3D of_match_bus(node);
+=09bus->count_cells(node, &na, &ns);
+=09if (!OF_CHECK_COUNTS(na, ns)) {
+=09=09pr_err("Bad cell count for %s\n", node->full_name);
+=09=09return NULL;
+=09}
+
+=09pna =3D of_n_addr_cells(node);
+=09np =3D pna + na + ns;
+
+=09start =3D of_get_property(node, "ranges", &rlen);
+=09if (start =3D=3D NULL)
+=09=09return NULL;
+
+=09end =3D start + rlen;
+
+=09if (!from)
+=09=09from =3D start;
+
+=09while (from + np <=3D end) {
+=09=09u64 cpu_addr, size;
+
+=09=09cpu_addr =3D of_translate_address(node, from + na);
+=09=09size =3D of_read_number(from + na + pna, ns);
+=09=09res->flags =3D bus->get_flags(from);
+=09=09from +=3D np;
+
+=09=09if (cpu_addr =3D=3D OF_BAD_ADDR || size =3D=3D 0)
+=09=09=09continue;
+
+=09=09res->name =3D node->full_name;
+=09=09res->start =3D cpu_addr;
+=09=09res->end =3D res->start + size - 1;
+=09=09res->parent =3D res->child =3D res->sibling =3D NULL;
+=09=09return from;
+=09}
+
+=09return NULL;
+}
+EXPORT_SYMBOL_GPL(of_pci_process_ranges);
+
#endif /* CONFIG_PCI */
=20
/*
@@ -421,7 +472,7 @@ u64 __of_translate_address(struct device_node *dev, con=
st __be32 *in_addr,
=09=09goto bail;
=09bus =3D of_match_bus(parent);
=20
-=09/* Cound address cells & copy address locally */
+=09/* Count address cells & copy address locally */
=09bus->count_cells(dev, &na, &ns);
=09if (!OF_CHECK_COUNTS(na, ns)) {
=09=09printk(KERN_ERR "prom_parse: Bad cell count for %s\n",
diff --git a/include/linux/of_address.h b/include/linux/of_address.h
index 01b925a..4582b20 100644
--- a/include/linux/of_address.h
+++ b/include/linux/of_address.h
@@ -26,6 +26,8 @@ static inline unsigned long pci_address_to_pio(phys_addr_=
t addr) { return -1; }
#define pci_address_to_pio pci_address_to_pio
#endif
=20
+const __be32 *of_pci_process_ranges(struct device_node *node,
+=09=09=09=09 struct resource *res, const __be32 *from);
#else /* CONFIG_OF_ADDRESS */
static inline int of_address_to_resource(struct device_node *dev, int inde=
x,
=09=09=09=09=09 struct resource *r)
@@ -48,6 +50,11 @@ static inline const u32 *of_get_address(struct device_no=
de *dev, int index,
{
=09return NULL;
}
+const __be32 *of_pci_process_ranges(struct device_node *node,
+=09=09=09=09 struct resource *res, const __be32 *from)
+{
+=09return NULL;
+}
#endif /* CONFIG_OF_ADDRESS */
=20
=20
--=20
1.7.0.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] pci: Provide support for parsing PCI DT ranges property
2012-12-12 16:37 [PATCH] pci: Provide support for parsing PCI DT ranges property Andrew Murray
@ 2012-12-13 9:13 ` Thierry Reding
2012-12-13 9:45 ` Andrew Murray
2012-12-15 1:06 ` Grant Likely
2012-12-20 8:25 ` Thierry Reding
2 siblings, 1 reply; 9+ messages in thread
From: Thierry Reding @ 2012-12-13 9:13 UTC (permalink / raw)
To: Andrew Murray
Cc: Michal Simek, linux-pci, devicetree-discuss, Liviu Dudau,
Rob Herring, Rob Herring, linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 3320 bytes --]
On Wed, Dec 12, 2012 at 04:37:50PM +0000, Andrew Murray wrote:
> DT bindings for PCI host bridges often use the ranges property to describe
> memory and IO ranges - this binding tends to be the same across architectures
> yet several parsing implementations exist, e.g. arch/mips/pci/pci.c,
> arch/powerpc/kernel/pci-common.c, arch/sparc/kernel/pci.c and
> arch/microblaze/pci/pci-common.c (clone of PPC). Some of these duplicate
> functionality provided by drivers/of/address.c.
>
> This patch provides a common iterator-based parser for the ranges property, it
> is hoped this will reduce DT representation differences between architectures
> and that architectures will migrate in part to this new parser.
>
> It is also hoped (and the motativation for the patch) that this patch will
> reduce duplication of code when writing host bridge drivers that are supported
> by multiple architectures.
>
> This patch provides struct resources from a device tree node, e.g.:
>
> u32 *last = NULL;
> struct resource res;
> while ((last = of_pci_process_ranges(np, res, last))) {
> //do something with res
> }
>
> Platforms with quirks can then do what they like with the resource or migrate
> common quirk handling to the parser. In an ideal world drivers can just request
> the obtained resources and pass them on (e.g. pci_add_resource_offset).
>
> Signed-off-by: Andrew Murray <Andrew.Murray@arm.com>
> Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
> ---
> drivers/of/address.c | 53 +++++++++++++++++++++++++++++++++++++++++++-
> include/linux/of_address.h | 7 +++++
> 2 files changed, 59 insertions(+), 1 deletions(-)
Hi Andrew,
I don't like iterator interfaces too much, but I can live with that.
Other than that the patch looks good to me and I'll try to work it into
my Tegra PCIe patch series.
Just two minor comments below.
> diff --git a/drivers/of/address.c b/drivers/of/address.c
[...]
> @@ -421,7 +472,7 @@ u64 __of_translate_address(struct device_node *dev, const __be32 *in_addr,
> goto bail;
> bus = of_match_bus(parent);
>
> - /* Cound address cells & copy address locally */
> + /* Count address cells & copy address locally */
> bus->count_cells(dev, &na, &ns);
> if (!OF_CHECK_COUNTS(na, ns)) {
> printk(KERN_ERR "prom_parse: Bad cell count for %s\n",
This is really minor, but it should still go into a separate patch.
> diff --git a/include/linux/of_address.h b/include/linux/of_address.h
> index 01b925a..4582b20 100644
> --- a/include/linux/of_address.h
> +++ b/include/linux/of_address.h
> @@ -26,6 +26,8 @@ static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; }
> #define pci_address_to_pio pci_address_to_pio
> #endif
>
> +const __be32 *of_pci_process_ranges(struct device_node *node,
> + struct resource *res, const __be32 *from);
> #else /* CONFIG_OF_ADDRESS */
> static inline int of_address_to_resource(struct device_node *dev, int index,
> struct resource *r)
> @@ -48,6 +50,11 @@ static inline const u32 *of_get_address(struct device_node *dev, int index,
> {
> return NULL;
> }
> +const __be32 *of_pci_process_ranges(struct device_node *node,
There should be a blank line to separate the above two lines.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] pci: Provide support for parsing PCI DT ranges property
2012-12-13 9:13 ` Thierry Reding
@ 2012-12-13 9:45 ` Andrew Murray
2012-12-13 10:03 ` Thierry Reding
0 siblings, 1 reply; 9+ messages in thread
From: Andrew Murray @ 2012-12-13 9:45 UTC (permalink / raw)
To: Thierry Reding
Cc: Michal Simek, linux-pci@vger.kernel.org, devicetree-discuss,
Liviu Dudau, rob.herring@calxeda.com, Rob Herring, linuxppc-dev
On Thu, Dec 13, 2012 at 09:13:33AM +0000, Thierry Reding wrote:
> Hi Andrew,
>=20
> I don't like iterator interfaces too much, but I can live with that.
> Other than that the patch looks good to me and I'll try to work it into
> my Tegra PCIe patch series.
>=20
> Just two minor comments below.
>=20
> > diff --git a/drivers/of/address.c b/drivers/of/address.c
> [...]
> > @@ -421,7 +472,7 @@ u64 __of_translate_address(struct device_node *dev,=
const __be32 *in_addr,
> > =09=09goto bail;
> > =09bus =3D of_match_bus(parent);
> > =20
> > -=09/* Cound address cells & copy address locally */
> > +=09/* Count address cells & copy address locally */
> > =09bus->count_cells(dev, &na, &ns);
> > =09if (!OF_CHECK_COUNTS(na, ns)) {
> > =09=09printk(KERN_ERR "prom_parse: Bad cell count for %s\n",
>=20
> This is really minor, but it should still go into a separate patch.
>=20
> > diff --git a/include/linux/of_address.h b/include/linux/of_address.h
> > index 01b925a..4582b20 100644
> > --- a/include/linux/of_address.h
> > +++ b/include/linux/of_address.h
> > @@ -26,6 +26,8 @@ static inline unsigned long pci_address_to_pio(phys_a=
ddr_t addr) { return -1; }
> > #define pci_address_to_pio pci_address_to_pio
> > #endif
> > =20
> > +const __be32 *of_pci_process_ranges(struct device_node *node,
> > +=09=09=09=09 struct resource *res, const __be32 *from);
> > #else /* CONFIG_OF_ADDRESS */
> > static inline int of_address_to_resource(struct device_node *dev, int =
index,
> > =09=09=09=09=09 struct resource *r)
> > @@ -48,6 +50,11 @@ static inline const u32 *of_get_address(struct devic=
e_node *dev, int index,
> > {
> > =09return NULL;
> > }
> > +const __be32 *of_pci_process_ranges(struct device_node *node,
>=20
> There should be a blank line to separate the above two lines.
>=20
Thanks for the feedback.
I will send another patch for the typo and leave this patch with you for
working into your existing series.
Andrew Murray
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] pci: Provide support for parsing PCI DT ranges property
2012-12-13 9:45 ` Andrew Murray
@ 2012-12-13 10:03 ` Thierry Reding
2012-12-13 10:34 ` Andrew Murray
0 siblings, 1 reply; 9+ messages in thread
From: Thierry Reding @ 2012-12-13 10:03 UTC (permalink / raw)
To: Andrew Murray
Cc: Michal Simek, linux-pci@vger.kernel.org, devicetree-discuss,
Liviu Dudau, rob.herring@calxeda.com, Rob Herring, linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 2154 bytes --]
On Thu, Dec 13, 2012 at 09:45:43AM +0000, Andrew Murray wrote:
> On Thu, Dec 13, 2012 at 09:13:33AM +0000, Thierry Reding wrote:
> > Hi Andrew,
> >
> > I don't like iterator interfaces too much, but I can live with that.
> > Other than that the patch looks good to me and I'll try to work it into
> > my Tegra PCIe patch series.
> >
> > Just two minor comments below.
> >
> > > diff --git a/drivers/of/address.c b/drivers/of/address.c
> > [...]
> > > @@ -421,7 +472,7 @@ u64 __of_translate_address(struct device_node *dev, const __be32 *in_addr,
> > > goto bail;
> > > bus = of_match_bus(parent);
> > >
> > > - /* Cound address cells & copy address locally */
> > > + /* Count address cells & copy address locally */
> > > bus->count_cells(dev, &na, &ns);
> > > if (!OF_CHECK_COUNTS(na, ns)) {
> > > printk(KERN_ERR "prom_parse: Bad cell count for %s\n",
> >
> > This is really minor, but it should still go into a separate patch.
> >
> > > diff --git a/include/linux/of_address.h b/include/linux/of_address.h
> > > index 01b925a..4582b20 100644
> > > --- a/include/linux/of_address.h
> > > +++ b/include/linux/of_address.h
> > > @@ -26,6 +26,8 @@ static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; }
> > > #define pci_address_to_pio pci_address_to_pio
> > > #endif
> > >
> > > +const __be32 *of_pci_process_ranges(struct device_node *node,
> > > + struct resource *res, const __be32 *from);
> > > #else /* CONFIG_OF_ADDRESS */
> > > static inline int of_address_to_resource(struct device_node *dev, int index,
> > > struct resource *r)
> > > @@ -48,6 +50,11 @@ static inline const u32 *of_get_address(struct device_node *dev, int index,
> > > {
> > > return NULL;
> > > }
> > > +const __be32 *of_pci_process_ranges(struct device_node *node,
> >
> > There should be a blank line to separate the above two lines.
> >
>
> Thanks for the feedback.
>
> I will send another patch for the typo and leave this patch with you for
> working into your existing series.
I suppose you have your own series that uses this patch?
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] pci: Provide support for parsing PCI DT ranges property
2012-12-13 10:03 ` Thierry Reding
@ 2012-12-13 10:34 ` Andrew Murray
0 siblings, 0 replies; 9+ messages in thread
From: Andrew Murray @ 2012-12-13 10:34 UTC (permalink / raw)
To: Thierry Reding
Cc: Michal Simek, linux-pci@vger.kernel.org, devicetree-discuss,
Liviu Dudau, rob.herring@calxeda.com, Rob Herring, linuxppc-dev
On Thu, Dec 13, 2012 at 10:03:18AM +0000, Thierry Reding wrote:
> On Thu, Dec 13, 2012 at 09:45:43AM +0000, Andrew Murray wrote:
> > On Thu, Dec 13, 2012 at 09:13:33AM +0000, Thierry Reding wrote:
> > > Hi Andrew,
> > >=20
> > > I don't like iterator interfaces too much, but I can live with that.
> > > Other than that the patch looks good to me and I'll try to work it in=
to
> > > my Tegra PCIe patch series.
> > >=20
> > > Just two minor comments below.
> > >=20
> > > > diff --git a/drivers/of/address.c b/drivers/of/address.c
> > > [...]
> > > > @@ -421,7 +472,7 @@ u64 __of_translate_address(struct device_node *=
dev, const __be32 *in_addr,
> > > > =09=09goto bail;
> > > > =09bus =3D of_match_bus(parent);
> > > > =20
> > > > -=09/* Cound address cells & copy address locally */
> > > > +=09/* Count address cells & copy address locally */
> > > > =09bus->count_cells(dev, &na, &ns);
> > > > =09if (!OF_CHECK_COUNTS(na, ns)) {
> > > > =09=09printk(KERN_ERR "prom_parse: Bad cell count for %s\n",
> > >=20
> > > This is really minor, but it should still go into a separate patch.
> > >=20
> > > > diff --git a/include/linux/of_address.h b/include/linux/of_address.=
h
> > > > index 01b925a..4582b20 100644
> > > > --- a/include/linux/of_address.h
> > > > +++ b/include/linux/of_address.h
> > > > @@ -26,6 +26,8 @@ static inline unsigned long pci_address_to_pio(ph=
ys_addr_t addr) { return -1; }
> > > > #define pci_address_to_pio pci_address_to_pio
> > > > #endif
> > > > =20
> > > > +const __be32 *of_pci_process_ranges(struct device_node *node,
> > > > +=09=09=09=09 struct resource *res, const __be32 *from);
> > > > #else /* CONFIG_OF_ADDRESS */
> > > > static inline int of_address_to_resource(struct device_node *dev, =
int index,
> > > > =09=09=09=09=09 struct resource *r)
> > > > @@ -48,6 +50,11 @@ static inline const u32 *of_get_address(struct d=
evice_node *dev, int index,
> > > > {
> > > > =09return NULL;
> > > > }
> > > > +const __be32 *of_pci_process_ranges(struct device_node *node,
> > >=20
> > > There should be a blank line to separate the above two lines.
> > >=20
> >=20
> > Thanks for the feedback.
> >=20
> > I will send another patch for the typo and leave this patch with you fo=
r
> > working into your existing series.
>=20
> I suppose you have your own series that uses this patch?
Not yet, it may be some time before I submit my PCI host bridge driver. Tho=
ugh
I am making changes else where (e.g. this patch) which I'm hoping to submit=
as
early as possible. I can rebase my work for these upstream dependencies.
I can re-spin this patch with your suggested changes if you prefer?
Andrew Murray
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] pci: Provide support for parsing PCI DT ranges property
2012-12-12 16:37 [PATCH] pci: Provide support for parsing PCI DT ranges property Andrew Murray
2012-12-13 9:13 ` Thierry Reding
@ 2012-12-15 1:06 ` Grant Likely
2013-01-14 9:24 ` Andrew Murray
2012-12-20 8:25 ` Thierry Reding
2 siblings, 1 reply; 9+ messages in thread
From: Grant Likely @ 2012-12-15 1:06 UTC (permalink / raw)
To: Andrew Murray
Cc: Michal Simek, linux-pci, devicetree-discuss, Thierry Reding,
Liviu Dudau, Rob Herring, Rob Herring, linuxppc-dev
On Wed, Dec 12, 2012 at 4:37 PM, Andrew Murray <Andrew.Murray@arm.com> wrote:
> DT bindings for PCI host bridges often use the ranges property to describe
> memory and IO ranges - this binding tends to be the same across architectures
> yet several parsing implementations exist, e.g. arch/mips/pci/pci.c,
> arch/powerpc/kernel/pci-common.c, arch/sparc/kernel/pci.c and
> arch/microblaze/pci/pci-common.c (clone of PPC). Some of these duplicate
> functionality provided by drivers/of/address.c.
Hi Andrew,
Thanks for looking into this. This definitely needs to be done.
However, I cannot merge this patch as-is because it actually makes
things worse by adding yet another implementation of the parsing code.
Plus it doesn't actually have any users. :-)
Instead, move the existing code that you need out of
arch/powerpc/kernel/pci-common.c into a shared place and add in the
features you need. Bonus points if you fixup microblaze or others at
the same time.
g.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] pci: Provide support for parsing PCI DT ranges property
2012-12-15 1:06 ` Grant Likely
@ 2013-01-14 9:24 ` Andrew Murray
0 siblings, 0 replies; 9+ messages in thread
From: Andrew Murray @ 2013-01-14 9:24 UTC (permalink / raw)
To: Grant Likely
Cc: Michal Simek, linux-pci@vger.kernel.org, devicetree-discuss,
Thierry Reding, Liviu Dudau, rob.herring@calxeda.com, Rob Herring,
linuxppc-dev
On Sat, Dec 15, 2012 at 01:06:41AM +0000, Grant Likely wrote:
> On Wed, Dec 12, 2012 at 4:37 PM, Andrew Murray <Andrew.Murray@arm.com> wr=
ote:
> > DT bindings for PCI host bridges often use the ranges property to descr=
ibe
> > memory and IO ranges - this binding tends to be the same across archite=
ctures
> > yet several parsing implementations exist, e.g. arch/mips/pci/pci.c,
> > arch/powerpc/kernel/pci-common.c, arch/sparc/kernel/pci.c and
> > arch/microblaze/pci/pci-common.c (clone of PPC). Some of these duplicat=
e
> > functionality provided by drivers/of/address.c.
>=20
> Hi Andrew,
>=20
> Thanks for looking into this. This definitely needs to be done.
>=20
> However, I cannot merge this patch as-is because it actually makes
> things worse by adding yet another implementation of the parsing code.
> Plus it doesn't actually have any users. :-)
I understand. Though I see Thierry has included this in his patch set - I
guess that means there is potentially one user now :).
>=20
> Instead, move the existing code that you need out of
> arch/powerpc/kernel/pci-common.c into a shared place and add in the
> features you need. Bonus points if you fixup microblaze or others at
> the same time.
In most part the patch I submitted was the common code from powerpc but
without quirks and tie-ins to powerpc structures. I'd like to convert
powerpc to using my patch and others but won't get time to do this at
present :(
>=20
> g.
>=20
Andrew Murray
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] pci: Provide support for parsing PCI DT ranges property
2012-12-12 16:37 [PATCH] pci: Provide support for parsing PCI DT ranges property Andrew Murray
2012-12-13 9:13 ` Thierry Reding
2012-12-15 1:06 ` Grant Likely
@ 2012-12-20 8:25 ` Thierry Reding
2013-01-14 9:15 ` Andrew Murray
2 siblings, 1 reply; 9+ messages in thread
From: Thierry Reding @ 2012-12-20 8:25 UTC (permalink / raw)
To: Andrew Murray
Cc: Michal Simek, linux-pci, devicetree-discuss, Liviu Dudau,
Rob Herring, Rob Herring, linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 549 bytes --]
On Wed, Dec 12, 2012 at 04:37:50PM +0000, Andrew Murray wrote:
[...]
> diff --git a/drivers/of/address.c b/drivers/of/address.c
[...]
> + start = of_get_property(node, "ranges", &rlen);
> + if (start == NULL)
> + return NULL;
> +
> + end = start + rlen;
I'm currently rewriting large parts of the Tegra PCIe controller driver
and I'm trying to use this new API. This seems to work fine, except that
I think this line needs to be:
end = start + rlen / sizeof(__be32);
Otherwise we'll try to process 4 times as many ranges as there are.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] pci: Provide support for parsing PCI DT ranges property
2012-12-20 8:25 ` Thierry Reding
@ 2013-01-14 9:15 ` Andrew Murray
0 siblings, 0 replies; 9+ messages in thread
From: Andrew Murray @ 2013-01-14 9:15 UTC (permalink / raw)
To: Thierry Reding
Cc: Michal Simek, linux-pci@vger.kernel.org, devicetree-discuss,
Liviu Dudau, rob.herring@calxeda.com, Rob Herring, linuxppc-dev
On Thu, Dec 20, 2012 at 08:25:00AM +0000, Thierry Reding wrote:
> On Wed, Dec 12, 2012 at 04:37:50PM +0000, Andrew Murray wrote:
> [...]
> > diff --git a/drivers/of/address.c b/drivers/of/address.c
> [...]
> > +=09start =3D of_get_property(node, "ranges", &rlen);
> > +=09if (start =3D=3D NULL)
> > +=09=09return NULL;
> > +
> > +=09end =3D start + rlen;
>=20
> I'm currently rewriting large parts of the Tegra PCIe controller driver
> and I'm trying to use this new API. This seems to work fine, except that
> I think this line needs to be:
>=20
> =09end =3D start + rlen / sizeof(__be32);
>=20
> Otherwise we'll try to process 4 times as many ranges as there are.
>=20
> Thierry
Good catch. Thanks for taking this on.
Andrew Murray
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-01-14 9:27 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-12 16:37 [PATCH] pci: Provide support for parsing PCI DT ranges property Andrew Murray
2012-12-13 9:13 ` Thierry Reding
2012-12-13 9:45 ` Andrew Murray
2012-12-13 10:03 ` Thierry Reding
2012-12-13 10:34 ` Andrew Murray
2012-12-15 1:06 ` Grant Likely
2013-01-14 9:24 ` Andrew Murray
2012-12-20 8:25 ` Thierry Reding
2013-01-14 9:15 ` Andrew Murray
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).