Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 02/11] iommu/arm-smmu: Introduce iommu_group notifier block
From: Varun Sethi @ 2014-01-21 17:48 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20140120222814.GI3471@alberich>



> -----Original Message-----
> From: Andreas Herrmann [mailto:andreas.herrmann at calxeda.com]
> Sent: Tuesday, January 21, 2014 3:58 AM
> To: Will Deacon
> Cc: iommu at lists.linux-foundation.org; linux-arm-
> kernel at lists.infradead.org; Andreas Herrmann; Sethi Varun-B16395
> Subject: [PATCH v3 02/11] iommu/arm-smmu: Introduce iommu_group notifier
> block
> 
> 
> At the moment just handle IOMMU_GROUP_NOTIFY_BIND_DRIVER to conditionally
> isolate all master devices for an SMMU.
> 
> Depending on DT information each device is put into its own protection
> domain (if possible).  For configuration with one or just a few masters
> per SMMU that is easy to achieve.
> 
> In case of many devices per SMMU (e.g. MMU-500 with it's distributed
> translation support) isolation of each device might not be possible --
> depending on number of available SMR groups and/or context banks.
> 
> Default is that device isolation is contolled per SMMU with SMMU node
> property "arm,smmu-isolate-devices" in a DT. If this property is set for
> an SMMU node, device isolation is performed.
> 
> W/o device isolation the driver detects SMMUs but no translation is
> configured (transactions just bypass translation process).
> 
> Note that for device isolation dma_base and size are fixed as 0 and
> SZ_128M at the moment. Additional patches will address this restriction
> and allow automatic growth of mapping size.
> 
> Cc: Varun Sethi <Varun.Sethi@freescale.com>
> Cc: Andreas Herrmann <herrmann.der.user@googlemail.com>
> Signed-off-by: Andreas Herrmann <andreas.herrmann@calxeda.com>
> ---
>  drivers/iommu/arm-smmu.c |   44
> ++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)
> 
> Hi Will,
> 
> This new patch addresses Varun's comments:
>  - use iommu_group notifier instead of bus notifier
>  - remove superfluous call to arm_smmu_add_device in
>    notifier function
> 
> This patch depends on commit "iommu/arm-smmu: add devices attached to the
> SMMU to an IOMMU group" as found in your git tree (e.g. in branch
> iommu/devel or for-joerg/arm-smmu/updates).
> 
> 
> Andreas
> 
> PS: This time with a proper adaption of the notifier function.
> 
> 
> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index
> 0a5649f..da19bd6 100644
> --- a/drivers/iommu/arm-smmu.c
> +++ b/drivers/iommu/arm-smmu.c
> @@ -46,6 +46,7 @@
>  #include <linux/amba/bus.h>
> 
>  #include <asm/pgalloc.h>
> +#include <asm/dma-iommu.h>
> 
>  /* Driver options */
>  #define ARM_SMMU_OPT_ISOLATE_DEVICES		(1 << 0)
> @@ -1517,6 +1518,47 @@ static int arm_smmu_domain_has_cap(struct
> iommu_domain *domain,
>  	return !!(cap & caps);
>  }
> 
> +static int arm_smmu_group_notifier(struct notifier_block *nb,
> +				unsigned long action, void *data)
> +{
> +	struct device *dev = data;
> +	struct dma_iommu_mapping *mapping;
> +	struct arm_smmu_device *smmu;
> +	int ret;
> +
> +	switch (action) {
> +	case IOMMU_GROUP_NOTIFY_BIND_DRIVER:
> +
> +		smmu = dev->archdata.iommu;
> +		if (!smmu || !(smmu->options & ARM_SMMU_OPT_ISOLATE_DEVICES))
> +			break;
[Sethi Varun-B16395] Should this check be really done here? The "Isolate devices" property would allow us to set up iommu groups. My understanding is that if we specify the isolate devices property, then each device would have a separate iommu group otherwise all devices connected to the SMMU would share the iommu group.

With that logic, we should link the mapping to the iommu group.

-Varun

> +
> +		mapping = arm_iommu_create_mapping(&platform_bus_type,
> +						0, SZ_128M, 0);
> +		if (IS_ERR(mapping)) {
> +			ret = PTR_ERR(mapping);
> +			dev_info(dev, "arm_iommu_create_mapping failed\n");
> +			break;
> +		}
> +
> +		ret = arm_iommu_attach_device(dev, mapping);
> +		if (ret < 0) {
> +			dev_info(dev, "arm_iommu_attach_device failed\n");
> +			arm_iommu_release_mapping(mapping);
> +		}
> +
> +		break;
> +	default:
> +		break;
> +	}
> +
> +	return 0;
> +}
> +
> +static struct notifier_block group_nb = {
> +	.notifier_call = arm_smmu_group_notifier, };
> +
>  static int arm_smmu_add_device(struct device *dev)  {
>  	struct arm_smmu_device *child, *parent, *smmu; @@ -1566,6 +1608,8
> @@ static int arm_smmu_add_device(struct device *dev)
>  		return PTR_ERR(group);
>  	}
> 
> +	iommu_group_register_notifier(group, &group_nb);
> +
>  	ret = iommu_group_add_device(group, dev);
>  	iommu_group_put(group);
>  	dev->archdata.iommu = smmu;
> --
> 1.7.9.5
> 
> 

^ permalink raw reply

* [PATCH] mmc: omap_hsmmc: Add support for Erratum 2.1.1.128 in device tree boot
From: Nishanth Menon @ 2014-01-21 17:38 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20140120233941.GG6516@saruman.home>

On 01/20/2014 05:39 PM, Felipe Balbi wrote:
> On Mon, Jan 20, 2014 at 05:29:02PM -0600, Nishanth Menon wrote:
>> When device is booted using devicetree, platforms impacted by
>> Erratum 2.1.1.128 is not detected easily in the mmc driver. This erratum
>> indicates that the module cannot do multi-block transfers.
>>
>> Handle this by providing a boolean flag to indicate to driver that it is
>> working on a hardware with mentioned limitation.
> 
> sure there's no way of reading the revision register to figure this one
> out without having to add a new DT attribute ?
> 
I did a quick patch to read the Module revision register:
http://slexy.org/view/s21TKvlWlR

sdp2430: Revision: 1.2, Spec: 0.0, normal interrupt

OMAP3430-ldp: (ES2.1): Revision: 2.6, Spec: 0.0, normal interrupt
SDP3430:(ES3.0) Revision: 2.6, Spec: 0.0, normal interrupt
AM3517-evm: (ES1.1): Revision: 2.6, Spec: 0.0, normal interrupt
AM3517-crane:(ES1.1): Revision: 2.6, Spec: 0.0, normal interrupt

AM37x-evm: (ES1.2) Revision: 2.6, Spec: 0.0, normal interrupt
OMAP3630-beag-xm (ES1.2): Revision: 2.6, Spec: 0.0, normal interrupt

am335x-evm:(ES1.0): Revision: 3.1, Spec: 0.1, normal interrupt
am335x-sk: (ES2.1): Revision: 3.1, Spec: 0.1, normal interrupt
am335x-beaglebone-black:(ES2.0): Revision: 3.1, Spec: 0.1, normal
interrupt

sdp4430.txt: (ES2.2): Revision: 3.1, Spec: 0.1, normal interrupt

OMAP4460-panda-es (ES1.1): Revision: 3.1, Spec: 0.1, normal interrupt

OMAP5uevm:(ES2.0): Revision: 3.3, Spec: 0.2, normal interrupt
dra7-evm (es1.1): Revision: 3.3, Spec: 0.2, normal interrupt


OMAP3430-ldp seems to be the only one impacted with module revision
2.6 -> so using revision information is not really helpful here. Hence
the usage of a flag in dt attribute to indicate hardware impacted by
erratum.

-- 
Regards,
Nishanth Menon

^ permalink raw reply

* [PATCH] arm64: Add CONFIG_CC_STACKPROTECTOR
From: Laura Abbott @ 2014-01-21 17:26 UTC (permalink / raw)
  To: linux-arm-kernel

arm64 currently lacks support for -fstack-protector. Add
similar functionality to arm to detect stack corruption.

Cc: Will Deacon <will.deacon@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
---
 arch/arm64/Kconfig                      |   12 +++++++++
 arch/arm64/Makefile                     |    4 +++
 arch/arm64/include/asm/stackprotector.h |   38 +++++++++++++++++++++++++++++++
 arch/arm64/kernel/process.c             |    9 +++++++
 4 files changed, 63 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm64/include/asm/stackprotector.h

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 6d4dd22..4f86874 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -168,6 +168,18 @@ config HOTPLUG_CPU
 	  Say Y here to experiment with turning CPUs off and on.  CPUs
 	  can be controlled through /sys/devices/system/cpu.
 
+config CC_STACKPROTECTOR
+	bool "Enable -fstack-protector buffer overflow detection"
+	help
+	  This option turns on the -fstack-protector GCC feature. This
+	  feature puts, at the beginning of functions, a canary value on
+	  the stack just before the return address, and validates
+	  the value just before actually returning.  Stack based buffer
+	  overflows (that need to overwrite this return address) now also
+	  overwrite the canary, which gets detected and the attack is then
+	  neutralized via a kernel panic.
+	  This feature requires gcc version 4.2 or above.
+
 source kernel/Kconfig.preempt
 
 config HZ
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 2fceb71..1ce221e 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -48,6 +48,10 @@ core-$(CONFIG_XEN) += arch/arm64/xen/
 libs-y		:= arch/arm64/lib/ $(libs-y)
 libs-y		+= $(LIBGCC)
 
+ifeq ($(CONFIG_CC_STACKPROTECTOR),y)
+KBUILD_CFLAGS	+=-fstack-protector
+endif
+
 # Default target when executing plain make
 KBUILD_IMAGE	:= Image.gz
 KBUILD_DTBS	:= dtbs
diff --git a/arch/arm64/include/asm/stackprotector.h b/arch/arm64/include/asm/stackprotector.h
new file mode 100644
index 0000000..de00332
--- /dev/null
+++ b/arch/arm64/include/asm/stackprotector.h
@@ -0,0 +1,38 @@
+/*
+ * GCC stack protector support.
+ *
+ * Stack protector works by putting predefined pattern at the start of
+ * the stack frame and verifying that it hasn't been overwritten when
+ * returning from the function.  The pattern is called stack canary
+ * and gcc expects it to be defined by a global variable called
+ * "__stack_chk_guard" on ARM.  This unfortunately means that on SMP
+ * we cannot have a different canary value per task.
+ */
+
+#ifndef _ASM_STACKPROTECTOR_H
+#define _ASM_STACKPROTECTOR_H 1
+
+#include <linux/random.h>
+#include <linux/version.h>
+
+extern unsigned long __stack_chk_guard;
+
+/*
+ * Initialize the stackprotector canary value.
+ *
+ * NOTE: this must only be called from functions that never return,
+ * and it must always be inlined.
+ */
+static __always_inline void boot_init_stack_canary(void)
+{
+	unsigned long canary;
+
+	/* Try to get a semi random initial value. */
+	get_random_bytes(&canary, sizeof(canary));
+	canary ^= LINUX_VERSION_CODE;
+
+	current->stack_canary = canary;
+	__stack_chk_guard = current->stack_canary;
+}
+
+#endif	/* _ASM_STACKPROTECTOR_H */
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index de17c89..592d630 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -50,6 +50,12 @@
 #include <asm/processor.h>
 #include <asm/stacktrace.h>
 
+#ifdef CONFIG_CC_STACKPROTECTOR
+#include <linux/stackprotector.h>
+unsigned long __stack_chk_guard __read_mostly;
+EXPORT_SYMBOL(__stack_chk_guard);
+#endif
+
 static void setup_restart(void)
 {
 	/*
@@ -288,6 +294,9 @@ struct task_struct *__switch_to(struct task_struct *prev,
 {
 	struct task_struct *last;
 
+#if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP)
+	__stack_chk_guard = next->stack_canary;
+#endif
 	fpsimd_thread_switch(next);
 	tls_thread_switch(next);
 	hw_breakpoint_thread_switch(next);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

^ permalink raw reply related

* [PATCH v6 00/10] USB Host support for OMAP5 uEVM (for 3.14)
From: Lee Jones @ 2014-01-21 17:19 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390227091-4523-1-git-send-email-rogerq@ti.com>

> This patchset brings up USB Host ports and Ethernet port on
> the OMAP5 uEVM board.

I'd keep hold of this and send it out again when the merge-window is
closed.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* [PATCH 1/4 v3] mfd: tc3589x: Add device tree bindings
From: Lee Jones @ 2014-01-21 17:13 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CACRpkdZoEwgRALT0R8vWB1aWxR_WCR2U0b1yF0Mr0qNm0LDGug@mail.gmail.com>

> > This defines the device tree bindings for the Toshiba TC3589x
> > series of multi-purpose expanders. Only the stuff I can test
> > is defined: GPIO and keypad. Others may implement more
> > subdevices further down the road.
> >
> > This is to complement
> > commit a435ae1d51e2f18414f2a87219fdbe068231e692
> > "mfd: Enable the tc3589x for Device Tree" which left off
> > the definition of the device tree bindings.
> >
> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> > ---
> > ChangeLog v2->v3:
> > - Fix the keys/rows bindings to be u32 rather than
> >   /bits/ 8, inconsistency noted by Mark Rutland.
> > ChangeLog v1->v2:
> > - Include a verbose example in the DT bindings.
> > - Explain why this is a stand-alone bindings patch.
> 
> So will this since Nov 12 uncommented-upon patch be merged or
> do you want me to do some change?
> 
> There was some back-and-forth regarding the (existing, already
> in use) linux-specific input bindings but the only thing I can
> see is some back and forth leaning toward just letting these
> be used.

We still need a DT Ack.

> I am happy to change this in whatever way but no directions
> for two months....

If it had slipped though the gaps, I'd probably suggest poking or
re-sending before the middle of the merge-window though.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* [PATCH v7 1/2] ohci-platform: Add support for devicetree instantiation
From: Hans de Goede @ 2014-01-21 17:10 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <52DEB57C.8080700@cogentembedded.com>

Hi,

On 01/21/2014 06:59 PM, Sergei Shtylyov wrote:
> Hello.
>
> On 01/15/2014 10:24 PM, Hans de Goede wrote:
>
>> Add support for ohci-platform instantiation from devicetree, including
>> optionally getting clks and a phy from devicetree, and enabling / disabling
>> those on power_on / off.
>
>> This should allow using ohci-platform from devicetree in various cases.
>> Specifically after this commit it can be used for the ohci controller found
>> on Allwinner sunxi SoCs.
>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> Acked-by: Alan Stern <stern@rowland.harvard.edu>
> [...]
>
>    Have only found time to fully read the patches just now...
>
>> diff --git a/Documentation/devicetree/bindings/usb/usb-ohci.txt b/Documentation/devicetree/bindings/usb/usb-ohci.txt
>> new file mode 100644
>> index 0000000..f9d6c73
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/usb/usb-ohci.txt
>> @@ -0,0 +1,22 @@
>> +USB OHCI controllers
>> +
>> +Required properties:
>> +- compatible : "usb-ohci"
>> +- reg : ohci controller register range (address and length)
>> +- interrupts : ohci controller interrupt
>> +
>> +Optional properties:
>> +- clocks : a list of phandle + clock specifier pairs
>> +- phys : phandle + phy specifier pair
>> +- phy-names : "usb"
>> +
>> +Example:
>> +
>> +    ohci0: ohci at 0x01c14400 {
>
>     Two minor nits: there should be no "0x" in the address part of the node name. And according to ePAPR [1], "the name of a node should be somewhat generic, reflecting the function of the device and not its precise programming model. If appropriate, the name should be one of the following choices:
> [...]
> - usb".
>
>     Same comments for "usb-ehci" binding.

You're right on both accounts, I'll do a v8 tomorrow, including a re-spin of the
big-endian patches.

Regards,

Hans

^ permalink raw reply

* [PATCH 1/2] ohci-platform: Add support for controllers with big-endian regs / descriptors
From: Hans de Goede @ 2014-01-21 17:01 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <Pine.LNX.4.44L0.1401211116370.1272-100000@iolanthe.rowland.org>

Hi,

On 01/21/2014 05:40 PM, Alan Stern wrote:
> On Tue, 21 Jan 2014, Hans de Goede wrote:
>
>> Note this commit uses the same devicetree booleans for this as the ones
>> already existing in the usb-ehci bindings.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>
>> --- a/drivers/usb/host/Kconfig
>> +++ b/drivers/usb/host/Kconfig
>> @@ -512,6 +512,10 @@ config USB_CNS3XXX_OHCI
>>
>>   config USB_OHCI_HCD_PLATFORM
>>   	tristate "Generic OHCI driver for a platform device"
>> +	# Always support LE, support BE on architectures which have readl_be
>> +	select USB_OHCI_LITTLE_ENDIAN
>> +	select USB_OHCI_BIG_ENDIAN_DESC if (AVR32 || MIPS || MICROBLAZE || SPARC || PPC32 || PPC64)
>> +	select USB_OHCI_BIG_ENDIAN_MMIO if (AVR32 || MIPS || MICROBLAZE || SPARC || PPC32 || PPC64)
>>   	default n
>
> The comment line above is slightly misleading.  USB_OHCI_LITTLE_ENDIAN
> doesn't exactly mean to include support for little-endian controllers;
> it means include mixed-endian support if either
> USB_OHCI_BIG_ENDIAN_DESC or USB_OHCI_BIG_ENDIAN_MMIO is set.  That is,
> the driver determines at runtime whether a particular controller is
> big-endian or little-endian, rather than choosing to support one or the
> other at compile time.

Right I already knew that, that is what the "Always" tried to summarize.

> In any case, the style we have adopted is that these select lines go in
> the arch-specific defconfig, not here.

Ok, so I should drop the Kconfig parts of both patches ?

>  For example, check out the
> occurrences of EHCI in arch/mips/Kconfig.  Also, I'm not sure how you
> came up with that list of architectures for the two selects; it's hard
> to say if they are right.  For instance, why did you include AVR32?

I included all archs which defines readl_be in asm/io.h

Regards,

Hans

^ permalink raw reply

* [PATCH v4 15/16] ARM: add uprobes support
From: David Long @ 2014-01-21 16:51 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1387564464.3404.106.camel@linaro1.home>

On 12/20/13 13:34, Jon Medhurst (Tixy) wrote:
> On Sun, 2013-12-15 at 23:08 -0500, David Long wrote:
>> From: "David A. Long" <dave.long@linaro.org>
>>
>> Using Rabin Vincent's ARM uprobes patches as a base, enable uprobes
>> support on ARM.
>>
>> Caveats:
>>
>>   - Thumb is not supported
>>   - XOL abort/trap handling is not implemented
>
> I shall repeat my comment from version one of the patch...
>
> What are the consequences of this, e.g. is it possible for a probe to
> get stuck in an infinite loop of faulting? I hope there are no integrity
> issues for the kernel itself.
>
> Would be good if someone familiar with uprobes working could answer
> that.

Testing shows it does indeed get stuck continuously trapping. The 
process is killable.  Fortunately all the infrastructure is already 
there for fixing this.  I've patched the code to detect the trap and 
allow it to be processed, using the powerpc uprobes code as a model. 
The changes required are fairly small and entirely in the 
architecture-specific code.

As mentioned before, thumb support is a follow-on project.

> I've a few other comments...

[snip]

>
>
>> +const union decode_item uprobes_probes_actions[] = {
>> +	[PROBES_EMULATE_NONE] {.handler = probes_simulate_nop},
>
> There is a missing '=' in the line above. Interesting that GCC doesn't
> complain (I tried compiling this patch and it didn't).
>

That is indeed odd.  I have fixed it (my code, not the compiler).

[snip]

>> +bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs)
>> +{
>> +	void *addr;
>
> 'addr' is not used so this line can be deleted
>
>> +	probes_opcode_t opcode;
>> +
>> +	if (!auprobe->simulate)
>> +		return false;
>> +
>> +	addr = (void *) regs->ARM_pc;
>
> and so can this line ^^^

Fixed.

>
>> +	opcode = __mem_to_opcode_arm(*(unsigned int *) auprobe->insn);
>> +
>> +	auprobe->asi.insn_singlestep(opcode, &auprobe->asi, regs);
>> +
>> +	return true;
>> +}
>> +
>

Fixed.

> [rest of patch snipped]
>


-dl

^ permalink raw reply

* [PATCH v3 11/15] watchdog: orion: Add support for Armada 370 and Armada XP SoC
From: Guenter Roeck @ 2014-01-21 16:41 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390310774-20781-12-git-send-email-ezequiel.garcia@free-electrons.com>

On Tue, Jan 21, 2014 at 10:26:10AM -0300, Ezequiel Garcia wrote:
> Using the added infrastructure for handling SoC differences,
> this commit adds support for the watchdog controller available
> in Armada 370 and Armada XP SoCs.
> 
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> ---
>  drivers/watchdog/orion_wdt.c | 93 ++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 93 insertions(+)
> 
> diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
> index c2beb9f..a5e157c 100644
> --- a/drivers/watchdog/orion_wdt.c
> +++ b/drivers/watchdog/orion_wdt.c
> @@ -30,6 +30,7 @@
>   * Watchdog timer block registers.
>   */
>  #define TIMER_CTRL		0x0000
> +#define TIMER_A370_STATUS	0x04
>  
>  #define WDT_MAX_CYCLE_COUNT	0xffffffff
>  #define WDT_IN_USE		0
> @@ -41,6 +42,12 @@
>  
>  #define WDT_AXP_FIXED_ENABLE_BIT BIT(10)
>  
> +#define WDT_A370_RATIO_MASK(v)	((v) << 16)
> +#define WDT_A370_RATIO_SHIFT	5
> +#define WDT_A370_RATIO		(1 << WDT_A370_RATIO_SHIFT)
> +

Are those introduced twice ? I seem to recall seeing those defines in patch 8.

> +#define WDT_A370_EXPIRED	BIT(31)
> +
>  static bool nowayout = WATCHDOG_NOWAYOUT;
>  static int heartbeat = -1;		/* module parameter (seconds) */
>  
> @@ -80,6 +87,48 @@ static int orion_wdt_clock_init(struct platform_device *pdev,
>  	return 0;
>  }
>  
> +static int armada370_wdt_clock_init(struct platform_device *pdev,
> +				    struct orion_watchdog *dev)
> +{
> +	int ret;
> +
> +	dev->clk = devm_clk_get(&pdev->dev, NULL);
> +	if (IS_ERR(dev->clk))
> +		return PTR_ERR(dev->clk);
> +	ret = clk_prepare_enable(dev->clk);
> +	if (ret)
> +		return ret;
> +
> +	/* Setup watchdog input clock */
> +	atomic_io_modify(dev->reg + TIMER_CTRL,
> +			WDT_A370_RATIO_MASK(WDT_A370_RATIO_SHIFT),
> +			WDT_A370_RATIO_MASK(WDT_A370_RATIO_SHIFT));
> +
> +	dev->clk_rate = clk_get_rate(dev->clk) / WDT_A370_RATIO;
> +	return 0;
> +}
> +
> +static int armadaxp_wdt_clock_init(struct platform_device *pdev,
> +				   struct orion_watchdog *dev)
> +{
> +	int ret;
> +
> +	dev->clk = of_clk_get_by_name(pdev->dev.of_node, "fixed");
> +	if (IS_ERR(dev->clk))
> +		return PTR_ERR(dev->clk);
> +	ret = clk_prepare_enable(dev->clk);
> +	if (ret)
> +		return ret;
> +
> +	/* Enable the fixed watchdog clock input */
> +	atomic_io_modify(dev->reg + TIMER_CTRL,
> +		WDT_AXP_FIXED_ENABLE_BIT,
> +		WDT_AXP_FIXED_ENABLE_BIT);

Who am I to complain, but your continuation line indentation isn't really
consistent ;-).

> +
> +	dev->clk_rate = clk_get_rate(dev->clk);
> +	return 0;
> +}
> +
>  static int orion_wdt_ping(struct watchdog_device *wdt_dev)
>  {
>  	struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
> @@ -89,6 +138,26 @@ static int orion_wdt_ping(struct watchdog_device *wdt_dev)
>  	return 0;
>  }
>  
> +static int armada370_start(struct watchdog_device *wdt_dev)
> +{
> +	struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
> +
> +	/* Set watchdog duration */
> +	writel(dev->clk_rate * wdt_dev->timeout,
> +	       dev->reg + dev->data->wdt_counter_offset);
> +
> +	/* Clear the watchdog expiration bit */
> +	atomic_io_modify(dev->reg + TIMER_A370_STATUS, WDT_A370_EXPIRED, 0);
> +
> +	/* Enable watchdog timer */
> +	atomic_io_modify(dev->reg + TIMER_CTRL, dev->data->wdt_enable_bit,
> +						dev->data->wdt_enable_bit);
> +
> +	atomic_io_modify(dev->rstout, dev->data->rstout_enable_bit,
> +				      dev->data->rstout_enable_bit);
> +	return 0;
> +}
> +
>  static int orion_start(struct watchdog_device *wdt_dev)
>  {
>  	struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
> @@ -170,11 +239,35 @@ static const struct orion_watchdog_data orion_data = {
>  	.start = orion_start,
>  };
>  
> +static const struct orion_watchdog_data armada370_data = {
> +	.rstout_enable_bit = BIT(8),
> +	.wdt_enable_bit = BIT(8),
> +	.wdt_counter_offset = 0x34,
> +	.clock_init = armada370_wdt_clock_init,
> +	.start = armada370_start,
> +};
> +
> +static const struct orion_watchdog_data armadaxp_data = {
> +	.rstout_enable_bit = BIT(8),
> +	.wdt_enable_bit = BIT(8),
> +	.wdt_counter_offset = 0x34,
> +	.clock_init = armadaxp_wdt_clock_init,
> +	.start = armada370_start,
> +};
> +
>  static const struct of_device_id orion_wdt_of_match_table[] = {
>  	{
>  		.compatible = "marvell,orion-wdt",
>  		.data = &orion_data,
>  	},
> +	{
> +		.compatible = "marvell,armada-370-wdt",
> +		.data = &armada370_data,
> +	},
> +	{
> +		.compatible = "marvell,armada-xp-wdt",
> +		.data = &armadaxp_data,
> +	},
>  	{},
>  };
>  MODULE_DEVICE_TABLE(of, orion_wdt_of_match_table);
> -- 
> 1.8.1.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply

* [PATCH 1/2] ohci-platform: Add support for controllers with big-endian regs / descriptors
From: Alan Stern @ 2014-01-21 16:40 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390319315-8391-1-git-send-email-hdegoede@redhat.com>

On Tue, 21 Jan 2014, Hans de Goede wrote:

> Note this commit uses the same devicetree booleans for this as the ones
> already existing in the usb-ehci bindings.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

> --- a/drivers/usb/host/Kconfig
> +++ b/drivers/usb/host/Kconfig
> @@ -512,6 +512,10 @@ config USB_CNS3XXX_OHCI
>  
>  config USB_OHCI_HCD_PLATFORM
>  	tristate "Generic OHCI driver for a platform device"
> +	# Always support LE, support BE on architectures which have readl_be
> +	select USB_OHCI_LITTLE_ENDIAN
> +	select USB_OHCI_BIG_ENDIAN_DESC if (AVR32 || MIPS || MICROBLAZE || SPARC || PPC32 || PPC64)
> +	select USB_OHCI_BIG_ENDIAN_MMIO if (AVR32 || MIPS || MICROBLAZE || SPARC || PPC32 || PPC64)
>  	default n

The comment line above is slightly misleading.  USB_OHCI_LITTLE_ENDIAN
doesn't exactly mean to include support for little-endian controllers;  
it means include mixed-endian support if either
USB_OHCI_BIG_ENDIAN_DESC or USB_OHCI_BIG_ENDIAN_MMIO is set.  That is,
the driver determines at runtime whether a particular controller is
big-endian or little-endian, rather than choosing to support one or the
other at compile time.

In any case, the style we have adopted is that these select lines go in
the arch-specific defconfig, not here.  For example, check out the
occurrences of EHCI in arch/mips/Kconfig.  Also, I'm not sure how you
came up with that list of architectures for the two selects; it's hard
to say if they are right.  For instance, why did you include AVR32?

The changes to the driver itself look fine.

Similar comments apply to the ehci-platform patch.

Alan Stern

^ permalink raw reply

* [PATCH v3 08/15] watchdog: orion: Introduce per-compatible of_device_id data
From: Guenter Roeck @ 2014-01-21 16:35 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390310774-20781-9-git-send-email-ezequiel.garcia@free-electrons.com>

On Tue, Jan 21, 2014 at 10:26:07AM -0300, Ezequiel Garcia wrote:
> This commit adds an orion_watchdog_data structure to holda compatible-data

	s/holda/hold/

> information. This allows to remove the driver-wide definition and to
> future add support for multiple compatible-strings.

Maybe "and to be able to add support for multiple compatible-strings in the
future" ?

> 
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> ---
>  drivers/watchdog/orion_wdt.c | 62 ++++++++++++++++++++++++++++++++------------
>  1 file changed, 46 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
> index 9a904be..5108496 100644
> --- a/drivers/watchdog/orion_wdt.c
> +++ b/drivers/watchdog/orion_wdt.c
> @@ -24,36 +24,47 @@
>  #include <linux/clk.h>
>  #include <linux/err.h>
>  #include <linux/of.h>
> +#include <linux/of_device.h>
>  
>  /*
>   * Watchdog timer block registers.
>   */
>  #define TIMER_CTRL		0x0000
> -#define WDT_EN			0x0010
> -#define WDT_VAL			0x0024
>  
>  #define WDT_MAX_CYCLE_COUNT	0xffffffff
>  #define WDT_IN_USE		0
>  #define WDT_OK_TO_CLOSE		1
>  
While looking at the new defines below, I noticed that WDT_IN_USE and
WDT_OK_TO_CLOSE are not used (anymore ?) and thus should be removed
(separate patch, though).

> -#define WDT_RESET_OUT_EN	BIT(1)
> +#define WDT_A370_RATIO_MASK(v)	((v) << 16)
> +#define WDT_A370_RATIO_SHIFT	5
> +#define WDT_A370_RATIO		(1 << WDT_A370_RATIO_SHIFT)
> +
> +#define WDT_AXP_FIXED_ENABLE_BIT BIT(10)
>  
Those new defines are not used. They should be introduced if and when used.

>  static bool nowayout = WATCHDOG_NOWAYOUT;
>  static int heartbeat = -1;		/* module parameter (seconds) */
>  
> +struct orion_watchdog_data {
> +	int wdt_counter_offset;
> +	int wdt_enable_bit;
> +	int rstout_enable_bit;
> +};
> +
>  struct orion_watchdog {
>  	struct watchdog_device wdt;
>  	void __iomem *reg;
>  	void __iomem *rstout;
>  	unsigned long clk_rate;
>  	struct clk *clk;
> +	struct orion_watchdog_data *data;
>  };
>  
>  static int orion_wdt_ping(struct watchdog_device *wdt_dev)
>  {
>  	struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
>  	/* Reload watchdog duration */
> -	writel(dev->clk_rate * wdt_dev->timeout, dev->reg + WDT_VAL);
> +	writel(dev->clk_rate * wdt_dev->timeout,
> +	       dev->reg + dev->data->wdt_counter_offset);
>  	return 0;
>  }
>  
> @@ -62,13 +73,16 @@ static int orion_wdt_start(struct watchdog_device *wdt_dev)
>  	struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
>  
>  	/* Set watchdog duration */
> -	writel(dev->clk_rate * wdt_dev->timeout, dev->reg + WDT_VAL);
> +	writel(dev->clk_rate * wdt_dev->timeout,
> +	       dev->reg + dev->data->wdt_counter_offset);
>  
>  	/* Enable watchdog timer */
> -	atomic_io_modify(dev->reg + TIMER_CTRL, WDT_EN, WDT_EN);
> +	atomic_io_modify(dev->reg + TIMER_CTRL, dev->data->wdt_enable_bit,
> +						dev->data->wdt_enable_bit);
>  
>  	/* Enable reset on watchdog */
> -	atomic_io_modify(dev->rstout, WDT_RESET_OUT_EN, WDT_RESET_OUT_EN);
> +	atomic_io_modify(dev->rstout, dev->data->rstout_enable_bit,
> +				      dev->data->rstout_enable_bit);
>  
>  	return 0;
>  }
> @@ -78,10 +92,10 @@ static int orion_wdt_stop(struct watchdog_device *wdt_dev)
>  	struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
>  
>  	/* Disable reset on watchdog */
> -	atomic_io_modify(dev->rstout, WDT_RESET_OUT_EN, 0);
> +	atomic_io_modify(dev->rstout, dev->data->rstout_enable_bit, 0);
>  
>  	/* Disable watchdog timer */
> -	atomic_io_modify(dev->reg + TIMER_CTRL, WDT_EN, 0);
> +	atomic_io_modify(dev->reg + TIMER_CTRL, dev->data->wdt_enable_bit, 0);
>  
>  	return 0;
>  }
> @@ -89,7 +103,7 @@ static int orion_wdt_stop(struct watchdog_device *wdt_dev)
>  static unsigned int orion_wdt_get_timeleft(struct watchdog_device *wdt_dev)
>  {
>  	struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
> -	return readl(dev->reg + WDT_VAL) / dev->clk_rate;
> +	return readl(dev->reg + dev->data->wdt_counter_offset) / dev->clk_rate;
>  }
>  
>  static int orion_wdt_set_timeout(struct watchdog_device *wdt_dev,
> @@ -119,9 +133,25 @@ static irqreturn_t orion_wdt_irq(int irq, void *devid)
>  	return IRQ_HANDLED;
>  }
>  
> +static const struct orion_watchdog_data orion_data = {
> +	.rstout_enable_bit = BIT(1),
> +	.wdt_enable_bit = BIT(4),
> +	.wdt_counter_offset = 0x24,
> +};
> +
> +static const struct of_device_id orion_wdt_of_match_table[] = {
> +	{
> +		.compatible = "marvell,orion-wdt",
> +		.data = &orion_data,
> +	},
> +	{},
> +};
> +MODULE_DEVICE_TABLE(of, orion_wdt_of_match_table);
> +
>  static int orion_wdt_probe(struct platform_device *pdev)
>  {
>  	struct orion_watchdog *dev;
> +	const struct of_device_id *match;
>  	unsigned int wdt_max_duration;	/* (seconds) */
>  	struct resource *res;
>  	int ret, irq;
> @@ -131,9 +161,15 @@ static int orion_wdt_probe(struct platform_device *pdev)
>  	if (!dev)
>  		return -ENOMEM;
>  
> +	match = of_match_device(orion_wdt_of_match_table, &pdev->dev);
> +	if (!match)
> +		/* Default legacy match */
> +		match = &orion_wdt_of_match_table[0];
> +
>  	dev->wdt.info = &orion_wdt_info;
>  	dev->wdt.ops = &orion_wdt_ops;
>  	dev->wdt.min_timeout = 1;
> +	dev->data = (struct orion_watchdog_data *)match->data;

match->data is a void *, so the typecast should not be needed here.
You might want to declare 'data' to be of type
'const struct orion_watchdog_data *' because otherwise you loose the
'const' attribute of match->data (which may be the reason for the typecast ?).

Guenter

^ permalink raw reply

* [PATCH 4/4] ARM: dts: cm-fx6: add support for USB host port 1
From: Igor Grinberg @ 2014-01-21 16:13 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390320812-25100-1-git-send-email-grinberg@compulab.co.il>

Setup pin control, vbus regulator and the usb host port 1 node
to enable the USB host port 1 support.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
 arch/arm/boot/dts/imx6q-cm-fx6.dts | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/arch/arm/boot/dts/imx6q-cm-fx6.dts b/arch/arm/boot/dts/imx6q-cm-fx6.dts
index 039a155..cf4c186 100644
--- a/arch/arm/boot/dts/imx6q-cm-fx6.dts
+++ b/arch/arm/boot/dts/imx6q-cm-fx6.dts
@@ -46,6 +46,16 @@
 			gpio = <&gpio3 22 0>;
 			enable-active-high;
 		};
+
+		reg_usb_h1_vbus: regulator at 1 {
+			compatible = "regulator-fixed";
+			reg = <1>;
+			regulator-name = "usb_h1_vbus";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			gpio = <&gpio7 8 0>;
+			enable-active-high;
+		};
 	};
 };
 
@@ -66,6 +76,12 @@
 		pinctrl_usbotg: usbotggrp {
 			fsl,pins = <MX6QDL_USBOTG_PINGRP2>;
 		};
+
+		pinctrl_usbh1: usbh1grp {
+			fsl,pins = <
+				MX6QDL_PAD_SD3_RST__GPIO7_IO08 0x80000000
+			>;
+		};
 	};
 };
 
@@ -99,3 +115,10 @@
 	dr_mode = "otg";
 	status = "okay";
 };
+
+&usbh1 {
+	vbus-supply = <&reg_usb_h1_vbus>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usbh1>;
+	status = "okay";
+};
-- 
1.8.3.2

^ permalink raw reply related

* [PATCH 3/4] ARM: dts: cm-fx6: add support for USB OTG
From: Igor Grinberg @ 2014-01-21 16:13 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390320812-25100-1-git-send-email-grinberg@compulab.co.il>

Setup pin control, vbus regulator and the usb otg node
to enable the USB OTG support.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
 arch/arm/boot/dts/imx6q-cm-fx6.dts | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/arch/arm/boot/dts/imx6q-cm-fx6.dts b/arch/arm/boot/dts/imx6q-cm-fx6.dts
index 07f90a5..039a155 100644
--- a/arch/arm/boot/dts/imx6q-cm-fx6.dts
+++ b/arch/arm/boot/dts/imx6q-cm-fx6.dts
@@ -32,7 +32,21 @@
 		};
 	};
 
+	regulators {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <0>;
 
+		reg_usb_otg_vbus: regulator at 0 {
+			compatible = "regulator-fixed";
+			reg = <0>;
+			regulator-name = "usb_otg_vbus";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			gpio = <&gpio3 22 0>;
+			enable-active-high;
+		};
+	};
 };
 
 &iomuxc {
@@ -48,6 +62,10 @@
 		pinctrl_uart4: uart4grp {
 			fsl,pins = <MX6QDL_UART4_PINGRP1>;
 		};
+
+		pinctrl_usbotg: usbotggrp {
+			fsl,pins = <MX6QDL_USBOTG_PINGRP2>;
+		};
 	};
 };
 
@@ -73,3 +91,11 @@
 &sata {
 	status = "okay";
 };
+
+&usbotg {
+	vbus-supply = <&reg_usb_otg_vbus>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_usbotg>;
+	dr_mode = "otg";
+	status = "okay";
+};
-- 
1.8.3.2

^ permalink raw reply related

* [PATCH 2/4] ARM: dts: cm-fx6: add SATA support
From: Igor Grinberg @ 2014-01-21 16:13 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390320812-25100-1-git-send-email-grinberg@compulab.co.il>

Enable SATA on cm-fx6.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
 arch/arm/boot/dts/imx6q-cm-fx6.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/imx6q-cm-fx6.dts b/arch/arm/boot/dts/imx6q-cm-fx6.dts
index 94cc6b5..07f90a5 100644
--- a/arch/arm/boot/dts/imx6q-cm-fx6.dts
+++ b/arch/arm/boot/dts/imx6q-cm-fx6.dts
@@ -69,3 +69,7 @@
 	pinctrl-0 = <&pinctrl_uart4>;
 	status = "okay";
 };
+
+&sata {
+	status = "okay";
+};
-- 
1.8.3.2

^ permalink raw reply related

* [PATCH 1/4] ARM: dts: cm-fx6: rearrange the dts file
From: Igor Grinberg @ 2014-01-21 16:13 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390320812-25100-1-git-send-email-grinberg@compulab.co.il>

Move the iomuxc definition before the devices definitions
(e.g. gpmi, fec).

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
 arch/arm/boot/dts/imx6q-cm-fx6.dts | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/arch/arm/boot/dts/imx6q-cm-fx6.dts b/arch/arm/boot/dts/imx6q-cm-fx6.dts
index 1a8ee79..94cc6b5 100644
--- a/arch/arm/boot/dts/imx6q-cm-fx6.dts
+++ b/arch/arm/boot/dts/imx6q-cm-fx6.dts
@@ -31,19 +31,8 @@
 			linux,default-trigger = "heartbeat";
 		};
 	};
-};
 
-&fec {
-	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_enet>;
-	phy-mode = "rgmii";
-	status = "okay";
-};
 
-&gpmi {
-	pinctrl-names = "default";
-	pinctrl-0 = <&pinctrl_gpmi_nand>;
-	status = "okay";
 };
 
 &iomuxc {
@@ -62,6 +51,19 @@
 	};
 };
 
+&fec {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_enet>;
+	phy-mode = "rgmii";
+	status = "okay";
+};
+
+&gpmi {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_gpmi_nand>;
+	status = "okay";
+};
+
 &uart4 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart4>;
-- 
1.8.3.2

^ permalink raw reply related

* [PATCH 0/4] ARM: dts: cm-fx6: extend board support
From: Igor Grinberg @ 2014-01-21 16:13 UTC (permalink / raw)
  To: linux-arm-kernel

Extend support for cm-fx6 (Utilite) board.
Add SATA, USB OTG, and USB Host port 1 support.

Igor Grinberg (4):
  ARM: dts: cm-fx6: rearrange the dts file
  ARM: dts: cm-fx6: add SATA support
  ARM: dts: cm-fx6: add support for USB OTG
  ARM: dts: cm-fx6: add support for USB host port 1

 arch/arm/boot/dts/imx6q-cm-fx6.dts | 77 ++++++++++++++++++++++++++++++++------
 1 file changed, 66 insertions(+), 11 deletions(-)

-- 
1.8.3.2

^ permalink raw reply

* [PATCH] pinctrl: at91: use locked variant of irq_set_handler
From: Nicolas Ferre @ 2014-01-21 15:55 UTC (permalink / raw)
  To: linux-arm-kernel

When setting the gpio irq type, use the __irq_set_handler_locked()
variant instead of the irq_set_handler() to prevent false
spinlock recursion warning.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: stable <stable@vger.kernel.org> # v3.12
---
 drivers/pinctrl/pinctrl-at91.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index a7549c4c83b4..7d7a21c20931 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -1260,22 +1260,22 @@ static int alt_gpio_irq_type(struct irq_data *d, unsigned type)
 
 	switch (type) {
 	case IRQ_TYPE_EDGE_RISING:
-		irq_set_handler(d->irq, handle_simple_irq);
+		__irq_set_handler_locked(d->irq, handle_simple_irq);
 		writel_relaxed(mask, pio + PIO_ESR);
 		writel_relaxed(mask, pio + PIO_REHLSR);
 		break;
 	case IRQ_TYPE_EDGE_FALLING:
-		irq_set_handler(d->irq, handle_simple_irq);
+		__irq_set_handler_locked(d->irq, handle_simple_irq);
 		writel_relaxed(mask, pio + PIO_ESR);
 		writel_relaxed(mask, pio + PIO_FELLSR);
 		break;
 	case IRQ_TYPE_LEVEL_LOW:
-		irq_set_handler(d->irq, handle_level_irq);
+		__irq_set_handler_locked(d->irq, handle_level_irq);
 		writel_relaxed(mask, pio + PIO_LSR);
 		writel_relaxed(mask, pio + PIO_FELLSR);
 		break;
 	case IRQ_TYPE_LEVEL_HIGH:
-		irq_set_handler(d->irq, handle_level_irq);
+		__irq_set_handler_locked(d->irq, handle_level_irq);
 		writel_relaxed(mask, pio + PIO_LSR);
 		writel_relaxed(mask, pio + PIO_REHLSR);
 		break;
@@ -1284,7 +1284,7 @@ static int alt_gpio_irq_type(struct irq_data *d, unsigned type)
 		 * disable additional interrupt modes:
 		 * fall back to default behavior
 		 */
-		irq_set_handler(d->irq, handle_simple_irq);
+		__irq_set_handler_locked(d->irq, handle_simple_irq);
 		writel_relaxed(mask, pio + PIO_AIMDR);
 		return 0;
 	case IRQ_TYPE_NONE:
-- 
1.8.2.2

^ permalink raw reply related

* [PATCH 2/2] ehci-platform: Add support for controllers with big-endian regs / descriptors
From: Hans de Goede @ 2014-01-21 15:48 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390319315-8391-1-git-send-email-hdegoede@redhat.com>

This uses the already documented devicetree booleans for this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/usb/host/Kconfig         |  3 +++
 drivers/usb/host/ehci-platform.c | 33 +++++++++++++++++++++++++++++++--
 2 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 237d7b1..4af41f3 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -256,6 +256,9 @@ config USB_EHCI_ATH79
 config USB_EHCI_HCD_PLATFORM
 	tristate "Generic EHCI driver for a platform device"
 	depends on !PPC_OF
+	# Support BE on architectures which have readl_be
+	select USB_EHCI_BIG_ENDIAN_DESC if (AVR32 || MIPS || MICROBLAZE || SPARC || PPC32 || PPC64)
+	select USB_EHCI_BIG_ENDIAN_MMIO if (AVR32 || MIPS || MICROBLAZE || SPARC || PPC32 || PPC64)
 	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 d8aebc0..5888abb 100644
--- a/drivers/usb/host/ehci-platform.c
+++ b/drivers/usb/host/ehci-platform.c
@@ -55,8 +55,10 @@ static int ehci_platform_reset(struct usb_hcd *hcd)
 
 	hcd->has_tt = pdata->has_tt;
 	ehci->has_synopsys_hc_bug = pdata->has_synopsys_hc_bug;
-	ehci->big_endian_desc = pdata->big_endian_desc;
-	ehci->big_endian_mmio = pdata->big_endian_mmio;
+	if (pdata->big_endian_desc)
+		ehci->big_endian_desc = 1;
+	if (pdata->big_endian_mmio)
+		ehci->big_endian_mmio = 1;
 
 	if (pdata->pre_setup) {
 		retval = pdata->pre_setup(hcd);
@@ -142,6 +144,7 @@ static int ehci_platform_probe(struct platform_device *dev)
 	struct resource *res_mem;
 	struct usb_ehci_pdata *pdata = dev_get_platdata(&dev->dev);
 	struct ehci_platform_priv *priv;
+	struct ehci_hcd *ehci;
 	int err, irq, clk = 0;
 
 	if (usb_disabled())
@@ -177,8 +180,34 @@ static int ehci_platform_probe(struct platform_device *dev)
 	platform_set_drvdata(dev, hcd);
 	dev->dev.platform_data = pdata;
 	priv = hcd_to_ehci_priv(hcd);
+	ehci = hcd_to_ehci(hcd);
 
 	if (pdata == &ehci_platform_defaults && dev->dev.of_node) {
+		if (of_property_read_bool(dev->dev.of_node, "big-endian-regs"))
+			ehci->big_endian_mmio = 1;
+
+		if (of_property_read_bool(dev->dev.of_node, "big-endian-desc"))
+			ehci->big_endian_desc = 1;
+
+		if (of_property_read_bool(dev->dev.of_node, "big-endian"))
+			ehci->big_endian_mmio = ehci->big_endian_desc = 1;
+
+#ifndef CONFIG_USB_EHCI_BIG_ENDIAN_MMIO
+		if (ehci->big_endian_mmio) {
+			dev_err(&dev->dev,
+				"Error big-endian-regs not compiled in\n");
+			err = -EINVAL;
+			goto err_put_hcd;
+		}
+#endif
+#ifndef CONFIG_USB_EHCI_BIG_ENDIAN_DESC
+		if (ehci->big_endian_desc) {
+			dev_err(&dev->dev,
+				"Error big-endian-desc not compiled in\n");
+			err = -EINVAL;
+			goto err_put_hcd;
+		}
+#endif
 		priv->phy = devm_phy_get(&dev->dev, "usb");
 		if (IS_ERR(priv->phy)) {
 			err = PTR_ERR(priv->phy);
-- 
1.8.5.3

^ permalink raw reply related

* [PATCH 1/2] ohci-platform: Add support for controllers with big-endian regs / descriptors
From: Hans de Goede @ 2014-01-21 15:48 UTC (permalink / raw)
  To: linux-arm-kernel

Note this commit uses the same devicetree booleans for this as the ones
already existing in the usb-ehci bindings.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 Documentation/devicetree/bindings/usb/usb-ohci.txt |  3 +++
 drivers/usb/host/Kconfig                           |  4 ++++
 drivers/usb/host/ohci-platform.c                   | 27 ++++++++++++++++++++++
 3 files changed, 34 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/usb-ohci.txt b/Documentation/devicetree/bindings/usb/usb-ohci.txt
index f9d6c73..aa1d765 100644
--- a/Documentation/devicetree/bindings/usb/usb-ohci.txt
+++ b/Documentation/devicetree/bindings/usb/usb-ohci.txt
@@ -6,6 +6,9 @@ Required properties:
 - interrupts : ohci controller interrupt
 
 Optional properties:
+- big-endian-regs : boolean, set this for hcds with big-endian registers
+- big-endian-desc : boolean, set this for hcds with big-endian descriptors
+- big-endian : boolean, for hcds with big-endian-regs + big-endian-desc
 - clocks : a list of phandle + clock specifier pairs
 - phys : phandle + phy specifier pair
 - phy-names : "usb"
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index e28cbe0..237d7b1 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -512,6 +512,10 @@ config USB_CNS3XXX_OHCI
 
 config USB_OHCI_HCD_PLATFORM
 	tristate "Generic OHCI driver for a platform device"
+	# Always support LE, support BE on architectures which have readl_be
+	select USB_OHCI_LITTLE_ENDIAN
+	select USB_OHCI_BIG_ENDIAN_DESC if (AVR32 || MIPS || MICROBLAZE || SPARC || PPC32 || PPC64)
+	select USB_OHCI_BIG_ENDIAN_MMIO if (AVR32 || MIPS || MICROBLAZE || SPARC || PPC32 || PPC64)
 	default n
 	---help---
 	  Adds an OHCI host driver for a generic platform device, which
diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c
index b2d0e1e..71e9d8e 100644
--- a/drivers/usb/host/ohci-platform.c
+++ b/drivers/usb/host/ohci-platform.c
@@ -128,6 +128,7 @@ static int ohci_platform_probe(struct platform_device *dev)
 	struct resource *res_mem;
 	struct usb_ohci_pdata *pdata = dev_get_platdata(&dev->dev);
 	struct ohci_platform_priv *priv;
+	struct ohci_hcd *ohci;
 	int err, irq, clk = 0;
 
 	if (usb_disabled())
@@ -164,8 +165,34 @@ static int ohci_platform_probe(struct platform_device *dev)
 	platform_set_drvdata(dev, hcd);
 	dev->dev.platform_data = pdata;
 	priv = hcd_to_ohci_priv(hcd);
+	ohci = hcd_to_ohci(hcd);
 
 	if (pdata == &ohci_platform_defaults && dev->dev.of_node) {
+		if (of_property_read_bool(dev->dev.of_node, "big-endian-regs"))
+			ohci->flags |= OHCI_QUIRK_BE_MMIO;
+
+		if (of_property_read_bool(dev->dev.of_node, "big-endian-desc"))
+			ohci->flags |= OHCI_QUIRK_BE_DESC;
+
+		if (of_property_read_bool(dev->dev.of_node, "big-endian"))
+			ohci->flags |= OHCI_QUIRK_BE_MMIO | OHCI_QUIRK_BE_DESC;
+
+#ifndef CONFIG_USB_OHCI_BIG_ENDIAN_MMIO
+		if (ohci->flags & OHCI_QUIRK_BE_MMIO) {
+			dev_err(&dev->dev,
+				"Error big-endian-regs not compiled in\n");
+			err = -EINVAL;
+			goto err_put_hcd;
+		}
+#endif
+#ifndef CONFIG_USB_OHCI_BIG_ENDIAN_DESC
+		if (ohci->flags & OHCI_QUIRK_BE_DESC) {
+			dev_err(&dev->dev,
+				"Error big-endian-desc not compiled in\n");
+			err = -EINVAL;
+			goto err_put_hcd;
+		}
+#endif
 		priv->phy = devm_phy_get(&dev->dev, "usb");
 		if (IS_ERR(priv->phy)) {
 			err = PTR_ERR(priv->phy);
-- 
1.8.5.3

^ permalink raw reply related

* [PATCH V7] ARM : unwinder : Prevent data abort due to stack overflow
From: Anurag Aggarwal @ 2014-01-21 15:42 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1389154825-10140-1-git-send-email-a.anurag@samsung.com>

Any more update on the patch.?

^ permalink raw reply

* [PATCHv3 39/41] Doc/DT: Add DT binding documentation for Sony acx565akm panel
From: Sebastian Reichel @ 2014-01-21 15:28 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390301833-24944-40-git-send-email-tomi.valkeinen@ti.com>

On Tue, Jan 21, 2014 at 12:57:11PM +0200, Tomi Valkeinen wrote:
> Add DT binding documentation for Sony acx565akm panel
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

Reviewed-by: Sebastian Reichel <sre@debian.org>

-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140121/57e87725/attachment.sig>

^ permalink raw reply

* [PATCH] ARM: Make pgtbl macro more robust
From: Christopher Covington @ 2014-01-21 15:28 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20140117185029.GC13785@codeaurora.org>

On 01/17/2014 01:50 PM, Stephen Boyd wrote:
> On 01/06, Christopher Covington wrote:
>> The pgtbl macro couldn't handle the specific
>> (TEXT_OFFSET - PG_DIR_SIZE) value that the combination of
>> MSM platforms and LPAE created:
>>
>> head.S:163: Error: invalid constant (203000) after fixup
>>
>> Regardless of whether this combination of configuration options
>> will work on currently support platforms at run time, make it
>> at least assemble properly.
>>
>> Signed-off-by: Christopher Covington <cov@codeaurora.org>
> 
> Looks good to me.
> 
> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
> 
> I think you can put it in the patch tracker. Russell?

Added as

http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=7947/1

Regards,
Christopher

-- 
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] ARM: moxart: DT fixups
From: Jonas Jensen @ 2014-01-21 15:26 UTC (permalink / raw)
  To: linux-arm-kernel

Change DT files to remain coherent with changes in
accompanying drivers.

1. replace "sdhci" with "mmc"
2. add bus-width property to mmc node
3. drop device_type property
4. replace "mac@" with "ethernet@"
5. replace CONFIG_MMC_SDHCI_MOXART with CONFIG_MMC_MOXART

Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
---

Notes:
    Applies on top of:
    
    "[PATCH] ARM: moxart: move fixed rate clock child node to board level dts"
    http://lists.infradead.org/pipermail/linux-arm-kernel/2014-January/226141.html
    
    Applies to next-20140121

 arch/arm/boot/dts/moxart-uc7112lx.dts | 5 ++---
 arch/arm/boot/dts/moxart.dtsi         | 8 ++++----
 arch/arm/configs/moxart_defconfig     | 2 +-
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/moxart-uc7112lx.dts b/arch/arm/boot/dts/moxart-uc7112lx.dts
index 10d088d..ee6ef7c 100644
--- a/arch/arm/boot/dts/moxart-uc7112lx.dts
+++ b/arch/arm/boot/dts/moxart-uc7112lx.dts
@@ -80,15 +80,15 @@
 	clocks = <&ref12>;
 };
 
-&sdhci {
+&mmc {
 	status = "okay";
+	bus-width = <4>;
 };
 
 &mdio0 {
 	status = "okay";
 
 	ethphy0: ethernet-phy at 1 {
-		device_type = "ethernet-phy";
 		compatible = "moxa,moxart-rtl8201cp", "ethernet-phy-ieee802.3-c22";
 		reg = <1>;
 	};
@@ -98,7 +98,6 @@
 	status = "okay";
 
 	ethphy1: ethernet-phy at 1 {
-		device_type = "ethernet-phy";
 		compatible = "moxa,moxart-rtl8201cp", "ethernet-phy-ieee802.3-c22";
 		reg = <1>;
 	};
diff --git a/arch/arm/boot/dts/moxart.dtsi b/arch/arm/boot/dts/moxart.dtsi
index 1fd27ed..97c8084 100644
--- a/arch/arm/boot/dts/moxart.dtsi
+++ b/arch/arm/boot/dts/moxart.dtsi
@@ -90,8 +90,8 @@
 			clocks = <&clk_apb>;
 		};
 
-		sdhci: sdhci at 98e00000 {
-			compatible = "moxa,moxart-sdhci";
+		mmc: mmc at 98e00000 {
+			compatible = "moxa,moxart-mmc";
 			reg = <0x98e00000 0x5C>;
 			interrupts = <5 0>;
 			clocks = <&clk_apb>;
@@ -117,7 +117,7 @@
 			status = "disabled";
 		};
 
-		mac0: mac at 90900000 {
+		mac0: ethernet at 90900000 {
 			compatible = "moxa,moxart-mac";
 			reg = <0x90900000 0x90>;
 			interrupts = <25 0>;
@@ -126,7 +126,7 @@
 			status = "disabled";
 		};
 
-		mac1: mac at 92000000 {
+		mac1: ethernet at 92000000 {
 			compatible = "moxa,moxart-mac";
 			reg = <0x92000000 0x90>;
 			interrupts = <27 0>;
diff --git a/arch/arm/configs/moxart_defconfig b/arch/arm/configs/moxart_defconfig
index a3cb76c..708c0cf 100644
--- a/arch/arm/configs/moxart_defconfig
+++ b/arch/arm/configs/moxart_defconfig
@@ -107,7 +107,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
 CONFIG_MOXART_WDT=y
 # CONFIG_USB_SUPPORT is not set
 CONFIG_MMC=y
-CONFIG_MMC_SDHCI_MOXART=y
+CONFIG_MMC_MOXART=y
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
 CONFIG_LEDS_GPIO=y
-- 
1.8.2.1

^ permalink raw reply related

* [PATCHv3 30/41] ARM: omap3-n900.dts: add display information
From: Sebastian Reichel @ 2014-01-21 15:26 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1390301833-24944-31-git-send-email-tomi.valkeinen@ti.com>

On Tue, Jan 21, 2014 at 12:57:02PM +0200, Tomi Valkeinen wrote:
> Add DT data for OMAP3 N900 board. The board has the following
> displays:
> 
> lcd: LCD panel connected to OMAP's SDI output
> tv: analog svideo
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

Your dss-dt-review-3 branch boots on my N900 with working display.

Tested-by: Sebastian Reichel <sre@debian.org>

-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140121/7ad69e80/attachment.sig>

^ permalink raw reply

* [PATCH RFC 4/6] net: rfkill: gpio: add device tree support
From: Mika Westerberg @ 2014-01-21 15:25 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CAAVeFuKFfAvSPYLmvWV5jjT-peZFJ8sJ2bbh4F=JAYoWLhjZpA@mail.gmail.com>

On Tue, Jan 21, 2014 at 11:53:13PM +0900, Alexandre Courbot wrote:
> > I think a unified kernel API makes more sense for some subsystems than
> > others, and it depends a bit on the rate of adoption of APCI for drivers
> > that already have a DT binding (or vice versa, if that happens).
> >
> > GPIO might actually be in the first category since it's commonly used
> > for off-chip components that will get shared across ARM and x86 (as
> > well as everything else), while a common kernel API would be less
> > important for things that are internal to an SoC where Intel is the
> > only company needing ACPI support.
> 
> I am afraid I don't have a good enough view of the ACPI landscape to
> understand how often drivers might be reused on both ACPI and DT. But
> I suppose nothing speaks against that, technically speaking. Maybe
> Mika would have comments to make here?

Well, we try to reuse existing drivers whenever possible. As an example
Intel LPSS devices (that exists on Haswell and Baytrail) are mostly
existing drivers from ARM world.

I would say that GPIO is one of such things where we would like to have an
unified interface definitely.

^ 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