From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv2 4/4] ARM: mvebu: implement L2/PCIe deadlock workaround
Date: Wed, 14 May 2014 15:58:54 +0100 [thread overview]
Message-ID: <20140514145853.GE19866@localhost> (raw)
In-Reply-To: <1399975839-5311-5-git-send-email-thomas.petazzoni@free-electrons.com>
On Tue, May 13, 2014 at 11:10:39AM +0100, Thomas Petazzoni wrote:
> --- a/arch/arm/mach-mvebu/board-v7.c
> +++ b/arch/arm/mach-mvebu/board-v7.c
[...]
> +static void __init mvebu_l2x0_pl310_coherent(void)
> +{
> + struct device_node *np;
> +
> + if (!coherency_available())
> + return;
> +
> + for_each_compatible_node(np, NULL, "arm,pl310-cache") {
> + struct property *new_compat;
> +
> + new_compat = kzalloc(sizeof(*new_compat), GFP_KERNEL);
> + new_compat->name = kstrdup("compatible", GFP_KERNEL);
> + new_compat->value = kstrdup("arm,pl310-coherent-cache",
> + GFP_KERNEL);
> + new_compat->length = strlen(new_compat->value) + 1;
> + of_update_property(np, new_compat);
> + }
> +}
I got it know, you update the DT property on the fly.
> +
> static void __init mvebu_timer_and_clk_init(void)
> {
> of_clk_init(NULL);
> @@ -78,6 +125,14 @@ static void __init mvebu_timer_and_clk_init(void)
> mvebu_scu_enable();
> coherency_init();
> BUG_ON(mvebu_mbus_dt_init(coherency_available()));
> +
> + if (of_machine_is_compatible("marvell,armada375") ||
> + of_machine_is_compatible("marvell,armada38x")) {
> + arch_ioremap_caller = armada_pcie_wa_ioremap_caller;
> + pci_ioremap_set_mem_type(MT_MEMORY_RW_SO);
> + mvebu_l2x0_pl310_coherent();
> + }
> +
> l2x0_of_init(0, ~0UL);
>
> if (of_machine_is_compatible("marvell,armada375"))
A more "hackish" way would be to simply set outer_cache.sync to NULL
after l2x0_of_init, less code ;) but not nice either. With the .fixup in
Russell's L2C patches you could have added an mvebu specific callback to
check for coherency before setting .sync to NULL.
Anyway, your approach is fine by me but I would prefer a specific
property rather than "compatible".
--
Catalin
next prev parent reply other threads:[~2014-05-14 14:58 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-13 10:10 [PATCHv2 0/4] ARM: implement workaround for Cortex-A9/PL310/PCIe deadlock Thomas Petazzoni
2014-05-13 10:10 ` [PATCHv2 1/4] of: make of_update_property() usable earlier in the boot process Thomas Petazzoni
2014-05-13 14:00 ` Rob Herring
2014-05-13 14:30 ` Thomas Petazzoni
2014-05-13 14:54 ` Grant Likely
2014-05-13 15:30 ` Jason Cooper
2014-05-13 15:54 ` Thomas Petazzoni
2014-05-13 16:31 ` Jason Cooper
2014-05-13 16:58 ` Rob Herring
2014-05-13 17:00 ` Jason Cooper
2014-05-13 10:10 ` [PATCHv2 2/4] ARM: mm: allow sub-architectures to override PCI I/O memory type Thomas Petazzoni
2014-05-14 15:01 ` Catalin Marinas
2014-05-13 10:10 ` [PATCHv2 3/4] ARM: mm: add support for HW coherent systems in PL310 Thomas Petazzoni
2014-05-14 14:34 ` Catalin Marinas
2014-05-14 14:58 ` Thomas Petazzoni
2014-05-13 10:10 ` [PATCHv2 4/4] ARM: mvebu: implement L2/PCIe deadlock workaround Thomas Petazzoni
2014-05-13 11:13 ` Arnd Bergmann
2014-05-13 12:52 ` Thomas Petazzoni
2014-05-14 15:24 ` Catalin Marinas
2014-05-14 14:58 ` Catalin Marinas [this message]
2014-05-14 15:04 ` Thomas Petazzoni
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=20140514145853.GE19866@localhost \
--to=catalin.marinas@arm.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;
as well as URLs for NNTP newsgroup(s).