Re: [PATCH] ASoC: fsl_ssi: Implement symmetric_channels and symmetric_samplebits

2013-12-03 Thread Nicolin Chen
On Tue, Dec 03, 2013 at 02:58:33PM +, Mark Brown wrote:
> On Tue, Dec 03, 2013 at 06:38:07PM +0800, Nicolin Chen wrote:
> > Since we introduced symmetric_channels and symmetric_samplebits, we 
> > implement
> > these two features to fsl_ssi so as to drop some no-more-needed code and 
> > make
> > the driver neat and clean.
> 
> Applied, thanks.

Sir, shall we also implement these two to other drivers like codecs?
I know this symmetry is a new feature and might be still immature.
By implementing it might bring some side effects. But meanwhile, it
would also allows us to engage more people to test it, although myself
have done a branch of tests with different user cases on my platform.

Or we just wait for people engaging by themselves?

Thank you,
Nicolin Chen


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH v3] watchdog: mpc8xxx_wdt convert to watchdog core

2013-12-03 Thread Guenter Roeck

On 12/03/2013 10:32 PM, Christophe Leroy wrote:

Convert mpc8xxx_wdt.c to the new watchdog API.

Signed-off-by: Christophe Leroy 



Reviewed-by: Guenter Roeck 

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 3/3] powerpc: mm: optimize for the correctly placed page

2013-12-03 Thread Liu Ping Fan
The period check of _PAGE_NUMA can probably trigger the check on
the correctly placed page. For this case, we can just insert hpte and
do fast exception return.

Signed-off-by: Liu Ping Fan 
---
 arch/powerpc/mm/hash_utils_64.c | 34 +-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 9bf1195..735678c 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -965,6 +965,10 @@ int hash_page(unsigned long ea, unsigned long access, 
unsigned long trap)
const struct cpumask *tmp;
int rc, user_region = 0, local = 0;
int psize, ssize;
+   pte_t old, new;
+   struct vm_area_struct *vma;
+   int page_nid, target_nid;
+   struct page *test_page;
 
DBG_LOW("hash_page(ea=%016lx, access=%lx, trap=%lx\n",
ea, access, trap);
@@ -1033,12 +1037,40 @@ int hash_page(unsigned long ea, unsigned long access, 
unsigned long trap)
 
/* Get PTE and page size from page tables */
ptep = find_linux_pte_or_hugepte(pgdir, ea, &hugeshift);
-   if (ptep == NULL || !pte_present(*ptep) || pte_numa(*ptep)) {
+   if (ptep == NULL || !pte_present(*ptep)) {
DBG_LOW(" no PTE !\n");
rc = 1;
goto bail;
}
 
+   old = pte_val(*ptep);
+   if (pte_numa(old)) {
+   /* If fail to lock, let do_page_fault() to handle it */
+   if (down_read_trylock(&mm->mmap_sem)) {
+   vma = find_vma(mm, ea);
+   up_read(&mm->mmap_sem);
+   test_page = pte_page(old);
+   page_nid = page_to_nid(test_page);
+   target_nid = numa_migrate_prep(test_page, vma, ea,
+   page_nid);
+   if (target_nid < 0) {
+   new = pte_mknonnuma(old);
+   /* If ptep is modified under us,
+* just retry the access
+*/
+   if (unlikely(cmpxchg(ptep, old, new) != old)) {
+   put_page(test_page);
+   return 0;
+   }
+   put_page(test_page);
+   }
+   } else {
+   put_page(test_page);
+   rc = 1;
+   goto bail;
+   }
+   }
+
/* Add _PAGE_PRESENT to the required access perm */
access |= _PAGE_PRESENT;
 
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 2/3] mm: export numa_migrate_prep()

2013-12-03 Thread Liu Ping Fan
powerpc will use it in fast path.

Signed-off-by: Liu Ping Fan 
---
 include/linux/mm.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 5ab0e22..420fb77 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1092,6 +1092,8 @@ extern unsigned long change_protection(struct 
vm_area_struct *vma, unsigned long
 extern int mprotect_fixup(struct vm_area_struct *vma,
  struct vm_area_struct **pprev, unsigned long start,
  unsigned long end, unsigned long newflags);
+extern int numa_migrate_prep(struct page *page, struct vm_area_struct *vma,
+   unsigned long addr, int page_nid);
 
 /*
  * doesn't attempt to fault and will return short.
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 1/3] powerpc: mm: make _PAGE_NUMA take effect

2013-12-03 Thread Liu Ping Fan
To enable the do_numa_page(), we should not fix _PAGE_NUMA in
hash_page(), so bail out for the case of pte_numa().

Signed-off-by: Liu Ping Fan 
---
 arch/powerpc/mm/hash_utils_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index fb176e9..9bf1195 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -1033,7 +1033,7 @@ int hash_page(unsigned long ea, unsigned long access, 
unsigned long trap)
 
/* Get PTE and page size from page tables */
ptep = find_linux_pte_or_hugepte(pgdir, ea, &hugeshift);
-   if (ptep == NULL || !pte_present(*ptep)) {
+   if (ptep == NULL || !pte_present(*ptep) || pte_numa(*ptep)) {
DBG_LOW(" no PTE !\n");
rc = 1;
goto bail;
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 0/3] optimize for powerpc _PAGE_NUMA

2013-12-03 Thread Liu Ping Fan
I saw Aneesh had implemented Numa faults on ppc64. Most of them have been 
reviewed-by.
So I just diff mine and his to form some trivial modification.

Based on Aneesh's series  "[PATCH -V2 0/5] powerpc: mm: Numa faults support for 
ppc64"

Liu Ping Fan (3):
  powerpc: mm: make _PAGE_NUMA take effect
  mm: export numa_migrate_prep()
  powerpc: mm: optimize for the correctly placed page

 arch/powerpc/mm/hash_utils_64.c | 32 
 include/linux/mm.h  |  2 ++
 2 files changed, 34 insertions(+)

-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH v3] watchdog: mpc8xxx_wdt convert to watchdog core

2013-12-03 Thread Christophe Leroy
Convert mpc8xxx_wdt.c to the new watchdog API.

Signed-off-by: Christophe Leroy 

diff -ur a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c
--- a/drivers/watchdog/mpc8xxx_wdt.c2013-05-11 22:57:46.0 +0200
+++ b/drivers/watchdog/mpc8xxx_wdt.c2013-11-30 16:14:53.803495472 +0100
@@ -72,9 +72,7 @@
  * to 0
  */
 static int prescale = 1;
-static unsigned int timeout_sec;
 
-static unsigned long wdt_is_open;
 static DEFINE_SPINLOCK(wdt_spinlock);
 
 static void mpc8xxx_wdt_keepalive(void)
@@ -86,39 +84,23 @@
spin_unlock(&wdt_spinlock);
 }
 
+static struct watchdog_device mpc8xxx_wdt_dev;
 static void mpc8xxx_wdt_timer_ping(unsigned long arg);
-static DEFINE_TIMER(wdt_timer, mpc8xxx_wdt_timer_ping, 0, 0);
+static DEFINE_TIMER(wdt_timer, mpc8xxx_wdt_timer_ping, 0,
+   (unsigned long)&mpc8xxx_wdt_dev);
 
 static void mpc8xxx_wdt_timer_ping(unsigned long arg)
 {
+   struct watchdog_device *w = (struct watchdog_device *)arg;
+
mpc8xxx_wdt_keepalive();
/* We're pinging it twice faster than needed, just to be sure. */
-   mod_timer(&wdt_timer, jiffies + HZ * timeout_sec / 2);
-}
-
-static void mpc8xxx_wdt_pr_warn(const char *msg)
-{
-   pr_crit("%s, expect the %s soon!\n", msg,
-   reset ? "reset" : "machine check exception");
+   mod_timer(&wdt_timer, jiffies + HZ * w->timeout / 2);
 }
 
-static ssize_t mpc8xxx_wdt_write(struct file *file, const char __user *buf,
-size_t count, loff_t *ppos)
-{
-   if (count)
-   mpc8xxx_wdt_keepalive();
-   return count;
-}
-
-static int mpc8xxx_wdt_open(struct inode *inode, struct file *file)
+static int mpc8xxx_wdt_start(struct watchdog_device *w)
 {
u32 tmp = SWCRR_SWEN;
-   if (test_and_set_bit(0, &wdt_is_open))
-   return -EBUSY;
-
-   /* Once we start the watchdog we can't stop it */
-   if (nowayout)
-   __module_get(THIS_MODULE);
 
/* Good, fire up the show */
if (prescale)
@@ -132,59 +114,37 @@
 
del_timer_sync(&wdt_timer);
 
-   return nonseekable_open(inode, file);
+   return 0;
 }
 
-static int mpc8xxx_wdt_release(struct inode *inode, struct file *file)
+static int mpc8xxx_wdt_ping(struct watchdog_device *w)
 {
-   if (!nowayout)
-   mpc8xxx_wdt_timer_ping(0);
-   else
-   mpc8xxx_wdt_pr_warn("watchdog closed");
-   clear_bit(0, &wdt_is_open);
+   mpc8xxx_wdt_keepalive();
return 0;
 }
 
-static long mpc8xxx_wdt_ioctl(struct file *file, unsigned int cmd,
-   unsigned long arg)
+static int mpc8xxx_wdt_stop(struct watchdog_device *w)
 {
-   void __user *argp = (void __user *)arg;
-   int __user *p = argp;
-   static const struct watchdog_info ident = {
-   .options = WDIOF_KEEPALIVEPING,
-   .firmware_version = 1,
-   .identity = "MPC8xxx",
-   };
-
-   switch (cmd) {
-   case WDIOC_GETSUPPORT:
-   return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
-   case WDIOC_GETSTATUS:
-   case WDIOC_GETBOOTSTATUS:
-   return put_user(0, p);
-   case WDIOC_KEEPALIVE:
-   mpc8xxx_wdt_keepalive();
-   return 0;
-   case WDIOC_GETTIMEOUT:
-   return put_user(timeout_sec, p);
-   default:
-   return -ENOTTY;
-   }
+   mod_timer(&wdt_timer, jiffies);
+   return 0;
 }
 
-static const struct file_operations mpc8xxx_wdt_fops = {
-   .owner  = THIS_MODULE,
-   .llseek = no_llseek,
-   .write  = mpc8xxx_wdt_write,
-   .unlocked_ioctl = mpc8xxx_wdt_ioctl,
-   .open   = mpc8xxx_wdt_open,
-   .release= mpc8xxx_wdt_release,
+static struct watchdog_info mpc8xxx_wdt_info = {
+   .options = WDIOF_KEEPALIVEPING,
+   .firmware_version = 1,
+   .identity = "MPC8xxx",
 };
 
-static struct miscdevice mpc8xxx_wdt_miscdev = {
-   .minor  = WATCHDOG_MINOR,
-   .name   = "watchdog",
-   .fops   = &mpc8xxx_wdt_fops,
+static struct watchdog_ops mpc8xxx_wdt_ops = {
+   .owner = THIS_MODULE,
+   .start = mpc8xxx_wdt_start,
+   .ping = mpc8xxx_wdt_ping,
+   .stop = mpc8xxx_wdt_stop,
+};
+
+static struct watchdog_device mpc8xxx_wdt_dev = {
+   .info = &mpc8xxx_wdt_info,
+   .ops = &mpc8xxx_wdt_ops,
 };
 
 static const struct of_device_id mpc8xxx_wdt_match[];
@@ -196,6 +156,7 @@
const struct mpc8xxx_wdt_type *wdt_type;
u32 freq = fsl_get_sys_freq();
bool enabled;
+   unsigned int timeout_sec;
 
match = of_match_device(mpc8xxx_wdt_match, &ofdev->dev);
if (!match)
@@ -222,6 +183,7 @@
else
timeout_sec = timeout / freq;
 
+   mpc8xxx_wdt_dev.timeout = timeout_sec;
 #ifdef MODULE
ret = mpc8xxx_wdt_init_late();
if (ret)
@@ -237,7 +199,7 

Re: [PATCH v2] watchdog: mpc8xxx_wdt convert to watchdog core

2013-12-03 Thread Guenter Roeck

On 12/03/2013 05:31 AM, Christophe Leroy wrote:

Convert mpc8xxx_wdt.c to the new watchdog API.

Signed-off-by: Christophe Leroy 

diff -ur a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c
--- a/drivers/watchdog/mpc8xxx_wdt.c2013-05-11 22:57:46.0 +0200
+++ b/drivers/watchdog/mpc8xxx_wdt.c2013-11-30 16:14:53.803495472 +0100
@@ -72,53 +72,36 @@
   * to 0
   */
  static int prescale = 1;
-static unsigned int timeout_sec;

-static unsigned long wdt_is_open;
  static DEFINE_SPINLOCK(wdt_spinlock);

-static void mpc8xxx_wdt_keepalive(void)
+static int mpc8xxx_wdt_ping(struct watchdog_device *w)
  {
/* Ping the WDT */
spin_lock(&wdt_spinlock);
out_be16(&wd_base->swsrr, 0x556c);
out_be16(&wd_base->swsrr, 0xaa39);
spin_unlock(&wdt_spinlock);
+   return 0;
  }



Ok, now I understand a bit better.

I think it would be better to keep the original mpc8xxx_wdt_keepalive()
function and add

static int mpc8xxx_wdt_ping(struct watchdog_device *w)
{
mpc8xxx_wdt_keepalive();
}

since the parameter is not used. Then you can call mpc8xxx_wdt_keepalive()
from mpc8xxx_wdt_timer_ping(), and you don't have to add the dummy argument.

Otherwise looks good.

Note there is a problem in the probe function with
u32 freq = fsl_get_sys_freq();
and
if (!freq || freq == -1)
 ^^^

but fixing that would be a different patch. 

Guenter


+static struct watchdog_device mpc8xxx_wdt_dev;
  static void mpc8xxx_wdt_timer_ping(unsigned long arg);
-static DEFINE_TIMER(wdt_timer, mpc8xxx_wdt_timer_ping, 0, 0);
+static DEFINE_TIMER(wdt_timer, mpc8xxx_wdt_timer_ping, 0,
+   (unsigned long)&mpc8xxx_wdt_dev);

  static void mpc8xxx_wdt_timer_ping(unsigned long arg)
  {
-   mpc8xxx_wdt_keepalive();
-   /* We're pinging it twice faster than needed, just to be sure. */
-   mod_timer(&wdt_timer, jiffies + HZ * timeout_sec / 2);
-}
+   struct watchdog_device *w = (struct watchdog_device *)arg;

-static void mpc8xxx_wdt_pr_warn(const char *msg)
-{
-   pr_crit("%s, expect the %s soon!\n", msg,
-   reset ? "reset" : "machine check exception");
-}
-
-static ssize_t mpc8xxx_wdt_write(struct file *file, const char __user *buf,
-size_t count, loff_t *ppos)
-{
-   if (count)
-   mpc8xxx_wdt_keepalive();
-   return count;
+   mpc8xxx_wdt_ping(w);
+   /* We're pinging it twice faster than needed, just to be sure. */
+   mod_timer(&wdt_timer, jiffies + HZ * w->timeout / 2);
  }

-static int mpc8xxx_wdt_open(struct inode *inode, struct file *file)
+static int mpc8xxx_wdt_start(struct watchdog_device *w)
  {
u32 tmp = SWCRR_SWEN;
-   if (test_and_set_bit(0, &wdt_is_open))
-   return -EBUSY;
-
-   /* Once we start the watchdog we can't stop it */
-   if (nowayout)
-   __module_get(THIS_MODULE);

/* Good, fire up the show */
if (prescale)
@@ -132,59 +115,31 @@

del_timer_sync(&wdt_timer);

-   return nonseekable_open(inode, file);
+   return 0;
  }

-static int mpc8xxx_wdt_release(struct inode *inode, struct file *file)
+static int mpc8xxx_wdt_stop(struct watchdog_device *w)
  {
-   if (!nowayout)
-   mpc8xxx_wdt_timer_ping(0);
-   else
-   mpc8xxx_wdt_pr_warn("watchdog closed");
-   clear_bit(0, &wdt_is_open);
+   mod_timer(&wdt_timer, jiffies);
return 0;
  }

-static long mpc8xxx_wdt_ioctl(struct file *file, unsigned int cmd,
-   unsigned long arg)
-{
-   void __user *argp = (void __user *)arg;
-   int __user *p = argp;
-   static const struct watchdog_info ident = {
-   .options = WDIOF_KEEPALIVEPING,
-   .firmware_version = 1,
-   .identity = "MPC8xxx",
-   };
-
-   switch (cmd) {
-   case WDIOC_GETSUPPORT:
-   return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
-   case WDIOC_GETSTATUS:
-   case WDIOC_GETBOOTSTATUS:
-   return put_user(0, p);
-   case WDIOC_KEEPALIVE:
-   mpc8xxx_wdt_keepalive();
-   return 0;
-   case WDIOC_GETTIMEOUT:
-   return put_user(timeout_sec, p);
-   default:
-   return -ENOTTY;
-   }
-}
+static struct watchdog_info mpc8xxx_wdt_info = {
+   .options = WDIOF_KEEPALIVEPING,
+   .firmware_version = 1,
+   .identity = "MPC8xxx",
+};

-static const struct file_operations mpc8xxx_wdt_fops = {
-   .owner  = THIS_MODULE,
-   .llseek = no_llseek,
-   .write  = mpc8xxx_wdt_write,
-   .unlocked_ioctl = mpc8xxx_wdt_ioctl,
-   .open   = mpc8xxx_wdt_open,
-   .release= mpc8xxx_wdt_release,
+static struct watchdog_ops mpc8xxx_wdt_ops = {
+   .owner = THIS_MODULE,
+   .start = mpc8xxx_wdt_start,
+   

Re: [PATCH -V2 3/5] mm: Move change_prot_numa outside CONFIG_ARCH_USES_NUMA_PROT_NONE

2013-12-03 Thread Benjamin Herrenschmidt
On Mon, 2013-11-18 at 14:58 +0530, Aneesh Kumar K.V wrote:
> From: "Aneesh Kumar K.V" 
> 
> change_prot_numa should work even if _PAGE_NUMA != _PAGE_PROTNONE.
> On archs like ppc64 that don't use _PAGE_PROTNONE and also have
> a separate page table outside linux pagetable, we just need to
> make sure that when calling change_prot_numa we flush the
> hardware page table entry so that next page access  result in a numa
> fault.

That patch doesn't look right...

You are essentially making change_prot_numa() do whatever it does (which
I don't completely understand) *for all architectures* now, whether they
have CONFIG_ARCH_USES_NUMA_PROT_NONE or not ... So because you want that
behaviour on powerpc book3s64, you change everybody.

Is that correct ?

Also what exactly is that doing, can you explain ? From what I can see,
it calls back into the core of mprotect to change the protection to
vma->vm_page_prot, which I would have expected is already the protection
there, with the added "prot_numa" flag passed down.

Your changeset comment says "On archs like ppc64 [...] we just need to
make sure that when calling change_prot_numa we flush the
hardware page table entry so that next page access  result in a numa
fault."

But change_prot_numa() does a lot more than that ... it does
pte_mknuma(), do we need it ? I assume we do or we wouldn't have added
that PTE bit to begin with...

Now it *might* be allright and it might be that no other architecture
cares anyway etc... but I need at least some mm folks to ack on that
patch before I can take it because it *will* change behaviour of other
architectures.

Cheers,
Ben.

> Signed-off-by: Aneesh Kumar K.V 
> ---
>  include/linux/mm.h | 3 ---
>  mm/mempolicy.c | 9 -
>  2 files changed, 12 deletions(-)
> 
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 0548eb201e05..51794c1a1d7e 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -1851,11 +1851,8 @@ static inline pgprot_t vm_get_page_prot(unsigned long 
> vm_flags)
>  }
>  #endif
>  
> -#ifdef CONFIG_ARCH_USES_NUMA_PROT_NONE
>  unsigned long change_prot_numa(struct vm_area_struct *vma,
>   unsigned long start, unsigned long end);
> -#endif
> -
>  struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long 
> addr);
>  int remap_pfn_range(struct vm_area_struct *, unsigned long addr,
>   unsigned long pfn, unsigned long size, pgprot_t);
> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> index c4403cdf3433..cae10af4fdc4 100644
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -613,7 +613,6 @@ static inline int queue_pages_pgd_range(struct 
> vm_area_struct *vma,
>   return 0;
>  }
>  
> -#ifdef CONFIG_ARCH_USES_NUMA_PROT_NONE
>  /*
>   * This is used to mark a range of virtual addresses to be inaccessible.
>   * These are later cleared by a NUMA hinting fault. Depending on these
> @@ -627,7 +626,6 @@ unsigned long change_prot_numa(struct vm_area_struct *vma,
>   unsigned long addr, unsigned long end)
>  {
>   int nr_updated;
> - BUILD_BUG_ON(_PAGE_NUMA != _PAGE_PROTNONE);
>  
>   nr_updated = change_protection(vma, addr, end, vma->vm_page_prot, 0, 1);
>   if (nr_updated)
> @@ -635,13 +633,6 @@ unsigned long change_prot_numa(struct vm_area_struct 
> *vma,
>  
>   return nr_updated;
>  }
> -#else
> -static unsigned long change_prot_numa(struct vm_area_struct *vma,
> - unsigned long addr, unsigned long end)
> -{
> - return 0;
> -}
> -#endif /* CONFIG_ARCH_USES_NUMA_PROT_NONE */
>  
>  /*
>   * Walk through page tables and collect pages to be migrated.


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [V3 00/10] perf: New conditional branch filter

2013-12-03 Thread Michael Ellerman
On Wed, 2013-10-16 at 12:26 +0530, Anshuman Khandual wrote:
>   This patchset is the re-spin of the original branch stack 
> sampling
> patchset which introduced new PERF_SAMPLE_BRANCH_COND branch filter. This 
> patchset
> also enables SW based branch filtering support for book3s powerpc platforms 
> which
> have PMU HW backed branch stack sampling support. 
> 
> Summary of code changes in this patchset:
> 
> (1) Introduces a new PERF_SAMPLE_BRANCH_COND branch filter
> (2) Add the "cond" branch filter options in the "perf record" tool
> (3) Enable PERF_SAMPLE_BRANCH_COND in X86 platforms
> (4) Enable PERF_SAMPLE_BRANCH_COND in POWER8 platform 
> (5) Update the documentation regarding "perf record" tool

Can you please address my comments and then resend patches 1-5. And make sure
you send them to the perf maintainers.

Those three touch the generic code, powerpc and x86, so we'll get those merged
first, and then focus on the remaining patches, which are powerpc specific.

cheers


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: Error in frreing hugepages with preemption enabled

2013-12-03 Thread Benjamin Herrenschmidt
On Tue, 2013-12-03 at 23:21 +0100, Andrea Arcangeli wrote:
> #ifdef CONFIG_PPC_FSL_BOOK3E
> hugepd_free(tlb, hugepte);
 ^^

This is the culprit

(Alex, you didn't specify this was embedded or did I miss it ?)

> #else
> pgtable_free_tlb(tlb, hugepte, pdshift - shift);
> #endif
> }

That function does:

batchp = &__get_cpu_var(hugepd_freelist_cur);

IE, it tries to use a per-CPU batch. Basically, it's duplicating the
logic in mm/memory.c for RCU freeing using a per-cpu freelist. I suppose
it assumes being called under something like the page table lock ?

This code also never "flushes" the batch, which is a concern...

Alex, this is Freescale stuff, can you followup with them ?

Cheers,
Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: Error in frreing hugepages with preemption enabled

2013-12-03 Thread Andrea Arcangeli
Hi everyone,

On Fri, Nov 29, 2013 at 12:13:03PM +0100, Alexander Graf wrote:
> 
> On 29.11.2013, at 05:38, Bharat Bhushan  wrote:
> 
> > Hi Alex,
> > 
> > I am running KVM guest with host kernel having CONFIG_PREEMPT enabled. With 
> > allocated pages things seems to work fine but I uses hugepages for guest I 
> > see below prints when "quit" from qemu.
> > 
> > (qemu) QEMU waiting for connection on: telnet:0.0.0.0:,server
> > qemu-system-ppc64: pci_add_option_rom: failed to find romfile 
> > "efi-virtio.rom"
> > q
> > debug_smp_processor_id: 15 callbacks suppressed
> > BUG: using smp_processor_id() in preemptible [] code: 
> > qemu-system-ppc/2504
> > caller is .free_hugepd_range+0xb0/0x21c
> > CPU: 1 PID: 2504 Comm: qemu-system-ppc Not tainted 
> > 3.12.0-rc3-07733-gabf4907 #175
> > Call Trace:
> > [c000fb433400] [c0007d38] .show_stack+0x7c/0x1cc (unreliable)
> > [c000fb4334d0] [c05e8ce0] .dump_stack+0x9c/0xf4
> > [c000fb433560] [c02de5ec] .debug_smp_processor_id+0x108/0x11c
> > [c000fb4335f0] [c0025e10] .free_hugepd_range+0xb0/0x21c
> > [c000fb433680] [c00265bc] .hugetlb_free_pgd_range+0x2c8/0x3b0
> > [c000fb4337a0] [c00e428c] .free_pgtables+0x14c/0x158
> > [c000fb433840] [c00ef320] .exit_mmap+0xec/0x194
> > [c000fb433960] [c004d780] .mmput+0x64/0x124
> > [c000fb4339e0] [c0051f40] .do_exit+0x29c/0x9c8
> > [c000fb433ae0] [c00527c8] .do_group_exit+0x50/0xc4
> > [c000fb433b70] [c00606a0] .get_signal_to_deliver+0x21c/0x5d8
> > [c000fb433c70] [c0009b08] .do_signal+0x54/0x278
> > [c000fb433db0] [c0009e50] .do_notify_resume+0x64/0x78
> > [c000fb433e30] [cb44] .ret_from_except_lite+0x70/0x74
> > 
> > 
> > This mean that free_hugepd_range() must be called with preemption enabled.
> 
> with preemption disabled.
> 
> > I tried below change and this seems to work fine (I am not having expertise 
> > in this area so not sure this is correct way)
> 
> Not sure - the scope looks odd to me. Let's ask Andrea - I'm sure he knows 
> what to do :).

:) So I had a look at the top of this function (0xb0) in the upstream
kernel and no smp_processor_id() call is apparent, is this stock git
or a ppc tree? The first few calls seem not to call it but I may have
overlooked something. It's just quicker if somebody with vmlinux finds
the location of it.

static void free_hugepd_range(struct mmu_gather *tlb, hugepd_t *hpdp, int 
pdshift,
  unsigned long start, unsigned long end,
  unsigned long floor, unsigned long ceiling)
{
pte_t *hugepte = hugepd_page(*hpdp);
int i;

unsigned long pdmask = ~((1UL << pdshift) - 1);
unsigned int num_hugepd = 1;

#ifdef CONFIG_PPC_FSL_BOOK3E
/* Note: On fsl the hpdp may be the first of several */
num_hugepd = (1 << (hugepd_shift(*hpdp) - pdshift));
#else
unsigned int shift = hugepd_shift(*hpdp);
#endif

start &= pdmask;
if (start < floor)
return;
if (ceiling) {
ceiling &= pdmask;
if (! ceiling)
return;
}
if (end - 1 > ceiling - 1)
return;

for (i = 0; i < num_hugepd; i++, hpdp++)
hpdp->pd = 0;

tlb->need_flush = 1;

#ifdef CONFIG_PPC_FSL_BOOK3E
hugepd_free(tlb, hugepte);
#else
pgtable_free_tlb(tlb, hugepte, pdshift - shift);
#endif
}

Generally smp_processor_id should never be used, exactly to avoid
problems like above with preempion enabled in .config.

Instead it should be replaced with a get_cpu()/put_cpu() pair that is
exactly meant to fix bugs like this and define proper critical
sections around the per-cpu variables.

#define get_cpu()   ({ preempt_disable(); smp_processor_id(); })
#define put_cpu()   preempt_enable()

After you find where that smp_processor_id() is located, you should
simply replace it with a get_cpu() and then you should insert a
put_cpu immediately after the "cpu" info is not used anymore. That
will define a proper and strict critical section around the use of the
per-cpu variables.

With a ppc vmlinux it should be immediate to find the location of
smp_processor_id but I don't have the ppc vmlinux here.

Thanks!
Andrea

> 
> 
> Alex
> 
> > 
> > diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
> > index d67db4b..6bf8459 100644
> > --- a/arch/powerpc/mm/hugetlbpage.c
> > +++ b/arch/powerpc/mm/hugetlbpage.c
> > @@ -563,8 +563,10 @@ static void hugetlb_free_pmd_range(struct mmu_gather 
> > *tlb, pud_t *pud,
> > */
> >next = addr + (1 << hugepd_shift(*(hugepd_t *)pmd));
> > #endif
> > +   preempt_disable();
> >free_hugepd_range(tlb, (hugepd_t *)pmd, PMD_SHIFT,
> >  addr, next,

[PATCH v4 1/1] powerpc/embedded6xx: Add support for Motorola/Emerson MVME5100

2013-12-03 Thread Stephen Chivers
Add support for the Motorola/Emerson MVME5100 Single Board Computer.

The MVME5100 is a 6U form factor VME64 computer with:

- A single MPC7410 or MPC750 CPU
- A HAWK Processor Host Bridge (CPU to PCI) and
  MultiProcessor Interrupt Controller (MPIC)
- Up to 500Mb of onboard memory
- A M48T37 Real Time Clock (RTC) and Non-Volatile Memory chip
- Two 16550 compatible UARTS
- Two Intel E100 Fast Ethernets
- Two PCI Mezzanine Card (PMC) Slots
- PPCBug Firmware

The HAWK PHB/MPIC is compatible with the MPC10x devices.

There is no onboard disk support. This is usually provided by installing a PMC
in first PMC slot.

This patch revives the board support, it was present in early 2.6
series kernels. The board support in those days was by Matt Porter of
MontaVista Software.

CSC Australia has around 31 of these boards in service. The kernel in use
for the boards is based on 2.6.31. The boards are operated without disks
from a file server. 

This patch is based on linux-3.13-rc2 and has been boot tested.

Only boards with 512 Mb of memory are known to work.

V1->V2:
Address comments by Kular Gama and Scott Wood.
Minor adjustment to platforms/embedded6xx/Kconfig to ensure
correct indentation where possible.

V2->V3:
Address comments by Scott Wood and Ben Herrenschmidt.
Address errors reported by checkpatch.

V3->V4:
Address comment by Geert Uytterhoeven
Add tested by Alessio Bogani.

Signed-off-by: Stephen Chivers 
Tested-by: Alessio Igor Bogani 
---
 arch/powerpc/boot/Makefile|3 +-
 arch/powerpc/boot/dts/mvme5100.dts|  185 +
 arch/powerpc/boot/mvme5100.c  |   27 +++
 arch/powerpc/boot/wrapper |4 +
 arch/powerpc/configs/mvme5100_defconfig   |  144 
 arch/powerpc/platforms/embedded6xx/Kconfig|   13 ++-
 arch/powerpc/platforms/embedded6xx/Makefile   |1 +
 arch/powerpc/platforms/embedded6xx/mvme5100.c |  221 +
 8 files changed, 596 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index ca7f08c..cd9ea99 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -95,7 +95,7 @@ src-plat-$(CONFIG_FSL_SOC_BOOKE) += cuboot-85xx.c 
cuboot-85xx-cpm2.c
 src-plat-$(CONFIG_EMBEDDED6xx) += cuboot-pq2.c cuboot-mpc7448hpc2.c \
cuboot-c2k.c gamecube-head.S \
gamecube.c wii-head.S wii.c holly.c \
-   prpmc2800.c
+   prpmc2800.c fixed-head.S mvme5100.c
 src-plat-$(CONFIG_AMIGAONE) += cuboot-amigaone.c
 src-plat-$(CONFIG_PPC_PS3) += ps3-head.S ps3-hvcall.S ps3.c
 src-plat-$(CONFIG_EPAPR_BOOT) += epapr.c epapr-wrapper.c
@@ -286,6 +286,7 @@ image-$(CONFIG_MPC7448HPC2) += cuImage.mpc7448hpc2
 image-$(CONFIG_PPC_C2K)+= cuImage.c2k
 image-$(CONFIG_GAMECUBE)   += dtbImage.gamecube
 image-$(CONFIG_WII)+= dtbImage.wii
+image-$(CONFIG_MVME5100)   += dtbImage.mvme5100
 
 # Board port in arch/powerpc/platform/amigaone/Kconfig
 image-$(CONFIG_AMIGAONE)   += cuImage.amigaone
diff --git a/arch/powerpc/boot/dts/mvme5100.dts 
b/arch/powerpc/boot/dts/mvme5100.dts
new file mode 100644
index 000..1ecb341
--- /dev/null
+++ b/arch/powerpc/boot/dts/mvme5100.dts
@@ -0,0 +1,185 @@
+/*
+ * Device Tree Source for Motorola/Emerson MVME5100.
+ *
+ * Copyright 2013 CSC Australia Pty. Ltd.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without
+ * any warranty of any kind, whether express or implied.
+ */
+
+/dts-v1/;
+
+/ {
+   model = "MVME5100";
+   compatible = "MVME5100";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   aliases {
+   serial0 = &serial0;
+   pci0 = &pci0;
+   };
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   PowerPC,7410 {
+   device_type = "cpu";
+   reg = <0x0>;
+   /* Following required by dtc but not used */
+   d-cache-line-size = <32>;
+   i-cache-line-size = <32>;
+   i-cache-size = <32768>;
+   d-cache-size = <32768>;
+   timebase-frequency = <2500>;
+   clock-frequency = <5>;
+   bus-frequency = <1>;
+   };
+   };
+
+   memory {
+   device_type = "memory";
+   reg = <0x0 0x2000>;
+   };
+
+   hawk@fef8 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+

Re: Build regressions/improvements in v3.13-rc2

2013-12-03 Thread Geert Uytterhoeven
On Tue, Dec 3, 2013 at 9:45 PM, Guenter Roeck  wrote:
> ia64-defconfig:
>
> arch/ia64/kernel/built-in.o: In function `skip_rbs_switch':
> (.text+0xef2): undefined reference to `preempt_schedule_irq'

Funny, that one was actually introduced in v3.13-rc1, but it fell through
the cracks of the regex handling in my script.

BTW, my scripts are back online: https://github.com/geertu/linux-scripts.
linux-log-diff didn't see the ia64 breakage, linux-log-summary did.
One day I plan to merge linux-log-diff and linux-log-summary, so I have
to maintain only one regex chain.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: Build regressions/improvements in v3.13-rc2

2013-12-03 Thread Guenter Roeck
On Sun, Dec 01, 2013 at 10:50:16AM +0100, Geert Uytterhoeven wrote:
> On Sun, Dec 1, 2013 at 10:44 AM, Geert Uytterhoeven
>  wrote:
> > JFYI, when comparing v3.13-rc2[1] to v3.13-rc1[3], the summaries are:
> >   - build errors: +8/-8
> >   - build warnings: +147/-97
> 
>   + /scratch/kisskb/src/drivers/crypto/caam/jr.c: error: implicit
> declaration of function 'of_iomap'
> [-Werror=implicit-function-declaration]:  => 468:2
> 
> powerpc/mpc85xx_defconfig
> 
>   + /scratch/kisskb/src/arch/powerpc/kernel/swsusp_booke.S: Error:
> invalid sprg number:  => 161, 85, 165, 91, 167, 163, 87, 89
> 
> powerpc-randconfig
> 
>   + /scratch/kisskb/src/drivers/tty/ehv_bytechan.c: error: type
> defaults to 'int' in declaration of 'console_initcall'
> [-Werror=implicit-int]:  => 363:1
> 
> powerpc-allmodconfig
> 
>   + /scratch/kisskb/src/arch/sparc/kernel/kgdb_64.c: error: implicit
> declaration of function 'exception_enter'
> [-Werror=implicit-function-declaration]:  => 162:7
>   + /scratch/kisskb/src/arch/sparc/kernel/kgdb_64.c: error: implicit
> declaration of function 'exception_exit'
> [-Werror=implicit-function-declaration]:  => 176:2
> 
> sparc64-allmodconfig
> 
>   + error: drivers/built-in.o: undefined reference to
> `i2c_register_driver':  => .init.literal+0xd88)
>   + error: sram.c: undefined reference to `devm_regmap_init_i2c':  =>
> .text+0x590dc)
> 
> sparc-allmodconfig
> xtensa-allmodconfig
> 
>   + /scratch/kisskb/src/drivers/gpu/drm/drm_gem_cma_helper.c: error:
> implicit declaration of function 'dma_alloc_writecombine'
> [-Werror=implicit-function-declaration]:  => 91:2
>   + /scratch/kisskb/src/drivers/gpu/drm/drm_gem_cma_helper.c: error:
> implicit declaration of function 'dma_free_writecombine'
> [-Werror=implicit-function-declaration]:  => 176:3
> 
> sh-randconfig
> 
> > [1] http://kisskb.ellerman.id.au/kisskb/head/6939/ (119 out of 120 configs)
> > [3] http://kisskb.ellerman.id.au/kisskb/head/6919/ (119 out of 120 configs)
> 
Also:

ia64-defconfig:

arch/ia64/kernel/built-in.o: In function `skip_rbs_switch':
(.text+0xef2): undefined reference to `preempt_schedule_irq'

arm-allmodconfig:

drivers/isdn/hisax/telespci.c: In function 'setup_telespci':
drivers/isdn/hisax/telespci.c:294:2: error: #error "not running on big endian 
machines now"

mips64 (out of tree 64 bit configuration with MIPS32_O32 not set):

arch/mips/include/asm/syscall.h: In function 'mips_get_syscall_arg':
arch/mips/include/asm/syscall.h:32:16: error: unused variable 'usp' 
[-Werror=unused-variable]

Guenter
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 2/3 v2] iommu/fsl: Enable default DMA window for PCIe devices

2013-12-03 Thread Alex Williamson
On Tue, 2013-12-03 at 18:15 +, Varun Sethi wrote:
> 
> > -Original Message-
> > From: Alex Williamson [mailto:alex.william...@redhat.com]
> > Sent: Tuesday, December 03, 2013 3:04 AM
> > To: Sethi Varun-B16395
> > Cc: j...@8bytes.org; io...@lists.linux-foundation.org; linuxppc-
> > d...@lists.ozlabs.org; linux-ker...@vger.kernel.org; Yoder Stuart-B08248;
> > Wood Scott-B07421; Bhushan Bharat-R65777
> > Subject: Re: [PATCH 2/3 v2] iommu/fsl: Enable default DMA window for PCIe
> > devices
> > 
> > On Wed, 2013-10-16 at 16:53 +0530, Varun Sethi wrote:
> > > Once the PCIe device assigned to a guest VM (via VFIO) gets detached
> > > from the iommu domain (when guest terminates), its PAMU table entry is
> > > disabled. So, this would prevent the device from being used once it's
> > assigned back to the host.
> > >
> > > This patch allows for creation of a default DMA window corresponding
> > > to the device and subsequently enabling the PAMU table entry. Before
> > > we enable the entry, we ensure that the device's bus master capability
> > is disabled (device quiesced).
> > >
> > > Signed-off-by: Varun Sethi 
> > > ---
> > >  drivers/iommu/fsl_pamu.c|   43 ---
> > -
> > >  drivers/iommu/fsl_pamu.h|1 +
> > >  drivers/iommu/fsl_pamu_domain.c |   46
> > ---
> > >  3 files changed, 78 insertions(+), 12 deletions(-)
> > >
> > > diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index
> > > cba0498..fb4a031 100644
> > > --- a/drivers/iommu/fsl_pamu.c
> > > +++ b/drivers/iommu/fsl_pamu.c
> > > @@ -225,6 +225,21 @@ static struct paace *pamu_get_spaace(struct paace
> > *paace, u32 wnum)
> > >   return spaace;
> > >  }
> > >
> > > +/*
> > > + * Defaul PPAACE settings for an LIODN.
> > > + */
> > > +static void setup_default_ppaace(struct paace *ppaace) {
> > > + pamu_init_ppaace(ppaace);
> > > + /* window size is 2^(WSE+1) bytes */
> > > + set_bf(ppaace->addr_bitfields, PPAACE_AF_WSE, 35);
> > > + ppaace->wbah = 0;
> > > + set_bf(ppaace->addr_bitfields, PPAACE_AF_WBAL, 0);
> > > + set_bf(ppaace->impl_attr, PAACE_IA_ATM,
> > > + PAACE_ATM_NO_XLATE);
> > > + set_bf(ppaace->addr_bitfields, PAACE_AF_AP,
> > > + PAACE_AP_PERMS_ALL);
> > > +}
> > >  /**
> > >   * pamu_get_fspi_and_allocate() - Allocates fspi index and reserves
> > subwindows
> > >   *required for primary PAACE in the
> > secondary
> > > @@ -253,6 +268,24 @@ static unsigned long
> > pamu_get_fspi_and_allocate(u32 subwin_cnt)
> > >   return (spaace_addr - (unsigned long)spaact) / (sizeof(struct
> > > paace));  }
> > >
> > > +/* Reset the PAACE entry to the default state */ void
> > > +enable_default_dma_window(int liodn) {
> > > + struct paace *ppaace;
> > > +
> > > + ppaace = pamu_get_ppaace(liodn);
> > > + if (!ppaace) {
> > > + pr_debug("Invalid liodn entry\n");
> > > + return;
> > > + }
> > > +
> > > + memset(ppaace, 0, sizeof(struct paace));
> > > +
> > > + setup_default_ppaace(ppaace);
> > > + mb();
> > > + pamu_enable_liodn(liodn);
> > > +}
> > > +
> > >  /* Release the subwindows reserved for a particular LIODN */  void
> > > pamu_free_subwins(int liodn)  { @@ -752,15 +785,7 @@ static void
> > > __init setup_liodns(void)
> > >   continue;
> > >   }
> > >   ppaace = pamu_get_ppaace(liodn);
> > > - pamu_init_ppaace(ppaace);
> > > - /* window size is 2^(WSE+1) bytes */
> > > - set_bf(ppaace->addr_bitfields, PPAACE_AF_WSE, 35);
> > > - ppaace->wbah = 0;
> > > - set_bf(ppaace->addr_bitfields, PPAACE_AF_WBAL, 0);
> > > - set_bf(ppaace->impl_attr, PAACE_IA_ATM,
> > > - PAACE_ATM_NO_XLATE);
> > > - set_bf(ppaace->addr_bitfields, PAACE_AF_AP,
> > > - PAACE_AP_PERMS_ALL);
> > > + setup_default_ppaace(ppaace);
> > >   if (of_device_is_compatible(node, "fsl,qman-portal"))
> > >   setup_qbman_paace(ppaace, QMAN_PORTAL_PAACE);
> > >   if (of_device_is_compatible(node, "fsl,qman")) diff --
> > git
> > > a/drivers/iommu/fsl_pamu.h b/drivers/iommu/fsl_pamu.h index
> > > 8fc1a12..0edc 100644
> > > --- a/drivers/iommu/fsl_pamu.h
> > > +++ b/drivers/iommu/fsl_pamu.h
> > > @@ -406,5 +406,6 @@ void get_ome_index(u32 *omi_index, struct device
> > > *dev);  int  pamu_update_paace_stash(int liodn, u32 subwin, u32
> > > value);  int pamu_disable_spaace(int liodn, u32 subwin);
> > >  u32 pamu_get_max_subwin_cnt(void);
> > > +void enable_default_dma_window(int liodn);
> > >
> > >  #endif  /* __FSL_PAMU_H */
> > > diff --git a/drivers/iommu/fsl_pamu_domain.c
> > > b/drivers/iommu/fsl_pamu_domain.c index 966ae70..dd6cafc 100644
> > > --- a/drivers/iommu/fsl_pamu_domain.c
> > > +++ b/drivers/iommu/fsl_pamu_domain.c
> > > @@

RE: [PATCH 2/3 v2] iommu/fsl: Enable default DMA window for PCIe devices

2013-12-03 Thread Varun Sethi


> -Original Message-
> From: Alex Williamson [mailto:alex.william...@redhat.com]
> Sent: Tuesday, December 03, 2013 3:04 AM
> To: Sethi Varun-B16395
> Cc: j...@8bytes.org; io...@lists.linux-foundation.org; linuxppc-
> d...@lists.ozlabs.org; linux-ker...@vger.kernel.org; Yoder Stuart-B08248;
> Wood Scott-B07421; Bhushan Bharat-R65777
> Subject: Re: [PATCH 2/3 v2] iommu/fsl: Enable default DMA window for PCIe
> devices
> 
> On Wed, 2013-10-16 at 16:53 +0530, Varun Sethi wrote:
> > Once the PCIe device assigned to a guest VM (via VFIO) gets detached
> > from the iommu domain (when guest terminates), its PAMU table entry is
> > disabled. So, this would prevent the device from being used once it's
> assigned back to the host.
> >
> > This patch allows for creation of a default DMA window corresponding
> > to the device and subsequently enabling the PAMU table entry. Before
> > we enable the entry, we ensure that the device's bus master capability
> is disabled (device quiesced).
> >
> > Signed-off-by: Varun Sethi 
> > ---
> >  drivers/iommu/fsl_pamu.c|   43 ---
> -
> >  drivers/iommu/fsl_pamu.h|1 +
> >  drivers/iommu/fsl_pamu_domain.c |   46
> ---
> >  3 files changed, 78 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index
> > cba0498..fb4a031 100644
> > --- a/drivers/iommu/fsl_pamu.c
> > +++ b/drivers/iommu/fsl_pamu.c
> > @@ -225,6 +225,21 @@ static struct paace *pamu_get_spaace(struct paace
> *paace, u32 wnum)
> > return spaace;
> >  }
> >
> > +/*
> > + * Defaul PPAACE settings for an LIODN.
> > + */
> > +static void setup_default_ppaace(struct paace *ppaace) {
> > +   pamu_init_ppaace(ppaace);
> > +   /* window size is 2^(WSE+1) bytes */
> > +   set_bf(ppaace->addr_bitfields, PPAACE_AF_WSE, 35);
> > +   ppaace->wbah = 0;
> > +   set_bf(ppaace->addr_bitfields, PPAACE_AF_WBAL, 0);
> > +   set_bf(ppaace->impl_attr, PAACE_IA_ATM,
> > +   PAACE_ATM_NO_XLATE);
> > +   set_bf(ppaace->addr_bitfields, PAACE_AF_AP,
> > +   PAACE_AP_PERMS_ALL);
> > +}
> >  /**
> >   * pamu_get_fspi_and_allocate() - Allocates fspi index and reserves
> subwindows
> >   *required for primary PAACE in the
> secondary
> > @@ -253,6 +268,24 @@ static unsigned long
> pamu_get_fspi_and_allocate(u32 subwin_cnt)
> > return (spaace_addr - (unsigned long)spaact) / (sizeof(struct
> > paace));  }
> >
> > +/* Reset the PAACE entry to the default state */ void
> > +enable_default_dma_window(int liodn) {
> > +   struct paace *ppaace;
> > +
> > +   ppaace = pamu_get_ppaace(liodn);
> > +   if (!ppaace) {
> > +   pr_debug("Invalid liodn entry\n");
> > +   return;
> > +   }
> > +
> > +   memset(ppaace, 0, sizeof(struct paace));
> > +
> > +   setup_default_ppaace(ppaace);
> > +   mb();
> > +   pamu_enable_liodn(liodn);
> > +}
> > +
> >  /* Release the subwindows reserved for a particular LIODN */  void
> > pamu_free_subwins(int liodn)  { @@ -752,15 +785,7 @@ static void
> > __init setup_liodns(void)
> > continue;
> > }
> > ppaace = pamu_get_ppaace(liodn);
> > -   pamu_init_ppaace(ppaace);
> > -   /* window size is 2^(WSE+1) bytes */
> > -   set_bf(ppaace->addr_bitfields, PPAACE_AF_WSE, 35);
> > -   ppaace->wbah = 0;
> > -   set_bf(ppaace->addr_bitfields, PPAACE_AF_WBAL, 0);
> > -   set_bf(ppaace->impl_attr, PAACE_IA_ATM,
> > -   PAACE_ATM_NO_XLATE);
> > -   set_bf(ppaace->addr_bitfields, PAACE_AF_AP,
> > -   PAACE_AP_PERMS_ALL);
> > +   setup_default_ppaace(ppaace);
> > if (of_device_is_compatible(node, "fsl,qman-portal"))
> > setup_qbman_paace(ppaace, QMAN_PORTAL_PAACE);
> > if (of_device_is_compatible(node, "fsl,qman")) diff --
> git
> > a/drivers/iommu/fsl_pamu.h b/drivers/iommu/fsl_pamu.h index
> > 8fc1a12..0edc 100644
> > --- a/drivers/iommu/fsl_pamu.h
> > +++ b/drivers/iommu/fsl_pamu.h
> > @@ -406,5 +406,6 @@ void get_ome_index(u32 *omi_index, struct device
> > *dev);  int  pamu_update_paace_stash(int liodn, u32 subwin, u32
> > value);  int pamu_disable_spaace(int liodn, u32 subwin);
> >  u32 pamu_get_max_subwin_cnt(void);
> > +void enable_default_dma_window(int liodn);
> >
> >  #endif  /* __FSL_PAMU_H */
> > diff --git a/drivers/iommu/fsl_pamu_domain.c
> > b/drivers/iommu/fsl_pamu_domain.c index 966ae70..dd6cafc 100644
> > --- a/drivers/iommu/fsl_pamu_domain.c
> > +++ b/drivers/iommu/fsl_pamu_domain.c
> > @@ -340,17 +340,57 @@ static inline struct device_domain_info
> *find_domain(struct device *dev)
> > return dev->archdata.iommu_domain;
> >  }
> >
> > +/* Disable device DMA capability and enable default DMA win

Re: [PATCH] ASoC: fsl_ssi: Implement symmetric_channels and symmetric_samplebits

2013-12-03 Thread Mark Brown
On Tue, Dec 03, 2013 at 06:38:07PM +0800, Nicolin Chen wrote:
> Since we introduced symmetric_channels and symmetric_samplebits, we implement
> these two features to fsl_ssi so as to drop some no-more-needed code and make
> the driver neat and clean.

Applied, thanks.


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v1 1/1] powerpc/512x: dts: remove misplaced IRQ spec from 'soc' node

2013-12-03 Thread Anatolij Gustschin
On Tue,  3 Dec 2013 11:56:52 +0100
Gerhard Sittig  wrote:

> the 'soc' node in the common .dtsi for MPC5121 has an '#interrupt-cells'
> property although this node is not an interrupt controller
> 
> remove this erroneously placed property because starting with v3.13-rc1
> lookup and resolution of 'interrupts' specs for peripherals gets misled,
> emits 'no irq domain found' WARN() messages and breaks the boot process
> 
>   irq: no irq domain found for /soc@8000 !
>   [ cut here ]
>   WARNING: at /home/gsi/SRC/linux-torvalds/drivers/of/platform.c:171
>   Modules linked in:
>   CPU: 0 PID: 1 Comm: swapper Tainted: GW
> 3.13.0-rc1-1-g8a66234 #8
>   task: df823bb0 ti: df834000 task.ti: df834000
>   NIP: c02b5190 LR: c02b5180 CTR: c01cf4e0
>   REGS: df835c50 TRAP: 0700   Tainted: GW 
> (3.13.0-rc1-1-g8a66234)
>   MSR: 00029032   CR: 229a9d42  XER: 2000
> 
>   GPR00: c02b5180 df835d00 df823bb0   df835b18  
> 0308
>   GPR08: c0479cc0 c048 c0479cc0 0308 0308  c00040fc 
> 
>   GPR16:        
> df850880
>   GPR24: df84d670  0001 df8561a0 dccc df85089c 0020 
> 0001
>   NIP [c02b5190] of_device_alloc+0xf4/0x1a0
>   LR [c02b5180] of_device_alloc+0xe4/0x1a0
>   Call Trace:
>   [df835d00] [c02b5180] of_device_alloc+0xe4/0x1a0 (unreliable)
>   [df835d50] [c02b5278] of_platform_device_create_pdata+0x3c/0xc8
>   [df835d70] [c02b53fc] of_platform_bus_create+0xf8/0x170
>   [df835dc0] [c02b5448] of_platform_bus_create+0x144/0x170
>   [df835e10] [c02b55a8] of_platform_bus_probe+0x98/0xe8
>   [df835e30] [c0437508] mpc512x_init+0x28/0x1c4
>   [df835e70] [c0435de8] ppc_init+0x4c/0x60
>   [df835e80] [c0003b28] do_one_initcall+0x150/0x1a4
>   [df835ef0] [c0432048] kernel_init_freeable+0x114/0x1c0
>   [df835f30] [c0004114] kernel_init+0x18/0x124
>   [df835f40] [c000e910] ret_from_kernel_thread+0x5c/0x64
>   Instruction dump:
>   409effd4 57c9103a 57de2834 7c89f050 7f83e378 7c972214 7f45d378 48001f55
>   7c63d278 7c630034 5463d97e 687a0001 <0f1a> 2f99 387b0010 939b0098
>   ---[ end trace 2257f10e5a20cbdd ]---
> 
>   ...
>   irq: no irq domain found for /soc@8000 !
>   fsl-diu-fb 80002100.display: could not get DIU IRQ
>   fsl-diu-fb: probe of 80002100.display failed with error -22
>   irq: no irq domain found for /soc@8000 !
>   mpc512x_dma 80014000.dma: Error mapping IRQ!
>   mpc512x_dma: probe of 80014000.dma failed with error -22
>   ...
>   irq: no irq domain found for /soc@8000 !
>   fs_enet: probe of 80002800.ethernet failed with error -22
>   ...
>   irq: no irq domain found for /soc@8000 !
>   mpc5121-rtc 8a00.rtc: mpc5121_rtc_probe: could not request irq: 0
>   mpc5121-rtc: probe of 8a00.rtc failed with error -22
>   ...
> 
> [ best viewed with 'git diff -U5' to have DT node names in the context ]
> 
> Cc: Anatolij Gustschin 
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: devicet...@vger.kernel.org
> Signed-off-by: Gerhard Sittig 
> ---
>  arch/powerpc/boot/dts/mpc5121.dtsi |1 -
>  1 file changed, 1 deletion(-)

applied, thanks!

Anatolij
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH v2] watchdog: mpc8xxx_wdt convert to watchdog core

2013-12-03 Thread Christophe Leroy
Convert mpc8xxx_wdt.c to the new watchdog API.

Signed-off-by: Christophe Leroy 

diff -ur a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c
--- a/drivers/watchdog/mpc8xxx_wdt.c2013-05-11 22:57:46.0 +0200
+++ b/drivers/watchdog/mpc8xxx_wdt.c2013-11-30 16:14:53.803495472 +0100
@@ -72,53 +72,36 @@
  * to 0
  */
 static int prescale = 1;
-static unsigned int timeout_sec;
 
-static unsigned long wdt_is_open;
 static DEFINE_SPINLOCK(wdt_spinlock);
 
-static void mpc8xxx_wdt_keepalive(void)
+static int mpc8xxx_wdt_ping(struct watchdog_device *w)
 {
/* Ping the WDT */
spin_lock(&wdt_spinlock);
out_be16(&wd_base->swsrr, 0x556c);
out_be16(&wd_base->swsrr, 0xaa39);
spin_unlock(&wdt_spinlock);
+   return 0;
 }
 
+static struct watchdog_device mpc8xxx_wdt_dev;
 static void mpc8xxx_wdt_timer_ping(unsigned long arg);
-static DEFINE_TIMER(wdt_timer, mpc8xxx_wdt_timer_ping, 0, 0);
+static DEFINE_TIMER(wdt_timer, mpc8xxx_wdt_timer_ping, 0,
+   (unsigned long)&mpc8xxx_wdt_dev);
 
 static void mpc8xxx_wdt_timer_ping(unsigned long arg)
 {
-   mpc8xxx_wdt_keepalive();
-   /* We're pinging it twice faster than needed, just to be sure. */
-   mod_timer(&wdt_timer, jiffies + HZ * timeout_sec / 2);
-}
+   struct watchdog_device *w = (struct watchdog_device *)arg;
 
-static void mpc8xxx_wdt_pr_warn(const char *msg)
-{
-   pr_crit("%s, expect the %s soon!\n", msg,
-   reset ? "reset" : "machine check exception");
-}
-
-static ssize_t mpc8xxx_wdt_write(struct file *file, const char __user *buf,
-size_t count, loff_t *ppos)
-{
-   if (count)
-   mpc8xxx_wdt_keepalive();
-   return count;
+   mpc8xxx_wdt_ping(w);
+   /* We're pinging it twice faster than needed, just to be sure. */
+   mod_timer(&wdt_timer, jiffies + HZ * w->timeout / 2);
 }
 
-static int mpc8xxx_wdt_open(struct inode *inode, struct file *file)
+static int mpc8xxx_wdt_start(struct watchdog_device *w)
 {
u32 tmp = SWCRR_SWEN;
-   if (test_and_set_bit(0, &wdt_is_open))
-   return -EBUSY;
-
-   /* Once we start the watchdog we can't stop it */
-   if (nowayout)
-   __module_get(THIS_MODULE);
 
/* Good, fire up the show */
if (prescale)
@@ -132,59 +115,31 @@
 
del_timer_sync(&wdt_timer);
 
-   return nonseekable_open(inode, file);
+   return 0;
 }
 
-static int mpc8xxx_wdt_release(struct inode *inode, struct file *file)
+static int mpc8xxx_wdt_stop(struct watchdog_device *w)
 {
-   if (!nowayout)
-   mpc8xxx_wdt_timer_ping(0);
-   else
-   mpc8xxx_wdt_pr_warn("watchdog closed");
-   clear_bit(0, &wdt_is_open);
+   mod_timer(&wdt_timer, jiffies);
return 0;
 }
 
-static long mpc8xxx_wdt_ioctl(struct file *file, unsigned int cmd,
-   unsigned long arg)
-{
-   void __user *argp = (void __user *)arg;
-   int __user *p = argp;
-   static const struct watchdog_info ident = {
-   .options = WDIOF_KEEPALIVEPING,
-   .firmware_version = 1,
-   .identity = "MPC8xxx",
-   };
-
-   switch (cmd) {
-   case WDIOC_GETSUPPORT:
-   return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
-   case WDIOC_GETSTATUS:
-   case WDIOC_GETBOOTSTATUS:
-   return put_user(0, p);
-   case WDIOC_KEEPALIVE:
-   mpc8xxx_wdt_keepalive();
-   return 0;
-   case WDIOC_GETTIMEOUT:
-   return put_user(timeout_sec, p);
-   default:
-   return -ENOTTY;
-   }
-}
+static struct watchdog_info mpc8xxx_wdt_info = {
+   .options = WDIOF_KEEPALIVEPING,
+   .firmware_version = 1,
+   .identity = "MPC8xxx",
+};
 
-static const struct file_operations mpc8xxx_wdt_fops = {
-   .owner  = THIS_MODULE,
-   .llseek = no_llseek,
-   .write  = mpc8xxx_wdt_write,
-   .unlocked_ioctl = mpc8xxx_wdt_ioctl,
-   .open   = mpc8xxx_wdt_open,
-   .release= mpc8xxx_wdt_release,
+static struct watchdog_ops mpc8xxx_wdt_ops = {
+   .owner = THIS_MODULE,
+   .start = mpc8xxx_wdt_start,
+   .ping = mpc8xxx_wdt_ping,
+   .stop = mpc8xxx_wdt_stop,
 };
 
-static struct miscdevice mpc8xxx_wdt_miscdev = {
-   .minor  = WATCHDOG_MINOR,
-   .name   = "watchdog",
-   .fops   = &mpc8xxx_wdt_fops,
+static struct watchdog_device mpc8xxx_wdt_dev = {
+   .info = &mpc8xxx_wdt_info,
+   .ops = &mpc8xxx_wdt_ops,
 };
 
 static const struct of_device_id mpc8xxx_wdt_match[];
@@ -196,6 +151,7 @@
const struct mpc8xxx_wdt_type *wdt_type;
u32 freq = fsl_get_sys_freq();
bool enabled;
+   unsigned int timeout_sec;
 
match = of_match_device(mpc8xxx_wdt_match, &ofdev->dev);
if (!match)
@@ -222,6 +178,7 @

[PATCH v1 1/1] powerpc/512x: dts: remove misplaced IRQ spec from 'soc' node

2013-12-03 Thread Gerhard Sittig
the 'soc' node in the common .dtsi for MPC5121 has an '#interrupt-cells'
property although this node is not an interrupt controller

remove this erroneously placed property because starting with v3.13-rc1
lookup and resolution of 'interrupts' specs for peripherals gets misled,
emits 'no irq domain found' WARN() messages and breaks the boot process

  irq: no irq domain found for /soc@8000 !
  [ cut here ]
  WARNING: at /home/gsi/SRC/linux-torvalds/drivers/of/platform.c:171
  Modules linked in:
  CPU: 0 PID: 1 Comm: swapper Tainted: GW3.13.0-rc1-1-g8a66234 
#8
  task: df823bb0 ti: df834000 task.ti: df834000
  NIP: c02b5190 LR: c02b5180 CTR: c01cf4e0
  REGS: df835c50 TRAP: 0700   Tainted: GW 
(3.13.0-rc1-1-g8a66234)
  MSR: 00029032   CR: 229a9d42  XER: 2000

  GPR00: c02b5180 df835d00 df823bb0   df835b18  0308
  GPR08: c0479cc0 c048 c0479cc0 0308 0308  c00040fc 
  GPR16:        df850880
  GPR24: df84d670  0001 df8561a0 dccc df85089c 0020 0001
  NIP [c02b5190] of_device_alloc+0xf4/0x1a0
  LR [c02b5180] of_device_alloc+0xe4/0x1a0
  Call Trace:
  [df835d00] [c02b5180] of_device_alloc+0xe4/0x1a0 (unreliable)
  [df835d50] [c02b5278] of_platform_device_create_pdata+0x3c/0xc8
  [df835d70] [c02b53fc] of_platform_bus_create+0xf8/0x170
  [df835dc0] [c02b5448] of_platform_bus_create+0x144/0x170
  [df835e10] [c02b55a8] of_platform_bus_probe+0x98/0xe8
  [df835e30] [c0437508] mpc512x_init+0x28/0x1c4
  [df835e70] [c0435de8] ppc_init+0x4c/0x60
  [df835e80] [c0003b28] do_one_initcall+0x150/0x1a4
  [df835ef0] [c0432048] kernel_init_freeable+0x114/0x1c0
  [df835f30] [c0004114] kernel_init+0x18/0x124
  [df835f40] [c000e910] ret_from_kernel_thread+0x5c/0x64
  Instruction dump:
  409effd4 57c9103a 57de2834 7c89f050 7f83e378 7c972214 7f45d378 48001f55
  7c63d278 7c630034 5463d97e 687a0001 <0f1a> 2f99 387b0010 939b0098
  ---[ end trace 2257f10e5a20cbdd ]---

  ...
  irq: no irq domain found for /soc@8000 !
  fsl-diu-fb 80002100.display: could not get DIU IRQ
  fsl-diu-fb: probe of 80002100.display failed with error -22
  irq: no irq domain found for /soc@8000 !
  mpc512x_dma 80014000.dma: Error mapping IRQ!
  mpc512x_dma: probe of 80014000.dma failed with error -22
  ...
  irq: no irq domain found for /soc@8000 !
  fs_enet: probe of 80002800.ethernet failed with error -22
  ...
  irq: no irq domain found for /soc@8000 !
  mpc5121-rtc 8a00.rtc: mpc5121_rtc_probe: could not request irq: 0
  mpc5121-rtc: probe of 8a00.rtc failed with error -22
  ...

[ best viewed with 'git diff -U5' to have DT node names in the context ]

Cc: Anatolij Gustschin 
Cc: linuxppc-dev@lists.ozlabs.org
Cc: devicet...@vger.kernel.org
Signed-off-by: Gerhard Sittig 
---
 arch/powerpc/boot/dts/mpc5121.dtsi |1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/powerpc/boot/dts/mpc5121.dtsi 
b/arch/powerpc/boot/dts/mpc5121.dtsi
index bd14c00e5146..2d7cb04ac962 100644
--- a/arch/powerpc/boot/dts/mpc5121.dtsi
+++ b/arch/powerpc/boot/dts/mpc5121.dtsi
@@ -75,11 +75,10 @@
 
soc@8000 {
compatible = "fsl,mpc5121-immr";
#address-cells = <1>;
#size-cells = <1>;
-   #interrupt-cells = <2>;
ranges = <0x0 0x8000 0x40>;
reg = <0x8000 0x40>;
bus-frequency = <6600>; /* 66 MHz ips bus */
 
 
-- 
1.7.10.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH] ASoC: fsl_ssi: Implement symmetric_channels and symmetric_samplebits

2013-12-03 Thread Nicolin Chen
Since we introduced symmetric_channels and symmetric_samplebits, we implement
these two features to fsl_ssi so as to drop some no-more-needed code and make
the driver neat and clean.

Signed-off-by: Nicolin Chen 
---
 sound/soc/fsl/fsl_ssi.c | 79 ++---
 1 file changed, 9 insertions(+), 70 deletions(-)

diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 90ff107..f9f4569 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -119,8 +119,6 @@ static inline void write_ssi_mask(u32 __iomem *addr, u32 
clear, u32 set)
  * @ssi: pointer to the SSI's registers
  * @ssi_phys: physical address of the SSI registers
  * @irq: IRQ of this SSI
- * @first_stream: pointer to the stream that was opened first
- * @second_stream: pointer to second stream
  * @playback: the number of playback streams opened
  * @capture: the number of capture streams opened
  * @cpu_dai: the CPU DAI for this device
@@ -132,8 +130,6 @@ struct fsl_ssi_private {
struct ccsr_ssi __iomem *ssi;
dma_addr_t ssi_phys;
unsigned int irq;
-   struct snd_pcm_substream *first_stream;
-   struct snd_pcm_substream *second_stream;
unsigned int fifo_depth;
struct snd_soc_dai_driver cpu_dai_drv;
struct device_attribute dev_attr;
@@ -438,54 +434,13 @@ static int fsl_ssi_startup(struct snd_pcm_substream 
*substream,
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct fsl_ssi_private *ssi_private =
snd_soc_dai_get_drvdata(rtd->cpu_dai);
-   int synchronous = ssi_private->cpu_dai_drv.symmetric_rates;
 
-   /*
-* If this is the first stream opened, then request the IRQ
-* and initialize the SSI registers.
+   /* First, we only do fsl_ssi_setup() when SSI is going to be active.
+* Second, fsl_ssi_setup was already called by ac97_init earlier if
+* the driver is in ac97 mode.
 */
-   if (!ssi_private->first_stream) {
-   ssi_private->first_stream = substream;
-
-   /*
-* fsl_ssi_setup was already called by ac97_init earlier if
-* the driver is in ac97 mode.
-*/
-   if (!ssi_private->imx_ac97)
-   fsl_ssi_setup(ssi_private);
-   } else {
-   if (synchronous) {
-   struct snd_pcm_runtime *first_runtime =
-   ssi_private->first_stream->runtime;
-   /*
-* This is the second stream open, and we're in
-* synchronous mode, so we need to impose sample
-* sample size constraints. This is because STCCR is
-* used for playback and capture in synchronous mode,
-* so there's no way to specify different word
-* lengths.
-*
-* Note that this can cause a race condition if the
-* second stream is opened before the first stream is
-* fully initialized.  We provide some protection by
-* checking to make sure the first stream is
-* initialized, but it's not perfect.  ALSA sometimes
-* re-initializes the driver with a different sample
-* rate or size.  If the second stream is opened
-* before the first stream has received its final
-* parameters, then the second stream may be
-* constrained to the wrong sample rate or size.
-*/
-   if (first_runtime->sample_bits) {
-   snd_pcm_hw_constraint_minmax(substream->runtime,
-   SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
-   first_runtime->sample_bits,
-   first_runtime->sample_bits);
-   }
-   }
-
-   ssi_private->second_stream = substream;
-   }
+   if (!dai->active && !ssi_private->imx_ac97)
+   fsl_ssi_setup(ssi_private);
 
return 0;
 }
@@ -615,23 +570,6 @@ static int fsl_ssi_trigger(struct snd_pcm_substream 
*substream, int cmd,
return 0;
 }
 
-/**
- * fsl_ssi_shutdown: shutdown the SSI
- *
- * Shutdown the SSI if there are no other substreams open.
- */
-static void fsl_ssi_shutdown(struct snd_pcm_substream *substream,
-struct snd_soc_dai *dai)
-{
-   struct snd_soc_pcm_runtime *rtd = substream->private_data;
-   struct fsl_ssi_private *ssi_private = 
snd_soc_dai_get_drvdata(rtd->cpu_dai);
-
-   if (ssi_private->first_stream == substream)
-   ssi_private->first_stream = ssi_private->second_stream;
-
-   ssi_private->second_stream = NU

Re: [V3 01/10] perf: New conditional branch filter criteria in branch stack sampling

2013-12-03 Thread Anshuman Khandual
On 11/26/2013 03:45 PM, Anshuman Khandual wrote:
> On 11/26/2013 11:36 AM, m...@ellerman.id.au wrote:
>> Ideally your commit subject would contain a verb, preferably in the present
>> tense.
>>
>> I think simply "perf: Add PERF_SAMPLE_BRANCH_COND" would be clearer.
> 
> 
> Sure, will change it.
> 
>>
>> On Wed, 2013-16-10 at 06:56:48 UTC, Anshuman Khandual wrote:
>>> POWER8 PMU based BHRB supports filtering for conditional branches.
>>> This patch introduces new branch filter PERF_SAMPLE_BRANCH_COND which
>>> will extend the existing perf ABI. Other architectures can provide
>>> this functionality with either HW filtering support (if present) or
>>> with SW filtering of instructions.
>>>
>>> Signed-off-by: Anshuman Khandual 
>>> Reviewed-by: Stephane Eranian 
>>> ---
>>>  include/uapi/linux/perf_event.h | 3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/include/uapi/linux/perf_event.h 
>>> b/include/uapi/linux/perf_event.h
>>> index 0b1df41..5da52b6 100644
>>> --- a/include/uapi/linux/perf_event.h
>>> +++ b/include/uapi/linux/perf_event.h
>>> @@ -160,8 +160,9 @@ enum perf_branch_sample_type {
>>> PERF_SAMPLE_BRANCH_ABORT_TX = 1U << 7, /* transaction aborts */
>>> PERF_SAMPLE_BRANCH_IN_TX= 1U << 8, /* in transaction */
>>> PERF_SAMPLE_BRANCH_NO_TX= 1U << 9, /* not in transaction */
>>> +   PERF_SAMPLE_BRANCH_COND = 1U << 10, /* conditional branches */
>>>  
>>> -   PERF_SAMPLE_BRANCH_MAX  = 1U << 10, /* non-ABI */
>>> +   PERF_SAMPLE_BRANCH_MAX  = 1U << 11, /* non-ABI */
>>>  };
>>
>> This no longer applies against Linus' tree, you'll need to rebase it.
> 
> Okay

Hey Michael,

Looks like the patch still applies on top of Linus's tree. The modified patch 
with
a new commit subject line can be found here.

--
>From d368096fc51a8da65f2d80ed5090d43cbc269f62 Mon Sep 17 00:00:00 2001
From: Anshuman Khandual 
Date: Mon, 22 Jul 2013 12:22:27 +0530
Subject: [PATCH] perf: Add PERF_SAMPLE_BRANCH_COND

POWER8 PMU based BHRB supports filtering for conditional branches.
This patch introduces new branch filter PERF_SAMPLE_BRANCH_COND which
will extend the existing perf ABI. Other architectures can provide
this functionality with either HW filtering support (if present) or
with SW filtering of instructions.

Signed-off-by: Anshuman Khandual 
Reviewed-by: Stephane Eranian 
---
 include/uapi/linux/perf_event.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
index e1802d6..e2d8b8b 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -163,8 +163,9 @@ enum perf_branch_sample_type {
PERF_SAMPLE_BRANCH_ABORT_TX = 1U << 7, /* transaction aborts */
PERF_SAMPLE_BRANCH_IN_TX= 1U << 8, /* in transaction */
PERF_SAMPLE_BRANCH_NO_TX= 1U << 9, /* not in transaction */
+   PERF_SAMPLE_BRANCH_COND = 1U << 10, /* conditional branches */
 
-   PERF_SAMPLE_BRANCH_MAX  = 1U << 10, /* non-ABI */
+   PERF_SAMPLE_BRANCH_MAX  = 1U << 11, /* non-ABI */
 };
 
 #define PERF_SAMPLE_BRANCH_PLM_ALL \
-- 
1.7.11.7

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev