devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2 v2] Fix MAX_PHANDLE_ARGS limitations
@ 2015-07-16  8:22 Joerg Roedel
  2015-07-16  8:22 ` [PATCH 1/2] of: base: Allow more args than MAX_PHANDLE_ARGS if required Joerg Roedel
  2015-07-16  8:22 ` [PATCH 2/2] arm/smmu: Make use of of_parse_phandle_with_var_args Joerg Roedel
  0 siblings, 2 replies; 4+ messages in thread
From: Joerg Roedel @ 2015-07-16  8:22 UTC (permalink / raw)
  To: Will Deacon, Grant Likely, Rob Herring
  Cc: linux-arm-kernel, iommu, linux-kernel, devicetree, Joerg Roedel

From: Joerg Roedel <jroedel@suse.de>

Hi,

here is the second version of my patches to fix the
MAX_PHANDLE_ARGS limitation for the arm-smmu driver. On my
AMD Seattle system the max value of 16 is not enough to
initialize the SMMU, as the device tree node has an entry
with 25 phandle args (possible are up to 128). The result is
a WARNING and incorrect SMMU initialization.

On the other side MAX_PHANDLE_ARGS can't grow indefinitly,
as it causes 'struct of_phandle_args' to get bigger. This
struct is often allocated on-stack and should be small by
default.

So these patches introduce a way to make 'struct
of_phandle_args' bigger only when needed and change the
ARM-SMMU driver to make use of it.

The patches have been tested on my AMD Seattle system.

Please review.

Thanks,

	Joerg

Changes to v1:

	* Rebased to v4.2-rc2
	* Fixed leak in patch 2, as pointed out by Will
	  Deacon

Joerg Roedel (2):
  of: base: Allow more args than MAX_PHANDLE_ARGS if required
  arm/smmu: Make use of of_parse_phandle_with_var_args

 drivers/iommu/arm-smmu.c | 23 ++++++++++++++++-------
 drivers/of/base.c        | 43 ++++++++++++++++++++++++++++++++++++-------
 include/linux/of.h       |  7 +++++++
 3 files changed, 59 insertions(+), 14 deletions(-)

-- 
1.8.4.5

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [PATCH 0/2 v2] Fix MAX_PHANDLE_ARGS limitations
@ 2015-07-16  8:30 Joerg Roedel
  0 siblings, 0 replies; 4+ messages in thread
From: Joerg Roedel @ 2015-07-16  8:30 UTC (permalink / raw)
  To: Will Deacon, Grant Likely, Rob Herring
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Joerg Roedel,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

From: Joerg Roedel <jroedel-l3A5Bk7waGM@public.gmane.org>

Hi,

here is the second version of my patches to fix the
MAX_PHANDLE_ARGS limitation for the arm-smmu driver. On my
AMD Seattle system the max value of 16 is not enough to
initialize the SMMU, as the device tree node has an entry
with 25 phandle args (possible are up to 128). The result is
a WARNING and incorrect SMMU initialization.

On the other side MAX_PHANDLE_ARGS can't grow indefinitly,
as it causes 'struct of_phandle_args' to get bigger. This
struct is often allocated on-stack and should be small by
default.

So these patches introduce a way to make 'struct
of_phandle_args' bigger only when needed and change the
ARM-SMMU driver to make use of it.

The patches have been tested on my AMD Seattle system.

Please review.

Thanks,

	Joerg

Changes to v1:

	* Rebased to v4.2-rc2
	* Fixed leak in patch 2, as pointed out by Will
	  Deacon

Joerg Roedel (2):
  of: base: Allow more args than MAX_PHANDLE_ARGS if required
  arm/smmu: Make use of of_parse_phandle_with_var_args

 drivers/iommu/arm-smmu.c | 23 ++++++++++++++++-------
 drivers/of/base.c        | 43 ++++++++++++++++++++++++++++++++++++-------
 include/linux/of.h       |  7 +++++++
 3 files changed, 59 insertions(+), 14 deletions(-)

-- 
1.8.4.5

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-16  8:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-16  8:22 [PATCH 0/2 v2] Fix MAX_PHANDLE_ARGS limitations Joerg Roedel
2015-07-16  8:22 ` [PATCH 1/2] of: base: Allow more args than MAX_PHANDLE_ARGS if required Joerg Roedel
2015-07-16  8:22 ` [PATCH 2/2] arm/smmu: Make use of of_parse_phandle_with_var_args Joerg Roedel
  -- strict thread matches above, loose matches on Subject: below --
2015-07-16  8:30 [PATCH 0/2 v2] Fix MAX_PHANDLE_ARGS limitations Joerg Roedel

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).