Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 04/11] arm64: KVM: flush VM pages before letting the guest enable caches
From: Christoffer Dall @ 2014-02-07  4:08 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1391630151-7875-5-git-send-email-marc.zyngier@arm.com>

On Wed, Feb 05, 2014 at 07:55:44PM +0000, Marc Zyngier wrote:
> When the guest runs with caches disabled (like in an early boot
> sequence, for example), all the writes are diectly going to RAM,
> bypassing the caches altogether.
> 
> Once the MMU and caches are enabled, whatever sits in the cache
> becomes suddenly visible, which isn't what the guest expects.
> 
> A way to avoid this potential disaster is to invalidate the cache
> when the MMU is being turned on. For this, we hook into the SCTLR_EL1
> trapping code, and scan the stage-2 page tables, invalidating the
> pages/sections that have already been mapped in.
> 
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
> ---
>  arch/arm/include/asm/kvm_mmu.h   |  8 ++++
>  arch/arm/kvm/mmu.c               | 93 ++++++++++++++++++++++++++++++++++++++++
>  arch/arm64/include/asm/kvm_mmu.h |  4 ++
>  arch/arm64/kvm/sys_regs.c        |  5 ++-
>  4 files changed, 109 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
> index 6d0f3d3..0931cda 100644
> --- a/arch/arm/include/asm/kvm_mmu.h
> +++ b/arch/arm/include/asm/kvm_mmu.h
> @@ -114,6 +114,12 @@ static inline void kvm_set_s2pmd_writable(pmd_t *pmd)
>  	pmd_val(*pmd) |= L_PMD_S2_RDWR;
>  }
>  
> +/* Open coded pgd_addr_end that can deal with 64bit addresses */
> +#define kvm_pgd_addr_end(addr, end)					\
> +({	u64 __boundary = ((addr) + PGDIR_SIZE) & PGDIR_MASK;		\
> +	(__boundary - 1 < (end) - 1)? __boundary: (end);		\
> +})
> +
>  struct kvm;
>  
>  static inline void coherent_cache_guest_page(struct kvm_vcpu *vcpu, hva_t hva,
> @@ -142,6 +148,8 @@ static inline void coherent_cache_guest_page(struct kvm_vcpu *vcpu, hva_t hva,
>  #define kvm_flush_dcache_to_poc(a,l)	__cpuc_flush_dcache_area((a), (l))
>  #define kvm_virt_to_phys(x)		virt_to_idmap((unsigned long)(x))
>  
> +void stage2_flush_vm(struct kvm *kvm);
> +
>  #endif	/* !__ASSEMBLY__ */
>  
>  #endif /* __ARM_KVM_MMU_H__ */
> diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
> index fc71a8d..ea21b6a 100644
> --- a/arch/arm/kvm/mmu.c
> +++ b/arch/arm/kvm/mmu.c
> @@ -187,6 +187,99 @@ static void unmap_range(struct kvm *kvm, pgd_t *pgdp,
>  	}
>  }
>  
> +static void stage2_flush_ptes(struct kvm *kvm, pmd_t *pmd,
> +			      phys_addr_t addr, phys_addr_t end)
> +{
> +	pte_t *pte;
> +
> +	pte = pte_offset_kernel(pmd, addr);
> +	do {
> +		if (!pte_none(*pte)) {
> +			hva_t hva = gfn_to_hva(kvm, addr >> PAGE_SHIFT);
> +			kvm_flush_dcache_to_poc((void*)hva, PAGE_SIZE);
> +		}
> +	} while (pte++, addr += PAGE_SIZE, addr != end);
> +}
> +
> +static void stage2_flush_pmds(struct kvm *kvm, pud_t *pud,
> +			      phys_addr_t addr, phys_addr_t end)
> +{
> +	pmd_t *pmd;
> +	phys_addr_t next;
> +
> +	pmd = pmd_offset(pud, addr);
> +	do {
> +		next = pmd_addr_end(addr, end);
> +		if (!pmd_none(*pmd)) {
> +			if (kvm_pmd_huge(*pmd)) {
> +				hva_t hva = gfn_to_hva(kvm, addr >> PAGE_SHIFT);
> +				kvm_flush_dcache_to_poc((void*)hva, PMD_SIZE);
> +			} else {
> +				stage2_flush_ptes(kvm, pmd, addr, next);
> +			}
> +		}
> +	} while (pmd++, addr = next, addr != end);
> +}
> +
> +static void stage2_flush_puds(struct kvm *kvm, pgd_t *pgd,
> +			      phys_addr_t addr, phys_addr_t end)
> +{
> +	pud_t *pud;
> +	phys_addr_t next;
> +
> +	pud = pud_offset(pgd, addr);
> +	do {
> +		next = pud_addr_end(addr, end);
> +		if (!pud_none(*pud)) {
> +			if (pud_huge(*pud)) {
> +				hva_t hva = gfn_to_hva(kvm, addr >> PAGE_SHIFT);
> +				kvm_flush_dcache_to_poc((void*)hva, PUD_SIZE);
> +			} else {
> +				stage2_flush_pmds(kvm, pud, addr, next);
> +			}
> +		}
> +	} while(pud++, addr = next, addr != end);

you missed one space after this while, but no need to respin just
because of that.

> +}
> +
> +static void stage2_flush_memslot(struct kvm *kvm,
> +				 struct kvm_memory_slot *memslot)
> +{
> +	phys_addr_t addr = memslot->base_gfn << PAGE_SHIFT;
> +	phys_addr_t end = addr + PAGE_SIZE * memslot->npages;
> +	phys_addr_t next;
> +	pgd_t *pgd;
> +
> +	pgd = kvm->arch.pgd + pgd_index(addr);
> +	do {
> +		next = kvm_pgd_addr_end(addr, end);
> +		stage2_flush_puds(kvm, pgd, addr, next);
> +	} while (pgd++, addr = next, addr != end);
> +}
> +
> +/**
> + * stage2_flush_vm - Invalidate cache for pages mapped in stage 2
> + * @kvm: The struct kvm pointer
> + *
> + * Go through the stage 2 page tables and invalidate any cache lines
> + * backing memory already mapped to the VM.
> + */
> +void stage2_flush_vm(struct kvm *kvm)
> +{
> +	struct kvm_memslots *slots;
> +	struct kvm_memory_slot *memslot;
> +	int idx;
> +
> +	idx = srcu_read_lock(&kvm->srcu);
> +	spin_lock(&kvm->mmu_lock);
> +
> +	slots = kvm_memslots(kvm);
> +	kvm_for_each_memslot(memslot, slots)
> +		stage2_flush_memslot(kvm, memslot);
> +
> +	spin_unlock(&kvm->mmu_lock);
> +	srcu_read_unlock(&kvm->srcu, idx);
> +}
> +
>  /**
>   * free_boot_hyp_pgd - free HYP boot page tables
>   *
> diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
> index 6eaf69b..e78d050 100644
> --- a/arch/arm64/include/asm/kvm_mmu.h
> +++ b/arch/arm64/include/asm/kvm_mmu.h
> @@ -121,6 +121,8 @@ static inline void kvm_set_s2pmd_writable(pmd_t *pmd)
>  	pmd_val(*pmd) |= PMD_S2_RDWR;
>  }
>  
> +#define kvm_pgd_addr_end(addr, end)	pgd_addr_end(addr, end)
> +
>  struct kvm;
>  
>  #define kvm_flush_dcache_to_poc(a,l)	__flush_dcache_area((a), (l))
> @@ -146,5 +148,7 @@ static inline void coherent_cache_guest_page(struct kvm_vcpu *vcpu, hva_t hva,
>  
>  #define kvm_virt_to_phys(x)		__virt_to_phys((unsigned long)(x))
>  
> +void stage2_flush_vm(struct kvm *kvm);
> +
>  #endif /* __ASSEMBLY__ */
>  #endif /* __ARM64_KVM_MMU_H__ */
> diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
> index 2097e5e..0324458 100644
> --- a/arch/arm64/kvm/sys_regs.c
> +++ b/arch/arm64/kvm/sys_regs.c
> @@ -27,6 +27,7 @@
>  #include <asm/kvm_host.h>
>  #include <asm/kvm_emulate.h>
>  #include <asm/kvm_coproc.h>
> +#include <asm/kvm_mmu.h>
>  #include <asm/cacheflush.h>
>  #include <asm/cputype.h>
>  #include <trace/events/kvm.h>
> @@ -154,8 +155,10 @@ static bool access_sctlr(struct kvm_vcpu *vcpu,
>  {
>  	access_vm_reg(vcpu, p, r);
>  
> -	if (vcpu_has_cache_enabled(vcpu))	/* MMU+Caches enabled? */
> +	if (vcpu_has_cache_enabled(vcpu)) {	/* MMU+Caches enabled? */
>  		vcpu->arch.hcr_el2 &= ~HCR_TVM;
> +		stage2_flush_vm(vcpu->kvm);
> +	}
>  
>  	return true;
>  }
> -- 
> 1.8.3.4
> 

Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>

^ permalink raw reply

* [PATCH v3 05/11] ARM: LPAE: provide an IPA capable pmd_addr_end
From: Christoffer Dall @ 2014-02-07  4:04 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20140206104328.GB29446@arm.com>

On Thu, Feb 06, 2014 at 10:43:28AM +0000, Catalin Marinas wrote:
> On Wed, Feb 05, 2014 at 07:55:45PM +0000, Marc Zyngier wrote:
> > The default pmd_addr_end macro uses an unsigned long to represent
> > the VA. When used with KVM and stage-2 translation, the VA is
> > actually an IPA, which is up to 40 bits. This also affect the
> > SMMU driver, which also deals with stage-2 translation.
> > 
> > Instead, provide an implementation that can cope with larger VAs
> > by using a u64 instead. This version will overload the default
> > one provided in include/asm-generic/pgtable.h.
> > 
> > Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> > ---
> >  arch/arm/include/asm/pgtable-3level.h | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h
> > index 03243f7..594867b 100644
> > --- a/arch/arm/include/asm/pgtable-3level.h
> > +++ b/arch/arm/include/asm/pgtable-3level.h
> > @@ -262,6 +262,11 @@ static inline int has_transparent_hugepage(void)
> >  	return 1;
> >  }
> >  
> > +#define pmd_addr_end(addr, end)						\
> > +({	u64 __boundary = ((addr) + PMD_SIZE) & PMD_MASK;		\
> > +	(__boundary - 1 < (end) - 1)? __boundary: (end);		\
> > +})
> 
> I see why you need this but it affects all the other uses of
> pmd_addr_end() with 32-bit VA. It would be slight performance, I don't
> think it's noticeable.
> 
> A different approach could be something like (untested):
> 
> #define pmd_addr_end(addr, end)					\
> ({	__typeof__(addr) __boundary = ...
> 	...
> })
> 
> What about the pgd_addr_end(), do we need this or it's not used by KVM?
> 

What about pud_addr_end(), is that defined as a noop on LPAE, or?

I would be in favor of introducing them all using your approach to avoid
somebody being inspired by the KVM code when dealing with IPAs and
breaking things unknowingly.

-Christoffer

^ permalink raw reply

* [PATCH V4 6/8] phy: st-miphy-40lp: Add SPEAr1310 and SPEAr1340 PCIe phy support
From: Pratyush Anand @ 2014-02-07  3:54 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <201402061637.05414.arnd@arndb.de>

Hi Arnd,

On Thu, Feb 06, 2014 at 11:37:05PM +0800, Arnd Bergmann wrote:
> On Thursday 06 February 2014, Pratyush Anand wrote:
> > +static int spear1310_pcie_miphy_exit(struct st_miphy40lp_priv *phypriv)
> > +{
> > +       u32 mask;
> > +
> > +       switch (phypriv->id) {
> > +       case 0:
> > +               mask = SPEAR1310_PCIE_CFG_MASK(0);
> > +               break;
> > +       case 1:
> > +               mask = SPEAR1310_PCIE_CFG_MASK(1);
> > +               break;
> > +       case 2:
> > +               mask = SPEAR1310_PCIE_CFG_MASK(2);
> > +               break;
> > +       default:
> > +               return -EINVAL;
> > +       }
> > +
> > +       regmap_update_bits(phypriv->misc, SPEAR1310_PCIE_SATA_CFG,
> > +                       SPEAR1310_PCIE_CFG_MASK(phypriv->id), 0);
> > +
> > +       regmap_update_bits(phypriv->misc, SPEAR1310_PCIE_MIPHY_CFG_1,
> > +                       SPEAR1310_PCIE_SATA_MIPHY_CFG_PCIE_MASK, 0);
> > +
> > +       return 0;
> > +}
> 
> hmm, you set the mask based on the id, but then use the macro below
> and ignore the mask?

Blunder, no need of switch case here :(
Will correct.

> 
> > +
> > +static int pcie_miphy_init(struct st_miphy40lp_priv *phypriv)
> > +{
> > +       if (of_device_is_compatible(phypriv->np, "st,spear1340-miphy"))
> > +               return spear1340_pcie_miphy_init(phypriv);
> > +       else if (of_device_is_compatible(phypriv->np, "st,spear1310-miphy"))
> > +               return spear1310_pcie_miphy_init(phypriv);
> > +       else
> > +               return -EINVAL;
> > +}
> > +
> > +static int pcie_miphy_exit(struct st_miphy40lp_priv *phypriv)
> > +{
> > +       if (of_device_is_compatible(phypriv->np, "st,spear1340-miphy"))
> > +               return spear1340_pcie_miphy_exit(phypriv);
> > +       else if (of_device_is_compatible(phypriv->np, "st,spear1310-miphy"))
> > +               return spear1310_pcie_miphy_exit(phypriv);
> > +       else
> > +               return -EINVAL;
> > +}
> 
> I think it's better to make this code table-driven. Rather than checking
> 'of_device_is_compatible()', it's much easier to add a .data field to
> the of_device_id array that describes the PHY. You can use .data to
> point to a structure containing per-device function pointers or
> (better) values and offsets to be used.

Sounds a better idea. will reduce code size a lot. Thanks.

Regards
Pratyush

> 
> 	Arnd

^ permalink raw reply

* [PATCH v1 1/3] net: stmmac:sti: Add STi SOC glue driver.
From: David Miller @ 2014-02-07  3:53 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1391428868-27245-1-git-send-email-srinivas.kandagatla@st.com>

From: <srinivas.kandagatla@st.com>
Date: Mon, 3 Feb 2014 12:01:08 +0000

> +	res = platform_get_resource_byname(pdev,
> +				IORESOURCE_MEM, "sti-ethconf");

This is not the correct way to format multi-line function calls,
you'll need to fix this up in this entire series.

The arguments on the second and subsequent lines must start at
the first column after the openning parenthesis of the function
call.  You must use the appropriate number of both space and
TAB characters necessary to do so.

If you're only using TAB characters to indent, you're doing it
wrong.

Thank you.

^ permalink raw reply

* [PATCH] ARM: KVM: fix warning in mmu.c
From: Christoffer Dall @ 2014-02-07  3:51 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1391630305-8056-1-git-send-email-marc.zyngier@arm.com>

On Wed, Feb 05, 2014 at 07:58:25PM +0000, Marc Zyngier wrote:
> Compiling with THP enabled leads to the following warning:
> 
> arch/arm/kvm/mmu.c: In function ?unmap_range?:
> arch/arm/kvm/mmu.c:177:39: warning: ?pte? may be used uninitialized in this function [-Wmaybe-uninitialized]
>    if (kvm_pmd_huge(*pmd) || page_empty(pte)) {
>                                         ^
> Code inspection reveals that these two cases are mutually exclusive,
> so GCC is a bit overzealous here. But silence it anyway by setting
> pte to NULL if kvm_pmd_huge(*pmd) is true.
> 
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
>  arch/arm/kvm/mmu.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
> index ea21b6a..3020221 100644
> --- a/arch/arm/kvm/mmu.c
> +++ b/arch/arm/kvm/mmu.c
> @@ -169,12 +169,14 @@ static void unmap_range(struct kvm *kvm, pgd_t *pgdp,
>  			pte = pte_offset_kernel(pmd, addr);
>  			clear_pte_entry(kvm, pte, addr);
>  			next = addr + PAGE_SIZE;
> +		} else {
> +			pte = NULL;
>  		}

If it's just for the compiler, how about just setting pte = NULL when
pte is declared in the top of the function as to not interrupt the flow?

-Christoffer

^ permalink raw reply

* [PATCH 3/3] ARM: sunxi: dt: Convert to the new net compatibles
From: David Miller @ 2014-02-07  3:47 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1391348953-10662-3-git-send-email-maxime.ripard@free-electrons.com>

From: Maxime Ripard <maxime.ripard@free-electrons.com>
Date: Sun,  2 Feb 2014 14:49:13 +0100

> Switch the device tree to the new compatibles introduced in the ethernet and
> mdio drivers to have a common pattern accross all Allwinner SoCs.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Applied.

^ permalink raw reply

* [PATCH 2/3] net: phy: sunxi: Add new compatibles
From: David Miller @ 2014-02-07  3:47 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1391348953-10662-2-git-send-email-maxime.ripard@free-electrons.com>

From: Maxime Ripard <maxime.ripard@free-electrons.com>
Date: Sun,  2 Feb 2014 14:49:12 +0100

> The Allwinner A10 compatibles were following a slightly different compatible
> patterns than the rest of the SoCs for historical reasons. Add compatibles
> matching the other pattern to the mdio driver for consistency, and keep the
> older one for backward compatibility.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Applied.

^ permalink raw reply

* [PATCH 1/3] net: ethernet: sunxi: Add new compatibles
From: David Miller @ 2014-02-07  3:47 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1391348953-10662-1-git-send-email-maxime.ripard@free-electrons.com>

From: Maxime Ripard <maxime.ripard@free-electrons.com>
Date: Sun,  2 Feb 2014 14:49:11 +0100

> The Allwinner A10 compatibles were following a slightly different compatible
> patterns than the rest of the SoCs for historical reasons. Add compatibles
> matching the other pattern to the ethernet driver for consistency, and keep the
> older one for backward compatibility.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Applied.

^ permalink raw reply

* [PATCH v2 0/9] Samsung PM consolidation part 1 (clocks)
From: Thomas Abraham @ 2014-02-07  3:45 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1391710616-14226-1-git-send-email-t.figa@samsung.com>

On Thu, Feb 6, 2014 at 11:46 PM, Tomasz Figa <t.figa@samsung.com> wrote:
> This series reworks suspend/resume handling of Samsung clock drivers
> to cover more SoC specific aspects that are beyond simple register
> save and restore. The goal is to have all the suspend/resume code
> that touches the clock controller in single place, which is the
> clock driver.
>
> On Exynos4210-based Trats, Exynos4412-based Trats2 and Exynos5250-based
> Arndale boards (except suspend/resume, which is broken because of
> unrelated reasons):
>
> Tested-by: Tomasz Figa <t.figa@samsung.com>
>
> Tomasz Figa (9):
>   clk: exynos4: Remove remnants of non-DT support
>   clk: samsung: Provide common helpers for register save/restore
>   clk: samsung: exynos4: Move suspend/resume handling to SoC driver
>   clk: samsung: exynos5250: Move suspend/resume handling to SoC driver
>   clk: samsung: exynos5420: Move suspend/resume handling to SoC driver
>   clk: samsung: s3c64xx: Move suspend/resume handling to SoC driver
>   clk: samsung: Drop old suspend/resume code
>   clk: samsung: exynos4: Add remaining suspend/resume handling
>   ARM: EXYNOS: pm: Drop legacy Exynos4 clock suspend/resume code
>
>  arch/arm/mach-exynos/pm.c            | 148 +-----------------------------
>  drivers/clk/samsung/clk-exynos4.c    | 172 +++++++++++++++++++++++++++++++----
>  drivers/clk/samsung/clk-exynos5250.c |  49 +++++++++-
>  drivers/clk/samsung/clk-exynos5420.c |  49 +++++++++-
>  drivers/clk/samsung/clk-exynos5440.c |   2 +-
>  drivers/clk/samsung/clk-s3c64xx.c    |  79 +++++++++++++---
>  drivers/clk/samsung/clk.c            |  71 ++++++---------
>  drivers/clk/samsung/clk.h            |  14 ++-
>  8 files changed, 348 insertions(+), 236 deletions(-)

Nice series!
Reviewed-by: Thomas Abraham <thomas.ab@samsung.com>


>
> --
> 1.8.5.2
>
>
> _______________________________________________
> 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 2/2] ALSA: hda/ca0132 - Fix recording from mode id 0x8
From: Hsin-Yu Chao @ 2014-02-07  3:35 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1391744130-15043-1-git-send-email-hychao@chromium.org>

The Chromebook Pixel has a microphone under the keyboard that
is attached to node id 0x8. Before this fix, recording would
always go to the main internal mic (node id 0x7).

Signed-off-by: Hsin-Yu Chao <hychao@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
---
 sound/pci/hda/patch_ca0132.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index 59104dc..d5aabce 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -2770,9 +2770,7 @@ static int ca0132_capture_pcm_prepare(struct hda_pcm_stream *hinfo,
 					unsigned int format,
 					struct snd_pcm_substream *substream)
 {
-	struct ca0132_spec *spec = codec->spec;
-
-	snd_hda_codec_setup_stream(codec, spec->adcs[substream->number],
+	snd_hda_codec_setup_stream(codec, hinfo->nid,
 				   stream_tag, 0, format);
 
 	return 0;
-- 
1.9.0.rc1.175.g0b1dcb5

^ permalink raw reply related

* [PATCH 1/2] ALSA: hda/ca0132 - setup/cleanup streams
From: Hsin-Yu Chao @ 2014-02-07  3:35 UTC (permalink / raw)
  To: linux-arm-kernel

When a HDMI stream is opened with the same stream tag
as a following opened stream to ca0132, audio will be
heard from two ports simultaneously.
Fix this issue by change to use snd_hda_codec_setup_stream
and snd_hda_codec_cleanup_stream instead, so that an
inactive stream can be marked as 'dirty' when found
with a conflict stream tag, and then get purified.

Signed-off-by: Hsin-Yu Chao <hychao@chromium.org>
Reviewed-by: Chih-Chung Chang <chihchung@chromium.org>
---
 sound/pci/hda/patch_ca0132.c | 68 ++++++--------------------------------------
 1 file changed, 9 insertions(+), 59 deletions(-)

diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index 54d1479..59104dc 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -2662,60 +2662,6 @@ static bool dspload_wait_loaded(struct hda_codec *codec)
 }
 
 /*
- * PCM stuffs
- */
-static void ca0132_setup_stream(struct hda_codec *codec, hda_nid_t nid,
-				 u32 stream_tag,
-				 int channel_id, int format)
-{
-	unsigned int oldval, newval;
-
-	if (!nid)
-		return;
-
-	snd_printdd(
-		   "ca0132_setup_stream: NID=0x%x, stream=0x%x, "
-		   "channel=%d, format=0x%x\n",
-		   nid, stream_tag, channel_id, format);
-
-	/* update the format-id if changed */
-	oldval = snd_hda_codec_read(codec, nid, 0,
-				    AC_VERB_GET_STREAM_FORMAT,
-				    0);
-	if (oldval != format) {
-		msleep(20);
-		snd_hda_codec_write(codec, nid, 0,
-				    AC_VERB_SET_STREAM_FORMAT,
-				    format);
-	}
-
-	oldval = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONV, 0);
-	newval = (stream_tag << 4) | channel_id;
-	if (oldval != newval) {
-		snd_hda_codec_write(codec, nid, 0,
-				    AC_VERB_SET_CHANNEL_STREAMID,
-				    newval);
-	}
-}
-
-static void ca0132_cleanup_stream(struct hda_codec *codec, hda_nid_t nid)
-{
-	unsigned int val;
-
-	if (!nid)
-		return;
-
-	snd_printdd(KERN_INFO "ca0132_cleanup_stream: NID=0x%x\n", nid);
-
-	val = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONV, 0);
-	if (!val)
-		return;
-
-	snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_STREAM_FORMAT, 0);
-	snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CHANNEL_STREAMID, 0);
-}
-
-/*
  * PCM callbacks
  */
 static int ca0132_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
@@ -2726,7 +2672,9 @@ static int ca0132_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
 {
 	struct ca0132_spec *spec = codec->spec;
 
-	ca0132_setup_stream(codec, spec->dacs[0], stream_tag, 0, format);
+	ca0132_toggle_dac_format(codec);
+
+	snd_hda_codec_setup_stream(codec, spec->dacs[0], stream_tag, 0, format);
 
 	return 0;
 }
@@ -2745,7 +2693,7 @@ static int ca0132_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
 	if (spec->effects_switch[PLAY_ENHANCEMENT - EFFECT_START_NID])
 		msleep(50);
 
-	ca0132_cleanup_stream(codec, spec->dacs[0]);
+	snd_hda_codec_cleanup_stream(codec, spec->dacs[0]);
 
 	return 0;
 }
@@ -2824,8 +2772,8 @@ static int ca0132_capture_pcm_prepare(struct hda_pcm_stream *hinfo,
 {
 	struct ca0132_spec *spec = codec->spec;
 
-	ca0132_setup_stream(codec, spec->adcs[substream->number],
-			    stream_tag, 0, format);
+	snd_hda_codec_setup_stream(codec, spec->adcs[substream->number],
+				   stream_tag, 0, format);
 
 	return 0;
 }
@@ -2839,7 +2787,7 @@ static int ca0132_capture_pcm_cleanup(struct hda_pcm_stream *hinfo,
 	if (spec->dsp_state == DSP_DOWNLOADING)
 		return 0;
 
-	ca0132_cleanup_stream(codec, hinfo->nid);
+	snd_hda_codec_cleanup_stream(codec, hinfo->nid);
 	return 0;
 }
 
@@ -4742,6 +4690,8 @@ static int patch_ca0132(struct hda_codec *codec)
 		return err;
 
 	codec->patch_ops = ca0132_patch_ops;
+	codec->pcm_format_first = 1;
+	codec->no_sticky_stream = 1;
 
 	return 0;
 }
-- 
1.9.0.rc1.175.g0b1dcb5

^ permalink raw reply related

* [PATCH] backlight: add PWM dependencies
From: Jingoo Han @ 2014-02-07  3:05 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <201402061708.05845.arnd@arndb.de>

On Friday, February 07, 2014 1:08 AM, Arnd Bergmann wrote:
> On Thursday 06 February 2014, Jingoo Han wrote:
> > In the case of "CONFIG_HAVE_PWM=y && CONFIG_PWM=n", it makes
> > the problem.
> >
> > The HAVE_PWM symbol is only for legacy platforms that provide
> > the PWM API without using the generic framework. PXA looks to
> > use the generic PWM framework. Then, how about removing
> > "select HAVE_PWM" from PXA as below?
> >
> 
> I think this is correct, but we may need additional patches. I notice
> that INPUT_MAX8997_HAPTIC and INPUT_PWM_BEEPER have a dependency on
> HAVE_PWM at the moment, so those two drivers become impossible
> to select after your change.
> 
> There is also one use of HAVE_PWM outside of PXA, for ARCH_LPC32XX.
> This one seems to have the same problem.

I looked at all HAVE_PWMs in the latest mainline kernel 3.14-rc1.

1. ARM - PXA
  ./arch/arm/mach-pxa/Kconfig

2. ARM - NXP LPC32XX
  ./arc ARM - PXA h/arm/Kconfig
  config ARCH_LPC32XX
  	select HAVE_PWM

3. MIPS - Ingenic JZ4740 based machines
  ./arch/mips/Kconfig
  config MACH_JZ4740
  	select HAVE_PWM

However, the legacy PWM drivers for PXA, LPC32XX, and JZ474 were
already moved to the generic PWM framework.
  ./drivers/pwm/pwm-pxa.c
  ./drivers/pwm/pwm-lpc32xx.c
  ./drivers/pwm/pwm-jz4740.c

In conclusion, HAVE_PWM should be removed, because HAVE_PWM is
NOT required anymore.

How about the following?

  [PATCH 1/7] ARM: pxa: don't select HAVE_PWM
  [PATCH 2/7] ARM: lpc32xx: don't select HAVE_PWM
  [PATCH 3/7] ARM: remove HAVE_PWM config option
  [PATCH 4/7] MIPS: jz4740: don't select HAVE_PWM
  [PATCH 5/7] Input: max8997_haptic: remove HAVE_PWM dependencies
  [PATCH 6/7] Input: pwm-beepe: remove HAVE_PWM dependencies
  [PATCH 7/7] pwm: don't use IS_ENABLED(CONFIG_HAVE_PWM)

I would like to merge it through PWM tree.
After merging these patches, all HAVE_PWM will be removed from
the mainline kernel. Thank you. :-)

Best regards,
Jingoo Han

> 
> Finally, I have recently encountered a couple of drivers
> (BACKLIGHT_LM3630A, BACKLIGHT_LP855X, BACKLIGHT_LP8788) that use
> the PWM interfaces but are missing a 'depends on PWM'. This is
> strictly speaking a different problem, but we could try to solve
> it at the same time.
> 
> 	Arnd

^ permalink raw reply

* [PATCH 02/21] IRQ: Orion: Fix getting generic chip pointer.
From: Jason Cooper @ 2014-02-07  2:38 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1391730137-14814-3-git-send-email-andrew@lunn.ch>

On Fri, Feb 07, 2014 at 12:41:58AM +0100, Andrew Lunn wrote:
> Enabling SPARSE_IRQ shows up a bug in the irq-orion bridge interrupt
> handler. The bridge interrupt is implemented using a single generic
> chip. Thus the parameter passed to irq_get_domain_generic_chip()
> should always be zero.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  drivers/irqchip/irq-orion.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

applied to mvebu-next/irqchip-fixes with:

Fixes: 9dbd90f17e4f ("irqchip: Add support for Marvell Orion SoCs")
Cc: <stable@vger.kernel.org> # v3.11+

thx,

Jason.

^ permalink raw reply

* [PATCH v2] pwm: add CSR SiRFSoC PWM driver
From: Barry Song @ 2014-02-07  2:30 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <201402061627.17086.arnd@arndb.de>

2014-02-06 23:27 GMT+08:00 Arnd Bergmann <arnd@arndb.de>:
> On Thursday 06 February 2014, Barry Song wrote:
>> > How about modeling  that other source as a fixed-rate clock in DT
>> > then?
>>
>> sirfsoc clock drivers have a clock node for OSC whose index is "1".
>> do you think the following is the right way to handle?
>>
>> in dts, put both pwm controller clock and OSC
>> 672                         pwm: pwm at b0130000 {
>> 673                                 compatible = "sirf,prima2-pwm";
>> 674                                 #pwm-cells = <2>;
>> 675                                 reg = <0xb0130000 0x10000>;
>> 676                                 clocks = <&clks 21>,  <&clks 1>;
>> 677                                 clock-names = "pwmc", "osc";
>> 678                         };
>>
>> and in pwm-sirf.c driver, use
>> clk = clk_get(dev, "osc");
>> clk_get_rate(clk);
>>
>> to get the rate in probe()?
>
> Ah, if that's the right clock, it sounds great, yes.
>
> Just make sure that the clock-names values make sense from the
> point of view of the pwm node, rather than referring to the
> name given in the clock provider.

from the point of clock provider, it is "osc", from the view of pwm,
it is the clock source of PWM waves.
so i guess "clk_pwm_source" is preferred?

>
>         Arnd

-barry

^ permalink raw reply

* [PATCHv2 2/2] arm: Get rid of meminfo
From: Courtney Cavin @ 2014-02-07  2:09 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1391558551-31395-3-git-send-email-lauraa@codeaurora.org>

On Wed, Feb 05, 2014 at 01:02:31AM +0100, Laura Abbott wrote:
> memblock is now fully integrated into the kernel and is the prefered
> method for tracking memory. Rather than reinvent the wheel with
> meminfo, migrate to using memblock directly instead of meminfo as
> an intermediate.
> 
> Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
[...]
> diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
> index 0b11c1a..51d814e 100644
> --- a/arch/arm/mach-pxa/spitz.c
> +++ b/arch/arm/mach-pxa/spitz.c
> @@ -32,6 +32,7 @@
>  #include <linux/io.h>
>  #include <linux/module.h>
>  #include <linux/reboot.h>
> +#include <linux/memblock.h>
> 
>  #include <asm/setup.h>
>  #include <asm/mach-types.h>
> @@ -971,13 +972,9 @@ static void __init spitz_init(void)
>         spitz_i2c_init();
>  }
> 
> -static void __init spitz_fixup(struct tag *tags, char **cmdline,
> -                              struct meminfo *mi)
> +static void __init spitz_fixup(struct tag *tags, char **cmdline)
>  {
> -       sharpsl_save_param();
> -       mi->nr_banks = 1;
> -       mi->bank[0].start = 0xa0000000;
> -       mi->bank[0].size = (64*1024*1024);
> +       memblock_addr(0xa0000000, SZ_64M);

memblock_add() ?

-Courtney

^ permalink raw reply

* [PATCH v6 17/19] watchdog: orion: Enable the build on ARCH_MVEBU
From: Guenter Roeck @ 2014-02-07  2:07 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1391707226-18258-18-git-send-email-ezequiel.garcia@free-electrons.com>

On 02/06/2014 09:20 AM, Ezequiel Garcia wrote:
> After adding support for Armada 370/XP SoC let's enable the build on
> these platforms.
>
> Tested-by: Willy Tarreau <w@1wt.eu>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   drivers/watchdog/Kconfig | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 4c4c566..2dda6c0 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -291,7 +291,7 @@ config DAVINCI_WATCHDOG
>
>   config ORION_WATCHDOG
>   	tristate "Orion watchdog"
> -	depends on ARCH_ORION5X || ARCH_KIRKWOOD || ARCH_DOVE
> +	depends on ARCH_ORION5X || ARCH_KIRKWOOD || ARCH_DOVE || ARCH_MVEBU
>   	select WATCHDOG_CORE
>   	help
>   	  Say Y here if to include support for the watchdog timer
>

^ permalink raw reply

* [PATCH v6 05/19] watchdog: orion: Make sure the watchdog is initially stopped
From: Guenter Roeck @ 2014-02-07  2:02 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1391707226-18258-6-git-send-email-ezequiel.garcia@free-electrons.com>

On 02/06/2014 09:20 AM, Ezequiel Garcia wrote:
> Having the watchdog initially fully stopped is important to avoid
> any spurious watchdog triggers, in case the registers are not in
> its reset state.
>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> Tested-by: Willy Tarreau <w@1wt.eu>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> ---
>   drivers/watchdog/orion_wdt.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
> index 6746033..2dbeee9 100644
> --- a/drivers/watchdog/orion_wdt.c
> +++ b/drivers/watchdog/orion_wdt.c
> @@ -142,6 +142,9 @@ static int orion_wdt_probe(struct platform_device *pdev)
>   	orion_wdt.max_timeout = wdt_max_duration;
>   	watchdog_init_timeout(&orion_wdt, heartbeat, &pdev->dev);
>
> +	/* Let's make sure the watchdog is fully stopped */
> +	orion_wdt_stop(&orion_wdt);
> +

Actually we just had that in another driver, and I stumbled over it there.

Problem with stopping the watchdog in probe unconditionally is that you can
use it to defeat nowayout: unload the module, then load it again,
and the watchdog is stopped even if nowayout is true.

Is this really what you want ? Or, in other words, what is the problem
you are trying to solve ?

Thanks,
Guenter


>   	watchdog_set_nowayout(&orion_wdt, nowayout);
>   	ret = watchdog_register_device(&orion_wdt);
>   	if (ret)
>

^ permalink raw reply

* [PATCH 20/21] ARM: MVEBU: Remove unneeded headers
From: Jason Cooper @ 2014-02-07  2:02 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1391730137-14814-21-git-send-email-andrew@lunn.ch>

On Fri, Feb 07, 2014 at 12:42:16AM +0100, Andrew Lunn wrote:
> Remove headers which are no longer needed, and add a couple of missing
> onces.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  arch/arm/mach-mvebu/kirkwood.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)

You could probably collapse this into the previous patch.

thx,

Jason.

> diff --git a/arch/arm/mach-mvebu/kirkwood.c b/arch/arm/mach-mvebu/kirkwood.c
> index 1df0c0b138d5..5d7fef04c36d 100644
> --- a/arch/arm/mach-mvebu/kirkwood.c
> +++ b/arch/arm/mach-mvebu/kirkwood.c
> @@ -13,18 +13,15 @@
>  #include <linux/clk.h>
>  #include <linux/kernel.h>
>  #include <linux/init.h>
> +#include <linux/mbus.h>
>  #include <linux/of.h>
>  #include <linux/of_address.h>
>  #include <linux/of_net.h>
>  #include <linux/of_platform.h>
> -#include <linux/dma-mapping.h>
> -#include <linux/irqchip.h>
> -#include <linux/kexec.h>
> +#include <linux/slab.h>
>  #include <asm/hardware/cache-feroceon-l2.h>
>  #include <asm/mach/arch.h>
>  #include <asm/mach/map.h>
> -#include <plat/common.h>
> -#include <plat/pcie.h>
>  #include "kirkwood.h"
>  #include "kirkwood-pm.h"
>  #include "common.h"
> -- 
> 1.8.5.3
> 

^ permalink raw reply

* [PATCH 16/21] drivers: Enable building of Kirkwood drivers for mach-mvebu
From: Jason Cooper @ 2014-02-07  1:59 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1391730137-14814-17-git-send-email-andrew@lunn.ch>

On Fri, Feb 07, 2014 at 12:42:12AM +0100, Andrew Lunn wrote:
> With the move to mach-mvebu, drivers Kconfig need tweeking to allow
> the kirkwood specific drivers to be built.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  drivers/cpufreq/Kconfig.arm | 2 +-
>  drivers/cpuidle/Kconfig.arm | 2 +-
>  drivers/leds/Kconfig        | 4 ++--
>  drivers/phy/Kconfig         | 2 +-
>  drivers/thermal/Kconfig     | 2 +-
>  sound/soc/kirkwood/Kconfig  | 2 +-
>  6 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
> index 31297499a60a..de931081fd01 100644
> --- a/drivers/cpufreq/Kconfig.arm
> +++ b/drivers/cpufreq/Kconfig.arm
> @@ -113,7 +113,7 @@ config ARM_INTEGRATOR
>  	  If in doubt, say Y.
>  
>  config ARM_KIRKWOOD_CPUFREQ
> -	def_bool ARCH_KIRKWOOD && OF
> +	def_bool (ARCH_KIRKWOOD || MACH_KIRKWOOD) && OF

I agree with creating MACH_KIRKWOOD underneath ARCH_MVEBU earlier in
this series, but the 'ARCH_KIRKWOOD || MACH_KIRKWOOD' just looks
confusing.  Also, MACH_KIRKWOOD implies OF so this particular one could
be reduced to

	def_bool MACH_KIRKWOOD

thx,

Jason.

>  	help
>  	  This adds the CPUFreq driver for Marvell Kirkwood
>  	  SoCs.
> diff --git a/drivers/cpuidle/Kconfig.arm b/drivers/cpuidle/Kconfig.arm
> index d988948a89a0..97ccc31dbdd8 100644
> --- a/drivers/cpuidle/Kconfig.arm
> +++ b/drivers/cpuidle/Kconfig.arm
> @@ -22,7 +22,7 @@ config ARM_HIGHBANK_CPUIDLE
>  
>  config ARM_KIRKWOOD_CPUIDLE
>  	bool "CPU Idle Driver for Marvell Kirkwood SoCs"
> -	depends on ARCH_KIRKWOOD
> +	depends on ARCH_KIRKWOOD || MACH_KIRKWOOD
>  	help
>  	  This adds the CPU Idle driver for Marvell Kirkwood SoCs.
>  
> diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> index 72156c123033..44c358ecf5a1 100644
> --- a/drivers/leds/Kconfig
> +++ b/drivers/leds/Kconfig
> @@ -421,7 +421,7 @@ config LEDS_MC13783
>  config LEDS_NS2
>  	tristate "LED support for Network Space v2 GPIO LEDs"
>  	depends on LEDS_CLASS
> -	depends on ARCH_KIRKWOOD
> +	depends on ARCH_KIRKWOOD || MACH_KIRKWOOD
>  	default y
>  	help
>  	  This option enable support for the dual-GPIO LED found on the
> @@ -431,7 +431,7 @@ config LEDS_NS2
>  config LEDS_NETXBIG
>  	tristate "LED support for Big Network series LEDs"
>  	depends on LEDS_CLASS
> -	depends on ARCH_KIRKWOOD
> +	depends on ARCH_KIRKWOOD || MACH_KIRKWOOD
>  	default y
>  	help
>  	  This option enable support for LEDs found on the LaCie 2Big
> diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
> index afa2354f6600..5e6b33f9c294 100644
> --- a/drivers/phy/Kconfig
> +++ b/drivers/phy/Kconfig
> @@ -24,7 +24,7 @@ config PHY_EXYNOS_MIPI_VIDEO
>  
>  config PHY_MVEBU_SATA
>  	def_bool y
> -	depends on ARCH_KIRKWOOD || ARCH_DOVE
> +	depends on ARCH_KIRKWOOD || ARCH_DOVE || MACH_KIRKWOOD
>  	depends on OF
>  	select GENERIC_PHY
>  
> diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
> index 35c066489a19..1bc9cbc4f1b8 100644
> --- a/drivers/thermal/Kconfig
> +++ b/drivers/thermal/Kconfig
> @@ -142,7 +142,7 @@ config RCAR_THERMAL
>  
>  config KIRKWOOD_THERMAL
>  	tristate "Temperature sensor on Marvell Kirkwood SoCs"
> -	depends on ARCH_KIRKWOOD
> +	depends on ARCH_KIRKWOOD || MACH_KIRKWOOD
>  	depends on OF
>  	help
>  	  Support for the Kirkwood thermal sensor driver into the Linux thermal
> diff --git a/sound/soc/kirkwood/Kconfig b/sound/soc/kirkwood/Kconfig
> index 78ed4a42ad21..106e2e22fed2 100644
> --- a/sound/soc/kirkwood/Kconfig
> +++ b/sound/soc/kirkwood/Kconfig
> @@ -1,6 +1,6 @@
>  config SND_KIRKWOOD_SOC
>  	tristate "SoC Audio for the Marvell Kirkwood and Dove chips"
> -	depends on ARCH_KIRKWOOD || ARCH_DOVE || COMPILE_TEST
> +	depends on ARCH_KIRKWOOD || ARCH_DOVE || MACH_KIRKWOOD || COMPILE_TEST
>  	help
>  	  Say Y or M if you want to add support for codecs attached to
>  	  the Kirkwood I2S interface. You will also need to select the
> -- 
> 1.8.5.3
> 

^ permalink raw reply

* [PATCH 02/03] pinctrl: sh-pfc: r8a7790: Break out USB0 OVC/VBUS
From: Simon Horman @ 2014-02-07  1:39 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1869968.h64ujKRKE7@avalon>

On Fri, Feb 07, 2014 at 01:36:35AM +0100, Laurent Pinchart wrote:
> Hi Simon,
> 
> On Friday 07 February 2014 09:15:44 Simon Horman wrote:
> > On Thu, Feb 06, 2014 at 10:34:27PM +0900, Magnus Damm wrote:
> > > On Thu, Feb 6, 2014 at 8:01 PM, Laurent Pinchart wrote:
> > > > On Friday 31 January 2014 12:10:05 Magnus Damm wrote:
> > > >> On Fri, Jan 31, 2014 at 10:17 AM, Laurent Pinchart wrote:
> > > >> > On Thursday 30 January 2014 08:10:19 Magnus Damm wrote:
> > > >> >> From: Magnus Damm <damm@opensource.se>
> > > >> >> 
> > > >> >> Create a new group for the USB0 OVC/VBUS pin by itself. This
> > > >> >> allows us to monitor PWEN as GPIO on the Lager board.
> > > >> >> 
> > > >> >> Signed-off-by: Magnus Damm <damm@opensource.se>
> 
> [snip]
> 
> > > > 
> > > > Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Acked-by: Simon Horman <horms+renesas@verge.net.au>

> > > 
> > > Thanks,
> > 
> > Thanks Magnus.
> > 
> > Laurent, with that in mind could you pick up this patch?
> 
> I was thinking about letting Linus pick up the PFC patches again now that the 
> flood is over. Of course, if it can help, I can still pick the patches up and 
> submit pull requests to Linus.
> 
> Linus, what's your opinion on this ? Would you rather pick the patches 
> directly after I've acked them, or process pull requests ?

Either way is fine for me :)

^ permalink raw reply

* [PATCH 15/21] ARM: MVEBU: Let kirkwood use the system controller for restart
From: Jason Cooper @ 2014-02-07  1:37 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1391730137-14814-16-git-send-email-andrew@lunn.ch>

On Fri, Feb 07, 2014 at 12:42:11AM +0100, Andrew Lunn wrote:
> The mvebu system controller already supports restarting orion
> systems. Make use of it, rather than the kirkwood specific code.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  arch/arm/boot/dts/kirkwood.dtsi |  5 +++++

Please separate these into two patches.

thx,

Jason.

>  arch/arm/mach-mvebu/kirkwood.c  | 20 ++------------------
>  2 files changed, 7 insertions(+), 18 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
> index 1d8129ac2672..6c4028e410fa 100644
> --- a/arch/arm/boot/dts/kirkwood.dtsi
> +++ b/arch/arm/boot/dts/kirkwood.dtsi
> @@ -145,6 +145,11 @@
>  			reg = <0x20000 0x80>, <0x1500 0x20>;
>  		};
>  
> +		system-controller at 20000 {
> +			compatible = "marvell,orion-system-controller";
> +			reg = <0x20000 0x120>;
> +		};
> +
>  		bridge_intc: bridge-interrupt-ctrl at 20110 {
>  			compatible = "marvell,orion-bridge-intc";
>  			interrupt-controller;
> diff --git a/arch/arm/mach-mvebu/kirkwood.c b/arch/arm/mach-mvebu/kirkwood.c
> index 56e83035bc97..af77923a3483 100644
> --- a/arch/arm/mach-mvebu/kirkwood.c
> +++ b/arch/arm/mach-mvebu/kirkwood.c
> @@ -27,6 +27,7 @@
>  #include <plat/common.h>
>  #include <plat/pcie.h>
>  #include "kirkwood-pm.h"
> +#include "common.h"
>  
>  static struct resource kirkwood_cpufreq_resources[] = {
>  	[0] = {
> @@ -68,23 +69,6 @@ static void __init kirkwood_cpuidle_init(void)
>  	platform_device_register(&kirkwood_cpuidle);
>  }
>  
> -/* Temporary here since mach-mvebu has a function we can use */
> -static void kirkwood_restart(enum reboot_mode mode, const char *cmd)
> -{
> -	/*
> -	 * Enable soft reset to assert RSTOUTn.
> -	 */
> -	writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK);
> -
> -	/*
> -	 * Assert soft reset.
> -	 */
> -	writel(SOFT_RESET, SYSTEM_SOFT_RESET);
> -
> -	while (1)
> -		;
> -}
> -
>  #define MV643XX_ETH_MAC_ADDR_LOW	0x0414
>  #define MV643XX_ETH_MAC_ADDR_HIGH	0x0418
>  
> @@ -203,6 +187,6 @@ static const char * const kirkwood_dt_board_compat[] = {
>  DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)")
>  	/* Maintainer: Jason Cooper <jason@lakedaemon.net> */
>  	.init_machine	= kirkwood_dt_init,
> -	.restart	= kirkwood_restart,
> +	.restart	= mvebu_restart,
>  	.dt_compat	= kirkwood_dt_board_compat,
>  MACHINE_END
> -- 
> 1.8.5.3
> 

^ permalink raw reply

* [PATCH 10/21] ARM: MM: Add DT binding for Feroceon L2 cache
From: Jason Cooper @ 2014-02-07  1:27 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1391730137-14814-11-git-send-email-andrew@lunn.ch>

On Fri, Feb 07, 2014 at 12:42:06AM +0100, Andrew Lunn wrote:
> Instantiate the L2 cache from DT. Indicate in DT where the cache
> control register is and if write through should be made.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  .../devicetree/bindings/arm/mrvl/foroceon.txt      | 19 +++++++++
>  arch/arm/boot/dts/kirkwood.dtsi                    |  5 +++
>  arch/arm/include/asm/hardware/cache-feroceon-l2.h  |  2 +
>  arch/arm/mach-kirkwood/board-dt.c                  | 15 +------
>  arch/arm/mm/cache-feroceon-l2.c                    | 46 ++++++++++++++++++++++
>  5 files changed, 73 insertions(+), 14 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/arm/mrvl/foroceon.txt

for the next revision, please split out the dtsi changes into a separate
patch.

> 
> diff --git a/Documentation/devicetree/bindings/arm/mrvl/foroceon.txt b/Documentation/devicetree/bindings/arm/mrvl/foroceon.txt
> new file mode 100644
> index 000000000000..8058676d1476
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/arm/mrvl/foroceon.txt

name typo.

> @@ -0,0 +1,19 @@
> +* Marvell Feroceon Cache
> +
> +Required properties:
> +- compatible : Should be "marvell,feroceon-kirkwood".

This is a little ambiguous, I'd like to see 'l2' in the compatible string.

> +- reg        : Address of the L2 cache control register
> +
> +Optional properties:
> +- writethrough : only if present, the cache will be used in write through mode.
> +
> +Example:
> +		l2: l2-cache at 20128 {
> +			compatible = "marvell,marvell,feroceon-kirkwood";

only need a single 'marvell'.

> +			reg = <0x20128 0x4>;
> +		};
> +
> +There are at least two variants of the Feroceon, differing in how
> +write through is enabled or not. If mv78xx0 support is added, it is
> +expected to have a different compatibility string.
> +
> diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
> index 6abf44d257df..1d8129ac2672 100644
> --- a/arch/arm/boot/dts/kirkwood.dtsi
> +++ b/arch/arm/boot/dts/kirkwood.dtsi
> @@ -161,6 +161,11 @@
>  			#clock-cells = <1>;
>  		};
>  
> +		l2: l2-cache at 20128 {
> +			compatible = "marvell,feroceon-kirkwood";
> +			reg = <0x20128 0x4>;
> +		};
> +
>  		intc: main-interrupt-ctrl at 20200 {
>  			compatible = "marvell,orion-intc";
>  			interrupt-controller;
> diff --git a/arch/arm/include/asm/hardware/cache-feroceon-l2.h b/arch/arm/include/asm/hardware/cache-feroceon-l2.h
> index 8edd330aabf6..12e1588dc4f1 100644
> --- a/arch/arm/include/asm/hardware/cache-feroceon-l2.h
> +++ b/arch/arm/include/asm/hardware/cache-feroceon-l2.h
> @@ -9,3 +9,5 @@
>   */
>  
>  extern void __init feroceon_l2_init(int l2_wt_override);
> +extern int __init feroceon_of_init(void);
> +
> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> index 34c35510fd17..2ef59ee2182d 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -42,19 +42,6 @@ static void __init kirkwood_map_io(void)
>  	iotable_init(kirkwood_io_desc, ARRAY_SIZE(kirkwood_io_desc));
>  }
>  
> -static void __init kirkwood_l2_init(void)
> -{
> -#ifdef CONFIG_CACHE_FEROCEON_L2
> -#ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
> -	writel(readl(L2_CONFIG_REG) | L2_WRITETHROUGH, L2_CONFIG_REG);
> -	feroceon_l2_init(1);
> -#else
> -	writel(readl(L2_CONFIG_REG) & ~L2_WRITETHROUGH, L2_CONFIG_REG);
> -	feroceon_l2_init(0);
> -#endif
> -#endif
> -}
> -
>  static struct resource kirkwood_cpufreq_resources[] = {
>  	[0] = {
>  		.start  = CPU_CONTROL_PHYS,
> @@ -211,7 +198,7 @@ static void __init kirkwood_dt_init(void)
>  
>  	BUG_ON(mvebu_mbus_dt_init());
>  
> -	kirkwood_l2_init();
> +	feroceon_of_init();
>  
>  	kirkwood_cpufreq_init();
>  	kirkwood_cpuidle_init();
> diff --git a/arch/arm/mm/cache-feroceon-l2.c b/arch/arm/mm/cache-feroceon-l2.c
> index 898362e7972b..193fe7dbdb12 100644
> --- a/arch/arm/mm/cache-feroceon-l2.c
> +++ b/arch/arm/mm/cache-feroceon-l2.c
> @@ -13,11 +13,17 @@
>   */
>  
>  #include <linux/init.h>
> +#include <linux/of.h>
> +#include <linux/of_address.h>
>  #include <linux/highmem.h>
> +#include <linux/io.h>
>  #include <asm/cacheflush.h>
>  #include <asm/cp15.h>
>  #include <asm/hardware/cache-feroceon-l2.h>
>  
> +#define L2_WRITETHROUGH_KIRKWOOD	0x00000010
> +
> +
>  /*
>   * Low-level cache maintenance operations.
>   *
> @@ -350,3 +356,43 @@ void __init feroceon_l2_init(int __l2_wt_override)
>  	printk(KERN_INFO "Feroceon L2: Cache support initialised%s.\n",
>  			 l2_wt_override ? ", in WT override mode" : "");
>  }
> +#ifdef CONFIG_OF
> +static const struct of_device_id feroceon_ids[] __initconst = {
> +	{ .compatible = "marvell,feroceon-kirkwood"},
> +	{}
> +};
> +
> +int __init feroceon_of_init(void)
> +{
> +	struct device_node *node;
> +	void __iomem *base;
> +	bool writethrough = false;
> +	struct resource res;
> +
> +	node = of_find_matching_node(NULL, feroceon_ids);
> +	if (!node) {
> +		pr_info("Didn't find marvell,feroceon-*, not enabling it\n");
> +		return -ENODEV;
> +	}

I'd prefer to fallback to hardcoded register address here.  We know
we're on kirkwood at this point.

thx,

Jason.

> +
> +	if (of_property_read_bool(node, "writethrough"))
> +		writethrough = true;
> +
> +	if (of_address_to_resource(node, 0, &res))
> +		return -ENODEV;
> +
> +	base = ioremap(res.start, resource_size(&res));
> +	if (!base)
> +		return -ENOMEM;
> +
> +	if (writethrough) {
> +		writel(readl(base) | L2_WRITETHROUGH_KIRKWOOD, base);
> +		feroceon_l2_init(1);
> +	} else {
> +		writel(readl(base) & ~L2_WRITETHROUGH_KIRKWOOD, base);
> +	feroceon_l2_init(0);
> +	}
> +
> +	return 0;
> +}
> +#endif
> -- 
> 1.8.5.3
> 

^ permalink raw reply

* [PATCH 1/2] PPC: powernv: remove redundant cpuidle_idle_call()
From: Nicolas Pitre @ 2014-02-07  1:17 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <52F3BCFE.3010703@linux.vnet.ibm.com>

On Thu, 6 Feb 2014, Preeti U Murthy wrote:

> Hi Daniel,
> 
> On 02/06/2014 09:55 PM, Daniel Lezcano wrote:
> > Hi Nico,
> > 
> > 
> > On 6 February 2014 14:16, Nicolas Pitre <nicolas.pitre@linaro.org> wrote:
> > 
> >> The core idle loop now takes care of it.
> >>
> >> Signed-off-by: Nicolas Pitre <nico@linaro.org>
> >> ---
> >>  arch/powerpc/platforms/powernv/setup.c | 13 +------------
> >>  1 file changed, 1 insertion(+), 12 deletions(-)
> >>
> >> diff --git a/arch/powerpc/platforms/powernv/setup.c
> >> b/arch/powerpc/platforms/powernv/setup.c
> >> index 21166f65c9..a932feb290 100644
> >> --- a/arch/powerpc/platforms/powernv/setup.c
> >> +++ b/arch/powerpc/platforms/powernv/setup.c
> >> @@ -26,7 +26,6 @@
> >>  #include <linux/of_fdt.h>
> >>  #include <linux/interrupt.h>
> >>  #include <linux/bug.h>
> >> -#include <linux/cpuidle.h>
> >>
> >>  #include <asm/machdep.h>
> >>  #include <asm/firmware.h>
> >> @@ -217,16 +216,6 @@ static int __init pnv_probe(void)
> >>         return 1;
> >>  }
> >>
> >> -void powernv_idle(void)
> >> -{
> >> -       /* Hook to cpuidle framework if available, else
> >> -        * call on default platform idle code
> >> -        */
> >> -       if (cpuidle_idle_call()) {
> >> -               power7_idle();
> >> -       }
> >>
> > 
> > The cpuidle_idle_call is called from arch_cpu_idle in
> > arch/powerpc/kernel/idle.c between a ppc64_runlatch_off|on section.
> > Shouldn't the cpuidle-powernv driver call these functions when entering
> > idle ?
> 
> Yes they should, I will send out a patch that does that ontop of this.
> There have been cpuidle driver cleanups for powernv and pseries in this
> merge window. While no change would be required in the pseries cpuidle
> driver as a result of Nicolas's cleanup, we would need to add the
> ppc64_runlatch_on and off functions before and after the entry into the
> powernv idle states.

What about creating arch_cpu_idle_enter() and arch_cpu_idle_exit() in 
arch/powerpc/kernel/idle.c and calling ppc64_runlatch_off() and 
ppc64_runlatch_on() respectively from there instead?  Would that work?  
That would make the idle consolidation much easier afterwards.


Nicolas

^ permalink raw reply

* [PATCH 00/21] Move DT kirkwood into mach-mvebu
From: Jason Cooper @ 2014-02-07  1:14 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1391730137-14814-1-git-send-email-andrew@lunn.ch>

On Fri, Feb 07, 2014 at 12:41:56AM +0100, Andrew Lunn wrote:
> The process of making most kirkwood boards boot using DT is nearly
> complete. We can now move these boards into mach-mvebu, freeing them
> of the legacy code needed for none-DT systems. At the same time, they
> can become part of ARCH_MULTI_V5.
> 
> Andrew Lunn (21):
>   ARM: Kirkwood: Give pm.c its own header file.
>   IRQ: Orion: Fix getting generic chip pointer.
>   ARM: Kirkwood: Convert mv88f6281gtw_ge switch setup to DT
>   ARM: Kirkwood: Drop printing the SoC type and revision
>   ARM: Kirkwood: Seperate board-dt from common and pcie code.
>   ARM: Kirkwood: ioremap the cpu_config register before using it.
>   ARM: Kirkwood: ioremap memory control register
>   ARM: MVEBU: Add ARCH_MULTI_V7 to SoCs
>   ARM: Orion: Move cache-feroceon-l2.h out of plat-orion
>   ARM: MM: Add DT binding for Feroceon L2 cache
>   ARM: Fix default CPU selection for ARCH_MULTI_V5
>   ARM: Fix MULTI_TLB for feroceon
>   ARM: MM Enable building Feroceon L2 cache controller with ARCH_MVEBU
>   ARM: Move kirkwood DT boards into mach-mvebu
>   ARM: MVEBU: Let kirkwood use the system controller for restart
>   drivers: Enable building of Kirkwood drivers for mach-mvebu
>   ARM: MVEBU: Enable mvebu-soc-id on Kirkwood
>   ARM: config: Add a multi_v5_defconfig
>   ARM: MVEBU: Simplifiy headers and make local
>   ARM: MVEBU: Remove unneeded headers
>   ARM: Kirkwood: Remove DT support
> 
>  .../devicetree/bindings/arm/mrvl/forocean.txt      |  19 +++

nit.  s/forocean/feroceon/

thx,

Jason.

>  arch/arm/Kconfig                                   |   2 +-
>  arch/arm/boot/dts/Makefile                         |  34 ++--
>  arch/arm/boot/dts/kirkwood.dtsi                    |  10 ++
>  arch/arm/configs/kirkwood_defconfig                |   6 -
>  arch/arm/configs/multi_v5_defconfig                | 183 ++++++++++++++++++++
>  arch/arm/include/asm/hardware/cache-feroceon-l2.h  |  13 ++
>  arch/arm/mach-kirkwood/Kconfig                     |  25 ---
>  arch/arm/mach-kirkwood/Makefile                    |   6 +-
>  arch/arm/mach-kirkwood/Module.symvers              |   0
>  arch/arm/mach-kirkwood/board-dt.c                  | 150 ----------------
>  arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c     |  50 ------
>  arch/arm/mach-kirkwood/common.c                    |   3 +-
>  arch/arm/mach-kirkwood/common.h                    |  13 --
>  arch/arm/mach-kirkwood/include/mach/bridge-regs.h  |   2 +
>  arch/arm/mach-kirkwood/pm.c                        |   9 +-
>  arch/arm/mach-kirkwood/pm.h                        |  26 +++
>  arch/arm/mach-mv78xx0/common.c                     |   2 +-
>  arch/arm/mach-mvebu/Kconfig                        |  28 ++-
>  arch/arm/mach-mvebu/Makefile                       |   1 +
>  arch/arm/mach-mvebu/kirkwood-pm.c                  |  76 +++++++++
>  arch/arm/mach-mvebu/kirkwood-pm.h                  |  26 +++
>  arch/arm/mach-mvebu/kirkwood.c                     | 189 +++++++++++++++++++++
>  arch/arm/mach-mvebu/kirkwood.h                     |  22 +++
>  arch/arm/mach-mvebu/mvebu-soc-id.c                 |   1 +
>  arch/arm/mm/Kconfig                                |   2 +-
>  arch/arm/mm/cache-feroceon-l2.c                    |  48 +++++-
>  arch/arm/mm/proc-feroceon.S                        |   2 +-
>  arch/arm/mm/tlb-v4wbi.S                            |   3 +
>  .../plat-orion/include/plat/cache-feroceon-l2.h    |  11 --
>  drivers/cpufreq/Kconfig.arm                        |   2 +-
>  drivers/cpuidle/Kconfig.arm                        |   2 +-
>  drivers/irqchip/irq-orion.c                        |   3 +-
>  drivers/leds/Kconfig                               |   4 +-
>  drivers/phy/Kconfig                                |   2 +-
>  drivers/thermal/Kconfig                            |   2 +-
>  sound/soc/kirkwood/Kconfig                         |   2 +-
>  37 files changed, 682 insertions(+), 297 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/arm/mrvl/forocean.txt
>  create mode 100644 arch/arm/configs/multi_v5_defconfig
>  create mode 100644 arch/arm/include/asm/hardware/cache-feroceon-l2.h
>  create mode 100644 arch/arm/mach-kirkwood/Module.symvers
>  delete mode 100644 arch/arm/mach-kirkwood/board-dt.c
>  delete mode 100644 arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c
>  create mode 100644 arch/arm/mach-kirkwood/pm.h
>  create mode 100644 arch/arm/mach-mvebu/kirkwood-pm.c
>  create mode 100644 arch/arm/mach-mvebu/kirkwood-pm.h
>  create mode 100644 arch/arm/mach-mvebu/kirkwood.c
>  create mode 100644 arch/arm/mach-mvebu/kirkwood.h
>  delete mode 100644 arch/arm/plat-orion/include/plat/cache-feroceon-l2.h
> 
> -- 
> 1.8.5.3
> 

^ permalink raw reply

* [PATCH 10/21] ARM: MM: Add DT binding for Feroceon L2 cache
From: Jason Gunthorpe @ 2014-02-07  0:51 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1391730137-14814-11-git-send-email-andrew@lunn.ch>

On Fri, Feb 07, 2014 at 12:42:06AM +0100, Andrew Lunn wrote:
  
> +#define L2_WRITETHROUGH_KIRKWOOD	0x00000010

BIT(x)?

> +#ifdef CONFIG_OF
> +static const struct of_device_id feroceon_ids[] __initconst = {
> +	{ .compatible = "marvell,feroceon-kirkwood"},
> +	{}
> +}

How about following the naming convention from l2x0:

"marvell,kirkwood-cache"
"marvell,feroceon-cache"

> +	if (writethrough) {
> +		writel(readl(base) | L2_WRITETHROUGH_KIRKWOOD, base);
> +		feroceon_l2_init(1);
> +	} else {
> +		writel(readl(base) & ~L2_WRITETHROUGH_KIRKWOOD, base);
> +	feroceon_l2_init(0);

This should only happen for "marvell,kirkwood-cache" - it is very
kirkwood specific.. Someday mv78xx0 will have a different bit of code.

Maybe pass -1 to feroceon_l2_init and don't print the writethrough
type at all for the "marvell,feroceon-cache" case?

Regards,
Jason

^ 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