Re: [PATCH Bug fix 0/5] Bug fix for physical memory hot-remove.

2013-01-28 Thread Michal Hocko
On Mon 28-01-13 09:33:49, Tang Chen wrote:
 On 01/25/2013 09:17 PM, Michal Hocko wrote:
 On Wed 23-01-13 06:29:31, Simon Jeons wrote:
 On Tue, 2013-01-22 at 19:42 +0800, Tang Chen wrote:
 Here are some bug fix patches for physical memory hot-remove. All these
 patches are based on the latest -mm tree.
 git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm
 
 And patch1 and patch3 are very important.
 patch1: free compound pages when freeing memmap, otherwise the kernel
  will panic the next time memory is hot-added.
 patch3: the old way of freeing pagetable pages was wrong. We should never
  split larger pages into small ones.
 
 
 
 Hi Tang,
 
 I remember your big physical memory hot-remove patchset has already
 merged by Andrew, but where I can find it? Could you give me git tree
 address?
 
 Andrew tree is also mirrored into a git tree.
 http://git.kernel.org/?p=linux/kernel/git/mhocko/mm.git;a=summary
 
 It contains only Memory management patches on top of the last major
 release (since-.X.Y branch).
 
 Hi Michal,
 
 I'm not sure I got your meaning. :)

Well, the mirror tree gets updated when Andrew releases mmotm and quite
often even when mmots is released.
All patches in the mm section are applied.

 In http://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm,
 I can find the following commit.
 
 commit deed0460e01b3968f2cf46fb94851936535b7e0d
 Author: Tang Chen tangc...@cn.fujitsu.com
 Date:   Sat Jan 19 11:07:13 2013 +1100
 
 memory-hotplug: do not allocate pgdat if it was not freed when
 offline.
 
 
 This is one of memory hot-remove patches. Please try to update the
 mirror tree,
 and try to find the above commit.

That one is in my mirror tree as f48bf999 (memory-hotplug: do not
allocate pdgat if it was not freed when offline.).
-- 
Michal Hocko
SUSE Labs
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH v5 31/45] blackfin/smp: Use get/put_online_cpus_atomic() to prevent CPU offline

2013-01-28 Thread Bob Liu
On Tue, Jan 22, 2013 at 3:41 PM, Srivatsa S. Bhat
srivatsa.b...@linux.vnet.ibm.com wrote:
 Once stop_machine() is gone from the CPU offline path, we won't be able to
 depend on preempt_disable() or local_irq_disable() to prevent CPUs from
 going offline from under us.

 Use the get/put_online_cpus_atomic() APIs to prevent CPUs from going offline,
 while invoking from atomic context.

 Cc: Mike Frysinger vap...@gentoo.org
 Cc: Bob Liu lliu...@gmail.com
 Cc: Steven Miao real...@gmail.com
 Cc: uclinux-dist-de...@blackfin.uclinux.org
 Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com

Thanks, will be applied to my blackfin arch tree.

 ---

  arch/blackfin/mach-common/smp.c |6 --
  1 file changed, 4 insertions(+), 2 deletions(-)

 diff --git a/arch/blackfin/mach-common/smp.c b/arch/blackfin/mach-common/smp.c
 index bb61ae4..6cc6d7a 100644
 --- a/arch/blackfin/mach-common/smp.c
 +++ b/arch/blackfin/mach-common/smp.c
 @@ -194,6 +194,7 @@ void send_ipi(const struct cpumask *cpumask, enum 
 ipi_message_type msg)
 struct ipi_data *bfin_ipi_data;
 unsigned long flags;

 +   get_online_cpus_atomic();
 local_irq_save(flags);
 smp_mb();
 for_each_cpu(cpu, cpumask) {
 @@ -205,6 +206,7 @@ void send_ipi(const struct cpumask *cpumask, enum 
 ipi_message_type msg)
 }

 local_irq_restore(flags);
 +   put_online_cpus_atomic();
  }

  void arch_send_call_function_single_ipi(int cpu)
 @@ -238,13 +240,13 @@ void smp_send_stop(void)
  {
 cpumask_t callmap;

 -   preempt_disable();
 +   get_online_cpus_atomic();
 cpumask_copy(callmap, cpu_online_mask);
 cpumask_clear_cpu(smp_processor_id(), callmap);
 if (!cpumask_empty(callmap))
 send_ipi(callmap, BFIN_IPI_CPU_STOP);

 -   preempt_enable();
 +   put_online_cpus_atomic();

 return;
  }

 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/

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


Re: [PATCH v5 31/45] blackfin/smp: Use get/put_online_cpus_atomic() to prevent CPU offline

2013-01-28 Thread Tejun Heo
Hello, Bob.

On Mon, Jan 28, 2013 at 1:09 AM, Bob Liu lliu...@gmail.com wrote:
 Thanks, will be applied to my blackfin arch tree.

I think we still have some work ahead of us to have this patchset
ready for inclusion and even then it probably would be best to route
these patches together, so probably not a very good idea to apply this
to blackfin right now.

Thanks.

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


Re: [RFC/PATCH 29/32] usb: gadget: pxa27x_udc: let udc-core manage gadget-dev

2013-01-28 Thread Robert Jarzmik
Felipe Balbi ba...@ti.com writes:

 By simply setting a flag, we can drop some
 boilerplate code.

 Signed-off-by: Felipe Balbi ba...@ti.com
 ---
  drivers/usb/gadget/pxa27x_udc.c | 9 +
Acked-by: Robert Jarzmik robert.jarz...@free.fr

And I tested also your patch and it works in my environment. For next patches
I'd like to be CCed for pxa27x_udc stuff as I'm maintaining that one since its
beginning (and yes, I know, I didn't put that in MAINTAINERS ...).

Cheers.

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


[git pull] Please pull powerpc.git merge branch

2013-01-28 Thread Benjamin Herrenschmidt
Hi Linus !

Whenever you have a chance between two dives, you might want to consider
pulling my merge branch to pickup a few fixes for 3.8 that have been
accumulating for the last couple of weeks (I was myself travelling
then on vacation). Nothing major, just a handful of powerpc bug fixes
that I consider worth getting in before 3.8 goes final.

Cheers,
Ben.

The following changes since commit 45e72af09faa7dad5d8539ebac0fe317ae88318b:

  Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-fixes 
(2013-01-28 11:53:49 -0800)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git 

for you to fetch changes up to 689dfa894c57842a05bf6dc9f97e6bb71ec5f386:

  powerpc: Max next_tb to prevent from replaying timer interrupt (2013-01-29 
10:18:16 +1100)


Carl E. Love (1):
  powerpc/oprofile: Fix error in oprofile power7_marked_instr_event() 
function

Cong Ding (1):
  powerpc: kernel/kgdb.c: Fix memory leakage

Li Zhong (1):
  powerpc: Fix MAX_STACK_TRACE_ENTRIES too low warning for ppc32

Steven Rostedt (1):
  powerpc/pasemi: Fix crash on reboot

Tiejun Chen (2):
  powerpc/book3e: Disable interrupt after preempt_schedule_irq
  powerpc: Max next_tb to prevent from replaying timer interrupt

 arch/powerpc/kernel/entry_32.S  |2 ++
 arch/powerpc/kernel/entry_64.S  |   13 +
 arch/powerpc/kernel/kgdb.c  |5 +++--
 arch/powerpc/kernel/time.c  |9 +++--
 arch/powerpc/oprofile/op_model_power4.c |2 +-
 arch/powerpc/platforms/pasemi/cpufreq.c |7 +++
 6 files changed, 33 insertions(+), 5 deletions(-)


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


Re: [git pull] Please pull powerpc.git merge branch

2013-01-28 Thread Linus Torvalds
On Mon, Jan 28, 2013 at 3:42 PM, Benjamin Herrenschmidt
b...@kernel.crashing.org wrote:

 Whenever you have a chance between two dives, you might want to consider
 pulling my merge branch to pickup a few fixes for 3.8 that have been
 accumulating for the last couple of weeks (I was myself travelling
 then on vacation).

I'll have you know that I haven't quite even left for Au yet, and I
have LCA before diving. So no snarky in between dives comments,
please.

At least not for a few days.

   git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git

Nothing there. Forgot to push? Or some unnamed branch/tag?

(And I _am_ leaving for the airport soon, so I may not get to it for a
while unless you reply asap)

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


Re: [git pull] Please pull powerpc.git merge branch

2013-01-28 Thread Benjamin Herrenschmidt
On Mon, 2013-01-28 at 16:03 -0800, Linus Torvalds wrote:
 I'll have you know that I haven't quite even left for Au yet, and I
 have LCA before diving. So no snarky in between dives comments,
 please.

It wasn't meant to be snarky, sorry about that...

 At least not for a few days.
 
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git
 
 Nothing there. Forgot to push? Or some unnamed branch/tag?

My usual problem with git request-pull when the mirror haven't caught up
yet. Branch is merge.

 (And I _am_ leaving for the airport soon, so I may not get to it for a
 while unless you reply asap)

Have a good trip !

Cheers,
Ben.

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


Re: [PATCH v2] ppc/iommu: use find_first_bit to look up entries in the iommu table

2013-01-28 Thread Benjamin Herrenschmidt
On Thu, 2013-01-10 at 17:33 -0200, Thadeu Lima de Souza Cascardo wrote:
 Signed-off-by: Thadeu Lima de Souza Cascardo casca...@linux.vnet.ibm.com
 ---
 v2:
 Remove the unneeded extra variable i, which caused build failure.

I believe something equivalent is already in -next, can you dbl check ?

Cheers,
Ben.

 ---
  arch/powerpc/kernel/iommu.c |9 ++---
  1 files changed, 2 insertions(+), 7 deletions(-)
 
 diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
 index 6d48ff8..0fc44d2 100644
 --- a/arch/powerpc/kernel/iommu.c
 +++ b/arch/powerpc/kernel/iommu.c
 @@ -708,7 +708,7 @@ struct iommu_table *iommu_init_table(struct iommu_table 
 *tbl, int nid)
  
  void iommu_free_table(struct iommu_table *tbl, const char *node_name)
  {
 - unsigned long bitmap_sz, i;
 + unsigned long bitmap_sz;
   unsigned int order;
  
   if (!tbl || !tbl-it_map) {
 @@ -725,14 +725,9 @@ void iommu_free_table(struct iommu_table *tbl, const 
 char *node_name)
   clear_bit(0, tbl-it_map);
  
   /* verify that table contains no entries */
 - /* it_size is in entries, and we're examining 64 at a time */
 - for (i = 0; i  (tbl-it_size/64); i++) {
 - if (tbl-it_map[i] != 0) {
 + if (find_first_bit(tbl-it_map, tbl-it_size)  tbl-it_size)
   printk(KERN_WARNING %s: Unexpected TCEs for %s\n,
   __func__, node_name);
 - break;
 - }
 - }
  
   /* calculate bitmap size in bytes */
   bitmap_sz = (tbl-it_size + 7) / 8;


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


Re: [PATCH v5 31/45] blackfin/smp: Use get/put_online_cpus_atomic() to prevent CPU offline

2013-01-28 Thread Srivatsa S. Bhat
On 01/29/2013 06:06 AM, Tejun Heo wrote:
 Hello, Bob.
 
 On Mon, Jan 28, 2013 at 1:09 AM, Bob Liu lliu...@gmail.com wrote:
 Thanks, will be applied to my blackfin arch tree.
 
 I think we still have some work ahead of us to have this patchset
 ready for inclusion and even then it probably would be best to route
 these patches together, so probably not a very good idea to apply this
 to blackfin right now.
 

Thanks Tejun for pointing that out! I'll address the review comments
soon and respin the patchset.
 
Regards,
Srivatsa S. Bhat

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


[PATCH 1/2] pseries/iommu: restore_default_window does not use liobn parameter

2013-01-28 Thread Nishanth Aravamudan
The parameter is unused, and complicates a following fix. Just remove
it.

Signed-off-by: Nishanth Aravamudan n...@us.ibm.com

diff --git a/arch/powerpc/platforms/pseries/iommu.c 
b/arch/powerpc/platforms/pseries/iommu.c
index b4bb9e1..a8e99f9 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -884,7 +884,7 @@ static int create_ddw(struct pci_dev *dev, const u32 
*ddw_avail,
 }
 
 static void restore_default_window(struct pci_dev *dev,
-   u32 ddw_restore_token, unsigned long liobn)
+   u32 ddw_restore_token)
 {
struct eeh_dev *edev;
u32 cfg_addr;
@@ -1100,7 +1100,7 @@ out_free_prop:
 
 out_restore_window:
if (ddw_restore_token)
-   restore_default_window(dev, ddw_restore_token, liobn);
+   restore_default_window(dev, ddw_restore_token);
 
 out_unlock:
mutex_unlock(direct_window_init_mutex);

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


[PATCH 2/2] pseries/iommu: remove DDW on kexec

2013-01-28 Thread Nishanth Aravamudan
pseries/iommu: remove DDW on kexec

We currently insert a property in the device-tree when we successfully
configure DDW for a given slot. This was meant to be an optimization to
speed up kexec/kdump, so that we don't need to make the RTAS calls again
to re-configured DDW in the new kernel.

However, we end up tripping a plpar_tce_stuff failure on kexec/kdump
because we unconditionally parse the ibm,dma-window property for the
node at bus/dev setup time. This property contains the 32-bit DMA window
LIOBN, which is distinct from the DDW window's. We pass that LIOBN (via
iommu_table_init - iommu_table_clear - tce_free -
tce_freemulti_pSeriesLP) to plpar_tce_stuff, which fails because that
32-bit window is no longer present after
25ebc45b93452d0bc60271f178237123c4b26808 (powerpc/pseries/iommu: remove
default window before attempting DDW manipulation).

I believe the simplest, easiest-to-maintain fix is to just change our
initcall to, rather than detecting and updating the new kernel's DDW
knowledge, just remove all DDW configurations. When the drivers
re-initialize, we will set everything back up as it was before.

Signed-off-by: Nishanth Aravamudan n...@us.ibm.com

diff --git a/arch/powerpc/platforms/pseries/iommu.c 
b/arch/powerpc/platforms/pseries/iommu.c
index a8e99f9..1b2a174 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -787,33 +787,68 @@ static u64 find_existing_ddw(struct device_node *pdn)
return dma_addr;
 }
 
+static void __restore_default_window(struct eeh_dev *edev,
+   u32 ddw_restore_token)
+{
+   u32 cfg_addr;
+   u64 buid;
+   int ret;
+
+   /*
+* Get the config address and phb buid of the PE window.
+* Rely on eeh to retrieve this for us.
+* Retrieve them from the pci device, not the node with the
+* dma-window property
+*/
+   cfg_addr = edev-config_addr;
+   if (edev-pe_config_addr)
+   cfg_addr = edev-pe_config_addr;
+   buid = edev-phb-buid;
+
+   do {
+   ret = rtas_call(ddw_restore_token, 3, 1, NULL, cfg_addr,
+   BUID_HI(buid), BUID_LO(buid));
+   } while (rtas_busy_delay(ret));
+   pr_info(ibm,reset-pe-dma-windows(%x) %x %x %x returned %d\n,
+ddw_restore_token, cfg_addr, BUID_HI(buid), BUID_LO(buid), 
ret);
+}
+
 static int find_existing_ddw_windows(void)
 {
-   int len;
struct device_node *pdn;
-   struct direct_window *window;
const struct dynamic_dma_window_prop *direct64;
+   const u32 *ddw_extensions;
 
if (!firmware_has_feature(FW_FEATURE_LPAR))
return 0;
 
for_each_node_with_property(pdn, DIRECT64_PROPNAME) {
-   direct64 = of_get_property(pdn, DIRECT64_PROPNAME, len);
+   direct64 = of_get_property(pdn, DIRECT64_PROPNAME, NULL);
if (!direct64)
continue;
 
-   window = kzalloc(sizeof(*window), GFP_KERNEL);
-   if (!window || len  sizeof(struct dynamic_dma_window_prop)) {
-   kfree(window);
-   remove_ddw(pdn);
-   continue;
-   }
+   /*
+* We need to ensure the IOMMU table is active when we
+* return from the IOMMU setup so that the common code
+* can clear the table or find the holes. To that end,
+* first, remove any existing DDW configuration.
+*/
+   remove_ddw(pdn);
 
-   window-device = pdn;
-   window-prop = direct64;
-   spin_lock(direct_window_list_lock);
-   list_add(window-list, direct_window_list);
-   spin_unlock(direct_window_list_lock);
+   /*
+* Second, if we are running on a new enough level of
+* firmware where the restore API is present, use it to
+* restore the 32-bit window, which was removed in
+* create_ddw.
+* If the API is not present, then create_ddw couldn't
+* have removed the 32-bit window in the first place, so
+* removing the DDW configuration should be sufficient.
+*/
+   ddw_extensions = of_get_property(pdn, ibm,ddw-extensions,
+   NULL);
+   if (ddw_extensions  ddw_extensions[0]  0)
+   __restore_default_window(of_node_to_eeh_dev(pdn),
+   ddw_extensions[1]);
}
 
return 0;
@@ -886,30 +921,7 @@ static int create_ddw(struct pci_dev *dev, const u32 
*ddw_avail,
 static void restore_default_window(struct pci_dev *dev,
u32 ddw_restore_token)
 {
- 

[PATCH] powerpc/p1023/config: enable hugetlbfs support

2013-01-28 Thread Shaohui Xie
Hugetlbfs is missed in current p1023rds_defconfig, enable it by default.

Signed-off-by: Shaohui Xie shaohui@freescale.com
---
 arch/powerpc/configs/85xx/p1023rds_defconfig |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/configs/85xx/p1023rds_defconfig 
b/arch/powerpc/configs/85xx/p1023rds_defconfig
index b80bcc6..98125b0 100644
--- a/arch/powerpc/configs/85xx/p1023rds_defconfig
+++ b/arch/powerpc/configs/85xx/p1023rds_defconfig
@@ -1,4 +1,5 @@
 CONFIG_PPC_85xx=y
+CONFIG_PHYS_64BIT=y
 CONFIG_SMP=y
 CONFIG_NR_CPUS=2
 CONFIG_EXPERIMENTAL=y
@@ -138,6 +139,7 @@ CONFIG_VFAT_FS=y
 CONFIG_NTFS_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_TMPFS=y
+CONFIG_HUGETLBFS=y
 CONFIG_ADFS_FS=m
 CONFIG_AFFS_FS=m
 CONFIG_HFS_FS=m
-- 
1.6.4


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