LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v3 0/4] Consolidate sdhci pltfm & OF drivers and get them self registered
From: Grant Likely @ 2011-05-27  7:26 UTC (permalink / raw)
  To: Shawn Guo
  Cc: sameo, Arnd Bergmann, patches, devicetree-discuss, linux-mmc,
	Saeed Bishara, Xiaobo Xie, kernel, Mike Rapoport, Olof Johansson,
	Chris Ball, linuxppc-dev, Albert Herranz, linux-arm-kernel
In-Reply-To: <1306321314-2493-1-git-send-email-shawn.guo@linaro.org>

On Wed, May 25, 2011 at 07:01:50PM +0800, Shawn Guo wrote:
> Here are what the patch set does.
> 
> * Remove .probe and .remove hooks from sdhci-pltfm.c and make it be
>   a pure common helper function providers.
> * Add .probe and .remove hooks for sdhci pltfm drivers sdhci-cns3xxx,
>   sdhci-dove, sdhci-tegra, and sdhci-esdhc-imx to make them self
>   registered with calling helper functions created above.
> * Migrate the use of sdhci_of_host and sdhci_of_data to
>   sdhci_pltfm_host and sdhci_pltfm_data, so that OF version host and
>   data structure works can be saved, and pltfm version works for both
>   cases.
> * Add OF common helper stuff into sdhci-pltfm.c, and make OF version
>   sdhci drivers sdhci-of-esdhc and sdhci-of-hlwd become self
>   registered as well, so that sdhci-of-core.c and sdhci-of.h can be
>   removed.
> * Eliminate include/linux/mmc/sdhci-pltfm.h with moving stuff into
>   drivers/mmc/host/sdhci-pltfm.h.
> 
> And the benefits we gain from the changes are:
> 
> * Get the sdhci device driver follow the Linux trend that driver
>   makes the registration by its own.
> * sdhci-pltfm.c becomes simple and clean as it only has common helper
>   stuff there now.
> * All sdhci device specific things are going back its own driver.
> * The dt and non-dt drivers are consolidated to use the same pair of
>   .probe and .remove hooks.

Hey Chris,

Any chance we can get this series into $NEXT_KERNEL?

Thanks,
g.

> 
> Changes since v2:
> * Drop imx mpc esdhc consolidation
> * Fix checkpatch errors
> * Add sdhci-of-core.c copyright into sdhci-pltfm.c
> 
> Changes since v1:
> * Rebase on cjb's mmc-next tree
> * Introduce helper function pair sdhci_pltfm_register and
>   sdhci_pltfm_unregister
> * Eliminate variable 'scratch' in .remove hook to make the code
>   look simple
> * Return ERR_PTR in sdhci_pltfm_init and use IS_ERR/PTR_ERR to check
>   return value in .probe hooks
> * Correct MODULE_AUTHOR statement
> * Split esdhc conlidation patch to ease reviewing
> 
> Shawn Guo (4):
>       mmc: sdhci: make sdhci-pltfm device drivers self registered
>       mmc: sdhci: eliminate sdhci_of_host and sdhci_of_data
>       mmc: sdhci: make sdhci-of device drivers self registered
>       mmc: sdhci: merge two sdhci-pltfm.h into one
> 
>  drivers/mmc/host/Kconfig           |   47 +++----
>  drivers/mmc/host/Makefile          |   18 +--
>  drivers/mmc/host/sdhci-cns3xxx.c   |   43 ++++++-
>  drivers/mmc/host/sdhci-dove.c      |   42 ++++++-
>  drivers/mmc/host/sdhci-esdhc-imx.c |  114 +++++++++++-----
>  drivers/mmc/host/sdhci-of-core.c   |  250 ---------------------------------
>  drivers/mmc/host/sdhci-of-esdhc.c  |   85 +++++++++---
>  drivers/mmc/host/sdhci-of-hlwd.c   |   66 ++++++++--
>  drivers/mmc/host/sdhci-of.h        |   42 ------
>  drivers/mmc/host/sdhci-pltfm.c     |  266 ++++++++++++++++++++----------------
>  drivers/mmc/host/sdhci-pltfm.h     |   39 +++++-
>  drivers/mmc/host/sdhci-tegra.c     |  116 +++++++++++-----
>  include/linux/mmc/sdhci-pltfm.h    |   35 -----
>  13 files changed, 578 insertions(+), 585 deletions(-)
> 
> Regards,
> Shawn
> 

^ permalink raw reply

* Re: Linuxppc-dev Digest, Vol 81, Issue 140
From: Muhammad Waseem @ 2011-05-27  7:26 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <mailman.1.1306461602.19013.linuxppc-dev@lists.ozlabs.org>

[-- Attachment #1: Type: text/plain, Size: 511 bytes --]

I have developed a simple polling based serial device driver for PC's serial
port (COM1: 0x3F8) which works fine. Now I want to implement the same on
UART # 1 of PPC440EPx (Sequoia board).

By changing the base address 0x3F8 to UART# 1 base address (0xEF600400) in
Sequoia it does not work and return all the registers contents
from 0xEF600400 to 0xEF600407 as 0xFF.

Whereas existing ttyS1 driver works for UART# 1.

How can I access the UART# 1 registers in a custom serial driver under
kernel space.

Waseem

[-- Attachment #2: Type: text/html, Size: 667 bytes --]

^ permalink raw reply

* [git pull] Please pull powerpc.git merge branch
From: Benjamin Herrenschmidt @ 2011-05-27  6:55 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linuxppc-dev list, Andrew Morton, Linux Kernel list

Hi Linus !

Here's the 3 patches Kumar was complaining I forgot to pull :-)

Two are pretty old patches related to FSL RapidIO stuff, and
one is a bug fix.

Cheers,
Ben.

The following changes since commit dc7acbb2518f250050179c8581a972df3b6a24f1:

  Merge branch 'upstream/tidy-xen-mmu-2.6.39' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen (2011-05-26 19:01:15 -0700)

are available in the git repository at:

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

Benjamin Herrenschmidt (1):
      Merge remote branch 'kumar/merge' into merge

Shaohui Xie (2):
      powerpc/fsl_rio: move machine_check handler
      powerpc/fsl_rio: Error interrupt handler for sRIO on MPC85xx

Shengzhou Liu (1):
      powerpc/fsl_lbc: Add workaround for ELBC-A001 erratum

 arch/powerpc/include/asm/fsl_lbc.h |    2 +
 arch/powerpc/include/asm/rio.h     |    5 ++
 arch/powerpc/kernel/traps.c        |   13 +++++
 arch/powerpc/sysdev/fsl_lbc.c      |    9 +++-
 arch/powerpc/sysdev/fsl_rio.c      |  100 ++++++++++++++++++++++++++++-------
 5 files changed, 107 insertions(+), 22 deletions(-)

^ permalink raw reply

* MPC8308 bursting question
From: Bruce_Leonard @ 2011-05-27  6:11 UTC (permalink / raw)
  To: linuxppc-dev

All,

This isn't really a Linux PPC question, but this is the smartest mailing 
list I know for asking PPC hardware questions, so here goes.

We're using an MPC8308 and want to use the DMA engine to move data in and 
out of an FPGA hanging on the local bus.  Our bandwidth/local bus burden 
calculations were done assuming that we could use bursting.  So I've setup 
a UPM to do single beat and burst reads/writes.  I've also configured my 
DMA TCD to use a data transfer size of 32-bytes when accessing the FPGA. 
The problem I'm having is I can't seem to get the UPM to ever trigger the 
burst write sequence using the DMA.  Single beat reads and writes work 
okay, but no bursting.  In fact, the only thing I've been able to find in 
the manual that causes a burst transaction is a cache line miss, which is 
wholly in the purview of the core and really does me no good.

Does anyone know of any way (short of issuing a run command to the UPM via 
MxMR) to force a burst transaction on the 8308?  Am I just being dumb and 
missing something totally fundamental?

Thanks.

Bruce

^ permalink raw reply

* [PATCH] drivers/misc: add Kbuild header file entry for Freescale hypervisor management driver
From: Timur Tabi @ 2011-05-26 22:55 UTC (permalink / raw)
  To: kumar.gala, akpm, linuxppc-dev, linux-kernel

fsl_hypervisor.h includes an ioctl interface, so it should be made available
via "make headers_install".

Signed-off-by: Timur Tabi <timur@freescale.com>
---

This adds one change that I forgot to include in my previous patch,
"drivers/misc: introduce Freescale hypervisor management driver".

Kumar, if at all possible, please squash this patch into that one.

 include/linux/Kbuild |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 75cf611..68c341a 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -134,6 +134,7 @@ header-y += firewire-cdev.h
 header-y += firewire-constants.h
 header-y += flat.h
 header-y += fs.h
+header-y += fsl_hypervisor.h
 header-y += fuse.h
 header-y += futex.h
 header-y += gameport.h
-- 
1.7.3.4

^ permalink raw reply related

* Re: [git pull] Please pull powerpc.git merge branch
From: Benjamin Herrenschmidt @ 2011-05-26 22:20 UTC (permalink / raw)
  To: Kumar Gala
  Cc: linuxppc-dev list, Andrew Morton, Linus Torvalds,
	Linux Kernel list
In-Reply-To: <C1E4ECF7-17CD-4A32-941D-FE53137F94EC@kernel.crashing.org>

On Thu, 2011-05-26 at 09:02 -0500, Kumar Gala wrote:
> Ben,
> 
> Did you ignore my pull request with a bug fix and two long standing
> RIO patches?

I suppose I did ... oops :-)

I'll send that today.

Cheers,
Ben.

^ permalink raw reply

* Re: [PATCH v2 1/2] powerpc: document the FSL MPIC message register binding
From: Scott Wood @ 2011-05-26 20:06 UTC (permalink / raw)
  To: Meador Inge
  Cc: openmcapi-dev, Hollis Blanchard, devicetree-discuss, linuxppc-dev
In-Reply-To: <1305909399-26969-2-git-send-email-meador_inge@mentor.com>

On Fri, 20 May 2011 11:36:38 -0500
Meador Inge <meador_inge@mentor.com> wrote:

> This binding documents how the message register blocks found in some FSL
> MPIC implementations shall be represented in a device tree.
> 
> Signed-off-by: Meador Inge <meador_inge@mentor.com>
> Cc: Hollis Blanchard <hollis_blanchard@mentor.com>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>  .../devicetree/bindings/powerpc/fsl/mpic-msgr.txt  |   62 ++++++++++++++++++++
>  1 files changed, 62 insertions(+), 0 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/powerpc/fsl/mpic-msgr.txt
> 
> diff --git a/Documentation/devicetree/bindings/powerpc/fsl/mpic-msgr.txt b/Documentation/devicetree/bindings/powerpc/fsl/mpic-msgr.txt
> new file mode 100644
> index 0000000..385dba6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/powerpc/fsl/mpic-msgr.txt
> @@ -0,0 +1,62 @@
> +* FSL MPIC Message Registers
> +
> +This binding specifies what properties must be available in the device tree
> +representation of the message register groups found in some FSL MPIC
> +implementations.
> +
> +Required properties:
> +
> +    - compatible: Specifies the compatibility list for the message register
> +      block.  The type shall be <string> and the value shall be of the form
> +      "fsl,mpic-v<version>-msgr", where <version> is the version number of
> +      the MPIC containing the message registers.
> +
> +    - reg: Specifies the base physical address(s) and size(s) of the
> +      message register block's addressable register space.  The type shall be
> +      <prop-encoded-array>.
> +
> +    - interrupts: Specifies a list of interrupt source and level-sense pairs.
> +      The type shall be <prop-encoded-array>.  The length shall be equal to
> +      the number of bits set in the 'msg-receive-mask' property value.

Oh, just noticed -- mismatch between msg-receive-mask here...

> +
> +Optional properties:
> +
> +    - mpic-msgr-receive-mask: Specifies what registers in the containing block
> +      are allowed to receive interrupts.  The value is a bit mask where a set
> +      bit at bit 'n' indicates that message register 'n' can receive interrupts.
> +      The type shall be <prop-encoded-array>.  If not present, then all of
> +      the message registers in the block are available.

...and mpic-msgr-receive-mask here.

Might want to just say "equal to the number of registers that are
available for receiving interrupts", to more clearly apply to the case where
mpic-msgr-receive-mask is missing.

-Scott

^ permalink raw reply

* Re: [PATCH v2 1/2] powerpc: document the FSL MPIC message register binding
From: Scott Wood @ 2011-05-26 20:03 UTC (permalink / raw)
  To: Meador Inge
  Cc: openmcapi-dev, Hollis Blanchard, devicetree-discuss, linuxppc-dev
In-Reply-To: <1305909399-26969-2-git-send-email-meador_inge@mentor.com>

On Fri, 20 May 2011 11:36:38 -0500
Meador Inge <meador_inge@mentor.com> wrote:

> This binding documents how the message register blocks found in some FSL
> MPIC implementations shall be represented in a device tree.
> 
> Signed-off-by: Meador Inge <meador_inge@mentor.com>
> Cc: Hollis Blanchard <hollis_blanchard@mentor.com>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Acked-by: Scott Wood <scottwood@freescale.com>

> ---
>  .../devicetree/bindings/powerpc/fsl/mpic-msgr.txt  |   62 ++++++++++++++++++++
>  1 files changed, 62 insertions(+), 0 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/powerpc/fsl/mpic-msgr.txt
> 
> diff --git a/Documentation/devicetree/bindings/powerpc/fsl/mpic-msgr.txt b/Documentation/devicetree/bindings/powerpc/fsl/mpic-msgr.txt
> new file mode 100644
> index 0000000..385dba6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/powerpc/fsl/mpic-msgr.txt
> @@ -0,0 +1,62 @@
> +* FSL MPIC Message Registers
> +
> +This binding specifies what properties must be available in the device tree
> +representation of the message register groups found in some FSL MPIC
> +implementations.
> +
> +Required properties:
> +
> +    - compatible: Specifies the compatibility list for the message register
> +      block.  The type shall be <string> and the value shall be of the form
> +      "fsl,mpic-v<version>-msgr", where <version> is the version number of
> +      the MPIC containing the message registers.
> +
> +    - reg: Specifies the base physical address(s) and size(s) of the
> +      message register block's addressable register space.  The type shall be
> +      <prop-encoded-array>.
> +
> +    - interrupts: Specifies a list of interrupt source and level-sense pairs.
> +      The type shall be <prop-encoded-array>.  The length shall be equal to
> +      the number of bits set in the 'msg-receive-mask' property value.
> +
> +Optional properties:
> +
> +    - mpic-msgr-receive-mask: Specifies what registers in the containing block
> +      are allowed to receive interrupts.  The value is a bit mask where a set
> +      bit at bit 'n' indicates that message register 'n' can receive interrupts.
> +      The type shall be <prop-encoded-array>.  If not present, then all of
> +      the message registers in the block are available.
> +
> +Aliases:
> +
> +    An alias should be created for every message register block.  They are not
> +    required, though.  However, are particular implementation of this binding
> +    may require aliases to be present.  Aliases are of the form
> +    'mpic-msgr-block<n>', where <n> is an integer specifying the block's number.
> +    Numbers shall start at 0.
> +
> +Example:
> +
> +	aliases {
> +		mpic-msgr-block0 = &mpic_msgr_block0;
> +		mpic-msgr-block1 = &mpic_msgr_block1;
> +	};
> +
> +	mpic_msgr_block0: mpic-msgr-block@41400 {
> +		compatible = "fsl,mpic-v3.1-msgr";
> +		reg = <0x41400 0x200>;
> +		// Message registers 0 and 2 in this block can receive interrupts on
> +		// sources 0xb0 and 0xb2, respectively.
> +		interrupts = <0xb0 2 0xb2 2>;
> +		mpic-msgr-receive-mask = <0x5>;
> +	};
> +
> +	mpic_msgr_block1: mpic-msgr-block@42400 {
> +		compatible = "fsl,mpic-v3.1-msgr";
> +		reg = <0x42400 0x200>;
> +		// Message registers 0 and 2 in this block can receive interrupts on
> +		// sources 0xb4 and 0xb6, respectively.
> +		interrupts = <0xb4 2 0xb6 2>;
> +		mpic-msgr-receive-mask = <0x5>;
> +	};
> +

^ permalink raw reply

* [PATCH v8] powerpc: Force page alignment for initrd reserved memory
From: Dave Carroll @ 2011-05-26 16:53 UTC (permalink / raw)
  To: Milton Miller; +Cc: Dave Carroll, LPPC, LKML
In-Reply-To: <initrd-align-v7-reply@mdm.bga.com>

From: Dave Carroll <dcarroll@astekcorp.com>

When using 64K pages with a separate cpio rootfs, U-Boot will align
the rootfs on a 4K page boundary. When the memory is reserved, and
subsequent early memblock_alloc is called, it will allocate memory
between the 64K page alignment and reserved memory. When the reserved
memory is subsequently freed, it is done so by pages, causing the
early memblock_alloc requests to be re-used, which in my case, caused
the device-tree to be clobbered.

This patch forces the reserved memory for initrd to be kernel page
aligned, and will move the device tree if it overlaps with the range
extension of initrd. This patch will also consolidate the identical
function free_initrd_mem() from mm/init_32.c, init_64.c to mm/mem.c,
and adds the same range extension when freeing initrd. free_initrd_mem()
is also moved to the __init section.

Many thanks to Milton Miller for his input on this patch.

Signed-off-by: Dave Carroll <dcarroll@astekcorp.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/powerpc/kernel/prom.c |   23 ++++++++++++++++++++---
 arch/powerpc/mm/init_32.c  |   15 ---------------
 arch/powerpc/mm/init_64.c  |   14 --------------
 arch/powerpc/mm/mem.c      |   19 +++++++++++++++++++
 4 files changed, 39 insertions(+), 32 deletions(-)

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 48aeb55..fba012a 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -82,11 +82,25 @@ static int __init early_parse_mem(char *p)
 }
 early_param("mem", early_parse_mem);
 
+/*
+ * overlaps_initrd - check for overlap with page aligned extension of
+ * initrd.
+ */
+static inline int overlaps_initrd(unsigned long start, unsigned long size)
+{
+	if (!initrd_start)
+		return 0;
+
+	return	(start + size) > _ALIGN_DOWN(initrd_start, PAGE_SIZE) &&
+			start <= _ALIGN_UP(initrd_end, PAGE_SIZE);
+}
+
 /**
  * move_device_tree - move tree to an unused area, if needed.
  *
  * The device tree may be allocated beyond our memory limit, or inside the
- * crash kernel region for kdump. If so, move it out of the way.
+ * crash kernel region for kdump, or within the page aligned range of initrd.
+ * If so, move it out of the way.
  */
 static void __init move_device_tree(void)
 {
@@ -99,7 +113,8 @@ static void __init move_device_tree(void)
 	size = be32_to_cpu(initial_boot_params->totalsize);
 
 	if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) ||
-			overlaps_crashkernel(start, size)) {
+			overlaps_crashkernel(start, size) ||
+			overlaps_initrd(start, size)) {
 		p = __va(memblock_alloc(size, PAGE_SIZE));
 		memcpy(p, initial_boot_params, size);
 		initial_boot_params = (struct boot_param_header *)p;
@@ -555,7 +570,9 @@ static void __init early_reserve_mem(void)
 #ifdef CONFIG_BLK_DEV_INITRD
 	/* then reserve the initrd, if any */
 	if (initrd_start && (initrd_end > initrd_start))
-		memblock_reserve(__pa(initrd_start), initrd_end - initrd_start);
+		memblock_reserve(_ALIGN_DOWN(__pa(initrd_start), PAGE_SIZE),
+			_ALIGN_UP(initrd_end, PAGE_SIZE) -
+			_ALIGN_DOWN(initrd_start, PAGE_SIZE));
 #endif /* CONFIG_BLK_DEV_INITRD */
 
 #ifdef CONFIG_PPC32
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index d65b591..5de0f25 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -223,21 +223,6 @@ void free_initmem(void)
 #undef FREESEC
 }
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-	if (start < end)
-		printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
-	for (; start < end; start += PAGE_SIZE) {
-		ClearPageReserved(virt_to_page(start));
-		init_page_count(virt_to_page(start));
-		free_page(start);
-		totalram_pages++;
-	}
-}
-#endif
-
-
 #ifdef CONFIG_8xx /* No 8xx specific .c file to put that in ... */
 void setup_initial_memory_limit(phys_addr_t first_memblock_base,
 				phys_addr_t first_memblock_size)
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index 6374b21..f6dbb4c 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -99,20 +99,6 @@ void free_initmem(void)
 		((unsigned long)__init_end - (unsigned long)__init_begin) >> 10);
 }
 
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-	if (start < end)
-		printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
-	for (; start < end; start += PAGE_SIZE) {
-		ClearPageReserved(virt_to_page(start));
-		init_page_count(virt_to_page(start));
-		free_page(start);
-		totalram_pages++;
-	}
-}
-#endif
-
 static void pgd_ctor(void *addr)
 {
 	memset(addr, 0, PGD_TABLE_SIZE);
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 57e545b..29d4dde 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -382,6 +382,25 @@ void __init mem_init(void)
 	mem_init_done = 1;
 }
 
+#ifdef CONFIG_BLK_DEV_INITRD
+void __init free_initrd_mem(unsigned long start, unsigned long end)
+{
+	if (start >= end)
+		return;
+
+	start = _ALIGN_DOWN(start, PAGE_SIZE);
+	end = _ALIGN_UP(end, PAGE_SIZE);
+	pr_info("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
+
+	for (; start < end; start += PAGE_SIZE) {
+		ClearPageReserved(virt_to_page(start));
+		init_page_count(virt_to_page(start));
+		free_page(start);
+		totalram_pages++;
+	}
+}
+#endif
+
 /*
  * This is called when a page has been modified by the kernel.
  * It just marks the page as not i-cache clean.  We do the i-cache
-- 
1.7.4

^ permalink raw reply related

* Re: [PATCH v2 0/2] powerpc: define and implement MPIC message register support
From: Meador Inge @ 2011-05-26 14:21 UTC (permalink / raw)
  To: linuxppc-dev@lists.ozlabs.org; +Cc: Scott Wood
In-Reply-To: <BANLkTikvDEG4DSvVMtxa8=i=NV=o=DQLXA@mail.gmail.com>


Scott, I addressed your feedback in this patch set:

   * 1/2 - http://lists.ozlabs.org/pipermail/linuxppc-dev/2011-May/090405.html
   * 2/2 - http://lists.ozlabs.org/pipermail/linuxppc-dev/2011-May/090406.html

Ben, my Cc for you didn't go through the first time.


> This patch set defines a binding for FSL MPIC message registers and implements
> an API for accessing those message registers.  Testing was done on a MPC8572DS
> in an Linux-Linux AMP setup using OpenMCAPI (www.openmcapi.org) to communicate
> between OS instances.  The message register API is used by the OpenMCAPI shared
> memory driver to send notifications between cores.
> 
> * v2 - Incorporate feedback from Scott Wood
>   * Make binding less implementation specific.
>   * Add 'mpic-' prefix to message register node properties and aliases.
>   * Remove 'interrupt-parent' from binding.
>   * Fixed some example bugs with receive masks.
> 
> Signed-off-by: Meador Inge <meador_inge@mentor.com>
> Cc: Hollis Blanchard <hollis_blanchard@mentor.com>
> 
> Meador Inge (2):
>  powerpc: document the FSL MPIC message register binding
>  powerpc: add support for MPIC message register API
> 
>  .../devicetree/bindings/powerpc/fsl/mpic-msgr.txt  |   62 +++++
>  arch/powerpc/include/asm/mpic_msgr.h               |   35 +++
>  arch/powerpc/platforms/Kconfig                     |    8 +
>  arch/powerpc/sysdev/Makefile                       |    3 +-
>  arch/powerpc/sysdev/mpic_msgr.c                    |  279 ++++++++++++++++++++
>  5 files changed, 386 insertions(+), 1 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/powerpc/fsl/mpic-msgr.txt
>  create mode 100644 arch/powerpc/include/asm/mpic_msgr.h
>  create mode 100644 arch/powerpc/sysdev/mpic_msgr.c
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev


-- 
Meador Inge
CodeSourcery / Mentor Embedded
http://www.mentor.com/embedded-software

^ permalink raw reply

* Re: [git pull] Please pull powerpc.git merge branch
From: Kumar Gala @ 2011-05-26 14:02 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: linuxppc-dev list, Andrew Morton, Linus Torvalds,
	Linux Kernel list
In-Reply-To: <1306387374.7481.451.camel@pasglop>


On May 26, 2011, at 12:22 AM, Benjamin Herrenschmidt wrote:

> Hi Linus !
>=20
> This is a bit more than I expected to send you that late in the merge
> window, but hopefully none of it should be problematic. A couple of
> patches were simply delayed due to misunderstandings as to which tree
> they should go through (4xx MSI and ftrace).
>=20
> There's a generic patch to linux/smp.h which removes some definitions
> that as far as we can tell aren't used anywhere anymore (we just =
removed
> the last use in powerpc in my previous pull request).
>=20
> The rest is either good enough bug fixes (in large part regressions),
> with a couple more cleanups from Milton on top of his big series that
> I merged earlier.
>=20
> Cheers,
> Ben.
>=20
> The following changes since commit =
3f5785ec31adcb7cafa9135087297a38d9698cf8:
>=20
>  Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 =
(2011-05-25 17:00:17 -0700)
>=20
> are available in the git repository at:
>=20
>  git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git =
..BRANCH.NOT.VERIFIED..
>=20
> Brian King (1):
>      powerpc/pseries: Update MAX_HCALL_OPCODE to reflect page =
coalescing
>=20
> Eric B Munson (1):
>      powerpc/oprofile: Handle events that raise an exception without =
overflowing
>=20
> Ian Munsie (1):
>      powerpc/ftrace: Implement raw syscall tracepoints on PowerPC
>=20
> Milton Miller (8):
>      Remove unused MSG_ flags in linux/smp.h
>      powerpc/cell: Use common smp ipi actions
>      powerpc/cell: Rename ipi functions to match current abstractions
>      powerpc/irq: Remove stale and misleading comment
>      powerpc/irq: Always free duplicate IRQ_LEGACY hosts
>      powerpc/irq: Check desc in handle_one_irq and expand =
generic_handle_irq
>      powerpc/irq: Protect irq_radix_revmap_lookup against =
irq_free_virt
>      powerpc: Fix irq_free_virt by adjusting bounds before loop
>=20
> Rupjyoti Sarmah (1):
>      powerpc/4xx: Adding PCIe MSI support

Ben,

Did you ignore my pull request with a bug fix and two long standing RIO =
patches?

- k=

^ permalink raw reply

* Re: [PATCH 6/8] powerpc 8xx: cascade eoi will be performed by generic_handle_irq handler
From: Milton Miller @ 2011-05-26 11:19 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1306380753.7481.350.camel@pasglop>

On Thu, 26 May 2011 about 13:32:33 +1000, Benjamin Herrenschmidt wrote:
> > On Wed, 2011-05-25 at 01:34 -0500, Milton Miller wrote:
> > > The 8xx cpm_cascade was calling irq_eoi for the cascaded irq,
> > > but that will already have been called by the handle_fasteoi_irq
> > > that generic_handle_irq will call.  The handler is set in
> > > arch/powerpc/sysdev/cpm1.c by the host map routine.
> > 
> > No it won't unless I'm missing something. The flow handler
> > (handle_fasteoi_irq) is going to be replaced by the chained handler when
> > mpc8xx_pics_init() calls irq_set_chained_handle(irq, cpm_cascade) no ?
> > 
> > Cheers,
> > Ben.

No.   We set the chained handler on the top level irq (on the irq
to the primary irq controller).  The handler is set to this 8xx_cascade
function.  We don't change the handler on the subordnate irq that
is invoked via generic_handle_irq in this function.

Or that is how I understand things to work, and this makes the 8xx
code match the current 8xxx cpm1 cascade handler.

Of course, it would be good for someone with hardware to confirm
that it works with the patch (or even put a printk or counter in the
handler if that would not cause printk recursion -- don't do it on
your console).

milton

> > 
> > > Signed-off-by: Milton Miller <miltonm@bga.com>
> > > 
> > > Index: work.git/arch/powerpc/platforms/8xx/m8xx_setup.c
> > > ===================================================================
> > > --- work.git.orig/arch/powerpc/platforms/8xx/m8xx_setup.c	2011-05-18 22:50:38.983498572 -0500
> > > +++ work.git/arch/powerpc/platforms/8xx/m8xx_setup.c	2011-05-18 22:52:48.920532258 -0500
> > > @@ -221,15 +221,9 @@ static void cpm_cascade(unsigned int irq
> > >  	struct irq_chip *chip;
> > >  	int cascade_irq;
> > >  
> > > -	if ((cascade_irq = cpm_get_irq()) >= 0) {
> > > -		struct irq_desc *cdesc = irq_to_desc(cascade_irq);
> > > -
> > > +	if ((cascade_irq = cpm_get_irq()) >= 0)
> > >  		generic_handle_irq(cascade_irq);
> > >  
> > > -		chip = irq_desc_get_chip(cdesc);
> > > -		chip->irq_eoi(&cdesc->irq_data);
> > > -	}
> > > -
> > >  	chip = irq_desc_get_chip(desc);
> > >  	chip->irq_eoi(&desc->irq_data);
> > >  }
> > 
> > 

^ permalink raw reply

* Re: [PATCH v7] powerpc: Force page alignment for initrd reserved memory
From: Milton Miller @ 2011-05-26 11:18 UTC (permalink / raw)
  To: Dave Carroll; +Cc: Dave Carroll, LPPC, LKML
In-Reply-To: <1306377162-7898-1-git-send-email-dcarroll@astekcorp.com>

On Wed, 25 May 2011 about 20:32:42 -0600, Dave Carroll wrote:

> When using 64K pages with a separate cpio rootfs, U-Boot will align
> the rootfs on a 4K page boundary. When the memory is reserved, and
> subsequent early memblock_alloc is called, it will allocate memory
> between the 64K page alignment and reserved memory. When the reserved
> memory is subsequently freed, it is done so by pages, causing the
> early memblock_alloc requests to be re-used, which in my case, caused
> the device-tree to be clobbered.
> 
> This patch forces the reserved memory for initrd to be kernel page
> aligned, and will move the device tree if it overlaps with the range
> extension of initrd. This patch will also consolidate the identical
> function free_initrd_mem() from mm/init_32.c, init_64.c to mm/mem.c,
> and adds the same range extension when freeing initrd.
> 
> Many thanks to Milton Miller for his input on this patch.
> 

Thanks for the mailer update, it applied cleanly.

> Signed-off-by: Dave Carroll <dcarroll@astekcorp.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> 
> ---
>  * The previous patch [v6] was the wrong copy, sorry ...
>  
>  arch/powerpc/kernel/prom.c |   21 ++++++++++++++++++---
>  arch/powerpc/mm/init_32.c  |   15 ---------------
>  arch/powerpc/mm/init_64.c  |   13 -------------
>  arch/powerpc/mm/mem.c      |   19 +++++++++++++++++++
>  4 files changed, 37 insertions(+), 31 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
> index 48aeb55..86966a0 100644
> --- a/arch/powerpc/kernel/prom.c
> +++ b/arch/powerpc/kernel/prom.c
> @@ -81,12 +81,24 @@ static int __init early_parse_mem(char *p)
>  	return 0;
>  }
>  early_param("mem", early_parse_mem);
> +/**
> + * overlaps_initrd - check for overlap with page aligned extension of
> + * initrd.
> + */

1) Please place a blank line after the above early_param before
the comment block.

2) /** says it is kernel doc format, so you need to follow the rules.
The description should fit on one line (I might say: ... with the initrd,
page aligned.)  and you have to document the parameters.  (Or just make
it a simple comment block by removing the second *)

> +static inline int overlaps_initrd(unsigned long start, unsigned long size)
> +{
> +	if (!initrd_start)
> +		return 0;
>  
> +	return	(start + size) > _ALIGN_DOWN(initrd_start, PAGE_SIZE) &&
> +			start <= _ALIGN_UP(initrd_end, PAGE_SIZE);
> +}
>  /**

need a blank line after the function before this comment block too.

>   * move_device_tree - move tree to an unused area, if needed.
>   *
>   * The device tree may be allocated beyond our memory limit, or inside the
> - * crash kernel region for kdump. If so, move it out of the way.
> + * crash kernel region for kdump, or within the page aligned range of initrd.
> + * If so, move it out of the way.

of the initrd.

>   */
>  static void __init move_device_tree(void)
>  {
> @@ -99,7 +111,8 @@ static void __init move_device_tree(void)
>  	size = be32_to_cpu(initial_boot_params->totalsize);
>  
>  	if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) ||
> -			overlaps_crashkernel(start, size)) {
> +			overlaps_crashkernel(start, size) ||
> +			overlaps_initrd(start, size)) {
>  		p = __va(memblock_alloc(size, PAGE_SIZE));
>  		memcpy(p, initial_boot_params, size);
>  		initial_boot_params = (struct boot_param_header *)p;
> @@ -555,7 +568,9 @@ static void __init early_reserve_mem(void)
>  #ifdef CONFIG_BLK_DEV_INITRD
>  	/* then reserve the initrd, if any */
>  	if (initrd_start && (initrd_end > initrd_start))
> -		memblock_reserve(__pa(initrd_start), initrd_end - initrd_start);
> +		memblock_reserve(_ALIGN_DOWN(__pa(initrd_start), PAGE_SIZE),
> +			_ALIGN_UP(initrd_end, PAGE_SIZE) -
> +			_ALIGN_DOWN(initrd_start, PAGE_SIZE));
>  #endif /* CONFIG_BLK_DEV_INITRD */
>  
>  #ifdef CONFIG_PPC32
> diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
> index d65b591..5de0f25 100644
> --- a/arch/powerpc/mm/init_32.c
> +++ b/arch/powerpc/mm/init_32.c
> @@ -223,21 +223,6 @@ void free_initmem(void)
>  #undef FREESEC
>  }
>  
> -#ifdef CONFIG_BLK_DEV_INITRD
> -void free_initrd_mem(unsigned long start, unsigned long end)
> -{
> -	if (start < end)
> -		printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
> -	for (; start < end; start += PAGE_SIZE) {
> -		ClearPageReserved(virt_to_page(start));
> -		init_page_count(virt_to_page(start));
> -		free_page(start);
> -		totalram_pages++;
> -	}
> -}
> -#endif
> -
> -
>  #ifdef CONFIG_8xx /* No 8xx specific .c file to put that in ... */
>  void setup_initial_memory_limit(phys_addr_t first_memblock_base,
>  				phys_addr_t first_memblock_size)
> diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
> index 6374b21..7591a97 100644
> --- a/arch/powerpc/mm/init_64.c
> +++ b/arch/powerpc/mm/init_64.c
> @@ -99,19 +99,6 @@ void free_initmem(void)
>  		((unsigned long)__init_end - (unsigned long)__init_begin) >> 10);
>  }
>  
> -#ifdef CONFIG_BLK_DEV_INITRD
> -void free_initrd_mem(unsigned long start, unsigned long end)
> -{
> -	if (start < end)
> -		printk ("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
> -	for (; start < end; start += PAGE_SIZE) {
> -		ClearPageReserved(virt_to_page(start));
> -		init_page_count(virt_to_page(start));
> -		free_page(start);
> -		totalram_pages++;
> -	}
> -}
> -#endif
>  
>  static void pgd_ctor(void *addr)
>  {
> diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
> index 57e545b..f60e44e 100644
> --- a/arch/powerpc/mm/mem.c
> +++ b/arch/powerpc/mm/mem.c
> @@ -160,6 +160,25 @@ walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages,
>  }
>  EXPORT_SYMBOL_GPL(walk_system_ram_range);
>  
> +#ifdef CONFIG_BLK_DEV_INITRD
> +void free_initrd_mem(unsigned long start, unsigned long end)
> +{
> +	if (start >= end)
> +		return;
> +
> +	start = _ALIGN_DOWN(start, PAGE_SIZE);
> +	end = _ALIGN_UP(end, PAGE_SIZE);
> +	printk(KERN_INFO "Freeing initrd memory: %ldk freed\n",
> +			(end - start) >> 10);

If you use pr_info then the above again fits on one line. 
(this is what triggered my formatting and whitespace review).

Although I would then add a blank line before the loop for readability.

> +	for (; start < end; start += PAGE_SIZE) {
> +		ClearPageReserved(virt_to_page(start));
> +		init_page_count(virt_to_page(start));
> +		free_page(start);
> +		totalram_pages++;
> +	}
> +}
> +#endif
> +

Nit: Looking at the whole file I would put this after mem_init
because that puts it next to the other code that sets page counts,
clears PageReerved, and hands pages to page_alloc.


>  /*
>   * Initialize the bootmem system and give it all the memory we
>   * have available.  If we are using highmem, we only put the
> -- 
> 1.7.4
> 

milton

^ permalink raw reply

* [PATCH] powerpc: Avoid extra indirect function call in sending IPIs
From: Paul Mackerras @ 2011-05-26  9:34 UTC (permalink / raw)
  To: linuxppc-dev

On many platforms (including pSeries), smp_ops->message_pass is always
smp_muxed_ipi_message_pass.  This changes arch/powerpc/kernel/smp.c so
that if smp_ops->message_pass is NULL, it calls smp_muxed_ipi_message_pass
directly.

This means that a platform doesn't need to set both .message_pass and
.cause_ipi, only one of them.  It is a slight performance improvement
in that it gets rid of an indirect function call at the expense of a
predictable conditional branch.

Signed-off-by: Paul Mackerras <paulus@samba.org>
---
 arch/powerpc/kernel/smp.c             |   16 ++++++++++++----
 arch/powerpc/platforms/85xx/smp.c     |    2 +-
 arch/powerpc/platforms/iseries/smp.c  |    2 +-
 arch/powerpc/platforms/powermac/smp.c |    2 +-
 arch/powerpc/platforms/pseries/smp.c  |    2 +-
 arch/powerpc/platforms/wsp/smp.c      |    2 +-
 6 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 4a6f2ec..b50c577 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -238,15 +238,23 @@ irqreturn_t smp_ipi_demux(void)
 }
 #endif /* CONFIG_PPC_SMP_MUXED_IPI */
 
+static inline void do_message_pass(int cpu, int msg)
+{
+	if (smp_ops->message_pass)
+		smp_ops->message_pass(cpu, msg);
+	else
+		smp_muxed_ipi_message_pass(cpu, msg);
+}
+
 void smp_send_reschedule(int cpu)
 {
 	if (likely(smp_ops))
-		smp_ops->message_pass(cpu, PPC_MSG_RESCHEDULE);
+		do_message_pass(cpu, PPC_MSG_RESCHEDULE);
 }
 
 void arch_send_call_function_single_ipi(int cpu)
 {
-	smp_ops->message_pass(cpu, PPC_MSG_CALL_FUNC_SINGLE);
+	do_message_pass(cpu, PPC_MSG_CALL_FUNC_SINGLE);
 }
 
 void arch_send_call_function_ipi_mask(const struct cpumask *mask)
@@ -254,7 +262,7 @@ void arch_send_call_function_ipi_mask(const struct cpumask *mask)
 	unsigned int cpu;
 
 	for_each_cpu(cpu, mask)
-		smp_ops->message_pass(cpu, PPC_MSG_CALL_FUNCTION);
+		do_message_pass(cpu, PPC_MSG_CALL_FUNCTION);
 }
 
 #if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC)
@@ -268,7 +276,7 @@ void smp_send_debugger_break(void)
 
 	for_each_online_cpu(cpu)
 		if (cpu != me)
-			smp_ops->message_pass(cpu, PPC_MSG_DEBUGGER_BREAK);
+			do_message_pass(cpu, PPC_MSG_DEBUGGER_BREAK);
 }
 #endif
 
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c
index d6a93a1..8eef8d2 100644
--- a/arch/powerpc/platforms/85xx/smp.c
+++ b/arch/powerpc/platforms/85xx/smp.c
@@ -236,7 +236,7 @@ void __init mpc85xx_smp_init(void)
 	}
 
 	if (cpu_has_feature(CPU_FTR_DBELL)) {
-		smp_85xx_ops.message_pass = smp_muxed_ipi_message_pass;
+		/* .message_pass defaults to smp_muxed_ipi_message_pass */
 		smp_85xx_ops.cause_ipi = doorbell_cause_ipi;
 	}
 
diff --git a/arch/powerpc/platforms/iseries/smp.c b/arch/powerpc/platforms/iseries/smp.c
index e3265ad..2df48c2 100644
--- a/arch/powerpc/platforms/iseries/smp.c
+++ b/arch/powerpc/platforms/iseries/smp.c
@@ -75,7 +75,7 @@ static void __devinit smp_iSeries_setup_cpu(int nr)
 }
 
 static struct smp_ops_t iSeries_smp_ops = {
-	.message_pass = smp_muxed_ipi_message_pass,
+	.message_pass = NULL,	/* Use smp_muxed_ipi_message_pass */
 	.cause_ipi    = smp_iSeries_cause_ipi,
 	.probe        = smp_iSeries_probe,
 	.kick_cpu     = smp_iSeries_kick_cpu,
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index db092d7..d15fca3 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -447,7 +447,7 @@ void __init smp_psurge_give_timebase(void)
 
 /* PowerSurge-style Macs */
 struct smp_ops_t psurge_smp_ops = {
-	.message_pass	= smp_muxed_ipi_message_pass,
+	.message_pass	= NULL,	/* Use smp_muxed_ipi_message_pass */
 	.cause_ipi	= smp_psurge_cause_ipi,
 	.probe		= smp_psurge_probe,
 	.kick_cpu	= smp_psurge_kick_cpu,
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index fbffd7e..84dafd3 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -207,7 +207,7 @@ static struct smp_ops_t pSeries_mpic_smp_ops = {
 };
 
 static struct smp_ops_t pSeries_xics_smp_ops = {
-	.message_pass	= smp_muxed_ipi_message_pass,
+	.message_pass	= NULL,	/* Use smp_muxed_ipi_message_pass */
 	.cause_ipi	= NULL,	/* Filled at runtime by xics_smp_probe() */
 	.probe		= xics_smp_probe,
 	.kick_cpu	= smp_pSeries_kick_cpu,
diff --git a/arch/powerpc/platforms/wsp/smp.c b/arch/powerpc/platforms/wsp/smp.c
index 9d20fa9..71bd105 100644
--- a/arch/powerpc/platforms/wsp/smp.c
+++ b/arch/powerpc/platforms/wsp/smp.c
@@ -75,7 +75,7 @@ static int __init smp_a2_probe(void)
 }
 
 static struct smp_ops_t a2_smp_ops = {
-	.message_pass	= smp_muxed_ipi_message_pass,
+	.message_pass	= NULL,	/* Use smp_muxed_ipi_message_pass */
 	.cause_ipi	= doorbell_cause_ipi,
 	.probe		= smp_a2_probe,
 	.kick_cpu	= smp_a2_kick_cpu,
-- 
1.7.5.1

^ permalink raw reply related

* Re: [PATCH 3/5] v2 seccomp_filters: Enable ftrace-based system call filtering
From: Ingo Molnar @ 2011-05-26  9:15 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: linux-mips, linux-sh, Peter Zijlstra, Frederic Weisbecker,
	Heiko Carstens, Oleg Nesterov, David Howells, Paul Mackerras,
	Eric Paris, H. Peter Anvin, sparclinux, Jiri Slaby, linux-s390,
	Russell King, x86, James Morris, Linus Torvalds, Ingo Molnar,
	kees.cook, Serge E. Hallyn, Steven Rostedt, Martin Schwidefsky,
	linux-arm-kernel, Michal Marek, Michal Simek, Will Drewry,
	linuxppc-dev, linux-kernel, Ralf Baechle, Paul Mundt, Tejun Heo,
	linux390, Andrew Morton, agl, David S. Miller
In-Reply-To: <alpine.LFD.2.02.1105251836030.3078@ionos>


* Thomas Gleixner <tglx@linutronix.de> wrote:

> > If anything then that should tell you something that events and 
> > seccomp are not just casually related ...
> 
> They happen to have the hook at the same point in the source and 
> for pure coincidence it works because the problem to solve is 
> extremly simplistic. And that's why the diffstat is minimalistic, 
> but that does not prove anything.

Here are the diffstats of the various versions of this proposed 
security feature:

       bitmask (2009):  6 files changed,  194 insertions(+), 22 deletions(-)
 filter engine (2010): 18 files changed, 1100 insertions(+), 21 deletions(-)
 event filters (2011):  5 files changed,   82 insertions(+), 16 deletions(-)

The third variant, 'event filters', is actually the most 
sophisticated one of all and it is not simplistic at all.

The main reason why the diffstat is small is because it reuses over 
ten thousand lines of pre-existing kernel code intelligently. Are you 
interpreting that as some sort of failure of the patch? I think it's 
a very good thing.

To demonstrate the non-simplicity of the feature:

 - These security rules/filters can be sophisticated like:

   sys_close() rule protecting against the closing of 
   stdin/stdout/stderr:

                  "fd == 0 || fd == 1 || fd == 2"

   sys_ioperm() rule allowing port 0x80 access but nothing else:

                  "from != 128 || num != 1"

   sys_listen() rule limiting the max accept() backlog to 16 entries:

                  "backlog > 16"

   sys_mprotect(), sys_mmap[2](), sys_unmap() and sys_mremap() rule
   protecting the first 1 MB NULL pointer guard range:

                  "addr < 0x00100000"

   sys_setscheduler() rule protecting against the switch to 
   non-SCHED_OTHER scheduler policies:

                  "policy != 0"

   Most of these examples are finegrained access restrictions that 
   AFAIK are not possible with any of the LSM based security measures 
   that Linux offers today.

 - These security rules/filters can be safely used and installed by 
   unprivileged userspace, allowing arbitrary end user apps to define 
   their own, flexible security policies.

 - These security rules/filters get automatically inherited into child 
   tasks and child tasks cannot mess with them - they cannot even 
   query/observe that these filters *exist*.

 - These security rules/filters nest on each other in basically 
   arbitrary depth, giving us a working, implemented, stackable LSM
   concept.

 - These security rules/filters can be extended to arbitrary more 
   object lifetime events in the future, without changing the ABI.

 - These security rules/filters, unlike most LSM rules, can execute
   not just within hardirqs but also within deeply atomic contexts
   such as NMI contexts, putting far less restrictions on what can
   be security/access checked.

 - Access permission violations can be set up to generate events of
   the violations into a scalable ring-buffer, providing unprivileged
   security-auditing functionality to the managing task(s).

I'd call that anything but 'simplistic'.

Thanks,

	Ingo

^ permalink raw reply

* Re: [PATCH] Add support for pt7c4338 (rtc device) in rtc-ds1307 driver
From: Wolfram Sang @ 2011-05-26  9:10 UTC (permalink / raw)
  To: Priyanka Jain; +Cc: a.zummo, akpm, linuxppc-dev, rtc-linux, p_gortmaker
In-Reply-To: <1306393409-16153-1-git-send-email-Priyanka.Jain@freescale.com>

[-- Attachment #1: Type: text/plain, Size: 690 bytes --]

On Thu, May 26, 2011 at 12:33:29PM +0530, Priyanka Jain wrote:

> PT7C4338 chip is being manufactured by Pericom Technology Inc.
> It is a serial real-time clock which provides:
> 1)Low-power clock/calendar.
> 2)Programmable square-wave output.
> It has 56 bytes of nonvolatile RAM.
> Its register set is same as that of rtc device: DS1307.
> 
> Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>

So it is identical to ds1307? Then why not name your platform_device
simply 'ds1307'?

Regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply

* Re: [PATCH 3/5] v2 seccomp_filters: Enable ftrace-based system call filtering
From: Ingo Molnar @ 2011-05-26  8:43 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: linux-mips, linux-sh, Peter Zijlstra, Frederic Weisbecker,
	Heiko Carstens, Oleg Nesterov, David Howells, Paul Mackerras,
	Eric Paris, H. Peter Anvin, sparclinux, Jiri Slaby, linux-s390,
	Russell King, x86, James Morris, Linus Torvalds, Ingo Molnar,
	kees.cook, Serge E. Hallyn, Steven Rostedt, Martin Schwidefsky,
	linux-arm-kernel, Michal Marek, Michal Simek, Will Drewry,
	linuxppc-dev, linux-kernel, Ralf Baechle, Paul Mundt, Tejun Heo,
	linux390, Andrew Morton, agl, David S. Miller
In-Reply-To: <alpine.LFD.2.02.1105251836030.3078@ionos>


* Thomas Gleixner <tglx@linutronix.de> wrote:

> > > We do _NOT_ make any decision based on the trace point so 
> > > what's the "pre-existing" active role in the syscall entry 
> > > code?
> > 
> > The seccomp code we are discussing in this thread.
> 
> That's proposed code and has absolutely nothing to do with the 
> existing trace point semantics.

So because it's proposed code it does not exist?

If the feature is accepted (and given Linus's opinion it's not clear 
at all it's accepted in any form) then it's obviously a very 
legitimate technical concern whether we do:

	ret = seccomp_check_syscall_event(p1, p2, p3, p4, p5);
	if (ret)
		return -EACCES;

	... random code ...

	trace_syscall_event(p1, p2, p3, p4, p5);

Where seccomp_check_syscall_event() duplicates much of the machinery 
that is behind trace_syscall_event().

Or we do the more intelligent:

	ret = check_syscall_event(p1, p2, p3, p4, p5);
	if (ret)
		return -EACCES;

Where we have the happy side effects of:

  - less code at the call site

  - (a lot of!) shared infrastructure between the proposed seccomp 
    code and event filters.

  - we'd also be able to trace at security check boundaries - which
    has obvious bug analysis advantages.

In fact i do not see *any* advantages in keeping this needlessly 
bloaty and needlessly inconsistently sampled form of instrumentation:

	ret = seccomp_check_syscall_event(p1, p2, p3, p4, p5);
	if (ret)
		return -EACCES;

	... random code ...

	trace_syscall_event(p1, p2, p3, p4, p5);

Do you?

Thanks,

	Ingo

^ permalink raw reply

* Re: [PATCH 3/5] v2 seccomp_filters: Enable ftrace-based system call filtering
From: Ingo Molnar @ 2011-05-26  8:35 UTC (permalink / raw)
  To: Pavel Machek
  Cc: linux-mips, linux-sh, Peter Zijlstra, Frederic Weisbecker,
	Heiko Carstens, linux-kernel, David Howells, Paul Mackerras,
	Ralf Baechle, H. Peter Anvin, sparclinux, Jiri Slaby, linux-s390,
	Russell King, x86, James Morris, Ingo Molnar, kees.cook,
	Serge E. Hallyn, Peter Zijlstra, Steven Rostedt,
	Martin Schwidefsky, Thomas Gleixner, agl, linux-arm-kernel,
	Michal Marek, Michal Simek, Will Drewry, linuxppc-dev,
	Oleg Nesterov, Eric Paris, Paul Mundt, Tejun Heo, linux390,
	Andrew Morton, Linus Torvalds, David S. Miller
In-Reply-To: <20110526062752.GA14622@localhost.ucw.cz>


* Pavel Machek <pavel@ucw.cz> wrote:

>   On Mon 2011-05-16 10:36:05, James Morris wrote:
> > On Fri, 13 May 2011, Ingo Molnar wrote:
> > How do you reason about the behavior of the system as a whole?
> > 
> > 
> > > I argue that this is the LSM and audit subsystems designed right: in the long 
> > > run it could allow everything that LSM does at the moment - and so much more 
> > > ...
> > 
> > Now you're proposing a redesign of the security subsystem.  That's a 
> > significant undertaking.
> > 
> > In the meantime, we have a simple, well-defined enhancement to seccomp 
> > which will be very useful to current users in reducing their kernel attack 
> > surface.
> 
> Well, you can do the same with subterfugue, even without kernel 
> changes. But that's ptrace -- slow. (And it already shows that 
> syscall based filters are extremely tricky to configure).

Yes, if you use syscall based filters to implement access to 
underlying objects where the access methods do not capture essential 
lifetime events properly (such as files) they you'll quickly run into 
trouble achieving a secure solution.

But you can robustly use syscall filters to control the underlying 
primary *resource*: various pieces of kernel code with *negative* 
utility to the current app - which have no use to the app but pose 
risks in terms of potential exploits in them.

But you can use event filters to implement arbitrary security 
policies robustly.

For example file objects: if you generate the right events for a 
class of objects then you can control access to them very robustly.

It's not a surprise that this is what SELinux does primarily: it has 
lifetime event hooks at the inode object (and socket, packet, etc.) 
level and captures those access attempts and validates them against 
the permissions of that object, in light of the accessing task's 
credentials.

Exactly that can be done with Will's patch as well, if its potential 
scope of event-checking points is not stupidly limited to the syscall 
boundary alone ...

Thanks,

	Ingo

^ permalink raw reply

* RE: [rtc-linux] [PATCH] RTC driver(Linux) for PT7C4338 chip.
From: Jain Priyanka-B32167 @ 2011-05-26  7:11 UTC (permalink / raw)
  To: Andrew Morton
  Cc: a.zummo@towertech.it, linuxppc-dev@lists.ozlabs.org,
	rtc-linux@googlegroups.com, p_gortmaker@yahoo.com
In-Reply-To: <20110525165620.eeaa11ff.akpm@linux-foundation.org>

Hi Andrew Morton,

I have added the support for pt7c4338 in Dallas driver rtc-ds1307.c as sugg=
ested by Wolfram Sang
And send the patch "Add support for pt7c4338 (rtc device) in rtc-ds1307 dri=
ver" for the same which will supersede the previous patch.

Please let me know if anything else is required.

Thanks
Priyanka


> -----Original Message-----
> From: Andrew Morton [mailto:akpm@linux-foundation.org]
> Sent: Thursday, May 26, 2011 5:26 AM
> To: Jain Priyanka-B32167
> Cc: Wolfram Sang; rtc-linux@googlegroups.com; linuxppc-
> dev@lists.ozlabs.org; a.zummo@towertech.it; p_gortmaker@yahoo.com
> Subject: Re: [rtc-linux] [PATCH] RTC driver(Linux) for PT7C4338 chip.
>=20
> On Thu, 10 Mar 2011 11:06:27 +0000
> Jain Priyanka-B32167 <B32167@freescale.com> wrote:
>=20
> > Hi Wolfram,
> >
> >
> > > -----Original Message-----
> > > From: Wolfram Sang [mailto:w.sang@pengutronix.de]
> > > Sent: Thursday, March 10, 2011 2:24 PM
> > > To: Jain Priyanka-B32167
> > > Cc: rtc-linux@googlegroups.com; linuxppc-dev@lists.ozlabs.org;
> > > a.zummo@towertech.it; p_gortmaker@yahoo.com;
> > > akpm@linux-foundation.org
> > > Subject: Re: [rtc-linux] [PATCH] RTC driver(Linux) for PT7C4338 chip.
> > >
> > > Hi Priyanka,
> > >
> > > > Though register-set looks identical but features were different.
> > >
> > > Can you tell what exactly is different?
> > I will check both the devices data sheets again in detail and will get
> back on this.
> > >
> > > > And also manufacturer is different.
> > >
> > > That does not matter. If you look at ds_type, there are already
> > > different manufacturers. They will be correctly distinguished by
> > > i2c_device_id. The name of the driver itself is, well, just a name.
> > >
> > > > But still it might be possible that we can reuse ds1307.c with
> > > > some modification.
> > >
> > > I agree. The driver already supports some variants. Adding one more
> > > should not hurt. See 97f902b7be4dd6ba03c6aa8d3400783ed687ebd1 for an
> > > example which added ds3231 support.
> > >
> > > > But if I look at the drivers present in drivers/rtc folder. Most
> > > > of them looks similar but still there are different drivers for
> > > > different chips.
> > >
> > > Yes, it probably could be cleaned up if somebody had the
> time/hardware.
> > >
> > > > Please suggest which way is more preferred: modifying existing
> > > > drivers(of different manufacturer) or writing new driver.
> > >
> > > Ususally avoiding code duplication is good, it reduces maintenance
> > > burden. However, if adding the support turns out to make the
> > > original code unreadable or hard to follow, a new driver might be
> > > justified. This is why it is important to understand the differences
> > > of the chip as a first step. (I have the feeling, that modifying is
> > > the way to go here, though).
> > >
> >
> > I will explore possibility of using ds1307 driver for this.
> >
>=20
> Has there been any movement here?

^ permalink raw reply

* [PATCH] Add support for pt7c4338 (rtc device) in rtc-ds1307 driver
From: Priyanka Jain @ 2011-05-26  7:03 UTC (permalink / raw)
  To: akpm, w.sang, rtc-linux, linuxppc-dev, a.zummo, p_gortmaker; +Cc: Priyanka Jain

PT7C4338 chip is being manufactured by Pericom Technology Inc.
It is a serial real-time clock which provides:
1)Low-power clock/calendar.
2)Programmable square-wave output.
It has 56 bytes of nonvolatile RAM.
Its register set is same as that of rtc device: DS1307.

Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>
---
 Changes :
	 This patch will supersede patch:
		"RTC driver(Linux) for PT7C4338 chip"
	 Incorporting Wolfram Sang's comments to reuse ds1307 driver.

 drivers/rtc/Kconfig      |    6 +++---
 drivers/rtc/rtc-ds1307.c |    7 +++++++
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index b8f4e9e..c6045dd 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -126,13 +126,13 @@ comment "I2C RTC drivers"
 if I2C
 
 config RTC_DRV_DS1307
-	tristate "Dallas/Maxim DS1307/37/38/39/40, ST M41T00, EPSON RX-8025"
+	tristate "Dallas/Maxim DS1307/37/38/39/40, ST M41T00, EPSON RX-8025, PT7C4338"
 	help
 	  If you say yes here you get support for various compatible RTC
 	  chips (often with battery backup) connected with I2C. This driver
 	  should handle DS1307, DS1337, DS1338, DS1339, DS1340, ST M41T00,
-	  EPSON RX-8025 and probably other chips. In some cases the RTC
-	  must already have been initialized (by manufacturing or a
+	  EPSON RX-8025, PT7C4338 and probably other chips. In some cases
+	  the RTC must already have been initialized (by manufacturing or a
 	  bootloader).
 
 	  The first seven registers on these chips hold an RTC, and other
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
index 4724ba3..8436f16 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -4,6 +4,8 @@
  *  Copyright (C) 2005 James Chapman (ds1337 core)
  *  Copyright (C) 2006 David Brownell
  *  Copyright (C) 2009 Matthias Fuchs (rx8025 support)
+ *  Copyright (C) 2011 Priyanka Jain (Priyanka.Jain@freescale.com)
+ *                                   (pt7c4338 support)
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -34,6 +36,7 @@ enum ds_type {
 	ds_1388,
 	ds_3231,
 	m41t00,
+	pt7c4338,
 	rx_8025,
 	// rs5c372 too?  different address...
 };
@@ -137,6 +140,8 @@ static const struct chip_desc chips[] = {
 },
 [m41t00] = {
 },
+[pt7c4338] = {
+},
 [rx_8025] = {
 }, };
 
@@ -149,6 +154,7 @@ static const struct i2c_device_id ds1307_id[] = {
 	{ "ds1340", ds_1340 },
 	{ "ds3231", ds_3231 },
 	{ "m41t00", m41t00 },
+	{ "pt7c4338", pt7c4338 },
 	{ "rx8025", rx_8025 },
 	{ }
 };
@@ -769,6 +775,7 @@ read_rtc:
 	switch (ds1307->type) {
 	case ds_1307:
 	case m41t00:
+	case pt7c4338:
 		/* clock halted?  turn it on, so clock can tick. */
 		if (tmp & DS1307_BIT_CH) {
 			i2c_smbus_write_byte_data(client, DS1307_REG_SECS, 0);
-- 
1.6.5.6

^ permalink raw reply related

* Re: [PATCH 3/5] v2 seccomp_filters: Enable ftrace-based system call filtering
From: Pavel Machek @ 2011-05-26  6:27 UTC (permalink / raw)
  To: James Morris
  Cc: linux-mips, linux-sh, Peter Zijlstra, Frederic Weisbecker,
	Heiko Carstens, linux-kernel, David Howells, Paul Mackerras,
	Ralf Baechle, H. Peter Anvin, sparclinux, Jiri Slaby, linux-s390,
	Russell King, x86, agl, Ingo Molnar, Ingo Molnar, Serge E. Hallyn,
	Peter Zijlstra, Steven Rostedt, Martin Schwidefsky,
	Thomas Gleixner, kees.cook, linux-arm-kernel, Michal Marek,
	Michal Simek, Will Drewry, linuxppc-dev, Oleg Nesterov,
	Eric Paris, Paul Mundt, Tejun Heo, linux390, Andrew Morton,
	Linus Torvalds, David S. Miller
In-Reply-To: <alpine.LRH.2.00.1105161006340.21749@tundra.namei.org>

  On Mon 2011-05-16 10:36:05, James Morris wrote:
> On Fri, 13 May 2011, Ingo Molnar wrote:
> How do you reason about the behavior of the system as a whole?
> 
> 
> > I argue that this is the LSM and audit subsystems designed right: in the long 
> > run it could allow everything that LSM does at the moment - and so much more 
> > ...
> 
> Now you're proposing a redesign of the security subsystem.  That's a 
> significant undertaking.
> 
> In the meantime, we have a simple, well-defined enhancement to seccomp 
> which will be very useful to current users in reducing their kernel attack 
> surface.

Well, you can do the same with subterfugue, even without kernel
changes. But that's ptrace -- slow. (And it already shows that syscall
based filters are extremely tricky to configure).

If yu want speed, seccomp+server for non-permitted operations seems like reasonable way.

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply

* Re: [PATCH v4]PPC4xx: Adding PCI(E) MSI support
From: Benjamin Herrenschmidt @ 2011-05-26  5:24 UTC (permalink / raw)
  To: Rupjyoti Sarmah; +Cc: linuxppc-dev, rsarmah, linux-kernel
In-Reply-To: <201103300910.p2U9AO8t024353@amcc.com>

On Wed, 2011-03-30 at 14:40 +0530, Rupjyoti Sarmah wrote:
> This patch adds MSI support for 440SPe, 460Ex, 460Sx and 405Ex.
> 
> Signed-off-by: Rupjyoti Sarmah <rsarmah@apm.com>
> Signed-off-by: Tirumala R Marri <tmarri@apm.com>

Ok so I sent the patch to Linus today. However I had to manually fix it
up for the generic changes to the irq subsystem. One change was trivial
set_irq_msi() -> irq_set_msi_desc(), but the other one was not: I just
removed the call to set_irq_data() as I couldn't figure out what it was
meant to do.

Please check the result and send any "fixup" patch that might be
necessary.

Cheers,
Ben.

> ---
> v4:
>  * Updated the coding style as per  recommendation by Philipp
>  * The goto style code removed as per suggestion
> v3:
>  * Rebased to Josh next tree
>  * Cleanup and remove some unwanted log msg.
>  * Remove list member and its references.
>  * Keep msi_data local reference.
> v2:
>   * Remove or add blank lines at appropriate places.
>   * Added BITMAP as it is easy to request and free the MSIs
>   * Removed UPPER_4BITS_OF36BIT & LOWER_32BITS_OF36BIT;
>   * Remove unused feature variable.
>   * Remove initialization of "virq".
>   * remove static int_no varaible and replace with bitmap.
>   * Eliminated reading count from DTS tree and added a macro.
>   * Remove printK.
>   * Remove else in setup_irqs.
>   * Free interrupts in teardown_msi_interrupts().
>   * Print contraints in check_device().
>   * Replace ioremap with of_iomap().
>   * Use msi_data in setup_pcieh_hw().
>   * Don't unmap in the setup_pcieh_hw().
>   * don't use WARN_ON.
>   * Remove ppc4xx_msi_ids[].
> ---
>  arch/powerpc/boot/dts/canyonlands.dts |   18 ++
>  arch/powerpc/boot/dts/katmai.dts      |   18 ++
>  arch/powerpc/boot/dts/kilauea.dts     |   28 ++++
>  arch/powerpc/boot/dts/redwood.dts     |   20 +++
>  arch/powerpc/platforms/40x/Kconfig    |    2 +
>  arch/powerpc/platforms/44x/Kconfig    |    6 +
>  arch/powerpc/sysdev/Kconfig           |    7 +
>  arch/powerpc/sysdev/Makefile          |    1 +
>  arch/powerpc/sysdev/ppc4xx_msi.c      |  277 +++++++++++++++++++++++++++++++++
>  9 files changed, 377 insertions(+), 0 deletions(-)
>  create mode 100644 arch/powerpc/sysdev/ppc4xx_msi.c
> 
> diff --git a/arch/powerpc/boot/dts/canyonlands.dts b/arch/powerpc/boot/dts/canyonlands.dts
> index 2779f08..22dd6ae 100644
> --- a/arch/powerpc/boot/dts/canyonlands.dts
> +++ b/arch/powerpc/boot/dts/canyonlands.dts
> @@ -530,5 +530,23 @@
>  				0x0 0x0 0x0 0x3 &UIC3 0x12 0x4 /* swizzled int C */
>  				0x0 0x0 0x0 0x4 &UIC3 0x13 0x4 /* swizzled int D */>;
>  		};
> +
> +		MSI: ppc4xx-msi@C10000000 {
> +			compatible = "amcc,ppc4xx-msi", "ppc4xx-msi";
> +			reg = < 0xC 0x10000000 0x100>;
> +			sdr-base = <0x36C>;
> +			msi-data = <0x00000000>;
> +			msi-mask = <0x44440000>;
> +			interrupt-count = <3>;
> +			interrupts = <0 1 2 3>;
> +			interrupt-parent = <&UIC3>;
> +			#interrupt-cells = <1>;
> +			#address-cells = <0>;
> +			#size-cells = <0>;
> +			interrupt-map = <0 &UIC3 0x18 1
> +					1 &UIC3 0x19 1
> +					2 &UIC3 0x1A 1
> +					3 &UIC3 0x1B 1>;
> +		};
>  	};
>  };
> diff --git a/arch/powerpc/boot/dts/katmai.dts b/arch/powerpc/boot/dts/katmai.dts
> index 7c3be5e..f913dbe 100644
> --- a/arch/powerpc/boot/dts/katmai.dts
> +++ b/arch/powerpc/boot/dts/katmai.dts
> @@ -442,6 +442,24 @@
>  				0x0 0x0 0x0 0x4 &UIC3 0xb 0x4 /* swizzled int D */>;
>  		};
>  
> +		MSI: ppc4xx-msi@400300000 {
> +				compatible = "amcc,ppc4xx-msi", "ppc4xx-msi";
> +				reg = < 0x4 0x00300000 0x100>;
> +				sdr-base = <0x3B0>;
> +				msi-data = <0x00000000>;
> +				msi-mask = <0x44440000>;
> +				interrupt-count = <3>;
> +				interrupts =<0 1 2 3>;
> +				interrupt-parent = <&UIC0>;
> +				#interrupt-cells = <1>;
> +				#address-cells = <0>;
> +				#size-cells = <0>;
> +				interrupt-map = <0 &UIC0 0xC 1
> +					1 &UIC0 0x0D 1
> +					2 &UIC0 0x0E 1
> +					3 &UIC0 0x0F 1>;
> +		};
> +
>  		I2O: i2o@400100000 {
>  			compatible = "ibm,i2o-440spe";
>  			reg = <0x00000004 0x00100000 0x100>;
> diff --git a/arch/powerpc/boot/dts/kilauea.dts b/arch/powerpc/boot/dts/kilauea.dts
> index 89edb16..1613d6e 100644
> --- a/arch/powerpc/boot/dts/kilauea.dts
> +++ b/arch/powerpc/boot/dts/kilauea.dts
> @@ -403,5 +403,33 @@
>  				0x0 0x0 0x0 0x3 &UIC2 0xd 0x4 /* swizzled int C */
>  				0x0 0x0 0x0 0x4 &UIC2 0xe 0x4 /* swizzled int D */>;
>  		};
> +
> +		MSI: ppc4xx-msi@C10000000 {
> +			compatible = "amcc,ppc4xx-msi", "ppc4xx-msi";
> +			reg = < 0x0 0xEF620000 0x100>;
> +			sdr-base = <0x4B0>;
> +			msi-data = <0x00000000>;
> +			msi-mask = <0x44440000>;
> +			interrupt-count = <12>;
> +			interrupts = <0 1 2 3 4 5 6 7 8 9 0xA 0xB 0xC 0xD>;
> +			interrupt-parent = <&UIC2>;
> +			#interrupt-cells = <1>;
> +			#address-cells = <0>;
> +			#size-cells = <0>;
> +			interrupt-map = <0 &UIC2 0x10 1
> +					1 &UIC2 0x11 1
> +					2 &UIC2 0x12 1
> +					2 &UIC2 0x13 1
> +					2 &UIC2 0x14 1
> +					2 &UIC2 0x15 1
> +					2 &UIC2 0x16 1
> +					2 &UIC2 0x17 1
> +					2 &UIC2 0x18 1
> +					2 &UIC2 0x19 1
> +					2 &UIC2 0x1A 1
> +					2 &UIC2 0x1B 1
> +					2 &UIC2 0x1C 1
> +					3 &UIC2 0x1D 1>;
> +		};
>  	};
>  };
> diff --git a/arch/powerpc/boot/dts/redwood.dts b/arch/powerpc/boot/dts/redwood.dts
> index 81636c0..d86a3a4 100644
> --- a/arch/powerpc/boot/dts/redwood.dts
> +++ b/arch/powerpc/boot/dts/redwood.dts
> @@ -358,8 +358,28 @@
>  				0x0 0x0 0x0 0x4 &UIC3 0xb 0x4 /* swizzled int D */>;
>  		};
>  
> +		MSI: ppc4xx-msi@400300000 {
> +				compatible = "amcc,ppc4xx-msi", "ppc4xx-msi";
> +				reg = < 0x4 0x00300000 0x100
> +					0x4 0x00300000 0x100>;
> +				sdr-base = <0x3B0>;
> +				msi-data = <0x00000000>;
> +				msi-mask = <0x44440000>;
> +				interrupt-count = <3>;
> +				interrupts =<0 1 2 3>;
> +				interrupt-parent = <&UIC0>;
> +				#interrupt-cells = <1>;
> +				#address-cells = <0>;
> +				#size-cells = <0>;
> +				interrupt-map = <0 &UIC0 0xC 1
> +					1 &UIC0 0x0D 1
> +					2 &UIC0 0x0E 1
> +					3 &UIC0 0x0F 1>;
> +		};
> +
>  	};
>  
> +
>  	chosen {
>  		linux,stdout-path = "/plb/opb/serial@ef600200";
>  	};
> diff --git a/arch/powerpc/platforms/40x/Kconfig b/arch/powerpc/platforms/40x/Kconfig
> index b721764..92aeee6 100644
> --- a/arch/powerpc/platforms/40x/Kconfig
> +++ b/arch/powerpc/platforms/40x/Kconfig
> @@ -57,6 +57,8 @@ config KILAUEA
>  	select 405EX
>  	select PPC40x_SIMPLE
>  	select PPC4xx_PCI_EXPRESS
> +	select PCI_MSI
> +	select 4xx_MSI
>  	help
>  	  This option enables support for the AMCC PPC405EX evaluation board.
>  
> diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
> index f485fc5..f10cc7f 100644
> --- a/arch/powerpc/platforms/44x/Kconfig
> +++ b/arch/powerpc/platforms/44x/Kconfig
> @@ -74,6 +74,8 @@ config KATMAI
>  	select 440SPe
>  	select PCI
>  	select PPC4xx_PCI_EXPRESS
> +	select PCI_MSI
> +	select 4xx_MSI
>  	help
>  	  This option enables support for the AMCC PPC440SPe evaluation board.
>  
> @@ -118,6 +120,8 @@ config CANYONLANDS
>  	select 460EX
>  	select PCI
>  	select PPC4xx_PCI_EXPRESS
> +	select PCI_MSI
> +	select 4xx_MSI
>  	select IBM_NEW_EMAC_RGMII
>  	select IBM_NEW_EMAC_ZMII
>  	help
> @@ -144,6 +148,8 @@ config REDWOOD
>  	select 460SX
>  	select PCI
>  	select PPC4xx_PCI_EXPRESS
> +	select PCI_MSI
> +	select 4xx_MSI
>  	help
>  	  This option enables support for the AMCC PPC460SX Redwood board.
>  
> diff --git a/arch/powerpc/sysdev/Kconfig b/arch/powerpc/sysdev/Kconfig
> index 3965828..32f5a40 100644
> --- a/arch/powerpc/sysdev/Kconfig
> +++ b/arch/powerpc/sysdev/Kconfig
> @@ -7,8 +7,15 @@ config PPC4xx_PCI_EXPRESS
>  	depends on PCI && 4xx
>  	default n
>  
> +config 4xx_MSI
> +	bool
> +	depends on PCI_MSI
> +	depends on PCI && 4xx
> +	default n
> +
>  config PPC_MSI_BITMAP
>  	bool
>  	depends on PCI_MSI
>  	default y if MPIC
>  	default y if FSL_PCI
> +	default y if 4xx_MSI
> diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
> index 1e0c933..5d92e29 100644
> --- a/arch/powerpc/sysdev/Makefile
> +++ b/arch/powerpc/sysdev/Makefile
> @@ -41,6 +41,7 @@ obj-$(CONFIG_OF_RTC)		+= of_rtc.o
>  ifeq ($(CONFIG_PCI),y)
>  obj-$(CONFIG_4xx)		+= ppc4xx_pci.o
>  endif
> +obj-$(CONFIG_4xx_MSI)		+= ppc4xx_msi.o
>  obj-$(CONFIG_PPC4xx_CPM)	+= ppc4xx_cpm.o
>  obj-$(CONFIG_PPC4xx_GPIO)	+= ppc4xx_gpio.o
>  
> diff --git a/arch/powerpc/sysdev/ppc4xx_msi.c b/arch/powerpc/sysdev/ppc4xx_msi.c
> new file mode 100644
> index 0000000..ab69edb
> --- /dev/null
> +++ b/arch/powerpc/sysdev/ppc4xx_msi.c
> @@ -0,0 +1,277 @@
> +/*
> + * Adding PCI-E MSI support for PPC4XX SoCs.
> + *
> + * Copyright (c) 2010, Applied Micro Circuits Corporation
> + * Authors:	Tirumala R Marri <tmarri@apm.com>
> + *		Feng Kan <fkan@apm.com>
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +#include <linux/irq.h>
> +#include <linux/bootmem.h>
> +#include <linux/pci.h>
> +#include <linux/msi.h>
> +#include <linux/of_platform.h>
> +#include <linux/interrupt.h>
> +#include <asm/prom.h>
> +#include <asm/hw_irq.h>
> +#include <asm/ppc-pci.h>
> +#include <boot/dcr.h>
> +#include <asm/dcr-regs.h>
> +#include <asm/msi_bitmap.h>
> +
> +#define PEIH_TERMADH	0x00
> +#define PEIH_TERMADL	0x08
> +#define PEIH_MSIED	0x10
> +#define PEIH_MSIMK	0x18
> +#define PEIH_MSIASS	0x20
> +#define PEIH_FLUSH0	0x30
> +#define PEIH_FLUSH1	0x38
> +#define PEIH_CNTRST	0x48
> +#define NR_MSI_IRQS	4
> +
> +struct ppc4xx_msi {
> +	u32 msi_addr_lo;
> +	u32 msi_addr_hi;
> +	void __iomem *msi_regs;
> +	int msi_virqs[NR_MSI_IRQS];
> +	struct msi_bitmap bitmap;
> +	struct device_node *msi_dev;
> +};
> +
> +static struct ppc4xx_msi ppc4xx_msi;
> +
> +static int ppc4xx_msi_init_allocator(struct platform_device *dev,
> +		struct ppc4xx_msi *msi_data)
> +{
> +	int err;
> +
> +	err = msi_bitmap_alloc(&msi_data->bitmap, NR_MSI_IRQS,
> +			      dev->dev.of_node);
> +	if (err)
> +		return err;
> +
> +	err = msi_bitmap_reserve_dt_hwirqs(&msi_data->bitmap);
> +	if (err < 0) {
> +		msi_bitmap_free(&msi_data->bitmap);
> +		return err;
> +	}
> +
> +	return 0;
> +}
> +
> +static int ppc4xx_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
> +{
> +	int int_no = -ENOMEM;
> +	unsigned int virq;
> +	struct msi_msg msg;
> +	struct msi_desc *entry;
> +	struct ppc4xx_msi *msi_data = &ppc4xx_msi;
> +
> +	list_for_each_entry(entry, &dev->msi_list, list) {
> +		int_no = msi_bitmap_alloc_hwirqs(&msi_data->bitmap, 1);
> +		if (int_no >= 0)
> +			break;
> +		if (int_no < 0) {
> +			pr_debug("%s: fail allocating msi interrupt\n",
> +					__func__);
> +		}
> +		virq = irq_of_parse_and_map(msi_data->msi_dev, int_no);
> +		if (virq == NO_IRQ) {
> +			dev_err(&dev->dev, "%s: fail mapping irq\n", __func__);
> +			msi_bitmap_free_hwirqs(&msi_data->bitmap, int_no, 1);
> +			return -ENOSPC;
> +		}
> +		set_irq_data(virq, (void *)int_no);
> +		dev_dbg(&dev->dev, "%s: virq = %d\n", __func__, virq);
> +
> +		/* Setup msi address space */
> +		msg.address_hi = msi_data->msi_addr_hi;
> +		msg.address_lo = msi_data->msi_addr_lo;
> +
> +		set_irq_msi(virq, entry);
> +		msg.data = int_no;
> +		write_msi_msg(virq, &msg);
> +	}
> +	return 0;
> +}
> +
> +void ppc4xx_teardown_msi_irqs(struct pci_dev *dev)
> +{
> +	struct msi_desc *entry;
> +	struct ppc4xx_msi *msi_data = &ppc4xx_msi;
> +
> +	dev_dbg(&dev->dev, "PCIE-MSI: tearing down msi irqs\n");
> +
> +	list_for_each_entry(entry, &dev->msi_list, list) {
> +		if (entry->irq == NO_IRQ)
> +			continue;
> +		set_irq_msi(entry->irq, NULL);
> +		msi_bitmap_free_hwirqs(&msi_data->bitmap,
> +				virq_to_hw(entry->irq), 1);
> +		irq_dispose_mapping(entry->irq);
> +	}
> +}
> +
> +static int ppc4xx_msi_check_device(struct pci_dev *pdev, int nvec, int type)
> +{
> +	dev_dbg(&pdev->dev, "PCIE-MSI:%s called. vec %x type %d\n",
> +		__func__, nvec, type);
> +	if (type == PCI_CAP_ID_MSIX)
> +		pr_debug("ppc4xx msi: MSI-X untested, trying anyway.\n");
> +
> +	return 0;
> +}
> +
> +static int ppc4xx_setup_pcieh_hw(struct platform_device *dev,
> +				 struct resource res, struct ppc4xx_msi *msi)
> +{
> +	const u32 *msi_data;
> +	const u32 *msi_mask;
> +	const u32 *sdr_addr;
> +	dma_addr_t msi_phys;
> +	void *msi_virt;
> +
> +	sdr_addr = of_get_property(dev->dev.of_node, "sdr-base", NULL);
> +	if (!sdr_addr)
> +		return -1;
> +
> +	SDR0_WRITE(sdr_addr, (u64)res.start >> 32);	 /*HIGH addr */
> +	SDR0_WRITE(sdr_addr + 1, res.start & 0xFFFFFFFF); /* Low addr */
> +
> +
> +	msi->msi_dev = of_find_node_by_name(NULL, "ppc4xx-msi");
> +	if (msi->msi_dev)
> +		return -ENODEV;
> +
> +	msi->msi_regs = of_iomap(msi->msi_dev, 0);
> +	if (!msi->msi_regs) {
> +		dev_err(&dev->dev, "of_iomap problem failed\n");
> +		return -ENOMEM;
> +	}
> +	dev_dbg(&dev->dev, "PCIE-MSI: msi register mapped 0x%x 0x%x\n",
> +		(u32) (msi->msi_regs + PEIH_TERMADH), (u32) (msi->msi_regs));
> +
> +	msi_virt = dma_alloc_coherent(&dev->dev, 64, &msi_phys, GFP_KERNEL);
> +	msi->msi_addr_hi = 0x0;
> +	msi->msi_addr_lo = (u32) msi_phys;
> +	dev_dbg(&dev->dev, "PCIE-MSI: msi address 0x%x\n", msi->msi_addr_lo);
> +
> +	/* Progam the Interrupt handler Termination addr registers */
> +	out_be32(msi->msi_regs + PEIH_TERMADH, msi->msi_addr_hi);
> +	out_be32(msi->msi_regs + PEIH_TERMADL, msi->msi_addr_lo);
> +
> +	msi_data = of_get_property(dev->dev.of_node, "msi-data", NULL);
> +	if (!msi_data)
> +		return -1;
> +	msi_mask = of_get_property(dev->dev.of_node, "msi-mask", NULL);
> +	if (!msi_mask)
> +		return -1;
> +	/* Program MSI Expected data and Mask bits */
> +	out_be32(msi->msi_regs + PEIH_MSIED, *msi_data);
> +	out_be32(msi->msi_regs + PEIH_MSIMK, *msi_mask);
> +
> +	return 0;
> +}
> +
> +static int ppc4xx_of_msi_remove(struct platform_device *dev)
> +{
> +	struct ppc4xx_msi *msi = dev->dev.platform_data;
> +	int i;
> +	int virq;
> +
> +	for (i = 0; i < NR_MSI_IRQS; i++) {
> +		virq = msi->msi_virqs[i];
> +		if (virq != NO_IRQ)
> +			irq_dispose_mapping(virq);
> +	}
> +
> +	if (msi->bitmap.bitmap)
> +		msi_bitmap_free(&msi->bitmap);
> +	iounmap(msi->msi_regs);
> +	of_node_put(msi->msi_dev);
> +	kfree(msi);
> +
> +	return 0;
> +}
> +
> +static int __devinit ppc4xx_msi_probe(struct platform_device *dev)
> +{
> +	struct ppc4xx_msi *msi;
> +	struct resource res;
> +	int err = 0;
> +
> +	msi = &ppc4xx_msi;/*keep the msi data for further use*/
> +
> +	dev_dbg(&dev->dev, "PCIE-MSI: Setting up MSI support...\n");
> +
> +	msi = kzalloc(sizeof(struct ppc4xx_msi), GFP_KERNEL);
> +	if (!msi) {
> +		dev_err(&dev->dev, "No memory for MSI structure\n");
> +		return -ENOMEM;
> +	}
> +	dev->dev.platform_data = msi;
> +
> +	/* Get MSI ranges */
> +	err = of_address_to_resource(dev->dev.of_node, 0, &res);
> +	if (err) {
> +		dev_err(&dev->dev, "%s resource error!\n",
> +			dev->dev.of_node->full_name);
> +		goto error_out;
> +	}
> +
> +	if (ppc4xx_setup_pcieh_hw(dev, res, msi))
> +		goto error_out;
> +
> +	err = ppc4xx_msi_init_allocator(dev, msi);
> +	if (err) {
> +		dev_err(&dev->dev, "Error allocating MSI bitmap\n");
> +		goto error_out;
> +	}
> +
> +	ppc_md.setup_msi_irqs = ppc4xx_setup_msi_irqs;
> +	ppc_md.teardown_msi_irqs = ppc4xx_teardown_msi_irqs;
> +	ppc_md.msi_check_device = ppc4xx_msi_check_device;
> +	return err;
> +
> +error_out:
> +	ppc4xx_of_msi_remove(dev);
> +	return err;
> +}
> +static const struct of_device_id ppc4xx_msi_ids[] = {
> +	{
> +		.compatible = "amcc,ppc4xx-msi",
> +	},
> +	{}
> +};
> +static struct platform_driver ppc4xx_msi_driver = {
> +	.probe = ppc4xx_msi_probe,
> +	.remove = ppc4xx_of_msi_remove,
> +	.driver = {
> +		   .name = "ppc4xx-msi",
> +		   .owner = THIS_MODULE,
> +		   .of_match_table = ppc4xx_msi_ids,
> +		   },
> +
> +};
> +
> +static __init int ppc4xx_msi_init(void)
> +{
> +	return platform_driver_register(&ppc4xx_msi_driver);
> +}
> +
> +subsys_initcall(ppc4xx_msi_init);

^ permalink raw reply

* [git pull] Please pull powerpc.git merge branch
From: Benjamin Herrenschmidt @ 2011-05-26  5:22 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linuxppc-dev list, Andrew Morton, Linux Kernel list

Hi Linus !

This is a bit more than I expected to send you that late in the merge
window, but hopefully none of it should be problematic. A couple of
patches were simply delayed due to misunderstandings as to which tree
they should go through (4xx MSI and ftrace).

There's a generic patch to linux/smp.h which removes some definitions
that as far as we can tell aren't used anywhere anymore (we just removed
the last use in powerpc in my previous pull request).

The rest is either good enough bug fixes (in large part regressions),
with a couple more cleanups from Milton on top of his big series that
I merged earlier.

Cheers,
Ben.

The following changes since commit 3f5785ec31adcb7cafa9135087297a38d9698cf8:

  Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 (2011-05-25 17:00:17 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git ..BRANCH.NOT.VERIFIED..

Brian King (1):
      powerpc/pseries: Update MAX_HCALL_OPCODE to reflect page coalescing

Eric B Munson (1):
      powerpc/oprofile: Handle events that raise an exception without overflowing

Ian Munsie (1):
      powerpc/ftrace: Implement raw syscall tracepoints on PowerPC

Milton Miller (8):
      Remove unused MSG_ flags in linux/smp.h
      powerpc/cell: Use common smp ipi actions
      powerpc/cell: Rename ipi functions to match current abstractions
      powerpc/irq: Remove stale and misleading comment
      powerpc/irq: Always free duplicate IRQ_LEGACY hosts
      powerpc/irq: Check desc in handle_one_irq and expand generic_handle_irq
      powerpc/irq: Protect irq_radix_revmap_lookup against irq_free_virt
      powerpc: Fix irq_free_virt by adjusting bounds before loop

Rupjyoti Sarmah (1):
      powerpc/4xx: Adding PCIe MSI support

 arch/powerpc/Kconfig                    |    1 +
 arch/powerpc/boot/dts/canyonlands.dts   |   18 ++
 arch/powerpc/boot/dts/katmai.dts        |   18 ++
 arch/powerpc/boot/dts/kilauea.dts       |   28 +++
 arch/powerpc/boot/dts/redwood.dts       |   20 +++
 arch/powerpc/include/asm/ftrace.h       |   14 ++
 arch/powerpc/include/asm/hvcall.h       |    2 +-
 arch/powerpc/include/asm/smp.h          |    2 -
 arch/powerpc/include/asm/syscall.h      |    5 +
 arch/powerpc/include/asm/thread_info.h  |    7 +-
 arch/powerpc/kernel/Makefile            |    1 +
 arch/powerpc/kernel/ftrace.c            |    8 +
 arch/powerpc/kernel/irq.c               |   46 +++---
 arch/powerpc/kernel/ptrace.c            |   10 +
 arch/powerpc/kernel/smp.c               |    2 +-
 arch/powerpc/oprofile/op_model_power4.c |   24 +++-
 arch/powerpc/platforms/40x/Kconfig      |    2 +
 arch/powerpc/platforms/44x/Kconfig      |    6 +
 arch/powerpc/platforms/cell/interrupt.c |   55 ++----
 arch/powerpc/platforms/cell/interrupt.h |    2 +-
 arch/powerpc/platforms/cell/smp.c       |    2 +-
 arch/powerpc/sysdev/Kconfig             |    7 +
 arch/powerpc/sysdev/Makefile            |    1 +
 arch/powerpc/sysdev/ppc4xx_msi.c        |  276 +++++++++++++++++++++++++++++++
 include/linux/smp.h                     |   10 -
 25 files changed, 491 insertions(+), 76 deletions(-)
 create mode 100644 arch/powerpc/sysdev/ppc4xx_msi.c

^ permalink raw reply

* [PATCH] powerpc: Replace boot_cpu_count with spinning_secondaries, fix off-by-one cpu wait
From: Matt Evans @ 2011-05-26  4:09 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev

smp_release_cpus() waits for all cpus (including the bootcpu) due to an
off-by-one count on boot_cpu_count (which is all CPUs).  This patch replaces
that with spinning_secondaries (which is all secondary CPUs).

Signed-off-by: Matt Evans <matt@ozlabs.org>
---
 arch/powerpc/include/asm/smp.h |    2 +-
 arch/powerpc/kernel/head_64.S  |    2 +-
 arch/powerpc/kernel/prom.c     |    8 ++++++++
 arch/powerpc/kernel/setup_32.c |    1 -
 arch/powerpc/kernel/setup_64.c |    6 +++---
 5 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index 880b8c1..8f01c85 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -30,7 +30,7 @@
 #include <asm/percpu.h>
 
 extern int boot_cpuid;
-extern int boot_cpu_count;
+extern int spinning_secondaries;
 
 extern void cpu_die(void);
 
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index ba50409..3564c49 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -255,7 +255,7 @@ generic_secondary_common_init:
 	mtctr	r23
 	bctrl
 
-3:	LOAD_REG_ADDR(r3, boot_cpu_count) /* Decrement boot_cpu_count */
+3:	LOAD_REG_ADDR(r3, spinning_secondaries) /* Decrement spinning_secondaries */
 	lwarx	r4,0,r3
 	subi	r4,r4,1
 	stwcx.	r4,0,r3
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 48aeb55..540e0dc 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -69,6 +69,7 @@ unsigned long tce_alloc_start, tce_alloc_end;
 u64 ppc64_rma_size;
 #endif
 static phys_addr_t first_memblock_size;
+static int __initdata boot_cpu_count;
 
 static int __init early_parse_mem(char *p)
 {
@@ -748,6 +749,13 @@ void __init early_init_devtree(void *params)
 	 */
 	of_scan_flat_dt(early_init_dt_scan_cpus, NULL);
 
+#if defined(CONFIG_SMP) && defined(CONFIG_PPC64)
+	/* We'll later wait for secondaries to check in; there are
+	 * NCPUS-1 non-boot CPUs  :-)
+	 */
+	spinning_secondaries = boot_cpu_count - 1;
+#endif
+
 	DBG(" <- early_init_devtree()\n");
 }
 
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 620d792..1d2fbc9 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -48,7 +48,6 @@ extern void bootx_init(unsigned long r4, unsigned long phys);
 
 int boot_cpuid = -1;
 EXPORT_SYMBOL_GPL(boot_cpuid);
-int __initdata boot_cpu_count;
 int boot_cpuid_phys;
 
 int smp_hw_index[NR_CPUS];
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index a88bf27..0576919 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -73,7 +73,7 @@
 #endif
 
 int boot_cpuid = 0;
-int __initdata boot_cpu_count;
+int __initdata spinning_secondaries;
 u64 ppc64_pft_size;
 
 /* Pick defaults since we might want to patch instructions
@@ -253,11 +253,11 @@ void smp_release_cpus(void)
 	for (i = 0; i < 100000; i++) {
 		mb();
 		HMT_low();
-		if (boot_cpu_count == 0)
+		if (spinning_secondaries == 0)
 			break;
 		udelay(1);
 	}
-	DBG("boot_cpu_count = %d\n", boot_cpu_count);
+	DBG("spinning_secondaries = %d\n", spinning_secondaries);
 
 	DBG(" <- smp_release_cpus()\n");
 }
-- 
1.7.0.4

0

^ permalink raw reply related

* Re: [PATCH 6/8] powerpc 8xx: cascade eoi will be performed by generic_handle_irq handler
From: Benjamin Herrenschmidt @ 2011-05-26  3:32 UTC (permalink / raw)
  To: Milton Miller; +Cc: linuxppc-dev
In-Reply-To: <8xx-cascade-eoi@mdm.bga.com>

On Wed, 2011-05-25 at 01:34 -0500, Milton Miller wrote:
> The 8xx cpm_cascade was calling irq_eoi for the cascaded irq,
> but that will already have been called by the handle_fasteoi_irq
> that generic_handle_irq will call.  The handler is set in
> arch/powerpc/sysdev/cpm1.c by the host map routine.

No it won't unless I'm missing something. The flow handler
(handle_fasteoi_irq) is going to be replaced by the chained handler when
mpc8xx_pics_init() calls irq_set_chained_handle(irq, cpm_cascade) no ?

Cheers,
Ben.

> Signed-off-by: Milton Miller <miltonm@bga.com>
> 
> Index: work.git/arch/powerpc/platforms/8xx/m8xx_setup.c
> ===================================================================
> --- work.git.orig/arch/powerpc/platforms/8xx/m8xx_setup.c	2011-05-18 22:50:38.983498572 -0500
> +++ work.git/arch/powerpc/platforms/8xx/m8xx_setup.c	2011-05-18 22:52:48.920532258 -0500
> @@ -221,15 +221,9 @@ static void cpm_cascade(unsigned int irq
>  	struct irq_chip *chip;
>  	int cascade_irq;
>  
> -	if ((cascade_irq = cpm_get_irq()) >= 0) {
> -		struct irq_desc *cdesc = irq_to_desc(cascade_irq);
> -
> +	if ((cascade_irq = cpm_get_irq()) >= 0)
>  		generic_handle_irq(cascade_irq);
>  
> -		chip = irq_desc_get_chip(cdesc);
> -		chip->irq_eoi(&cdesc->irq_data);
> -	}
> -
>  	chip = irq_desc_get_chip(desc);
>  	chip->irq_eoi(&desc->irq_data);
>  }

^ 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