Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/5] drivers: of: add initialization code for reserved memory
From: Tomasz Figa @ 2014-02-11 14:29 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20140211121316.24032C40C4D@trevor.secretlab.ca>

Hi,

On 11.02.2014 13:13, Grant Likely wrote:
> On Tue, 11 Feb 2014 12:45:50 +0100, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
>> Hello,
>>
>> On 2014-02-05 12:05, Grant Likely wrote:
>>> On Tue, 04 Feb 2014 13:09:29 +0100, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
>>>> This patch adds device tree support for contiguous and reserved memory
>>>> regions defined in device tree.
>>>>
>>>> Large memory blocks can be reliably reserved only during early boot.
>>>> This must happen before the whole memory management subsystem is
>>>> initialized, because we need to ensure that the given contiguous blocks
>>>> are not yet allocated by kernel. Also it must happen before kernel
>>>> mappings for the whole low memory are created, to ensure that there will
>>>> be no mappings (for reserved blocks) or mapping with special properties
>>>> can be created (for CMA blocks). This all happens before device tree
>>>> structures are unflattened, so we need to get reserved memory layout
>>>> directly from fdt.
>>>>
>>>> Later, those reserved memory regions are assigned to devices on each
>>>> device structure initialization.
>>>>
>>>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>>>> Cc: Laura Abbott <lauraa@codeaurora.org>
>>>> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
>>>> [joshc: rework to implement new DT binding, provide mechanism for
>>>>   plugging in new reserved-memory node handlers via
>>>>   RESERVEDMEM_OF_DECLARE]
>>>> Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
>>>> [mszyprow: little code cleanup]
>>>> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
>>>> ---
>>>>   drivers/of/Kconfig                |    6 +
>>>>   drivers/of/Makefile               |    1 +
>>>>   drivers/of/of_reserved_mem.c      |  219 +++++++++++++++++++++++++++++++++++++
>>>>   drivers/of/platform.c             |    7 ++
>>>>   include/asm-generic/vmlinux.lds.h |   11 ++
>>>>   include/linux/of_reserved_mem.h   |   62 +++++++++++
>>>>   6 files changed, 306 insertions(+)
>>>>   create mode 100644 drivers/of/of_reserved_mem.c
>>>>   create mode 100644 include/linux/of_reserved_mem.h
>>>>
>>>> diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
>>>> index c6973f101a3e..aba13df56f3a 100644
>>>> --- a/drivers/of/Kconfig
>>>> +++ b/drivers/of/Kconfig
>>>> @@ -75,4 +75,10 @@ config OF_MTD
>>>>   	depends on MTD
>>>>   	def_bool y
>>>>
>>>> +config OF_RESERVED_MEM
>>>> +	depends on HAVE_MEMBLOCK
>>>> +	def_bool y
>>>> +	help
>>>> +	  Helpers to allow for reservation of memory regions
>>>> +
>>>>   endmenu # OF
>>>> diff --git a/drivers/of/Makefile b/drivers/of/Makefile
>>>> index efd05102c405..ed9660adad77 100644
>>>> --- a/drivers/of/Makefile
>>>> +++ b/drivers/of/Makefile
>>>> @@ -9,3 +9,4 @@ obj-$(CONFIG_OF_MDIO)	+= of_mdio.o
>>>>   obj-$(CONFIG_OF_PCI)	+= of_pci.o
>>>>   obj-$(CONFIG_OF_PCI_IRQ)  += of_pci_irq.o
>>>>   obj-$(CONFIG_OF_MTD)	+= of_mtd.o
>>>> +obj-$(CONFIG_OF_RESERVED_MEM) += of_reserved_mem.o
>>>> diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
>>>> new file mode 100644
>>>> index 000000000000..f17cd56e68d9
>>>> --- /dev/null
>>>> +++ b/drivers/of/of_reserved_mem.c
>>>> @@ -0,0 +1,219 @@
>>>> +/*
>>>> + * Device tree based initialization code for reserved memory.
>>>> + *
>>>> + * Copyright (c) 2013, The Linux Foundation. All Rights Reserved.
>>>> + * Copyright (c) 2013 Samsung Electronics Co., Ltd.
>>>> + *		http://www.samsung.com
>>>> + * Author: Marek Szyprowski <m.szyprowski@samsung.com>
>>>> + * Author: Josh Cartwright <joshc@codeaurora.org>
>>>> + *
>>>> + * This program is free software; you can redistribute it and/or
>>>> + * modify it under the terms of the GNU General Public License as
>>>> + * published by the Free Software Foundation; either version 2 of the
>>>> + * License or (at your optional) any later version of the license.
>>>> + */
>>>> +#include <linux/memblock.h>
>>>> +#include <linux/err.h>
>>>> +#include <linux/of.h>
>>>> +#include <linux/of_fdt.h>
>>>> +#include <linux/of_platform.h>
>>>> +#include <linux/mm.h>
>>>> +#include <linux/sizes.h>
>>>> +#include <linux/of_reserved_mem.h>
>>>> +
>>>> +#define MAX_RESERVED_REGIONS	16
>>>> +static struct reserved_mem reserved_mem[MAX_RESERVED_REGIONS];
>>>> +static int reserved_mem_count;
>>>> +
>>>> +int __init of_parse_flat_dt_reg(unsigned long node, const char *uname,
>>>> +				   phys_addr_t *base, phys_addr_t *size)
>>>
>>> Useful utility function; move to drivers/of/fdt.c
>>>
>>>> +{
>>>> +	unsigned long len;
>>>> +	__be32 *prop;
>>>> +
>>>> +	prop = of_get_flat_dt_prop(node, "reg", &len);
>>>> +	if (!prop)
>>>> +		return -EINVAL;
>>>> +
>>>> +	if (len < (dt_root_addr_cells + dt_root_size_cells) * sizeof(__be32)) {
>>>> +		pr_err("Reserved memory: invalid reg property in '%s' node.\n",
>>>> +				uname);
>>>> +		return -EINVAL;
>>>> +	}
>>>
>>> This is /okay/ for an initial implementation, but it is naive. While I
>>> suggested making #address-cells and #size-cells equal the root node
>>> values for the purpose of simplicity, it should still be perfectly valid
>>> to have different values if the ranges property is correctly formed.
>>>
>>>> +
>>>> +	*base = dt_mem_next_cell(dt_root_addr_cells, &prop);
>>>> +	*size = dt_mem_next_cell(dt_root_size_cells, &prop);
>>>
>>> Future enhancement; allow for parsing more than just the first reg
>>> tuple.
>>
>> One more question. Does it really makes any sense to support more than
>> one tuple for reg property? For consistency we should also allow more
>> than one entry in size, align and alloc-ranges property, but I don't
>> see any benefits for defining more than one range for a single region.
>> Same can be achieved by defining more regions instead if one really
>> needs such configuration.
>
> Yes, if only because it is an define usage of the reg property. If a
> devtree has multiple tuples in reg, then all of those tuples should be
> treated as reserved, even if the kernel doesn't know how to use them.
>
> I would not do the same for size/align/alloc-ranges unless there is a
> very specific use case that you can define. These ones are different
> from the static regions because they aren't ever used to protect
> something that already exists in the memory.

Is there a reason why multiple regions could not be used for this 
purpose, instead of adding extra complexity of having multiple reg 
entries per region?

I.e. I don't see a difference between

reg1: region at 00000000 {
	reg = <0x00000000 0x1000>;
};

reg2: region at 10000000 {
	reg = <0x10000000 0x1000>;
};

user {
	regions = <&reg1>, <&reg2>;
};

and

reg: region at 00000000 {
	reg = <0x00000000 0x1000>, <0x10000000 0x1000>;
};

user {
	regions = <&reg>;
};

except that the former IMHO better suits the definition of memory 
region, which I see as a single contiguous range of memory and can be 
simplified to have a single reg entry per region.

Best regards,
Tomasz

^ permalink raw reply

* [PATCH] ARM: dts: OMAP2+: Fix boot with multi_v7_defconfig
From: Hans de Goede @ 2014-02-11 14:35 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <52FA3102.7080407@ti.com>

Hi,

On 02/11/2014 03:17 PM, Nishanth Menon wrote:
> On 02/11/2014 07:53 AM, Roger Quadros wrote:
>> On 02/10/2014 08:10 PM, Roger Quadros wrote:
>>> The OMAP EHCI controller is not compatible with the EHCI
>>> platform HCD driver so don't claim that we are.
>>>
>>> This fixes boot on OMAP platforms with CONFIG_USB_EHCI_HCD_PLATFORM=y
>>> e.g. multi_v7_defconfig
>>>
>>> Reported-by: Nishanth Menon <nm@ti.com>
>>> Signed-off-by: Roger Quadros <rogerq@ti.com>
>>
>> Please ignore this patch as Hans has agreed to do a more proper fix in
>>
>> http://article.gmane.org/gmane.comp.hardware.netbook.arm.sunxi/7015
> umm.. even then, drivers/usb/host/ehci-ppc-of.c claims compatibility
> with usb,ehci -> and we wont function with that driver either.

Right, but that has never been an issue as no kernel will ever include
both ppc and omap support.

Regards,

Hans

^ permalink raw reply

* [PATCH V5 4/8] phy: st-miphy-40lp: Add skeleton driver
From: Arnd Bergmann @ 2014-02-11 14:38 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <2CC2A0A4A178534D93D5159BF3BCB66189FD2CAA9B@EAPEX1MAIL1.st.com>

On Tuesday 11 February 2014 11:57:46 Mohit KUMAR DCG wrote:
> 
> > Maybe mention that this phy is used inside the spear13xx
> > SoC here rather than a standalone phy.
> 
> - Yes, for spear13xx its used internally. Do you think that
> it requires to be mentioned here? 
> We have few prototype boards that uses this as external phy.

[adding Lee since he mentioned working on a similar part]

I'm a bit confused. Is it actually the same IP block that can
be used internally as part of a SoC and as a standalone chip?

Since some of the settings of the PHY are controlled through
the misc register in case of spear13xx, I assume that part
is different on the standalone version. How do you actually
select the mode in that case?

It would certainly be helpful to explain this somewhere,
and the binding might not be the worst place for this.

On a related note, the driver in its current shape looks
a bit silly since it doesn't contain any of the miphy specific
code but only the SoC specific parts (as I suggested you
do, so I'm not blaming you :-)) and a multiplexer that
switches between the two possible implementations.

What is your plan for the future, do you intend to add
the actual miphy code soon, or is that something you just
want to leave as an option for the future but have no
specific plans to do right now? If not, the driver
would probably look nicer if it were split into two
separate implementations, one for each spear13xx SoC
and with a separate set of phy_ops but no multiplexer.
The connection to the miphy code (if you want to keep
your options open) could be done by implementing some
kind of nested phy model where the st,spear1340-phy contains
another "phys" property pointing to the st,miphy40 node
and the driver just calls the slave phy_ops recursively,
or the sata and pcie nodes actually link to two phy nodes
that are separate from one another.

	Arnd

^ permalink raw reply

* [PATCH] ARM: dts: OMAP2+: Fix boot with multi_v7_defconfig
From: Nishanth Menon @ 2014-02-11 14:41 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <52FA3531.8090308@redhat.com>

On 02/11/2014 08:35 AM, Hans de Goede wrote:
> On 02/11/2014 03:17 PM, Nishanth Menon wrote:
>> On 02/11/2014 07:53 AM, Roger Quadros wrote:
>>> On 02/10/2014 08:10 PM, Roger Quadros wrote:
>>>> The OMAP EHCI controller is not compatible with the EHCI
>>>> platform HCD driver so don't claim that we are.
>>>>
>>>> This fixes boot on OMAP platforms with CONFIG_USB_EHCI_HCD_PLATFORM=y
>>>> e.g. multi_v7_defconfig
>>>>
>>>> Reported-by: Nishanth Menon <nm@ti.com>
>>>> Signed-off-by: Roger Quadros <rogerq@ti.com>
>>>
>>> Please ignore this patch as Hans has agreed to do a more proper fix in
>>>
>>> http://article.gmane.org/gmane.comp.hardware.netbook.arm.sunxi/7015
>> umm.. even then, drivers/usb/host/ehci-ppc-of.c claims compatibility
>> with usb,ehci -> and we wont function with that driver either.
> 
> Right, but that has never been an issue as no kernel will ever include
> both ppc and omap support.

Conceptually, we have compatibility string today in dts description
that maps a driver that cant ever handle the device. I dont have
strong opinions either way.. just something i noticed with a git grep..

-- 
Regards,
Nishanth Menon

^ permalink raw reply

* [PATCH 1/4] arm64: topology: Implement basic CPU topology support
From: Vincent Guittot @ 2014-02-11 14:46 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20140211140749.GE3748@arm.com>

On 11 February 2014 15:07, Catalin Marinas <catalin.marinas@arm.com> wrote:
> On Tue, Feb 11, 2014 at 01:18:56PM +0000, Vincent Guittot wrote:
>> On 11 February 2014 11:34, Will Deacon <will.deacon@arm.com> wrote:
>> > On Tue, Feb 11, 2014 at 08:15:19AM +0000, Vincent Guittot wrote:
>> >> On 10 February 2014 17:46, Mark Brown <broonie@kernel.org> wrote:
>> >> > On Mon, Feb 10, 2014 at 04:22:31PM +0000, Catalin Marinas wrote:
>> >> >> On Mon, Feb 10, 2014 at 01:02:01PM +0000, Mark Brown wrote:
>> >> >
>> >> >> > +           if (cpu != cpuid)
>> >> >> > +                   cpumask_set_cpu(cpu, &cpuid_topo->thread_sibling);
>> >> >> > +   }
>> >> >> > +   smp_wmb();
>> >> >
>> >> >> I now noticed there are a couple of smp_wmb() calls in this patch. What
>> >> >> are they for?
>> >> >
>> >> > To be honest I mostly cargo culted them from the ARM implementation; I
>> >> > did look a bit but didn't fully dig into it - it seemed they were
>> >> > required to ensure that the updates for the new CPU are visible over all
>> >> > CPUs.  Vincent?
>> >>
>> >> Yes that's it. we must ensure that updates are made visible to other CPUs
>> >
>> > In relation to what? The smp_* barriers ensure ordering of observability
>> > between a number of independent accesses, so you must be ensuring
>> > ordering against something else. Also, you need to guarantee ordering on the
>> > read-side too -- how is this achieved? I can't see any smp_rmb calls from a
>> > quick grep, so I assume you're making use of address dependencies?
>>
>> The boot sequence ensures the rmb
>
> As Will said, smp_*mb() do not ensure absolute visibility, only relative
> to subsequent memory accesses on the same processor. So just placing a
> barrier at the end of a function does not mean much, it only shows half
> of the problem it is trying to solve.

OK, that's probably the shortcut that has been made, we want to drain
the write buffer to make modification available to other cpus and I
though smp_wmb and the associated mb(ishst) was there for that
purpose.

Vincent

>
> How are the secondary CPUs using this information? AFAICT, secondaries
> call smp_store_cpu_info() which also go through each CPU in
> update_siblings_mask(). Is there any race here that smp_wmb() is trying
> to solve?
>
> I guess for secondaries you could move the barrier just before
> set_cpu_online(), this way it is clear that we want any previous writes
> to become visible when this CPU is marked online. For the primary, any
> memory writes should become visible before the CPU is started. One
> synchronisation point is the pen release, depending on the smp_ops. I
> think that's already covered by code like arch/arm/mach-*/platsmp.c.
>
> So my proposal is to remove the smp_wmb() from topology.c and add it
> where it is relevant as described above. If we have some race in
> topology.c (like for example we may later decide to start more
> secondaries at the same time), it needs to be solved using spinlocks.
>
> --
> Catalin

^ permalink raw reply

* [PATCH 1/2] OF: update stdout-path parsing
From: Grant Likely @ 2014-02-11 14:54 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1391860433-5343-1-git-send-email-plagnioj@jcrosoft.com>

On Sat,  8 Feb 2014 12:53:52 +0100, Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> wrote:
> Today we only check if the linux,stdout-path property is present and retreive
> the node. But the DT specification allow to pass the serial options too as
> this
> 	linux,stdout-path = &UART0;
> 
> or with options
> 
> 	inux,stdout-path = "/plb at 0/serial at 84000000:115200";

typo.  :-)

> 
> So update the parsing to support and also the backward compatible stdout-path
> property.

Looks reasonable to me. Comment below, but otherwise:

Acked-by: Grant Likely <grant.likely@linaro.org>

> 
> Cc: linux-serial at vger.kernel.org
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  drivers/of/base.c  | 57 +++++++++++++++++++++++++++++++++++++++++++++---------
>  include/linux/of.h |  4 ++--
>  2 files changed, 50 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index ff85450..ab9ff2f 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -34,6 +34,7 @@ EXPORT_SYMBOL(of_allnodes);
>  struct device_node *of_chosen;
>  struct device_node *of_aliases;
>  static struct device_node *of_stdout;
> +static char *of_stdout_option;
>  
>  DEFINE_MUTEX(of_aliases_mutex);
>  
> @@ -1783,6 +1784,45 @@ static void of_alias_add(struct alias_prop *ap, struct device_node *np,
>  }
>  
>  /**
> + * of_stdout_path_scan - check if a device node matches the
> + *                           linux,stdout-path property and parse it
> + */
> +static void of_stdout_path_scan(void)
> +{
> +	const char *name;
> +	const char *tmp;
> +	const char *tmp_option;
> +
> +	name = of_get_property(of_chosen, "linux,stdout-path", NULL);
> +	if (!name)
> +		name = of_get_property(of_chosen, "stdout-path", NULL);

Should protect against unterminated strings. Use of_property_read_string()

> +
> +	if (!name)
> +		return;
> +
> +	tmp_option = strchr(name, ':');
> +
> +	if (!tmp_option) {
> +		of_stdout = of_find_node_by_path(name);
> +		return;
> +	}
> +
> +	tmp = kstrndup(name, strlen(name) - strlen(tmp_option), GFP_KERNEL);
> +	if (!tmp)
> +		return;

Having to do a strdup is kind of ugly and expensive when the only
problem is the terminating colon. I would rather see
of_find_node_by_path modified to do the right thing by ignoring the
colon which is illegal in path names anyway.

> +
> +	of_stdout = of_find_node_by_path(tmp);
> +	if (!of_stdout)
> +		goto out;
> +
> +	tmp_option++;
> +	of_stdout_option = kstrdup(tmp_option, GFP_KERNEL);

The strdup is unnecessary. tmp_option is already null terminated, is
immutable, and contains the data you need.

> +
> +out:
> +	kfree(tmp);

Please reverse the to eliminate the non-error goto:
	of_stdout = of_find_node_by_path(tmp);
	if (of_stdout)
		of_stdout_option = tmp_option++;
	kfree(tmp);

> +}
> +
> +/**
>   * of_alias_scan - Scan all properties of 'aliases' node
>   *
>   * The function scans all the properties of 'aliases' node and populate
> @@ -1800,13 +1840,8 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
>  	if (of_chosen == NULL)
>  		of_chosen = of_find_node_by_path("/chosen at 0");
>  
> -	if (of_chosen) {
> -		const char *name;
> -
> -		name = of_get_property(of_chosen, "linux,stdout-path", NULL);
> -		if (name)
> -			of_stdout = of_find_node_by_path(name);
> -	}
> +	if (of_chosen)
> +		of_stdout_path_scan();

Move the of_chosen check directly into the function.

>  
>  	of_aliases = of_find_node_by_path("/aliases");
>  	if (!of_aliases)
> @@ -1923,13 +1958,17 @@ EXPORT_SYMBOL_GPL(of_prop_next_string);
>   *                            linux,stdout-path property
>   *
>   * Check if this device node matches the linux,stdout-path property
> - * in the chosen node. return true if yes, false otherwise.
> + * in the chosen node. return true if yes, false otherwise with the option if
> + * requested.
>   */
> -int of_device_is_stdout_path(struct device_node *dn)
> +int of_device_is_stdout_path(struct device_node *dn, char** option)
>  {
>  	if (!of_stdout)
>  		return false;
>  
> +	if (option)
> +		*option = of_stdout_option;
> +
>  	return of_stdout == dn;
>  }
>  EXPORT_SYMBOL_GPL(of_device_is_stdout_path);
> diff --git a/include/linux/of.h b/include/linux/of.h
> index 70c64ba..a8afe44 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -352,7 +352,7 @@ const __be32 *of_prop_next_u32(struct property *prop, const __be32 *cur,
>   */
>  const char *of_prop_next_string(struct property *prop, const char *cur);
>  
> -int of_device_is_stdout_path(struct device_node *dn);
> +int of_device_is_stdout_path(struct device_node *dn, char** option);
>  
>  #else /* CONFIG_OF */
>  
> @@ -542,7 +542,7 @@ static inline int of_machine_is_compatible(const char *compat)
>  	return 0;
>  }
>  
> -static inline int of_device_is_stdout_path(struct device_node *dn)
> +static inline int of_device_is_stdout_path(struct device_node *dn, char** option)
>  {
>  	return 0;
>  }
> -- 
> 1.9.rc1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply

* [PATCH RESEND v4 00/37] mtd: st_spi_fsm: Add new driver
From: Angus Clark @ 2014-02-11 15:00 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390473085-24626-1-git-send-email-lee.jones@linaro.org>

Hi Lee,

Sorry for the delay.  I have now had a quick look through the patches.  Just a
couple of points :-)

* stfsm_probe(): stfsm_fetch_platform_configs() needs to be called *before*
config() -- config() is based on platform capabilities.  Conceptually,
stfsm_fetch_platform_configs() should be called before stfsm_jedec_probe(), and
FLASH_FLAG_32BIT_ADDR should be moved out of stfsm_fetch_platform_configs(),
placed just after stfsm_jedec_probe() but before config().

* fsm_wait_busy(): logic not quite correct if we get a P_ERR or E_ERR error
after a timeout.  I am also not sure about returning (uint8_t)-EIO.  For what
its worth, this is what I did in response to Brian's comment about the race
condition:

static uint8_t fsm_wait_busy(struct stm_spi_fsm *fsm, unsigned int max_time_ms)
{
	struct fsm_seq *seq = &fsm_seq_read_status_fifo;
	unsigned long deadline;
	uint32_t status;
	int timeout = 0;

	/* Use RDRS1 */
	seq->seq_opc[0] = (SEQ_OPC_PADS_1 |
			   SEQ_OPC_CYCLES(8) |
			   SEQ_OPC_OPCODE(FLASH_CMD_RDSR));

	/* Load read_status sequence */
	fsm_load_seq(fsm, seq);

	/*
	 * Repeat until busy bit is deasserted, or timeout, or error (S25FLxxxS)
	 */
	deadline = jiffies + msecs_to_jiffies(max_time_ms);
	while (!timeout) {
		cond_resched();

		if (time_after_eq(jiffies, deadline))
			timeout = 1;

		fsm_wait_seq(fsm);

		fsm_read_fifo(fsm, &status, 4);

		if ((status & FLASH_STATUS_BUSY) == 0)
			return 0;

		if ((fsm->configuration & CFG_S25FL_CHECK_ERROR_FLAGS) &&
		    ((status & S25FL_STATUS_P_ERR) ||
		     (status & S25FL_STATUS_E_ERR)))
			return (uint8_t)(status & 0xff);

		if (!timeout)
			/* Restart */
			writel(seq->seq_cfg, fsm->base + SPI_FAST_SEQ_CFG);
	}

	dev_err(fsm->dev, "timeout on wait_busy\n");

	return FLASH_STATUS_TIMEOUT;
}

and:

static int fsm_wait_seq(struct stm_spi_fsm *fsm)
{
	unsigned long deadline = jiffies +
		msecs_to_jiffies(FSM_MAX_WAIT_SEQ_MS);
	int timeout = 0;

	while (!timeout) {
		if (time_after_eq(jiffies, deadline))
			timeout = 1;

		if (fsm_is_idle(fsm))
			return 0;

		cond_resched();
	}

	dev_err(fsm->dev, "timeout on sequence completion\n");

	return 1;
}


* "MFD" creeps into a few commit logs ;-)

Cheers,

Angus

On 01/23/2014 10:30 AM, Lee Jones wrote:
> Version 4:
>   Tended to Brian's review comments
>     - Checkpatch acceptance
>     - MODULE_DEVICE_TABLE() name slip correction
>     - Timeout issue(s) resolved
>     - Potential infinite loop mitigated
>     - Code clarity suggests heeded
>     - Duplication with MTD core code removed
>     - Upgraded to using ROUND_UP() helper
>     - Moved non-shared header code into main driver
>     - Relocated dynamic msg sequence stores into main struct
>     - Averted adaption of static (table) data
>     - Basic whitespace/spelling/data type/dev_err suggestions applied
>   
> Version 3:
>   Okay, this thing should be fully functional now. Identify a chip
>   based on it's JEDEC ID, Read, Write, Erase (all or by sector).
>   Support for various chip quirks added too.
> 
> Version 2:
>   The first bunch of these patches have been on the MLs before, but
>   didn't receive a great deal of attention for the most part. We are
>   a little more featureful this time however. We can now successfully
>   setup and configure the N25Q256. We still can't read/write/erase
>   it though. I'll start work on that next week and will provide it in
>   the next instalment.
> 
> Version 1:
>   First stab at getting this thing Mainlined. It doesn't do a great deal
>   yet, but we are able to initialise the device and dynamically set it up
>   correctly based on an extracted JEDEC ID.
> 
>  Documentation/devicetree/bindings/mtd/st-fsm.txt |   26 ++
>  arch/arm/boot/dts/stih416-b2105.dts              |   14 +
>  arch/arm/boot/dts/stih416-pinctrl.dtsi           |   12 +
>  drivers/mtd/devices/Kconfig                      |    8 +
>  drivers/mtd/devices/Makefile                     |    1 +
>  drivers/mtd/devices/serial_flash_cmds.h          |   81 ++++
>  drivers/mtd/devices/st_spi_fsm.c                 | 2124 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 7 files changed, 2266 insertions(+)
> 
> 

-- 
-------------------------------------
Angus Clark
ST Microelectronics (R&D) Ltd.
1000 Aztec West, Bristol, BS32 4SQ
email: angus.clark at st.com
tel: +44 (0) 1454 462389
st-tina: 065 2389
-------------------------------------

^ permalink raw reply

* [PATCH 2/5] clocksource: qcom: Move clocksource code out of mach-msm
From: Kumar Gala @ 2014-02-11 15:00 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <52F9ECC7.8010702@linaro.org>


On Feb 11, 2014, at 3:26 AM, Daniel Lezcano <daniel.lezcano@linaro.org> wrote:

> On 02/04/2014 11:36 PM, Kumar Gala wrote:
>> We intent to share the clocksource code for MSM platforms between legacy
>> and multiplatform supported qcom SoCs.
>> 
>> Acked-by: Olof Johansson <olof@lixom.net>
>> Signed-off-by: Kumar Gala <galak@codeaurora.org>
> 
> Hi Kumar,
> 
> through which tree do you expect this patch to be upstream ?

The linux-qcom to keep things sane there.  So an ack would be great.

- k

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply

* [PATCH 2/2] ehci-platform: Change compatible string from usb-ehci to ehci-platform
From: Roger Quadros @ 2014-02-11 15:00 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1392127826-31290-3-git-send-email-hdegoede@redhat.com>

Hi Hans,

On 02/11/2014 04:10 PM, Hans de Goede wrote:
> The initial versions of the devicetree enablement patches for ehci-platform
> used "ehci-platform" as compatible string. However this was disliked by various
> reviewers because the platform bus is a Linux invention and devicetree is
> supposed to be OS agnostic. After much discussion I gave up, added a:
> "depends on !PPC_OF" to Kconfig to avoid a known conflict with PPC-OF platforms
> and went with the generic usb-ehci as requested.
> 
> In retro-spect I should have stuck to my guns, because the dts files for many
> existing boards already claim to be compatible with "usb-ehci", ie they have:
> 
> 	compatible = "ti,ehci-omap", "usb-ehci";
> 
> In theory this should not be a problem since the "ti,ehci-omap" entry takes
> presedence, but in practice using a conflicting compatible string is an issue,
> because it makes which driver gets used depent on driver registration order.
> 
> This patch changes the compatible string claimed by ehci-platform (back) to
> "ehci-platform", avoiding the driver registration / module loading ordering
> problems, and removes the "depends on !PPC_OF" workaround.
> 
> Note that there already is a precedent for using ?hci-platform, in the form
> of xhci-platform.c using "xhci-platfrom" as compatible string.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  Documentation/devicetree/bindings/usb/usb-ehci.txt | 4 ++--
>  drivers/usb/host/Kconfig                           | 1 -
>  drivers/usb/host/ehci-platform.c                   | 2 +-
>  3 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/usb/usb-ehci.txt b/Documentation/devicetree/bindings/usb/usb-ehci.txt
> index 2c1aeeb..46f428a 100644
> --- a/Documentation/devicetree/bindings/usb/usb-ehci.txt
> +++ b/Documentation/devicetree/bindings/usb/usb-ehci.txt
> @@ -1,7 +1,7 @@
>  USB EHCI controllers
>  
>  Required properties:
> -  - compatible : should be "usb-ehci".
> +  - compatible : should be "ehci-platform".

Won't this break DT binding info for power PC?

I'm even OK with removing "usb-ehci" and "usb-ohci" compatibles from all OMAP dts files
since they aren't really compatible with the original PPC driver.

cheers,
-roger

>    - reg : should contain at least address and length of the standard EHCI
>      register set for the device. Optional platform-dependent registers
>      (debug-port or other) can be also specified here, but only after
> @@ -27,7 +27,7 @@ Example (Sequoia 440EPx):
>  
>  Example (Allwinner sun4i A10 SoC):
>     ehci0: usb at 01c14000 {
> -	   compatible = "allwinner,sun4i-a10-ehci", "usb-ehci";
> +	   compatible = "allwinner,sun4i-a10-ehci", "ehci-platform";
>  	   reg = <0x01c14000 0x100>;
>  	   interrupts = <39>;
>  	   clocks = <&ahb_gates 1>;
> diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
> index e28cbe0..a9707da 100644
> --- a/drivers/usb/host/Kconfig
> +++ b/drivers/usb/host/Kconfig
> @@ -255,7 +255,6 @@ config USB_EHCI_ATH79
>  
>  config USB_EHCI_HCD_PLATFORM
>  	tristate "Generic EHCI driver for a platform device"
> -	depends on !PPC_OF
>  	default n
>  	---help---
>  	  Adds an EHCI host driver for a generic platform device, which
> diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
> index 8fde649..4f4d78f 100644
> --- a/drivers/usb/host/ehci-platform.c
> +++ b/drivers/usb/host/ehci-platform.c
> @@ -333,7 +333,7 @@ static int ehci_platform_resume(struct device *dev)
>  static const struct of_device_id vt8500_ehci_ids[] = {
>  	{ .compatible = "via,vt8500-ehci", },
>  	{ .compatible = "wm,prizm-ehci", },
> -	{ .compatible = "usb-ehci", },
> +	{ .compatible = "ehci-platform", },
>  	{}
>  };
>  MODULE_DEVICE_TABLE(of, vt8500_ehci_ids);
> 

^ permalink raw reply

* [PATCH 4/7] spi: pl022: attempt to get sspclk by name
From: Russell King - ARM Linux @ 2014-02-11 15:04 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <201402111508.06267.arnd@arndb.de>

On Tue, Feb 11, 2014 at 03:08:06PM +0100, Arnd Bergmann wrote:
> On Tuesday 11 February 2014, Mark Brown wrote:
> > On Tue, Feb 11, 2014 at 11:37:09AM +0000, Mark Rutland wrote:
> > 
> > > -     pl022->clk = devm_clk_get(&adev->dev, NULL);
> > > +     /*
> > > +      * For compatibility with old DTBs and platform data, fall back to the
> > > +      * first clock if there's not an explicitly named "sspclk" entry.
> > > +      */
> > > +     pl022->clk = devm_clk_get(&adev->dev, "sspclk");
> > > +     if (IS_ERR(pl022->clk))
> > > +             pl022->clk = devm_clk_get(&adev->dev, NULL);
> > > +
> > 
> > I'll just have a bit of a grumble here and point out that this sort of
> > stuff always worries me with the convention of using nameless clocks -
> > it causes hassle adding further clocks.
> 
> I think the best solution for this is to continue with anonymous clocks
> rather than adding names after the fact. This could be done (for DT-only
> drivers) using the of_clk_get() interface that takes an index, or
> we could add a generic dev_clk_get_index() or similar interface that
> has the same behavior but also works for clkdev.

Mixing devm_* and non-devm_* interfaces doesn't work.  If you want to do
that, devm_of_clk_get() would be a prerequisit.

-- 
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up.  Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was "up to 13.2Mbit".

^ permalink raw reply

* [PATCH 1/2] ohci-platform: Change compatible string from usb-ohci to ohci-platform
From: Kumar Gala @ 2014-02-11 15:06 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1392127826-31290-2-git-send-email-hdegoede@redhat.com>


On Feb 11, 2014, at 8:10 AM, Hans De Goede <hdegoede@redhat.com> wrote:

> The initial versions of the devicetree enablement patches for ohci-platform
> used "ohci-platform" as compatible string. However this was disliked by various
> reviewers because the platform bus is a Linux invention and devicetree is
> supposed to be OS agnostic. After much discussion I gave up and went with
> the generic usb-ohci as requested.
> 
> In retro-spect I should have stuck to my guns, because the dts files for many
> existing boards already claim to be compatible with "usb-ohci", ie they have:
> 
> 	compatible = "ti,ohci-omap3", "usb-ohci";
> 
> In theory this should not be a problem since the "ti,ohci-omap3" entry takes
> presedence, but in practice using a conflicting compatible string is an issue,
> because it makes which driver gets used depent on driver registration order.
> 
> This patch changes the compatible string claimed by ohci-platform (back) to
> "ohci-platform", avoiding the driver registration / module loading ordering
> problems. Note that there already is a precedent for using ?hci-platform, in
> the form of xhci-platform.c using "xhci-platfrom" as compatible string.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> Documentation/devicetree/bindings/usb/usb-ohci.txt | 4 ++--
> drivers/usb/host/ohci-platform.c                   | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/usb/usb-ohci.txt b/Documentation/devicetree/bindings/usb/usb-ohci.txt
> index 6933b0c..a8e576a 100644
> --- a/Documentation/devicetree/bindings/usb/usb-ohci.txt
> +++ b/Documentation/devicetree/bindings/usb/usb-ohci.txt
> @@ -1,7 +1,7 @@
> USB OHCI controllers
> 
> Required properties:
> -- compatible : "usb-ohci?

Why not leave ?usb-ohci? and deprecate it?

> +- compatible : "ohci-platform"
> - reg : ohci controller register range (address and length)
> - interrupts : ohci controller interrupt
> 
> @@ -16,7 +16,7 @@ Optional properties:
> Example:
> 
> 	ohci0: usb at 01c14400 {
> -		compatible = "allwinner,sun4i-a10-ohci", "usb-ohci";
> +		compatible = "allwinner,sun4i-a10-ohci", "ohci-platform";
> 		reg = <0x01c14400 0x100>;
> 		interrupts = <64>;
> 		clocks = <&usb_clk 6>, <&ahb_gates 2>;
> diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c
> index e2c28fd..59f3551 100644
> --- a/drivers/usb/host/ohci-platform.c
> +++ b/drivers/usb/host/ohci-platform.c
> @@ -319,7 +319,7 @@ static int ohci_platform_resume(struct device *dev)
> #endif /* CONFIG_PM */
> 
> static const struct of_device_id ohci_platform_ids[] = {
> -	{ .compatible = "usb-ohci", },
> +	{ .compatible = "ohci-platform", },
> 	{ }
> };
> MODULE_DEVICE_TABLE(of, ohci_platform_ids);
> -- 
> 1.8.5.3
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply

* [PATCH v3 3/5] ARM: qcom: Split Qualcomm support into legacy and multiplatform
From: Kumar Gala @ 2014-02-11 15:13 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20140208032607.GC10784@codeaurora.org>


On Feb 7, 2014, at 9:26 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:

> On 02/06, Kumar Gala wrote:
>> diff --git a/arch/arm/mach-msm/platsmp.c b/arch/arm/mach-qcom/platsmp.c
>> similarity index 98%
>> rename from arch/arm/mach-msm/platsmp.c
>> rename to arch/arm/mach-qcom/platsmp.c
>> index 251a91e..67823a7 100644
>> --- a/arch/arm/mach-msm/platsmp.c
>> +++ b/arch/arm/mach-qcom/platsmp.c
>> @@ -2,6 +2,7 @@
>>  *  Copyright (C) 2002 ARM Ltd.
>>  *  All Rights Reserved
>>  *  Copyright (c) 2010, Code Aurora Forum. All rights reserved.
>> + *  Copyright (c) 2014 The Linux Foundation. All rights reserved.
> 
> We should replace the Code Aurora Forum copyright with Linux
> Foundation here.

Is this something we?ve been doing?  Its normally bad form to make such changes, but I don?t know what the details re when LF took over CAF w/regards to something like Copyright.

- k

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply

* [PATCH 1/2] ohci-platform: Change compatible string from usb-ohci to ohci-platform
From: Hans de Goede @ 2014-02-11 15:21 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <954E6E26-EEF1-4A0A-A9BC-D5CA918FAD43@codeaurora.org>

Hi,

On 02/11/2014 04:06 PM, Kumar Gala wrote:
> 
> On Feb 11, 2014, at 8:10 AM, Hans De Goede <hdegoede@redhat.com> wrote:
> 
>> The initial versions of the devicetree enablement patches for ohci-platform
>> used "ohci-platform" as compatible string. However this was disliked by various
>> reviewers because the platform bus is a Linux invention and devicetree is
>> supposed to be OS agnostic. After much discussion I gave up and went with
>> the generic usb-ohci as requested.
>>
>> In retro-spect I should have stuck to my guns, because the dts files for many
>> existing boards already claim to be compatible with "usb-ohci", ie they have:
>>
>> 	compatible = "ti,ohci-omap3", "usb-ohci";
>>
>> In theory this should not be a problem since the "ti,ohci-omap3" entry takes
>> presedence, but in practice using a conflicting compatible string is an issue,
>> because it makes which driver gets used depent on driver registration order.
>>
>> This patch changes the compatible string claimed by ohci-platform (back) to
>> "ohci-platform", avoiding the driver registration / module loading ordering
>> problems. Note that there already is a precedent for using ?hci-platform, in
>> the form of xhci-platform.c using "xhci-platfrom" as compatible string.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>> Documentation/devicetree/bindings/usb/usb-ohci.txt | 4 ++--
>> drivers/usb/host/ohci-platform.c                   | 2 +-
>> 2 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/usb/usb-ohci.txt b/Documentation/devicetree/bindings/usb/usb-ohci.txt
>> index 6933b0c..a8e576a 100644
>> --- a/Documentation/devicetree/bindings/usb/usb-ohci.txt
>> +++ b/Documentation/devicetree/bindings/usb/usb-ohci.txt
>> @@ -1,7 +1,7 @@
>> USB OHCI controllers
>>
>> Required properties:
>> -- compatible : "usb-ohci?
> 
> Why not leave ?usb-ohci? and deprecate it?

As it was introduced just a couple of days ago in linux-next, and has never seen
the light in any released kernel.

Regards,

Hans

^ permalink raw reply

* [PATCH 06/11] ARM: mvebu: add Armada 380/385 support to the system-controller driver
From: Thomas Petazzoni @ 2014-02-11 15:24 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CACxGe6u--F0J=kaHnvSsyDXNaO1r++T_TgzpNyy_2JU7+07r7w@mail.gmail.com>

Grant,

On Tue, 11 Feb 2014 14:22:04 +0000, Grant Likely wrote:

> >> +     }, {
> >> +             /*
> >> +              * As far as RSTOUTn and System soft reset registers
> >> +              * are concerned, Armada 38x is similar to Armada
> >> +              * 370/XP
> >> +              */
> >> +             .compatible = "marvell,armada-380-system-controller",
> >> +             .data = (void *) &armada_370_xp_system_controller,
> 
> However, this would not be the right thing to do. The better solution
> is to put the following into the .dts file:
> 
> compatible = "marvell,armada-380-system-controller","marvell,armada-370-system-controller"
> 
> So that the kernel has the option to override the 370 version if an
> errata or extra feature support ever needs to be added.

Ah, right true. Makes sense. We are going to update our patch set to
take this suggestion into account, and resubmit a v2 with this. This
way, we don't need new to introduce in drivers new compatible strings
for the clocksource driver, the mbus driver and the system-controller
driver.

Thanks Grant for your suggestion.

Jason, are you ok with this?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply

* [PATCH 2/2] ehci-platform: Change compatible string from usb-ehci to ehci-platform
From: Hans de Goede @ 2014-02-11 15:26 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <52FA3B2B.7050906@ti.com>

Hi,

On 02/11/2014 04:00 PM, Roger Quadros wrote:
> Hi Hans,
> 
> On 02/11/2014 04:10 PM, Hans de Goede wrote:
>> The initial versions of the devicetree enablement patches for ehci-platform
>> used "ehci-platform" as compatible string. However this was disliked by various
>> reviewers because the platform bus is a Linux invention and devicetree is
>> supposed to be OS agnostic. After much discussion I gave up, added a:
>> "depends on !PPC_OF" to Kconfig to avoid a known conflict with PPC-OF platforms
>> and went with the generic usb-ehci as requested.
>>
>> In retro-spect I should have stuck to my guns, because the dts files for many
>> existing boards already claim to be compatible with "usb-ehci", ie they have:
>>
>> 	compatible = "ti,ehci-omap", "usb-ehci";
>>
>> In theory this should not be a problem since the "ti,ehci-omap" entry takes
>> presedence, but in practice using a conflicting compatible string is an issue,
>> because it makes which driver gets used depent on driver registration order.
>>
>> This patch changes the compatible string claimed by ehci-platform (back) to
>> "ehci-platform", avoiding the driver registration / module loading ordering
>> problems, and removes the "depends on !PPC_OF" workaround.
>>
>> Note that there already is a precedent for using ?hci-platform, in the form
>> of xhci-platform.c using "xhci-platfrom" as compatible string.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>>  Documentation/devicetree/bindings/usb/usb-ehci.txt | 4 ++--
>>  drivers/usb/host/Kconfig                           | 1 -
>>  drivers/usb/host/ehci-platform.c                   | 2 +-
>>  3 files changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/usb/usb-ehci.txt b/Documentation/devicetree/bindings/usb/usb-ehci.txt
>> index 2c1aeeb..46f428a 100644
>> --- a/Documentation/devicetree/bindings/usb/usb-ehci.txt
>> +++ b/Documentation/devicetree/bindings/usb/usb-ehci.txt
>> @@ -1,7 +1,7 @@
>>  USB EHCI controllers
>>  
>>  Required properties:
>> -  - compatible : should be "usb-ehci".
>> +  - compatible : should be "ehci-platform".
> 
> Won't this break DT binding info for power PC?

The powerpc bindings have never been really properly documented, ie
they rely on both usb-ehci and ibm,usb-ehci-440epx strings being there,
which was never documented. Given the issues surrounding using usb-ehci
as a compatible string I think completely removing it from the bindings
docs is best.

> I'm even OK with removing "usb-ehci" and "usb-ohci" compatibles from all OMAP dts files
> since they aren't really compatible with the original PPC driver.

I don't think that is necessary, as your grep has shown there are a lot
of dts files using compatible = "foo", "usb-?hci"; and some may even have
the dts in firmware, so we should simply make sure not to break such dts.

Regards,

Hans

^ permalink raw reply

* ohci-/ehci-platform: Change compatible string to ?hci-platform
From: Alan Stern @ 2014-02-11 15:27 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1392127826-31290-1-git-send-email-hdegoede@redhat.com>

On Tue, 11 Feb 2014, Hans de Goede wrote:

> Hi Greg,
> 
> Can you please add these 2 patches to usb-next, to unbreak usb on various
> ARM platforms?
> 
> These 2 patches can either be squashed into the first 2 patches of my previous
> set or added as is to preserve history, either way is fine with me.
> 
> The 2nd patch also fixes one of the Kconfig issues and I've a better plan
> for the 2nd Kconfig issue too, so please consider this a self-nack for my
> drivers/usb/host/Kconfig patches.
> 
> Here is a copy of the echi-platform commit-msg to explain the rationale of
> these changes, as well as how the breakage happened in the first place:
> 
> The initial versions of the devicetree enablement patches for ehci-platform
> used "ehci-platform" as compatible string. However this was disliked by various
> reviewers because the platform bus is a Linux invention and devicetree is
> supposed to be OS agnostic. After much discussion I gave up, added a:
> "depends on !PPC_OF" to Kconfig to avoid a known conflict with PPC-OF platforms
> and went with the generic usb-ehci as requested.
> 
> In retro-spect I should have stuck to my guns, because the dts files for many
> existing boards already claim to be compatible with "usb-ehci", ie they have:
> 
> 	compatible = "ti,ehci-omap", "usb-ehci";
> 
> In theory this should not be a problem since the "ti,ehci-omap" entry takes
> presedence, but in practice using a conflicting compatible string is an issue,
> because it makes which driver gets used depend on driver registration order.
> 
> This patch changes the compatible string claimed by ehci-platform (back) to
> "ehci-platform", avoiding the driver registration / module loading ordering
> problems, and removes the "depends on !PPC_OF" workaround.
> 
> Note that there already is a precedent for using ?hci-platform, in the form
> of xhci-platform.c using "xhci-platfrom" as compatible string.

I still think that "ehci-generic" would be better than "ehci-platform"  
(and the same for ohci).  The reason is that "-platform" is essentially
meaningless, whereas "-generic" strongly suggests that the hardware
matches the specification with no special features or requirements.  
Since the compatibility string -- like everything else in DT -- is
supposed to be a description of the hardware, this seems only logical.

It might even be a good idea to change the "xhci-platform" string to 
match, it that doesn't cause too much trouble.

Alan Stern

^ permalink raw reply

* [PATCH] ARM: dts: omap3-n9 family: mark proper OMAP version
From: Nishanth Menon @ 2014-02-11 15:29 UTC (permalink / raw)
  To: linux-arm-kernel

Nokia N900 uses OMAP3430 and N9/N950 uses OMAP3630. Mark SoC compatibilty
as per Documentation/devicetree/bindings/arm/omap/omap.txt else
N9/N950 will be probed as a OMAP3430 type device, since default ti,omap3
maps to OMAP3430 compatibility.

Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Nishanth Menon <nm@ti.com>
---

just build tested. but given examples such as 
http://thread.gmane.org/gmane.linux.ports.arm.omap/110006

I guess, some form of failure is expected.

based on v3.14-rc2

 arch/arm/boot/dts/omap3-n9.dts   |    2 +-
 arch/arm/boot/dts/omap3-n900.dts |    2 +-
 arch/arm/boot/dts/omap3-n950.dts |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/omap3-n9.dts b/arch/arm/boot/dts/omap3-n9.dts
index 39828ce..9938b5d 100644
--- a/arch/arm/boot/dts/omap3-n9.dts
+++ b/arch/arm/boot/dts/omap3-n9.dts
@@ -14,5 +14,5 @@
 
 / {
 	model = "Nokia N9";
-	compatible = "nokia,omap3-n9", "ti,omap3";
+	compatible = "nokia,omap3-n9", "ti,omap36xx", "ti,omap3";
 };
diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index 6fc85f9..97db027 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -13,7 +13,7 @@
 
 / {
 	model = "Nokia N900";
-	compatible = "nokia,omap3-n900", "ti,omap3";
+	compatible = "nokia,omap3-n900", "ti,omap3430", "ti,omap3";
 
 	cpus {
 		cpu at 0 {
diff --git a/arch/arm/boot/dts/omap3-n950.dts b/arch/arm/boot/dts/omap3-n950.dts
index b076a52..261c558 100644
--- a/arch/arm/boot/dts/omap3-n950.dts
+++ b/arch/arm/boot/dts/omap3-n950.dts
@@ -14,5 +14,5 @@
 
 / {
 	model = "Nokia N950";
-	compatible = "nokia,omap3-n950", "ti,omap3";
+	compatible = "nokia,omap3-n950", "ti,omap36xx", "ti,omap3";
 };
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH 06/11] ARM: mvebu: add Armada 380/385 support to the system-controller driver
From: Jason Cooper @ 2014-02-11 15:30 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20140211162436.2bbe5719@skate>

On Tue, Feb 11, 2014 at 04:24:36PM +0100, Thomas Petazzoni wrote:
> Grant,
> 
> On Tue, 11 Feb 2014 14:22:04 +0000, Grant Likely wrote:
> 
> > >> +     }, {
> > >> +             /*
> > >> +              * As far as RSTOUTn and System soft reset registers
> > >> +              * are concerned, Armada 38x is similar to Armada
> > >> +              * 370/XP
> > >> +              */
> > >> +             .compatible = "marvell,armada-380-system-controller",
> > >> +             .data = (void *) &armada_370_xp_system_controller,
> > 
> > However, this would not be the right thing to do. The better solution
> > is to put the following into the .dts file:
> > 
> > compatible = "marvell,armada-380-system-controller","marvell,armada-370-system-controller"
> > 
> > So that the kernel has the option to override the 370 version if an
> > errata or extra feature support ever needs to be added.
> 
> Ah, right true. Makes sense. We are going to update our patch set to
> take this suggestion into account, and resubmit a v2 with this. This
> way, we don't need new to introduce in drivers new compatible strings
> for the clocksource driver, the mbus driver and the system-controller
> driver.
> 
> Thanks Grant for your suggestion.
> 
> Jason, are you ok with this?

Yes.  Thanks Grant for clearing this up.  And thanks guys for tolerating
my "This doesn't look right, but I'm having trouble explaining how"
moment :)

thx,

Jason.

^ permalink raw reply

* [PATCH 1/2] ohci-platform: Change compatible string from usb-ohci to ohci-platform
From: Kumar Gala @ 2014-02-11 15:34 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <52FA3FE6.8040308@redhat.com>


On Feb 11, 2014, at 9:21 AM, Hans de Goede <hdegoede@redhat.com> wrote:

> Hi,
> 
> On 02/11/2014 04:06 PM, Kumar Gala wrote:
>> 
>> On Feb 11, 2014, at 8:10 AM, Hans De Goede <hdegoede@redhat.com> wrote:
>> 
>>> The initial versions of the devicetree enablement patches for ohci-platform
>>> used "ohci-platform" as compatible string. However this was disliked by various
>>> reviewers because the platform bus is a Linux invention and devicetree is
>>> supposed to be OS agnostic. After much discussion I gave up and went with
>>> the generic usb-ohci as requested.
>>> 
>>> In retro-spect I should have stuck to my guns, because the dts files for many
>>> existing boards already claim to be compatible with "usb-ohci", ie they have:
>>> 
>>> 	compatible = "ti,ohci-omap3", "usb-ohci";
>>> 
>>> In theory this should not be a problem since the "ti,ohci-omap3" entry takes
>>> presedence, but in practice using a conflicting compatible string is an issue,
>>> because it makes which driver gets used depent on driver registration order.
>>> 
>>> This patch changes the compatible string claimed by ohci-platform (back) to
>>> "ohci-platform", avoiding the driver registration / module loading ordering
>>> problems. Note that there already is a precedent for using ?hci-platform, in
>>> the form of xhci-platform.c using "xhci-platfrom" as compatible string.
>>> 
>>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>>> ---
>>> Documentation/devicetree/bindings/usb/usb-ohci.txt | 4 ++--
>>> drivers/usb/host/ohci-platform.c                   | 2 +-
>>> 2 files changed, 3 insertions(+), 3 deletions(-)
>>> 
>>> diff --git a/Documentation/devicetree/bindings/usb/usb-ohci.txt b/Documentation/devicetree/bindings/usb/usb-ohci.txt
>>> index 6933b0c..a8e576a 100644
>>> --- a/Documentation/devicetree/bindings/usb/usb-ohci.txt
>>> +++ b/Documentation/devicetree/bindings/usb/usb-ohci.txt
>>> @@ -1,7 +1,7 @@
>>> USB OHCI controllers
>>> 
>>> Required properties:
>>> -- compatible : "usb-ohci?
>> 
>> Why not leave ?usb-ohci? and deprecate it?
> 
> As it was introduced just a couple of days ago in linux-next, and has never seen
> the light in any released kernel.

ah, never mind :)

- k
-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply

* [RFC PATCH] ARM: Add imprecise abort enable/disable macro
From: Dave Martin @ 2014-02-11 15:38 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <52F90071.4080604@codethink.co.uk>

On Mon, Feb 10, 2014 at 04:38:09PM +0000, Ben Dooks wrote:
> On 10/02/14 15:21, Dave Martin wrote:

[...]

> >Does PCI have any way of finding out which parts of the configuration
> >space are there before you are forced to go poking around in invalid
> >address space?
> >
> >I'm guessing there may not be, otherwise this convsersation might not
> >be happening ... but I don't know too much about PCI.
> 
> IIRC for configuration accesses you have to wait for the PCIe core
> to get a response from the other end. The systems I've seen either
> poll for completion or hold the transaction until the pcie core has
> finished working.

So presumably if the other end isn't there, then it's up to the PCIe
implementation to decide how to signal that back to the CPU, or are
things more constrained than that?

I sill don't understand whether the failing probe is triggered directly
from the PCI common code in the kernel or whether it comes from the
specific bus driver.  If the latter, hacks for working round this at
least won't touch the common code, which is the preferable outcome.

Cheers
---Dave

^ permalink raw reply

* [RFC PATCH V2 3/4] arm64: mm: Enable HAVE_RCU_TABLE_FREE logic
From: Catalin Marinas @ 2014-02-11 15:42 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1391703531-12845-4-git-send-email-steve.capper@linaro.org>

Hi Steve,

On Thu, Feb 06, 2014 at 04:18:50PM +0000, Steve Capper wrote:
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 6d4dd22..129bd6a 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -28,6 +28,7 @@ config ARM64
>  	select HAVE_HW_BREAKPOINT if PERF_EVENTS
>  	select HAVE_MEMBLOCK
>  	select HAVE_PERF_EVENTS
> +	select HAVE_RCU_TABLE_FREE
>  	select IRQ_DOMAIN
>  	select MODULES_USE_ELF_RELA
>  	select NO_BOOTMEM
> diff --git a/arch/arm64/include/asm/tlb.h b/arch/arm64/include/asm/tlb.h
> index 717031a..8999823 100644
> --- a/arch/arm64/include/asm/tlb.h
> +++ b/arch/arm64/include/asm/tlb.h
> @@ -27,12 +27,33 @@
>  
>  #define MMU_GATHER_BUNDLE	8
>  
> +static inline void __tlb_remove_table(void *_table)
> +{
> +	free_page_and_swap_cache((struct page *)_table);
> +}

I think you can reduce your patch to just the above (and a linux/swap.h
include) after the arm64 conversion to generic mmu_gather below.

I cc'ed Peter Z for a sanity check, some of the code is close to
https://lkml.org/lkml/2011/3/7/302, only that it's under arch/arm64.

And, of course, it needs a lot more testing.

-------------8<---------------------------------------

>From 01a958dfc44eb7ec697625813b3b98a705bad324 Mon Sep 17 00:00:00 2001
From: Catalin Marinas <catalin.marinas@arm.com>
Date: Tue, 11 Feb 2014 15:22:01 +0000
Subject: [PATCH] arm64: Convert asm/tlb.h to generic mmu_gather

Over the past couple of years, the generic mmu_gather gained range
tracking - 597e1c3580b7 (mm/mmu_gather: enable tlb flush range in generic
mmu_gather), 2b047252d087 (Fix TLB gather virtual address range
invalidation corner cases) - and tlb_fast_mode() has been removed -
29eb77825cc7 (arch, mm: Remove tlb_fast_mode()).

The new mmu_gather structure is now suitable for arm64 and this patch
converts the arch asm/tlb.h to the generic code. One functional
difference is the shift_arg_pages() case where previously the code was
flushing the full mm (no tlb_start_vma call) but now it flushes the
range given to tlb_gather_mmu() (possibly slightly more efficient
previously).

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
---
 arch/arm64/include/asm/tlb.h | 136 +++++++------------------------------------
 1 file changed, 20 insertions(+), 116 deletions(-)

diff --git a/arch/arm64/include/asm/tlb.h b/arch/arm64/include/asm/tlb.h
index 717031a762c2..72cadf52ca80 100644
--- a/arch/arm64/include/asm/tlb.h
+++ b/arch/arm64/include/asm/tlb.h
@@ -19,115 +19,44 @@
 #ifndef __ASM_TLB_H
 #define __ASM_TLB_H
 
-#include <linux/pagemap.h>
-#include <linux/swap.h>
 
-#include <asm/pgalloc.h>
-#include <asm/tlbflush.h>
-
-#define MMU_GATHER_BUNDLE	8
-
-/*
- * TLB handling.  This allows us to remove pages from the page
- * tables, and efficiently handle the TLB issues.
- */
-struct mmu_gather {
-	struct mm_struct	*mm;
-	unsigned int		fullmm;
-	struct vm_area_struct	*vma;
-	unsigned long		start, end;
-	unsigned long		range_start;
-	unsigned long		range_end;
-	unsigned int		nr;
-	unsigned int		max;
-	struct page		**pages;
-	struct page		*local[MMU_GATHER_BUNDLE];
-};
+#include <asm-generic/tlb.h>
 
 /*
- * This is unnecessarily complex.  There's three ways the TLB shootdown
- * code is used:
+ * There's three ways the TLB shootdown code is used:
  *  1. Unmapping a range of vmas.  See zap_page_range(), unmap_region().
  *     tlb->fullmm = 0, and tlb_start_vma/tlb_end_vma will be called.
- *     tlb->vma will be non-NULL.
  *  2. Unmapping all vmas.  See exit_mmap().
  *     tlb->fullmm = 1, and tlb_start_vma/tlb_end_vma will be called.
- *     tlb->vma will be non-NULL.  Additionally, page tables will be freed.
+ *     Page tables will be freed.
  *  3. Unmapping argument pages.  See shift_arg_pages().
  *     tlb->fullmm = 0, but tlb_start_vma/tlb_end_vma will not be called.
- *     tlb->vma will be NULL.
  */
 static inline void tlb_flush(struct mmu_gather *tlb)
 {
-	if (tlb->fullmm || !tlb->vma)
+	if (tlb->fullmm) {
 		flush_tlb_mm(tlb->mm);
-	else if (tlb->range_end > 0) {
-		flush_tlb_range(tlb->vma, tlb->range_start, tlb->range_end);
-		tlb->range_start = TASK_SIZE;
-		tlb->range_end = 0;
+	} else if (tlb->end > 0) {
+		struct vm_area_struct vma = { .vm_mm = tlb->mm, };
+		flush_tlb_range(&vma, tlb->start, tlb->end);
+		tlb->start = TASK_SIZE;
+		tlb->end = 0;
 	}
 }
 
 static inline void tlb_add_flush(struct mmu_gather *tlb, unsigned long addr)
 {
 	if (!tlb->fullmm) {
-		if (addr < tlb->range_start)
-			tlb->range_start = addr;
-		if (addr + PAGE_SIZE > tlb->range_end)
-			tlb->range_end = addr + PAGE_SIZE;
-	}
-}
-
-static inline void __tlb_alloc_page(struct mmu_gather *tlb)
-{
-	unsigned long addr = __get_free_pages(GFP_NOWAIT | __GFP_NOWARN, 0);
-
-	if (addr) {
-		tlb->pages = (void *)addr;
-		tlb->max = PAGE_SIZE / sizeof(struct page *);
+		tlb->start = min(tlb->start, addr);
+		tlb->end = max(tlb->end, addr + PAGE_SIZE);
 	}
 }
 
-static inline void tlb_flush_mmu(struct mmu_gather *tlb)
-{
-	tlb_flush(tlb);
-	free_pages_and_swap_cache(tlb->pages, tlb->nr);
-	tlb->nr = 0;
-	if (tlb->pages == tlb->local)
-		__tlb_alloc_page(tlb);
-}
-
-static inline void
-tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, unsigned long start, unsigned long end)
-{
-	tlb->mm = mm;
-	tlb->fullmm = !(start | (end+1));
-	tlb->start = start;
-	tlb->end = end;
-	tlb->vma = NULL;
-	tlb->max = ARRAY_SIZE(tlb->local);
-	tlb->pages = tlb->local;
-	tlb->nr = 0;
-	__tlb_alloc_page(tlb);
-}
-
-static inline void
-tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
-{
-	tlb_flush_mmu(tlb);
-
-	/* keep the page table cache within bounds */
-	check_pgt_cache();
-
-	if (tlb->pages != tlb->local)
-		free_pages((unsigned long)tlb->pages, 0);
-}
-
 /*
  * Memorize the range for the TLB flush.
  */
-static inline void
-tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep, unsigned long addr)
+static inline void __tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep,
+					  unsigned long addr)
 {
 	tlb_add_flush(tlb, addr);
 }
@@ -137,38 +66,24 @@ tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep, unsigned long addr)
  * case where we're doing a full MM flush.  When we're doing a munmap,
  * the vmas are adjusted to only cover the region to be torn down.
  */
-static inline void
-tlb_start_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
+static inline void tlb_start_vma(struct mmu_gather *tlb,
+				 struct vm_area_struct *vma)
 {
 	if (!tlb->fullmm) {
-		tlb->vma = vma;
-		tlb->range_start = TASK_SIZE;
-		tlb->range_end = 0;
+		tlb->start = TASK_SIZE;
+		tlb->end = 0;
 	}
 }
 
-static inline void
-tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
+static inline void tlb_end_vma(struct mmu_gather *tlb,
+			       struct vm_area_struct *vma)
 {
 	if (!tlb->fullmm)
 		tlb_flush(tlb);
 }
 
-static inline int __tlb_remove_page(struct mmu_gather *tlb, struct page *page)
-{
-	tlb->pages[tlb->nr++] = page;
-	VM_BUG_ON(tlb->nr > tlb->max);
-	return tlb->max - tlb->nr;
-}
-
-static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
-{
-	if (!__tlb_remove_page(tlb, page))
-		tlb_flush_mmu(tlb);
-}
-
 static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,
-	unsigned long addr)
+				  unsigned long addr)
 {
 	pgtable_page_dtor(pte);
 	tlb_add_flush(tlb, addr);
@@ -184,16 +99,5 @@ static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmdp,
 }
 #endif
 
-#define pte_free_tlb(tlb, ptep, addr)	__pte_free_tlb(tlb, ptep, addr)
-#define pmd_free_tlb(tlb, pmdp, addr)	__pmd_free_tlb(tlb, pmdp, addr)
-#define pud_free_tlb(tlb, pudp, addr)	pud_free((tlb)->mm, pudp)
-
-#define tlb_migrate_finish(mm)		do { } while (0)
-
-static inline void
-tlb_remove_pmd_tlb_entry(struct mmu_gather *tlb, pmd_t *pmdp, unsigned long addr)
-{
-	tlb_add_flush(tlb, addr);
-}
 
 #endif

^ permalink raw reply related

* [PATCH] ARM: mm: add imprecise abort non-deadly handler
From: Dave Martin @ 2014-02-11 15:43 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <52F90B7B.50807@codethink.co.uk>

On Mon, Feb 10, 2014 at 05:25:15PM +0000, Ben Dooks wrote:
> On 10/02/14 14:37, Dave Martin wrote:

[...]

> >"Spurious" imprecise aborts pretty much always indicate a hardware error
> >or a nasty bug somewhere.
> 
> I need to find out where the one we are catching is coming from in our
> system.

Would certainly be good to know...

> >Another cause is badly implemented, buggy or malicious userspace software
> >being given more exotic mmaps that it is qualified to deal with
> >responsibly.  That's a nasty bug in the distro maintainer / system
> >administrator / vendor.
> >
> >So, I think this should be at least KERN_ERROR; maybe KERN_CRIT or above.
> >We must not encourage people to think that these aborts are somehow
> >benign.
> 
> Ok, KERN_ERROR or KERN_CRIT sound reasonable.
> 
> >If we really want people to fix their bugs, it may be worth considering
> >panic(), or doing this when some threshold is reached.  This may be a
> >bit harsh though, at least without some threshold.
> 
> I was considering also firing a WARN_ON(abort_count++ > 10) or something
> similar.

Maybe WARN_ON the first such abort, and ratelimit somehow after?

Being noisy is good -- it's just killing a random, possibly-innocent task
that's not so good.

Cheers
---Dave

^ permalink raw reply

* ohci-/ehci-platform: Change compatible string to ?hci-platform
From: Arnd Bergmann @ 2014-02-11 15:43 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <Pine.LNX.4.44L0.1402111023240.1209-100000@iolanthe.rowland.org>

On Tuesday 11 February 2014 10:27:12 Alan Stern wrote:
> 
> It might even be a good idea to change the "xhci-platform" string to 
> match, it that doesn't cause too much trouble.

The original xhci binding was contributed by Al Cooper, but I don't
see any dts files using it. I agree that xhci-generic is a better
name than xhci-platform, and I think we should make that the recommended
string. If Al or someone thinks the xhci-generic string might already
be used in production devices, we should however allow both names
in the binding and in the driver.

	Arnd

^ permalink raw reply

* [PATCH 4/7] spi: pl022: attempt to get sspclk by name
From: Arnd Bergmann @ 2014-02-11 15:48 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20140211150438.GJ26684@n2100.arm.linux.org.uk>

On Tuesday 11 February 2014 15:04:38 Russell King - ARM Linux wrote:
> On Tue, Feb 11, 2014 at 03:08:06PM +0100, Arnd Bergmann wrote:
> > On Tuesday 11 February 2014, Mark Brown wrote:
> > > On Tue, Feb 11, 2014 at 11:37:09AM +0000, Mark Rutland wrote:
> > > 
> > > > -     pl022->clk = devm_clk_get(&adev->dev, NULL);
> > > > +     /*
> > > > +      * For compatibility with old DTBs and platform data, fall back to the
> > > > +      * first clock if there's not an explicitly named "sspclk" entry.
> > > > +      */
> > > > +     pl022->clk = devm_clk_get(&adev->dev, "sspclk");
> > > > +     if (IS_ERR(pl022->clk))
> > > > +             pl022->clk = devm_clk_get(&adev->dev, NULL);
> > > > +
> > > 
> > > I'll just have a bit of a grumble here and point out that this sort of
> > > stuff always worries me with the convention of using nameless clocks -
> > > it causes hassle adding further clocks.
> > 
> > I think the best solution for this is to continue with anonymous clocks
> > rather than adding names after the fact. This could be done (for DT-only
> > drivers) using the of_clk_get() interface that takes an index, or
> > we could add a generic dev_clk_get_index() or similar interface that
> > has the same behavior but also works for clkdev.
> 
> Mixing devm_* and non-devm_* interfaces doesn't work.  If you want to do
> that, devm_of_clk_get() would be a prerequisit.

Yes, good point. So if we want to do it, we would have to add a new
function anyway, there is just the question whether it should be
devm_of_clk_get() or devm_clk_get_index() if that can also work for
non-DT devices. Do you think the latter actually makes sense in
the clkdev interfaces? I'm not familiar enough with the code to
tell how that would be implemented in a reasonable way.

	Arnd

^ permalink raw reply

* [RFC PATCH V2 4/4] arm64: mm: implement get_user_pages_fast
From: Catalin Marinas @ 2014-02-11 15:48 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1391703531-12845-5-git-send-email-steve.capper@linaro.org>

On Thu, Feb 06, 2014 at 04:18:51PM +0000, Steve Capper wrote:
> An implementation of get_user_pages_fast for arm64. It is based on the
> arm implementation (it has the added ability to walk huge puds) which
> is loosely on the PowerPC implementation. We disable interrupts in the
> walker to prevent the call_rcu_sched pagetable freeing code from
> running under us.
> 
> We also explicitly fire an IPI in the Transparent HugePage splitting
> case to prevent splits from interfering with the fast_gup walker.
> As THP splits are relatively rare, this should not have a noticable
> overhead.
> 
> Signed-off-by: Steve Capper <steve.capper@linaro.org>
> ---
>  arch/arm64/include/asm/pgtable.h |   4 +
>  arch/arm64/mm/Makefile           |   2 +-
>  arch/arm64/mm/gup.c              | 297 +++++++++++++++++++++++++++++++++++++++

Why don't you make a generic gup.c implementation and let architectures
select it? I don't see much arm64-specific code in here.

-- 
Catalin

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox