* [PATCH 00/10] treewide: Fix format strings that misuse continuations
From: Joe Perches @ 2010-01-31 20:02 UTC (permalink / raw)
To: linux-kernel
Cc: alsa-devel, Greg Kroah-Hartman, Christoph Lameter, Takashi Iwai,
Jaroslav Kysela, linux-ide, James E.J. Bottomley, Paul Mackerras,
Sonic Zhang, devel, linux-scsi, linuxppc-dev, Mike Frysinger,
Pekka Enberg, Matt Mackall, Liam Girdwood, linux-mm, netdev,
Mark Brown, uclinux-dist-devel, David S. Miller
Format strings that are continued with \ are frequently misused.
Change them to use mostly single line formats, some longer than 80 chars.
Fix a few miscellaneous typos at the same time.
Joe Perches (10):
arch/powerpc: Fix continuation line formats
arch/blackfin: Fix continuation line formats
drivers/ide: Fix continuation line formats
drivers/serial/bfin_5xx.c: Fix continuation line formats
drivers/scsi/arcmsr: Fix continuation line formats
drivers/staging: Fix continuation line formats
drivers/net/amd8111e.c: Fix continuation line formats
fs/proc/array.c: Fix continuation line formats
mm/slab.c: Fix continuation line formats
sound/soc/blackfin: Fix continuation line formats
arch/blackfin/mach-common/smp.c | 4 +-
arch/powerpc/kernel/nvram_64.c | 6 +-
arch/powerpc/platforms/pseries/hotplug-cpu.c | 8 ++--
arch/powerpc/platforms/pseries/smp.c | 4 +-
drivers/ide/au1xxx-ide.c | 4 +-
drivers/ide/pmac.c | 4 +-
drivers/net/amd8111e.c | 3 +-
drivers/scsi/arcmsr/arcmsr_hba.c | 49 +++++++++----------
drivers/serial/bfin_5xx.c | 6 +--
drivers/staging/dream/qdsp5/audio_mp3.c | 3 +-
.../rtl8187se/ieee80211/ieee80211_softmac_wx.c | 3 +-
drivers/staging/rtl8187se/r8180_core.c | 3 +-
drivers/staging/sep/sep_driver.c | 3 +-
fs/proc/array.c | 7 ++-
mm/slab.c | 4 +-
sound/soc/blackfin/bf5xx-ac97-pcm.c | 8 +--
sound/soc/blackfin/bf5xx-i2s-pcm.c | 3 +-
sound/soc/blackfin/bf5xx-tdm-pcm.c | 3 +-
18 files changed, 55 insertions(+), 70 deletions(-)
^ permalink raw reply
* [PATCH 01/10] arch/powerpc: Fix continuation line formats
From: Joe Perches @ 2010-01-31 20:02 UTC (permalink / raw)
To: linux-kernel; +Cc: Paul Mackerras, linuxppc-dev
In-Reply-To: <cover.1264967493.git.joe@perches.com>
String constants that are continued on subsequent lines with \
are not good.
Signed-off-by: Joe Perches <joe@perches.com>
---
arch/powerpc/kernel/nvram_64.c | 6 +++---
arch/powerpc/platforms/pseries/hotplug-cpu.c | 8 ++++----
arch/powerpc/platforms/pseries/smp.c | 4 ++--
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
index ad461e7..9cf197f 100644
--- a/arch/powerpc/kernel/nvram_64.c
+++ b/arch/powerpc/kernel/nvram_64.c
@@ -338,8 +338,8 @@ static int __init nvram_create_os_partition(void)
rc = nvram_write_header(new_part);
if (rc <= 0) {
- printk(KERN_ERR "nvram_create_os_partition: nvram_write_header \
- failed (%d)\n", rc);
+ printk(KERN_ERR "nvram_create_os_partition: nvram_write_header "
+ "failed (%d)\n", rc);
return rc;
}
@@ -349,7 +349,7 @@ static int __init nvram_create_os_partition(void)
rc = ppc_md.nvram_write((char *)&seq_init, sizeof(seq_init), &tmp_index);
if (rc <= 0) {
printk(KERN_ERR "nvram_create_os_partition: nvram_write "
- "failed (%d)\n", rc);
+ "failed (%d)\n", rc);
return rc;
}
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 6ea4698..a70de10 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -397,12 +397,12 @@ static int parse_cede_parameters(void)
CEDE_LATENCY_PARAM_MAX_LENGTH);
if (call_status != 0)
- printk(KERN_INFO "CEDE_LATENCY: \
- %s %s Error calling get-system-parameter(0x%x)\n",
+ printk(KERN_INFO "CEDE_LATENCY: "
+ "%s %s Error calling get-system-parameter(0x%x)\n",
__FILE__, __func__, call_status);
else
- printk(KERN_INFO "CEDE_LATENCY: \
- get-system-parameter successful.\n");
+ printk(KERN_INFO "CEDE_LATENCY: "
+ "get-system-parameter successful.\n");
return call_status;
}
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index b488663..4e7f89a 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -144,8 +144,8 @@ static void __devinit smp_pSeries_kick_cpu(int nr)
hcpuid = get_hard_smp_processor_id(nr);
rc = plpar_hcall_norets(H_PROD, hcpuid);
if (rc != H_SUCCESS)
- printk(KERN_ERR "Error: Prod to wake up processor %d\
- Ret= %ld\n", nr, rc);
+ printk(KERN_ERR "Error: Prod to wake up processor %d "
+ "Ret= %ld\n", nr, rc);
}
}
--
1.6.6.rc0.57.gad7a
^ permalink raw reply related
* Re: [PATCH 5/5] powerpc: Increase NR_IRQS Kconfig maximum to 32768
From: Benjamin Herrenschmidt @ 2010-01-31 20:35 UTC (permalink / raw)
To: Anton Blanchard; +Cc: linuxppc-dev
In-Reply-To: <20100131111403.GP2996@kryten>
On Sun, 2010-01-31 at 22:14 +1100, Anton Blanchard wrote:
> With dynamic irq descriptors the overhead of a large NR_IRQS is much lower
> than it used to be. With more MSI-X capable adapters and drivers exploiting
> multiple vectors we may as well allow the user to increase it beyond the
> current maximum of 512.
>
> 32768 seems large enough that we'd never have to bump it again (although I bet
> my prediction is horribly wrong). It boot tests OK and the vmlinux footprint
> increase is only around 500kB due to:
>
> struct irq_map_entry irq_map[NR_IRQS];
We could dynamically allocate that one.
Cheers,
Ben.
> We format /proc/interrupts correctly with the previous changes:
>
> CPU0 CPU1 CPU2 CPU3 CPU4 CPU5
> 286: 0 0 0 0 0 0
> 516: 0 0 0 0 0 0
> 16689: 1833 0 0 0 0 0
> 17157: 0 0 0 0 0 0
> 17158: 319 0 0 0 0 0
> 25092: 0 0 0 0 0 0
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
>
> Index: linux-cpumask/arch/powerpc/Kconfig
> ===================================================================
> --- linux-cpumask.orig/arch/powerpc/Kconfig 2010-01-31 15:07:11.707211107 +1100
> +++ linux-cpumask/arch/powerpc/Kconfig 2010-01-31 21:52:39.999711689 +1100
> @@ -58,7 +58,7 @@ config IRQ_PER_CPU
>
> config NR_IRQS
> int "Number of virtual interrupt numbers"
> - range 32 512
> + range 32 32768
> default "512"
> help
> This defines the number of virtual interrupt numbers the kernel
^ permalink raw reply
* Re: [PATCH] nodmask.h: remove macro any_online_node
From: Benjamin Herrenschmidt @ 2010-02-01 2:05 UTC (permalink / raw)
To: H Hartley Sweeten
Cc: neilb, Trond.Myklebust, bfields, linuxppc-dev, paulus,
Ricardo.Labiaga, rientjes, mel, devicetree-discuss, akpm,
kamezawa.hiroyu, lee.schermerhorn, linux-nfs, netdev,
Linux Kernel, miltonm, dave, chuck.lever, bhalevy, davem
In-Reply-To: <201001061624.59118.hartleys@visionengravers.com>
On Wed, 2010-01-06 at 16:24 -0700, H Hartley Sweeten wrote:
> nodmask.h: remove macro any_online_node
>
> The macro any_online_node is prone to producing sparse warnings
> due to the local symbol 'node'. Since all the in-tree users are really
> requesting the first online node (the mask argument is either
> NODE_MASK_ALL or node_online_map) just use the first_online_node
> macro and remove the any_online_node macro since there are no users.
>
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: David Rientjes <rientjes@google.com>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Cc: Mel Gorman <mel@csn.ul.ie>
> Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Dave Hansen <dave@linux.vnet.ibm.com>
> Cc: Milton Miller <miltonm@bga.com>
> Cc: Nathan Fontenot <nfont@austin.ibm.com>
> Cc: Geoff Levand <geoffrey.levand@am.sony.com>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: J. Bruce Fields <bfields@fieldses.org>
> Cc: Neil Brown <neilb@suse.de>
> Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Benny Halevy <bhalevy@panasas.com>
> Cc: Chuck Lever <chuck.lever@oracle.com>
> Cc: Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH 01/10] arch/powerpc: Fix continuation line formats
From: Benjamin Herrenschmidt @ 2010-02-01 2:16 UTC (permalink / raw)
To: Joe Perches; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel
In-Reply-To: <d8e2cb6523906c5e77bb13ea9ffc077a9310dc9e.1264967498.git.joe@perches.com>
On Sun, 2010-01-31 at 12:02 -0800, Joe Perches wrote:
> String constants that are continued on subsequent lines with \
> are not good.
>
> Signed-off-by: Joe Perches <joe@perches.com>
You want me to take that in the powerpc tree ?
A minor glitch below tho...
> ---
> arch/powerpc/kernel/nvram_64.c | 6 +++---
> arch/powerpc/platforms/pseries/hotplug-cpu.c | 8 ++++----
> arch/powerpc/platforms/pseries/smp.c | 4 ++--
> 3 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
> index ad461e7..9cf197f 100644
> --- a/arch/powerpc/kernel/nvram_64.c
> +++ b/arch/powerpc/kernel/nvram_64.c
> @@ -338,8 +338,8 @@ static int __init nvram_create_os_partition(void)
>
> rc = nvram_write_header(new_part);
> if (rc <= 0) {
> - printk(KERN_ERR "nvram_create_os_partition: nvram_write_header \
> - failed (%d)\n", rc);
> + printk(KERN_ERR "nvram_create_os_partition: nvram_write_header "
> + "failed (%d)\n", rc);
> return rc;
> }
>
> @@ -349,7 +349,7 @@ static int __init nvram_create_os_partition(void)
> rc = ppc_md.nvram_write((char *)&seq_init, sizeof(seq_init), &tmp_index);
> if (rc <= 0) {
> printk(KERN_ERR "nvram_create_os_partition: nvram_write "
> - "failed (%d)\n", rc);
> + "failed (%d)\n", rc);
> return rc;
> }
The above is objectionable :-)
>
> diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
> index 6ea4698..a70de10 100644
> --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
> +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
> @@ -397,12 +397,12 @@ static int parse_cede_parameters(void)
> CEDE_LATENCY_PARAM_MAX_LENGTH);
>
> if (call_status != 0)
> - printk(KERN_INFO "CEDE_LATENCY: \
> - %s %s Error calling get-system-parameter(0x%x)\n",
> + printk(KERN_INFO "CEDE_LATENCY: "
> + "%s %s Error calling get-system-parameter(0x%x)\n",
> __FILE__, __func__, call_status);
> else
> - printk(KERN_INFO "CEDE_LATENCY: \
> - get-system-parameter successful.\n");
> + printk(KERN_INFO "CEDE_LATENCY: "
> + "get-system-parameter successful.\n");
>
> return call_status;
> }
> diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
> index b488663..4e7f89a 100644
> --- a/arch/powerpc/platforms/pseries/smp.c
> +++ b/arch/powerpc/platforms/pseries/smp.c
> @@ -144,8 +144,8 @@ static void __devinit smp_pSeries_kick_cpu(int nr)
> hcpuid = get_hard_smp_processor_id(nr);
> rc = plpar_hcall_norets(H_PROD, hcpuid);
> if (rc != H_SUCCESS)
> - printk(KERN_ERR "Error: Prod to wake up processor %d\
> - Ret= %ld\n", nr, rc);
> + printk(KERN_ERR "Error: Prod to wake up processor %d "
> + "Ret= %ld\n", nr, rc);
> }
> }
>
^ permalink raw reply
* [PATCH] powerpc/pseries: Fix xics build without CONFIG_SMP
From: Benjamin Herrenschmidt @ 2010-02-01 2:33 UTC (permalink / raw)
To: linuxppc-dev
desc->affinity doesn't exit in that case. Let's use a macro for
the UP variant of get_irq_server(), it's the easiest way, avoids
evaluating arguments.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/platforms/pseries/xics.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index d80f193..1ee66db 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -191,11 +191,7 @@ static int get_irq_server(unsigned int virq, cpumask_t cpumask,
return default_server;
}
#else
-static int get_irq_server(unsigned int virq, cpumask_t cpumask,
- unsigned int strict_check)
-{
- return default_server;
-}
+#define get_irq_server(virq, cpumask, strict_check) (default_server)
#endif
static void xics_unmask_irq(unsigned int virq)
^ permalink raw reply related
* [resend] Make the kernel accept ePAPR style phandle information
From: David Gibson @ 2010-02-01 4:52 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, devicetree-discuss
Grant, I've updated this for your current test-devicetree branch.
Please apply.
Currently when processing flattened device trees, the kernel expects
the phandle in a property called "linux,phandle". The ePAPR spec -
not being Linux specific - instead requires phandles to be encoded in
a property named simply "phandle". This patch makes the kernel accept
either form when unflattening the device tree.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Index: working-2.6/drivers/of/fdt.c
===================================================================
--- working-2.6.orig/drivers/of/fdt.c 2010-02-01 15:51:44.000000000 +1100
+++ working-2.6/drivers/of/fdt.c 2010-02-01 15:51:46.458557615 +1100
@@ -310,10 +310,19 @@ unsigned long __init unflatten_dt_node(u
pp = unflatten_dt_alloc(&mem, sizeof(struct property),
__alignof__(struct property));
if (allnextpp) {
- if (strcmp(pname, "linux,phandle") == 0) {
+ /* We accept flattened tree phandles either in
+ * ePAPR-style "phandle" properties, or the
+ * legacy "linux,phandle" properties. If both
+ * appear and have different values, things
+ * will get weird. Don't do that. */
+ if ((strcmp(pname, "phandle") == 0)
+ || (strcmp(pname, "linux,phandle") == 0)) {
if (np->phandle == 0)
np->phandle = *((u32 *)*p);
}
+ /* And we process the "ibm,phandle" property
+ * used in pSeries dynamic device tree
+ * stuff */
if (strcmp(pname, "ibm,phandle") == 0)
np->phandle = *((u32 *)*p);
pp->name = pname;
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply
* Re: [git pull] Please pull powerpc.git merge branch
From: Benjamin Herrenschmidt @ 2010-02-01 4:53 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Andrew Morton, linuxppc-dev list, Linux Kernel list
In-Reply-To: <1264894480.8287.7.camel@pasglop>
On Sun, 2010-01-31 at 10:34 +1100, Benjamin Herrenschmidt wrote:
> Hi Linus !
>
> Here are some more defconfig updates that I missed before LCA and a
> few PCI related fixes, some of them actually fixing regressions and
> one of them (the 4xx one) trivial enough that's really not worth
> delaying it.
I've just added 2 commits. One is the powerpc version of the
TIF_ABI_PENDING bit removal (thanks Andreas ! I love it when people do
my work for me :-) and the other one is a small compile fix (a
regression fix actually).
New log below.
Cheers,
Ben.
The following changes since commit b04da8bfdfbbd79544cab2fadfdc12e87eb01600:
Greg Kroah-Hartman (1):
fnctl: f_modown should call write_lock_irqsave/restore
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git merge
Andreas Schwab (1):
powerpc: TIF_ABI_PENDING bit removal
Benjamin Herrenschmidt (5):
powerpc/pci: Add calls to set_pcie_port_type() and set_pcie_hotplug_bridge()
powerpc/pci: Add missing hookup to pci_slot
powerpc/pci: Add missing call to header fixup
Merge commit 'jwb/merge' into merge
powerpc/pseries: Fix xics build without CONFIG_SMP
Josh Boyer (2):
powerpc/44x: Update PowerPC 44x board defconfigs
powerpc/40x: Update the PowerPC 40x board defconfigs
Stef van Os (1):
powerpc/4xx: Add pcix type 1 transactions
arch/powerpc/configs/40x/acadia_defconfig | 241 ++++++++++++++-----
arch/powerpc/configs/40x/ep405_defconfig | 307 ++++++++++++++++++------
arch/powerpc/configs/40x/hcu4_defconfig | 256 +++++++++++++++-----
arch/powerpc/configs/40x/kilauea_defconfig | 140 ++++++++---
arch/powerpc/configs/40x/makalu_defconfig | 190 ++++++++++-----
arch/powerpc/configs/40x/walnut_defconfig | 257 +++++++++++++++-----
arch/powerpc/configs/44x/arches_defconfig | 135 ++++++++---
arch/powerpc/configs/44x/bamboo_defconfig | 255 +++++++++++++++-----
arch/powerpc/configs/44x/canyonlands_defconfig | 141 ++++++++---
arch/powerpc/configs/44x/ebony_defconfig | 258 +++++++++++++++-----
arch/powerpc/configs/44x/eiger_defconfig | 128 +++++++---
arch/powerpc/configs/44x/katmai_defconfig | 253 +++++++++++++++-----
arch/powerpc/configs/44x/rainier_defconfig | 254 +++++++++++++++-----
arch/powerpc/configs/44x/redwood_defconfig | 274 +++++++++++++++------
arch/powerpc/configs/44x/sam440ep_defconfig | 284 +++++++++++++++-------
arch/powerpc/configs/44x/sequoia_defconfig | 202 +++++++++++-----
arch/powerpc/configs/44x/taishan_defconfig | 258 +++++++++++++++-----
arch/powerpc/configs/44x/warp_defconfig | 228 ++++++++++++------
arch/powerpc/configs/ppc40x_defconfig | 292 ++++++++++++++++-------
arch/powerpc/configs/ppc44x_defconfig | 309 +++++++++++++++++-------
arch/powerpc/include/asm/elf.h | 8 +-
arch/powerpc/include/asm/thread_info.h | 2 -
arch/powerpc/kernel/pci_of_scan.c | 10 +
arch/powerpc/kernel/process.c | 12 -
arch/powerpc/platforms/pseries/xics.c | 6 +-
arch/powerpc/sysdev/ppc4xx_pci.c | 3 +-
drivers/pci/probe.c | 4 +-
include/linux/pci.h | 4 +
28 files changed, 3412 insertions(+), 1299 deletions(-)
^ permalink raw reply
* Re: [PATCH] powerpc: Add DMA mask to MPSC serial and network and UART device to serial
From: Benjamin Herrenschmidt @ 2010-02-01 4:58 UTC (permalink / raw)
To: minyard; +Cc: linuxppc-dev
In-Reply-To: <20100130000407.GA16156@minyard.local>
On Fri, 2010-01-29 at 18:04 -0600, Corey Minyard wrote:
> From: Corey Minyard <cminyard@mvista.com>
>
> The MPSC drivers that use DMA need to set coherent_dma_mask to allow
> dma_alloc_xxx routines to work properly. Also, the mpsc serial driver
> needed to set pi->port.dev to register properly. With these fixes,
> the MPSC drivers seem to work again.
>
> Signed-off-by: Corey Minyard <cminyard@mvista.com>
> ---
Is that enough ? Since 2.6.31 we also need the dma ops to be filled
properly and obviously that isn't going to happen for random platform
devices... Or are those initialized elsewhere by your platform code ? In
which case it might be a good place to also set the coherent mask...
Maybe we should have a more generic way to set the "default" dma
information (including ops, masks etc...) for use by platform,
of_platform etc... devices.
Cheers,
Ben.
> I'm not really sure about where to set the coherent_dma_mask, it seems
> like a more general place would be better but I couldn't find it.
>
> Without these, the console stops working after the switchover and
> the network driver fails to allocate buffers. With these, my board
> boots up and works fine.
>
> Index: linux-2.6.31/drivers/serial/mpsc.c
> ===================================================================
> --- linux-2.6.31.orig/drivers/serial/mpsc.c
> +++ linux-2.6.31/drivers/serial/mpsc.c
> @@ -2071,6 +2071,9 @@ static int mpsc_drv_probe(struct platfor
> if (!(rc = mpsc_drv_map_regs(pi, dev))) {
> mpsc_drv_get_platform_data(pi, dev, dev->id);
>
> + dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
> + pi->port.dev = &dev->dev;
> +
> if (!(rc = mpsc_make_ready(pi))) {
> spin_lock_init(&pi->tx_lock);
> if (!(rc = uart_add_one_port(&mpsc_reg,
> Index: linux-2.6.31/drivers/net/mv643xx_eth.c
> ===================================================================
> --- linux-2.6.31.orig/drivers/net/mv643xx_eth.c
> +++ linux-2.6.31/drivers/net/mv643xx_eth.c
> @@ -2916,7 +2916,7 @@ static int mv643xx_eth_probe(struct plat
> mp->shared = platform_get_drvdata(pd->shared);
> mp->base = mp->shared->base + 0x0400 + (pd->port_number << 10);
> mp->port_num = pd->port_number;
> -
> + pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
> mp->dev = dev;
>
> set_params(mp, pd);
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply
* Re: [RFC:PATCH 01/03] powerpc: Extended ptrace interface
From: Benjamin Herrenschmidt @ 2010-02-01 5:08 UTC (permalink / raw)
To: Michael Neuling
Cc: Thiago Jung Bauermann, Dave Kleikamp, David Gibson,
linuxppc-dev list, Torez Smith, Sergio Durigan Junior
In-Reply-To: <14701.1264042076@neuling.org>
On Thu, 2010-01-21 at 15:47 +1300, Michael Neuling wrote:
> > powerpc: Extended ptrace interface
> > +static long ppc_set_hwdebug(struct task_struct *child,
> > + struct ppc_hw_breakpoint *bp_info)
> > +{
> > + /*
> > + * We currently support one data breakpoint
> > + */
> > + if (((bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_RW) == 0) ||
> > + ((bp_info->trigger_type & ~PPC_BREAKPOINT_TRIGGER_RW) != 0) ||
> > + (bp_info->trigger_type != PPC_BREAKPOINT_TRIGGER_WRITE) ||
> > + (bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT) ||
> > + (bp_info->condition_mode != PPC_BREAKPOINT_CONDITION_NONE))
> > + return -EINVAL;
> > +
> > + if (child->thread.dabr)
> > + return -ENOSPC;
> > +
> > + if ((unsigned long)bp_info->addr >= TASK_SIZE)
> > + return -EIO;
> > +
> > + child->thread.dabr = (unsigned long)bp_info->addr;
> > +#ifdef CONFIG_BOOKE
>
> Do we want to add these CONFIG_BOOKE into a ppc_md call, so different
> CPU typs can have different setups? I could see other CPUs might need
> to do different stuff here and we end up in #ifdef chaos
Actually, I don't think we need that level of indirection just now. If
there's ever a need for more ifdef's then ok, but the BookE debug
facility is somewhat architected so I wouldn't expect that much new
stuff.
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH] powerpc: Reduce footprint of xics_ipi_struct
From: Benjamin Herrenschmidt @ 2010-02-01 5:18 UTC (permalink / raw)
To: Anton Blanchard; +Cc: linuxppc-dev
In-Reply-To: <20100112105805.GJ12666@kryten>
On Tue, 2010-01-12 at 21:58 +1100, Anton Blanchard wrote:
> Index: linux-cpumask/arch/powerpc/include/asm/hardirq.h
> ===================================================================
> --- linux-cpumask.orig/arch/powerpc/include/asm/hardirq.h 2010-01-12 12:36:47.174226189 +1100
> +++ linux-cpumask/arch/powerpc/include/asm/hardirq.h 2010-01-12 12:36:47.432976459 +1100
> @@ -6,6 +6,9 @@
>
> typedef struct {
> unsigned int __softirq_pending;
> +#if defined(CONFIG_XICS) && defined(CONFIG_SMP)
> + unsigned long xics_ipi;
> +#endif
> } ____cacheline_aligned irq_cpustat_t;
This is still a gross abuse of irq_cpustat_t ... Can't we do
a separate DECLARE_PER_CPU_SHARED_ALIGNED(unsigned long, xics_ipi)
inside xics.c instead ?
Cheers,
Ben.
> DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
> Index: linux-cpumask/arch/powerpc/platforms/pseries/xics.c
> ===================================================================
> --- linux-cpumask.orig/arch/powerpc/platforms/pseries/xics.c 2010-01-12 12:36:46.905477650 +1100
> +++ linux-cpumask/arch/powerpc/platforms/pseries/xics.c 2010-01-12 12:40:54.782975198 +1100
> @@ -514,15 +514,12 @@ static void __init xics_init_host(void)
> /*
> * XICS only has a single IPI, so encode the messages per CPU
> */
> -struct xics_ipi_struct {
> - unsigned long value;
> - } ____cacheline_aligned;
> -
> -static struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned;
>
> static inline void smp_xics_do_message(int cpu, int msg)
> {
> - set_bit(msg, &xics_ipi_message[cpu].value);
> + unsigned long *tgt = &(per_cpu(irq_stat, cpu).xics_ipi);
> +
> + set_bit(msg, tgt);
> mb();
> if (firmware_has_feature(FW_FEATURE_LPAR))
> lpar_qirr_info(cpu, IPI_PRIORITY);
> @@ -548,25 +545,23 @@ void smp_xics_message_pass(int target, i
>
> static irqreturn_t xics_ipi_dispatch(int cpu)
> {
> + unsigned long *tgt = &(per_cpu(irq_stat, cpu).xics_ipi);
> +
> WARN_ON(cpu_is_offline(cpu));
>
> mb(); /* order mmio clearing qirr */
> - while (xics_ipi_message[cpu].value) {
> - if (test_and_clear_bit(PPC_MSG_CALL_FUNCTION,
> - &xics_ipi_message[cpu].value)) {
> + while (*tgt) {
> + if (test_and_clear_bit(PPC_MSG_CALL_FUNCTION, tgt)) {
> smp_message_recv(PPC_MSG_CALL_FUNCTION);
> }
> - if (test_and_clear_bit(PPC_MSG_RESCHEDULE,
> - &xics_ipi_message[cpu].value)) {
> + if (test_and_clear_bit(PPC_MSG_RESCHEDULE, tgt)) {
> smp_message_recv(PPC_MSG_RESCHEDULE);
> }
> - if (test_and_clear_bit(PPC_MSG_CALL_FUNC_SINGLE,
> - &xics_ipi_message[cpu].value)) {
> + if (test_and_clear_bit(PPC_MSG_CALL_FUNC_SINGLE, tgt)) {
> smp_message_recv(PPC_MSG_CALL_FUNC_SINGLE);
> }
> #if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC)
> - if (test_and_clear_bit(PPC_MSG_DEBUGGER_BREAK,
> - &xics_ipi_message[cpu].value)) {
> + if (test_and_clear_bit(PPC_MSG_DEBUGGER_BREAK, tgt)) {
> smp_message_recv(PPC_MSG_DEBUGGER_BREAK);
> }
> #endif
^ permalink raw reply
* Re: [PATCH] powerpc: Reduce footprint of irq_stat
From: Benjamin Herrenschmidt @ 2010-02-01 5:21 UTC (permalink / raw)
To: Anton Blanchard; +Cc: linuxppc-dev
In-Reply-To: <20100112105642.GI12666@kryten>
> +typedef struct {
> + unsigned int __softirq_pending;
> +} ____cacheline_aligned irq_cpustat_t;
> +
> +DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
> +
> +#define __ARCH_IRQ_STAT
> +
> +#define local_softirq_pending() __get_cpu_var(irq_stat).__softirq_pending
> +
> +static inline void ack_bad_irq(unsigned int irq)
> +{
> + printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq);
> +}
Looks like some unrelated gunk slipped into this patch :-)
Cheers,
Ben.
^ permalink raw reply
* powerpc -next branch
From: Benjamin Herrenschmidt @ 2010-02-01 5:43 UTC (permalink / raw)
To: linuxppc-dev
So I'm about to do a proper -next branch for the next round (it's about
time !). I'll probably push a handful or two of things in my 'test'
branch tonight, which are then going to hit -next in a day or two if
nobody complains.
There's more to pickup though.
However, the bulk of the stuff pending on patchwork this time around
seems to be freescale related and thus will go through Kumar or Grant
for 52xx related bits.
Kumar, when do you expect to have a -next for me ?
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH] powerpc: Reduce footprint of irq_stat
From: Anton Blanchard @ 2010-02-01 5:44 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1265001704.8287.31.camel@pasglop>
Hi,
> > +static inline void ack_bad_irq(unsigned int irq)
> > +{
> > + printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq);
> > +}
>
> Looks like some unrelated gunk slipped into this patch :-)
We need that to link :)
kernel/irq/handle.c: In function ‘handle_bad_irq’:
kernel/irq/handle.c:43: error: implicit declaration of function ‘ack_bad_irq’
It's basically a copy of the fallback handler in the asm-generic hardirq.h
I'm happy to change it print "IRQ on fire" :)
Anton
^ permalink raw reply
* [PATCH] powerpc/pseries: Pass CPPR value to H_XIRR hcall
From: Mark Nelson @ 2010-02-01 6:12 UTC (permalink / raw)
To: linuxppc-dev
Now that we properly keep track of the CPPR value (since
49bd3647134ea47420067aea8d1401e722bf2aac, "powerpc/pseries: Track previous
CPPR values to correctly EOI interrupts") we can pass it to the
H_XIRR hcall.
This is needed because the Partition Adjunct Option of new versions of
pHyp extend the H_XIRR hcall to include the CPPR as an input parameter.
Earlier versions not supporting this option just disregard the extra
input parameter, so this doesn't cause any problems for existing systems.
The Partition Adjunct Option is required for future systems that will
support SR-IOV capable devices.
Signed-off-by: Mark Nelson <markn@au1.ibm.com>
---
arch/powerpc/platforms/pseries/plpar_wrappers.h | 4 ++--
arch/powerpc/platforms/pseries/xics.c | 7 ++++---
2 files changed, 6 insertions(+), 5 deletions(-)
Index: upstream/arch/powerpc/platforms/pseries/plpar_wrappers.h
===================================================================
--- upstream.orig/arch/powerpc/platforms/pseries/plpar_wrappers.h
+++ upstream/arch/powerpc/platforms/pseries/plpar_wrappers.h
@@ -259,12 +259,12 @@ static inline long plpar_ipi(unsigned lo
return plpar_hcall_norets(H_IPI, servernum, mfrr);
}
-static inline long plpar_xirr(unsigned long *xirr_ret)
+static inline long plpar_xirr(unsigned long *xirr_ret, unsigned char cppr)
{
long rc;
unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
- rc = plpar_hcall(H_XIRR, retbuf);
+ rc = plpar_hcall(H_XIRR, retbuf, cppr);
*xirr_ret = retbuf[0];
Index: upstream/arch/powerpc/platforms/pseries/xics.c
===================================================================
--- upstream.orig/arch/powerpc/platforms/pseries/xics.c
+++ upstream/arch/powerpc/platforms/pseries/xics.c
@@ -120,12 +120,12 @@ static inline void direct_qirr_info(int
/* LPAR low level accessors */
-static inline unsigned int lpar_xirr_info_get(void)
+static inline unsigned int lpar_xirr_info_get(unsigned char cppr)
{
unsigned long lpar_rc;
unsigned long return_value;
- lpar_rc = plpar_xirr(&return_value);
+ lpar_rc = plpar_xirr(&return_value, cppr);
if (lpar_rc != H_SUCCESS)
panic(" bad return code xirr - rc = %lx \n", lpar_rc);
return (unsigned int)return_value;
@@ -335,7 +335,8 @@ static unsigned int xics_get_irq_direct(
static unsigned int xics_get_irq_lpar(void)
{
- unsigned int xirr = lpar_xirr_info_get();
+ struct xics_cppr *os_cppr = &__get_cpu_var(xics_cppr);
+ unsigned int xirr = lpar_xirr_info_get(os_cppr->stack[os_cppr->index]);
unsigned int vec = xics_xirr_vector(xirr);
unsigned int irq;
^ permalink raw reply
* Re: [PATCH] powerpc: Reduce footprint of xics_ipi_struct
From: Anton Blanchard @ 2010-02-01 6:26 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1265001510.8287.30.camel@pasglop>
Hi,
> > +#if defined(CONFIG_XICS) && defined(CONFIG_SMP)
> > + unsigned long xics_ipi;
> > +#endif
> > } ____cacheline_aligned irq_cpustat_t;
>
> This is still a gross abuse of irq_cpustat_t ... Can't we do
> a separate DECLARE_PER_CPU_SHARED_ALIGNED(unsigned long, xics_ipi)
> inside xics.c instead ?
Yeah it was a bit tasteless :) Respinning...
Anton
^ permalink raw reply
* [PATCH 1/7] powerpc: Reduce footprint of irq_stat
From: Anton Blanchard @ 2010-02-01 6:30 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
PowerPC is currently using asm-generic/hardirq.h which statically allocates an
NR_CPUS irq_stat array. Switch to an arch specific implementation which uses
per cpu data:
On a kernel with NR_CPUS=1024, this saves quite a lot of memory:
text data bss dec hex filename
8767938 2944132 1636796 13348866 cbb002 vmlinux.baseline
8767779 2944260 1505724 13217763 c9afe3 vmlinux.irq_cpustat
A saving of around 128kB.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-cpumask/arch/powerpc/include/asm/hardirq.h
===================================================================
--- linux-cpumask.orig/arch/powerpc/include/asm/hardirq.h 2010-01-31 22:07:21.037211728 +1100
+++ linux-cpumask/arch/powerpc/include/asm/hardirq.h 2010-02-01 17:28:56.990963256 +1100
@@ -1 +1,22 @@
-#include <asm-generic/hardirq.h>
+#ifndef _ASM_POWERPC_HARDIRQ_H
+#define _ASM_POWERPC_HARDIRQ_H
+
+#include <linux/threads.h>
+#include <linux/irq.h>
+
+typedef struct {
+ unsigned int __softirq_pending;
+} ____cacheline_aligned irq_cpustat_t;
+
+DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
+
+#define __ARCH_IRQ_STAT
+
+#define local_softirq_pending() __get_cpu_var(irq_stat).__softirq_pending
+
+static inline void ack_bad_irq(unsigned int irq)
+{
+ printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq);
+}
+
+#endif /* _ASM_POWERPC_HARDIRQ_H */
Index: linux-cpumask/arch/powerpc/kernel/irq.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/kernel/irq.c 2010-01-31 22:07:21.027213106 +1100
+++ linux-cpumask/arch/powerpc/kernel/irq.c 2010-02-01 17:28:56.880963661 +1100
@@ -73,6 +73,9 @@
#define CREATE_TRACE_POINTS
#include <asm/trace.h>
+DEFINE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
+EXPORT_PER_CPU_SYMBOL(irq_stat);
+
int __irq_offset_value;
static int ppc_spurious_interrupts;
^ permalink raw reply
* [PATCH 2/7] powerpc: Reduce footprint of xics_ipi_struct
From: Anton Blanchard @ 2010-02-01 6:32 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
In-Reply-To: <20100201063023.GT2996@kryten>
Right now we allocate a cacheline sized NR_CPUS array for xics IPI
communication. Use DECLARE_PER_CPU_SHARED_ALIGNED to put it in percpu
data in its own cacheline since it is written to by other cpus.
On a kernel with NR_CPUS=1024, this saves quite a lot of memory:
text data bss dec hex filename
8767779 2944260 1505724 13217763 c9afe3 vmlinux.irq_cpustat
8767555 2813444 1505724 13086723 c7b003 vmlinux.xics
A saving of around 128kB.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-cpumask/arch/powerpc/platforms/pseries/xics.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/platforms/pseries/xics.c 2010-02-01 17:28:56.980961887 +1100
+++ linux-cpumask/arch/powerpc/platforms/pseries/xics.c 2010-02-01 17:29:00.980963118 +1100
@@ -514,15 +514,13 @@ static void __init xics_init_host(void)
/*
* XICS only has a single IPI, so encode the messages per CPU
*/
-struct xics_ipi_struct {
- unsigned long value;
- } ____cacheline_aligned;
-
-static struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned;
+static DEFINE_PER_CPU_SHARED_ALIGNED(unsigned long, xics_ipi_message);
static inline void smp_xics_do_message(int cpu, int msg)
{
- set_bit(msg, &xics_ipi_message[cpu].value);
+ unsigned long *tgt = &per_cpu(xics_ipi_message, cpu);
+
+ set_bit(msg, tgt);
mb();
if (firmware_has_feature(FW_FEATURE_LPAR))
lpar_qirr_info(cpu, IPI_PRIORITY);
@@ -548,25 +546,23 @@ void smp_xics_message_pass(int target, i
static irqreturn_t xics_ipi_dispatch(int cpu)
{
+ unsigned long *tgt = &per_cpu(xics_ipi_message, cpu);
+
WARN_ON(cpu_is_offline(cpu));
mb(); /* order mmio clearing qirr */
- while (xics_ipi_message[cpu].value) {
- if (test_and_clear_bit(PPC_MSG_CALL_FUNCTION,
- &xics_ipi_message[cpu].value)) {
+ while (*tgt) {
+ if (test_and_clear_bit(PPC_MSG_CALL_FUNCTION, tgt)) {
smp_message_recv(PPC_MSG_CALL_FUNCTION);
}
- if (test_and_clear_bit(PPC_MSG_RESCHEDULE,
- &xics_ipi_message[cpu].value)) {
+ if (test_and_clear_bit(PPC_MSG_RESCHEDULE, tgt)) {
smp_message_recv(PPC_MSG_RESCHEDULE);
}
- if (test_and_clear_bit(PPC_MSG_CALL_FUNC_SINGLE,
- &xics_ipi_message[cpu].value)) {
+ if (test_and_clear_bit(PPC_MSG_CALL_FUNC_SINGLE, tgt)) {
smp_message_recv(PPC_MSG_CALL_FUNC_SINGLE);
}
#if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC)
- if (test_and_clear_bit(PPC_MSG_DEBUGGER_BREAK,
- &xics_ipi_message[cpu].value)) {
+ if (test_and_clear_bit(PPC_MSG_DEBUGGER_BREAK, tgt)) {
smp_message_recv(PPC_MSG_DEBUGGER_BREAK);
}
#endif
^ permalink raw reply
* [PATCH 3/7] powerpc: Rework /proc/interrupts
From: Anton Blanchard @ 2010-02-01 6:33 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
In-Reply-To: <20100201063251.GU2996@kryten>
On a large machine I noticed the columns of /proc/interrupts failed to line up
with the header after CPU9. At sufficiently large numbers of CPUs it becomes
impossible to line up the CPU number with the counts.
While fixing this I noticed x86 has a number of updates that we may as well
pull in. On PowerPC we currently omit an interrupt completely if there is no
active handler, whereas on x86 it is printed if there is a non zero count.
The x86 code also spaces the first column correctly based on nr_irqs.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-cpumask/arch/powerpc/kernel/irq.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/kernel/irq.c 2010-02-01 17:28:56.880963661 +1100
+++ linux-cpumask/arch/powerpc/kernel/irq.c 2010-02-01 17:29:02.007212291 +1100
@@ -183,30 +183,46 @@ notrace void raw_local_irq_restore(unsig
EXPORT_SYMBOL(raw_local_irq_restore);
#endif /* CONFIG_PPC64 */
+static int show_other_interrupts(struct seq_file *p, int prec)
+{
+ int j;
+
+#if defined(CONFIG_PPC32) && defined(CONFIG_TAU_INT)
+ if (tau_initialized) {
+ seq_printf(p, "%*s: ", prec, "TAU");
+ for_each_online_cpu(j)
+ seq_printf(p, "%10u ", tau_interrupts(j));
+ seq_puts(p, " PowerPC Thermal Assist (cpu temp)\n");
+ }
+#endif /* CONFIG_PPC32 && CONFIG_TAU_INT */
+
+ seq_printf(p, "%*s: %10u\n", prec, "BAD", ppc_spurious_interrupts);
+
+ return 0;
+}
+
int show_interrupts(struct seq_file *p, void *v)
{
- int i = *(loff_t *)v, j;
+ unsigned long flags, any_count = 0;
+ int i = *(loff_t *) v, j, prec;
struct irqaction *action;
struct irq_desc *desc;
- unsigned long flags;
+ if (i > nr_irqs)
+ return 0;
+
+ for (prec = 3, j = 1000; prec < 10 && j <= nr_irqs; ++prec)
+ j *= 10;
+
+ if (i == nr_irqs)
+ return show_other_interrupts(p, prec);
+
+ /* print header */
if (i == 0) {
- seq_puts(p, " ");
+ seq_printf(p, "%*s", prec + 8, "");
for_each_online_cpu(j)
- seq_printf(p, "CPU%d ", j);
+ seq_printf(p, "CPU%-8d", j);
seq_putc(p, '\n');
- } else if (i == nr_irqs) {
-#if defined(CONFIG_PPC32) && defined(CONFIG_TAU_INT)
- if (tau_initialized){
- seq_puts(p, "TAU: ");
- for_each_online_cpu(j)
- seq_printf(p, "%10u ", tau_interrupts(j));
- seq_puts(p, " PowerPC Thermal Assist (cpu temp)\n");
- }
-#endif /* CONFIG_PPC32 && CONFIG_TAU_INT*/
- seq_printf(p, "BAD: %10u\n", ppc_spurious_interrupts);
-
- return 0;
}
desc = irq_to_desc(i);
@@ -214,34 +230,31 @@ int show_interrupts(struct seq_file *p,
return 0;
raw_spin_lock_irqsave(&desc->lock, flags);
-
+ for_each_online_cpu(j)
+ any_count |= kstat_irqs_cpu(i, j);
action = desc->action;
- if (!action || !action->handler)
- goto skip;
+ if (!action && !any_count)
+ goto out;
- seq_printf(p, "%3d: ", i);
-#ifdef CONFIG_SMP
+ seq_printf(p, "%*d: ", prec, i);
for_each_online_cpu(j)
seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
-#else
- seq_printf(p, "%10u ", kstat_irqs(i));
-#endif /* CONFIG_SMP */
if (desc->chip)
- seq_printf(p, " %s ", desc->chip->name);
+ seq_printf(p, " %-16s", desc->chip->name);
else
- seq_puts(p, " None ");
+ seq_printf(p, " %-16s", "None");
+ seq_printf(p, " %-8s", (desc->status & IRQ_LEVEL) ? "Level" : "Edge");
- seq_printf(p, "%s", (desc->status & IRQ_LEVEL) ? "Level " : "Edge ");
- seq_printf(p, " %s", action->name);
+ if (action) {
+ seq_printf(p, " %s", action->name);
+ while ((action = action->next) != NULL)
+ seq_printf(p, ", %s", action->name);
+ }
- for (action = action->next; action; action = action->next)
- seq_printf(p, ", %s", action->name);
seq_putc(p, '\n');
-
-skip:
+out:
raw_spin_unlock_irqrestore(&desc->lock, flags);
-
return 0;
}
^ permalink raw reply
* [PATCH 4/7] powerpc: Remove whitespace in irq chip name fields
From: Anton Blanchard @ 2010-02-01 6:33 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
In-Reply-To: <20100201063318.GV2996@kryten>
Now we use printf style alignment there is no need to manually space
these fields.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-cpumask/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c 2010-02-01 17:28:56.700961947 +1100
+++ linux-cpumask/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c 2010-02-01 17:29:02.987211921 +1100
@@ -79,7 +79,7 @@ cpld_unmask_irq(unsigned int irq)
}
static struct irq_chip cpld_pic = {
- .name = " CPLD PIC ",
+ .name = "CPLD PIC",
.mask = cpld_mask_irq,
.ack = cpld_mask_irq,
.unmask = cpld_unmask_irq,
Index: linux-cpumask/arch/powerpc/platforms/85xx/socrates_fpga_pic.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/platforms/85xx/socrates_fpga_pic.c 2010-02-01 17:28:56.750962488 +1100
+++ linux-cpumask/arch/powerpc/platforms/85xx/socrates_fpga_pic.c 2010-02-01 17:29:02.997212166 +1100
@@ -232,7 +232,7 @@ static int socrates_fpga_pic_set_type(un
}
static struct irq_chip socrates_fpga_pic_chip = {
- .name = " FPGA-PIC ",
+ .name = "FPGA-PIC",
.ack = socrates_fpga_pic_ack,
.mask = socrates_fpga_pic_mask,
.mask_ack = socrates_fpga_pic_mask_ack,
Index: linux-cpumask/arch/powerpc/platforms/cell/beat_interrupt.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/platforms/cell/beat_interrupt.c 2010-02-01 17:28:56.720961496 +1100
+++ linux-cpumask/arch/powerpc/platforms/cell/beat_interrupt.c 2010-02-01 17:29:02.997212166 +1100
@@ -110,7 +110,7 @@ static void beatic_end_irq(unsigned int
}
static struct irq_chip beatic_pic = {
- .name = " CELL-BEAT ",
+ .name = "CELL-BEAT",
.unmask = beatic_unmask_irq,
.mask = beatic_mask_irq,
.eoi = beatic_end_irq,
Index: linux-cpumask/arch/powerpc/platforms/cell/interrupt.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/platforms/cell/interrupt.c 2010-02-01 17:28:56.730973203 +1100
+++ linux-cpumask/arch/powerpc/platforms/cell/interrupt.c 2010-02-01 17:29:02.997212166 +1100
@@ -88,7 +88,7 @@ static void iic_eoi(unsigned int irq)
}
static struct irq_chip iic_chip = {
- .name = " CELL-IIC ",
+ .name = "CELL-IIC",
.mask = iic_mask,
.unmask = iic_unmask,
.eoi = iic_eoi,
@@ -133,7 +133,7 @@ static void iic_ioexc_cascade(unsigned i
static struct irq_chip iic_ioexc_chip = {
- .name = " CELL-IOEX",
+ .name = "CELL-IOEX",
.mask = iic_mask,
.unmask = iic_unmask,
.eoi = iic_ioexc_eoi,
Index: linux-cpumask/arch/powerpc/platforms/cell/spider-pic.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/platforms/cell/spider-pic.c 2010-02-01 17:28:56.720961496 +1100
+++ linux-cpumask/arch/powerpc/platforms/cell/spider-pic.c 2010-02-01 17:29:02.997212166 +1100
@@ -168,7 +168,7 @@ static int spider_set_irq_type(unsigned
}
static struct irq_chip spider_pic = {
- .name = " SPIDER ",
+ .name = "SPIDER",
.unmask = spider_unmask_irq,
.mask = spider_mask_irq,
.ack = spider_ack_irq,
Index: linux-cpumask/arch/powerpc/platforms/iseries/irq.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/platforms/iseries/irq.c 2010-02-01 17:28:56.690961770 +1100
+++ linux-cpumask/arch/powerpc/platforms/iseries/irq.c 2010-02-01 17:29:02.997212166 +1100
@@ -273,7 +273,7 @@ static void iseries_end_IRQ(unsigned int
}
static struct irq_chip iseries_pic = {
- .name = "iSeries irq controller",
+ .name = "iSeries",
.startup = iseries_startup_IRQ,
.shutdown = iseries_shutdown_IRQ,
.unmask = iseries_enable_IRQ,
Index: linux-cpumask/arch/powerpc/platforms/powermac/pic.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/platforms/powermac/pic.c 2010-02-01 17:28:56.710961247 +1100
+++ linux-cpumask/arch/powerpc/platforms/powermac/pic.c 2010-02-01 17:29:02.997212166 +1100
@@ -195,7 +195,7 @@ static int pmac_retrigger(unsigned int v
}
static struct irq_chip pmac_pic = {
- .name = " PMAC-PIC ",
+ .name = "PMAC-PIC",
.startup = pmac_startup_irq,
.mask = pmac_mask_irq,
.ack = pmac_ack_irq,
Index: linux-cpumask/arch/powerpc/platforms/pseries/xics.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/platforms/pseries/xics.c 2010-02-01 17:29:00.980963118 +1100
+++ linux-cpumask/arch/powerpc/platforms/pseries/xics.c 2010-02-01 17:29:02.997212166 +1100
@@ -428,7 +428,7 @@ static int xics_set_affinity(unsigned in
}
static struct irq_chip xics_pic_direct = {
- .name = " XICS ",
+ .name = "XICS",
.startup = xics_startup,
.mask = xics_mask_irq,
.unmask = xics_unmask_irq,
@@ -437,7 +437,7 @@ static struct irq_chip xics_pic_direct =
};
static struct irq_chip xics_pic_lpar = {
- .name = " XICS ",
+ .name = "XICS",
.startup = xics_startup,
.mask = xics_mask_irq,
.unmask = xics_unmask_irq,
Index: linux-cpumask/arch/powerpc/sysdev/cpm1.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/sysdev/cpm1.c 2010-02-01 17:28:56.810962592 +1100
+++ linux-cpumask/arch/powerpc/sysdev/cpm1.c 2010-02-01 17:29:02.997212166 +1100
@@ -77,7 +77,7 @@ static void cpm_end_irq(unsigned int irq
}
static struct irq_chip cpm_pic = {
- .name = " CPM PIC ",
+ .name = "CPM PIC",
.mask = cpm_mask_irq,
.unmask = cpm_unmask_irq,
.eoi = cpm_end_irq,
Index: linux-cpumask/arch/powerpc/sysdev/cpm2_pic.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/sysdev/cpm2_pic.c 2010-02-01 17:28:56.830961830 +1100
+++ linux-cpumask/arch/powerpc/sysdev/cpm2_pic.c 2010-02-01 17:29:02.997212166 +1100
@@ -198,7 +198,7 @@ err_sense:
}
static struct irq_chip cpm2_pic = {
- .name = " CPM2 SIU ",
+ .name = "CPM2 SIU",
.mask = cpm2_mask_irq,
.unmask = cpm2_unmask_irq,
.ack = cpm2_ack,
Index: linux-cpumask/arch/powerpc/sysdev/fsl_msi.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/sysdev/fsl_msi.c 2010-02-01 17:28:56.790962373 +1100
+++ linux-cpumask/arch/powerpc/sysdev/fsl_msi.c 2010-02-01 17:29:02.997212166 +1100
@@ -47,7 +47,7 @@ static struct irq_chip fsl_msi_chip = {
.mask = mask_msi_irq,
.unmask = unmask_msi_irq,
.ack = fsl_msi_end_irq,
- .name = " FSL-MSI ",
+ .name = "FSL-MSI",
};
static int fsl_msi_host_map(struct irq_host *h, unsigned int virq,
Index: linux-cpumask/arch/powerpc/sysdev/i8259.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/sysdev/i8259.c 2010-02-01 17:28:56.800961602 +1100
+++ linux-cpumask/arch/powerpc/sysdev/i8259.c 2010-02-01 17:29:02.997212166 +1100
@@ -135,7 +135,7 @@ static void i8259_unmask_irq(unsigned in
}
static struct irq_chip i8259_pic = {
- .name = " i8259 ",
+ .name = "i8259",
.mask = i8259_mask_irq,
.disable = i8259_mask_irq,
.unmask = i8259_unmask_irq,
Index: linux-cpumask/arch/powerpc/sysdev/ipic.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/sysdev/ipic.c 2010-02-01 17:28:56.770971720 +1100
+++ linux-cpumask/arch/powerpc/sysdev/ipic.c 2010-02-01 17:29:02.997212166 +1100
@@ -660,7 +660,7 @@ static int ipic_set_irq_type(unsigned in
/* level interrupts and edge interrupts have different ack operations */
static struct irq_chip ipic_level_irq_chip = {
- .name = " IPIC ",
+ .name = "IPIC",
.unmask = ipic_unmask_irq,
.mask = ipic_mask_irq,
.mask_ack = ipic_mask_irq,
@@ -668,7 +668,7 @@ static struct irq_chip ipic_level_irq_ch
};
static struct irq_chip ipic_edge_irq_chip = {
- .name = " IPIC ",
+ .name = "IPIC",
.unmask = ipic_unmask_irq,
.mask = ipic_mask_irq,
.mask_ack = ipic_mask_irq_and_ack,
Index: linux-cpumask/arch/powerpc/sysdev/mpc8xx_pic.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/sysdev/mpc8xx_pic.c 2010-02-01 17:28:56.780962529 +1100
+++ linux-cpumask/arch/powerpc/sysdev/mpc8xx_pic.c 2010-02-01 17:29:02.997212166 +1100
@@ -94,7 +94,7 @@ static int mpc8xx_set_irq_type(unsigned
}
static struct irq_chip mpc8xx_pic = {
- .name = " MPC8XX SIU ",
+ .name = "MPC8XX SIU",
.unmask = mpc8xx_unmask_irq,
.mask = mpc8xx_mask_irq,
.ack = mpc8xx_ack,
Index: linux-cpumask/arch/powerpc/sysdev/mpic_pasemi_msi.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/sysdev/mpic_pasemi_msi.c 2010-02-01 17:28:56.820964610 +1100
+++ linux-cpumask/arch/powerpc/sysdev/mpic_pasemi_msi.c 2010-02-01 17:29:02.997212166 +1100
@@ -60,7 +60,7 @@ static struct irq_chip mpic_pasemi_msi_c
.eoi = mpic_end_irq,
.set_type = mpic_set_irq_type,
.set_affinity = mpic_set_affinity,
- .name = "PASEMI-MSI ",
+ .name = "PASEMI-MSI",
};
static int pasemi_msi_check_device(struct pci_dev *pdev, int nvec, int type)
Index: linux-cpumask/arch/powerpc/sysdev/qe_lib/qe_ic.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/sysdev/qe_lib/qe_ic.c 2010-02-01 17:28:56.780962529 +1100
+++ linux-cpumask/arch/powerpc/sysdev/qe_lib/qe_ic.c 2010-02-01 17:29:02.997212166 +1100
@@ -237,7 +237,7 @@ static void qe_ic_mask_irq(unsigned int
}
static struct irq_chip qe_ic_irq_chip = {
- .name = " QEIC ",
+ .name = "QEIC",
.unmask = qe_ic_unmask_irq,
.mask = qe_ic_mask_irq,
.mask_ack = qe_ic_mask_irq,
Index: linux-cpumask/arch/powerpc/sysdev/uic.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/sysdev/uic.c 2010-02-01 17:28:56.760964179 +1100
+++ linux-cpumask/arch/powerpc/sysdev/uic.c 2010-02-01 17:29:02.997212166 +1100
@@ -177,7 +177,7 @@ static int uic_set_irq_type(unsigned int
}
static struct irq_chip uic_irq_chip = {
- .name = " UIC ",
+ .name = "UIC",
.unmask = uic_unmask_irq,
.mask = uic_mask_irq,
.mask_ack = uic_mask_ack_irq,
^ permalink raw reply
* [PATCH 5/7] powerpc: Add timer, performance monitor and machine check counts to /proc/interrupts
From: Anton Blanchard @ 2010-02-01 6:34 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
In-Reply-To: <20100201063341.GW2996@kryten>
With NO_HZ it is useful to know how often the decrementer is going off. The
patch below adds an entry for it and also adds it into the /proc/stat
summaries.
While here, I added performance monitoring and machine check exceptions.
I found it useful to keep an eye on the PMU exception rate
when using the perf tool. Since it's possible to take a completely
handled machine check on a System p box it also sounds like a good idea to
keep a machine check summary.
The event naming matches x86 to keep gratuitous differences to a minimum.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
If people really don't like the x86 short names, we can think up something
else.
Index: linux-cpumask/arch/powerpc/include/asm/hardirq.h
===================================================================
--- linux-cpumask.orig/arch/powerpc/include/asm/hardirq.h 2010-02-01 17:28:56.990963256 +1100
+++ linux-cpumask/arch/powerpc/include/asm/hardirq.h 2010-02-01 17:29:03.887211643 +1100
@@ -6,6 +6,9 @@
typedef struct {
unsigned int __softirq_pending;
+ unsigned int timer_irqs;
+ unsigned int pmu_irqs;
+ unsigned int mce_exceptions;
} ____cacheline_aligned irq_cpustat_t;
DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
@@ -19,4 +22,10 @@ static inline void ack_bad_irq(unsigned
printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq);
}
+extern u64 arch_irq_stat_cpu(unsigned int cpu);
+#define arch_irq_stat_cpu arch_irq_stat_cpu
+
+extern u64 arch_irq_stat(void);
+#define arch_irq_stat arch_irq_stat
+
#endif /* _ASM_POWERPC_HARDIRQ_H */
Index: linux-cpumask/arch/powerpc/kernel/time.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/kernel/time.c 2010-02-01 17:28:56.590961781 +1100
+++ linux-cpumask/arch/powerpc/kernel/time.c 2010-02-01 17:29:03.887211643 +1100
@@ -575,6 +575,8 @@ void timer_interrupt(struct pt_regs * re
trace_timer_interrupt_entry(regs);
+ __get_cpu_var(irq_stat).timer_irqs++;
+
/* Ensure a positive value is written to the decrementer, or else
* some CPUs will continuue to take decrementer exceptions */
set_dec(DECREMENTER_MAX);
Index: linux-cpumask/arch/powerpc/kernel/irq.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/kernel/irq.c 2010-02-01 17:29:02.007212291 +1100
+++ linux-cpumask/arch/powerpc/kernel/irq.c 2010-02-01 17:29:03.887211643 +1100
@@ -196,6 +196,21 @@ static int show_other_interrupts(struct
}
#endif /* CONFIG_PPC32 && CONFIG_TAU_INT */
+ seq_printf(p, "%*s: ", prec, "LOC");
+ for_each_online_cpu(j)
+ seq_printf(p, "%10u ", per_cpu(irq_stat, j).timer_irqs);
+ seq_printf(p, " Local timer interrupts\n");
+
+ seq_printf(p, "%*s: ", prec, "CNT");
+ for_each_online_cpu(j)
+ seq_printf(p, "%10u ", per_cpu(irq_stat, j).pmu_irqs);
+ seq_printf(p, " Performance monitoring interrupts\n");
+
+ seq_printf(p, "%*s: ", prec, "MCE");
+ for_each_online_cpu(j)
+ seq_printf(p, "%10u ", per_cpu(irq_stat, j).mce_exceptions);
+ seq_printf(p, " Machine check exceptions\n");
+
seq_printf(p, "%*s: %10u\n", prec, "BAD", ppc_spurious_interrupts);
return 0;
@@ -258,6 +273,26 @@ out:
return 0;
}
+/*
+ * /proc/stat helpers
+ */
+u64 arch_irq_stat_cpu(unsigned int cpu)
+{
+ u64 sum = per_cpu(irq_stat, cpu).timer_irqs;
+
+ sum += per_cpu(irq_stat, cpu).pmu_irqs;
+ sum += per_cpu(irq_stat, cpu).mce_exceptions;
+
+ return sum;
+}
+
+u64 arch_irq_stat(void)
+{
+ u64 sum = ppc_spurious_interrupts;
+
+ return sum;
+}
+
#ifdef CONFIG_HOTPLUG_CPU
void fixup_irqs(cpumask_t map)
{
Index: linux-cpumask/arch/powerpc/kernel/traps.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/kernel/traps.c 2010-02-01 17:28:56.570961322 +1100
+++ linux-cpumask/arch/powerpc/kernel/traps.c 2010-02-01 17:29:03.897211396 +1100
@@ -478,6 +478,8 @@ void machine_check_exception(struct pt_r
{
int recover = 0;
+ __get_cpu_var(irq_stat).mce_exceptions++;
+
/* See if any machine dependent calls. In theory, we would want
* to call the CPU first, and call the ppc_md. one if the CPU
* one returns a positive number. However there is existing code
@@ -960,6 +962,8 @@ void vsx_unavailable_exception(struct pt
void performance_monitor_exception(struct pt_regs *regs)
{
+ __get_cpu_var(irq_stat).pmu_irqs++;
+
perf_irq(regs);
}
^ permalink raw reply
* [PATCH 6/7] powerpc: Convert global "BAD" interrupt to per cpu spurious
From: Anton Blanchard @ 2010-02-01 6:34 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
In-Reply-To: <20100201063406.GX2996@kryten>
I often get asked if BAD interrupts are really bad. On some boxes (eg
IBM machines running a hypervisor) there are valid cases where are
presented with an interrupt that is not for us. These cases are common
enough to show up as thousands of BAD interrupts a day.
Tone them down by calling them spurious. Since they can be a significant cause
of OS jitter, we may as well log them per cpu so we know where they are
occurring.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Again, the short name matches x86 but if people are sufficiently confused by
it ("SPU"), then we can think up something else.
Index: linux-cpumask/arch/powerpc/include/asm/hardirq.h
===================================================================
--- linux-cpumask.orig/arch/powerpc/include/asm/hardirq.h 2010-02-01 17:29:03.887211643 +1100
+++ linux-cpumask/arch/powerpc/include/asm/hardirq.h 2010-02-01 17:29:04.738461552 +1100
@@ -9,6 +9,7 @@ typedef struct {
unsigned int timer_irqs;
unsigned int pmu_irqs;
unsigned int mce_exceptions;
+ unsigned int spurious_irqs;
} ____cacheline_aligned irq_cpustat_t;
DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
@@ -25,7 +26,4 @@ static inline void ack_bad_irq(unsigned
extern u64 arch_irq_stat_cpu(unsigned int cpu);
#define arch_irq_stat_cpu arch_irq_stat_cpu
-extern u64 arch_irq_stat(void);
-#define arch_irq_stat arch_irq_stat
-
#endif /* _ASM_POWERPC_HARDIRQ_H */
Index: linux-cpumask/arch/powerpc/kernel/irq.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/kernel/irq.c 2010-02-01 17:29:03.887211643 +1100
+++ linux-cpumask/arch/powerpc/kernel/irq.c 2010-02-01 17:29:04.738461552 +1100
@@ -77,7 +77,6 @@ DEFINE_PER_CPU_SHARED_ALIGNED(irq_cpusta
EXPORT_PER_CPU_SYMBOL(irq_stat);
int __irq_offset_value;
-static int ppc_spurious_interrupts;
#ifdef CONFIG_PPC32
EXPORT_SYMBOL(__irq_offset_value);
@@ -201,6 +200,11 @@ static int show_other_interrupts(struct
seq_printf(p, "%10u ", per_cpu(irq_stat, j).timer_irqs);
seq_printf(p, " Local timer interrupts\n");
+ seq_printf(p, "%*s: ", prec, "SPU");
+ for_each_online_cpu(j)
+ seq_printf(p, "%10u ", per_cpu(irq_stat, j).spurious_irqs);
+ seq_printf(p, " Spurious interrupts\n");
+
seq_printf(p, "%*s: ", prec, "CNT");
for_each_online_cpu(j)
seq_printf(p, "%10u ", per_cpu(irq_stat, j).pmu_irqs);
@@ -211,8 +215,6 @@ static int show_other_interrupts(struct
seq_printf(p, "%10u ", per_cpu(irq_stat, j).mce_exceptions);
seq_printf(p, " Machine check exceptions\n");
- seq_printf(p, "%*s: %10u\n", prec, "BAD", ppc_spurious_interrupts);
-
return 0;
}
@@ -282,13 +284,7 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
sum += per_cpu(irq_stat, cpu).pmu_irqs;
sum += per_cpu(irq_stat, cpu).mce_exceptions;
-
- return sum;
-}
-
-u64 arch_irq_stat(void)
-{
- u64 sum = ppc_spurious_interrupts;
+ sum += per_cpu(irq_stat, cpu).spurious_irqs;
return sum;
}
@@ -404,8 +400,7 @@ void do_IRQ(struct pt_regs *regs)
if (irq != NO_IRQ && irq != NO_IRQ_IGNORE)
handle_one_irq(irq);
else if (irq != NO_IRQ_IGNORE)
- /* That's not SMP safe ... but who cares ? */
- ppc_spurious_interrupts++;
+ __get_cpu_var(irq_stat).spurious_irqs++;
irq_exit();
set_irq_regs(old_regs);
^ permalink raw reply
* [PATCH 7/7] powerpc: Increase NR_IRQS Kconfig maximum to 32768
From: Anton Blanchard @ 2010-02-01 6:34 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
In-Reply-To: <20100201063436.GY2996@kryten>
With dynamic irq descriptors the overhead of a large NR_IRQS is much lower
than it used to be. With more MSI-X capable adapters and drivers exploiting
multiple vectors we may as well allow the user to increase it beyond the
current maximum of 512.
32768 seems large enough that we'd never have to bump it again (although I bet
my prediction is horribly wrong). It boot tests OK and the vmlinux footprint
increase is only around 500kB due to:
struct irq_map_entry irq_map[NR_IRQS];
We format /proc/interrupts correctly with the previous changes:
CPU0 CPU1 CPU2 CPU3 CPU4 CPU5
286: 0 0 0 0 0 0
516: 0 0 0 0 0 0
16689: 1833 0 0 0 0 0
17157: 0 0 0 0 0 0
17158: 319 0 0 0 0 0
25092: 0 0 0 0 0 0
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-cpumask/arch/powerpc/Kconfig
===================================================================
--- linux-cpumask.orig/arch/powerpc/Kconfig 2010-02-01 17:28:56.400961742 +1100
+++ linux-cpumask/arch/powerpc/Kconfig 2010-02-01 17:29:05.609711618 +1100
@@ -58,7 +58,7 @@ config IRQ_PER_CPU
config NR_IRQS
int "Number of virtual interrupt numbers"
- range 32 512
+ range 32 32768
default "512"
help
This defines the number of virtual interrupt numbers the kernel
^ permalink raw reply
* [PATCH v5 0/3] i2c-mpc: add support for the Freescale MPC512x and other fixes
From: Wolfgang Grandegger @ 2010-02-01 7:37 UTC (permalink / raw)
To: Linux-i2c; +Cc: Devicetree-discuss, Linuxppc-dev, Ben Dooks
This patch series adds support for the MPC512x from Freescale to the
i2c-mpc driver. At that occasion, issues with __devinit[data] have
been fixed and the doc of the FSL I2C dts bindings updated. It has
been tested on a MPC5121ADS, TQM5200 and TQM8560 board
Changes since v1:
- use macro MPC_I2C_CLOCK_PRESERVE/SAFE for the special clock settings.
- document the special DTS node "fsl,mpc5121-i2c-ctrl".
- update and correct the Kconfig help.
- some other minor fixes as suggested by Wolfram.
Changes since v2:
- use __init[data] instead of __devinit[data] for this driver.
Changes since v3:
- switch back to __devinit[data] as pointed out by Ben.
Changes since v4:
- check MPC_I2C_CLOCK_SAFE instead of "!clock" as suggested by Wolfram.
- update MODULE_DESCRIPTION().
Wolfgang
Wolfgang Grandegger (3):
i2c-mpc: use __devinit[data] for initialization functions and data
i2c-mpc: add support for the MPC512x processors from Freescale
powerpc: doc/dts-bindings: update doc of FSL I2C bindings
Documentation/powerpc/dts-bindings/fsl/i2c.txt | 30 +++-
drivers/i2c/busses/Kconfig | 7 +-
drivers/i2c/busses/i2c-mpc.c | 198 +++++++++++++++---------
3 files changed, 150 insertions(+), 85 deletions(-)
^ permalink raw reply
* [PATCH v5 1/3] i2c-mpc: use __devinit[data] for initialization functions and data
From: Wolfgang Grandegger @ 2010-02-01 7:37 UTC (permalink / raw)
To: Linux-i2c
Cc: Devicetree-discuss, Linuxppc-dev, Wolfgang Grandegger, Ben Dooks
In-Reply-To: <1265009836-26398-1-git-send-email-wg@grandegger.com>
From: Wolfgang Grandegger <wg@denx.de>
"__devinit[data]" has not yet been used for all initialization functions
and data. To avoid truncating lines, the struct "mpc_i2c_match_data" has
been renamed to "mpc_i2c_data", which is even the better name.
Signed-off-by: Wolfgang Grandegger <wg@denx.de>
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
---
drivers/i2c/busses/i2c-mpc.c | 103 +++++++++++++++++++----------------------
1 files changed, 48 insertions(+), 55 deletions(-)
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index f627001..275ebe6 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -66,7 +66,7 @@ struct mpc_i2c_divider {
u16 fdr; /* including dfsrr */
};
-struct mpc_i2c_match_data {
+struct mpc_i2c_data {
void (*setclock)(struct device_node *node,
struct mpc_i2c *i2c,
u32 clock, u32 prescaler);
@@ -165,7 +165,7 @@ static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, int writing)
}
#ifdef CONFIG_PPC_MPC52xx
-static const struct mpc_i2c_divider mpc_i2c_dividers_52xx[] = {
+static const struct __devinitdata mpc_i2c_divider mpc_i2c_dividers_52xx[] = {
{20, 0x20}, {22, 0x21}, {24, 0x22}, {26, 0x23},
{28, 0x24}, {30, 0x01}, {32, 0x25}, {34, 0x02},
{36, 0x26}, {40, 0x27}, {44, 0x04}, {48, 0x28},
@@ -186,7 +186,8 @@ static const struct mpc_i2c_divider mpc_i2c_dividers_52xx[] = {
{10240, 0x9d}, {12288, 0x9e}, {15360, 0x9f}
};
-int mpc_i2c_get_fdr_52xx(struct device_node *node, u32 clock, int prescaler)
+static int __devinit mpc_i2c_get_fdr_52xx(struct device_node *node, u32 clock,
+ int prescaler)
{
const struct mpc_i2c_divider *div = NULL;
unsigned int pvr = mfspr(SPRN_PVR);
@@ -215,9 +216,9 @@ int mpc_i2c_get_fdr_52xx(struct device_node *node, u32 clock, int prescaler)
return div ? (int)div->fdr : -EINVAL;
}
-static void mpc_i2c_setclock_52xx(struct device_node *node,
- struct mpc_i2c *i2c,
- u32 clock, u32 prescaler)
+static void __devinit mpc_i2c_setclock_52xx(struct device_node *node,
+ struct mpc_i2c *i2c,
+ u32 clock, u32 prescaler)
{
int ret, fdr;
@@ -230,15 +231,15 @@ static void mpc_i2c_setclock_52xx(struct device_node *node,
dev_info(i2c->dev, "clock %d Hz (fdr=%d)\n", clock, fdr);
}
#else /* !CONFIG_PPC_MPC52xx */
-static void mpc_i2c_setclock_52xx(struct device_node *node,
- struct mpc_i2c *i2c,
- u32 clock, u32 prescaler)
+static void __devinit mpc_i2c_setclock_52xx(struct device_node *node,
+ struct mpc_i2c *i2c,
+ u32 clock, u32 prescaler)
{
}
#endif /* CONFIG_PPC_MPC52xx*/
#ifdef CONFIG_FSL_SOC
-static const struct mpc_i2c_divider mpc_i2c_dividers_8xxx[] = {
+static const struct __devinitdata mpc_i2c_divider mpc_i2c_dividers_8xxx[] = {
{160, 0x0120}, {192, 0x0121}, {224, 0x0122}, {256, 0x0123},
{288, 0x0100}, {320, 0x0101}, {352, 0x0601}, {384, 0x0102},
{416, 0x0602}, {448, 0x0126}, {480, 0x0103}, {512, 0x0127},
@@ -258,7 +259,7 @@ static const struct mpc_i2c_divider mpc_i2c_dividers_8xxx[] = {
{49152, 0x011e}, {61440, 0x011f}
};
-u32 mpc_i2c_get_sec_cfg_8xxx(void)
+static u32 __devinit mpc_i2c_get_sec_cfg_8xxx(void)
{
struct device_node *node = NULL;
u32 __iomem *reg;
@@ -287,7 +288,8 @@ u32 mpc_i2c_get_sec_cfg_8xxx(void)
return val;
}
-int mpc_i2c_get_fdr_8xxx(struct device_node *node, u32 clock, u32 prescaler)
+static int __devinit mpc_i2c_get_fdr_8xxx(struct device_node *node, u32 clock,
+ u32 prescaler)
{
const struct mpc_i2c_divider *div = NULL;
u32 divider;
@@ -320,9 +322,9 @@ int mpc_i2c_get_fdr_8xxx(struct device_node *node, u32 clock, u32 prescaler)
return div ? (int)div->fdr : -EINVAL;
}
-static void mpc_i2c_setclock_8xxx(struct device_node *node,
- struct mpc_i2c *i2c,
- u32 clock, u32 prescaler)
+static void __devinit mpc_i2c_setclock_8xxx(struct device_node *node,
+ struct mpc_i2c *i2c,
+ u32 clock, u32 prescaler)
{
int ret, fdr;
@@ -338,9 +340,9 @@ static void mpc_i2c_setclock_8xxx(struct device_node *node,
}
#else /* !CONFIG_FSL_SOC */
-static void mpc_i2c_setclock_8xxx(struct device_node *node,
- struct mpc_i2c *i2c,
- u32 clock, u32 prescaler)
+static void __devinit mpc_i2c_setclock_8xxx(struct device_node *node,
+ struct mpc_i2c *i2c,
+ u32 clock, u32 prescaler)
{
}
#endif /* CONFIG_FSL_SOC */
@@ -529,8 +531,8 @@ static int __devinit fsl_i2c_probe(struct of_device *op,
clock = *prop;
if (match->data) {
- struct mpc_i2c_match_data *data =
- (struct mpc_i2c_match_data *)match->data;
+ struct mpc_i2c_data *data =
+ (struct mpc_i2c_data *)match->data;
data->setclock(op->node, i2c, clock, data->prescaler);
} else {
/* Backwards compatibility */
@@ -582,44 +584,35 @@ static int __devexit fsl_i2c_remove(struct of_device *op)
return 0;
};
+static struct mpc_i2c_data __devinitdata mpc_i2c_data_52xx = {
+ .setclock = mpc_i2c_setclock_52xx,
+};
+
+static struct mpc_i2c_data __devinitdata mpc_i2c_data_8313 = {
+ .setclock = mpc_i2c_setclock_8xxx,
+};
+
+static struct mpc_i2c_data __devinitdata mpc_i2c_data_8543 = {
+ .setclock = mpc_i2c_setclock_8xxx,
+ .prescaler = 2,
+};
+
+static struct mpc_i2c_data __devinitdata mpc_i2c_data_8544 = {
+ .setclock = mpc_i2c_setclock_8xxx,
+ .prescaler = 3,
+};
+
static const struct of_device_id mpc_i2c_of_match[] = {
- {.compatible = "mpc5200-i2c",
- .data = &(struct mpc_i2c_match_data) {
- .setclock = mpc_i2c_setclock_52xx,
- },
- },
- {.compatible = "fsl,mpc5200b-i2c",
- .data = &(struct mpc_i2c_match_data) {
- .setclock = mpc_i2c_setclock_52xx,
- },
- },
- {.compatible = "fsl,mpc5200-i2c",
- .data = &(struct mpc_i2c_match_data) {
- .setclock = mpc_i2c_setclock_52xx,
- },
- },
- {.compatible = "fsl,mpc8313-i2c",
- .data = &(struct mpc_i2c_match_data) {
- .setclock = mpc_i2c_setclock_8xxx,
- },
- },
- {.compatible = "fsl,mpc8543-i2c",
- .data = &(struct mpc_i2c_match_data) {
- .setclock = mpc_i2c_setclock_8xxx,
- .prescaler = 2,
- },
- },
- {.compatible = "fsl,mpc8544-i2c",
- .data = &(struct mpc_i2c_match_data) {
- .setclock = mpc_i2c_setclock_8xxx,
- .prescaler = 3,
- },
+ {.compatible = "mpc5200-i2c", .data = &mpc_i2c_data_52xx, },
+ {.compatible = "fsl,mpc5200b-i2c", .data = &mpc_i2c_data_52xx, },
+ {.compatible = "fsl,mpc5200-i2c", .data = &mpc_i2c_data_52xx, },
+ {.compatible = "fsl,mpc8313-i2c", .data = &mpc_i2c_data_8313, },
+ {.compatible = "fsl,mpc8543-i2c", .data = &mpc_i2c_data_8543, },
+ {.compatible = "fsl,mpc8544-i2c", .data = &mpc_i2c_data_8544, },
/* Backward compatibility */
- },
{.compatible = "fsl-i2c", },
{},
};
-
MODULE_DEVICE_TABLE(of, mpc_i2c_of_match);
@@ -634,7 +627,7 @@ static struct of_platform_driver mpc_i2c_driver = {
},
};
-static int __init fsl_i2c_init(void)
+static int __devinit fsl_i2c_init(void)
{
int rv;
@@ -645,7 +638,7 @@ static int __init fsl_i2c_init(void)
return rv;
}
-static void __exit fsl_i2c_exit(void)
+static void __devexit fsl_i2c_exit(void)
{
of_unregister_platform_driver(&mpc_i2c_driver);
}
--
1.6.2.5
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox