* Re: [PATCH] booke_wdt: Fix build (unconstify watchdog_info)
From: Wim Van Sebroeck @ 2010-04-27 7:42 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Andrew Morton, Anton Vorontsov
In-Reply-To: <1272350220.24542.7.camel@pasglop>
Hi Ben,
> > commit 42747d712de56cf2087b702d2ad90af114c53138 ("[WATCHDOG]
> > watchdog_info constify") introduced the following build failure:
> >
> > CC booke_wdt.o
> > booke_wdt.c: In function 'booke_wdt_init':
> > booke_wdt.c:220: error: assignment of read-only variable 'ident'
> >
> > Fix this by removing 'const' qualifier from watchdog_info struct.
>
> Should this go via powerpc.git ? If yes, I'll send to Linus asap.
I'm sending watchdog related patches to Linus today. This one will be included.
Kind regards,
Wim.
^ permalink raw reply
* Re: perf top broken on ppc64
From: Alexander Graf @ 2010-04-27 7:39 UTC (permalink / raw)
To: Ian Munsie
Cc: Peter Zijlstra, LKML Mailing List, Arnaldo Carvalho de Melo,
Paul Mackerras, Ingo Molnar, ppc-dev
In-Reply-To: <1272331742-sup-1208@au1.ibm.com>
Am 27.04.2010 um 02:30 schrieb Ian Munsie <imunsie@au1.ibm.com>:
>>> I'm using 32 bit userland and 64 bit kernel on a PowerPC box and
>>> it's working for me.
>>> Are you building perf from the tip tree?
>>
>> I'm using kvm.git which is pretty close to tip. The version says
>> something 2.6.34-rc3'ish. Has anything significantly changed since
>> then?
>>
>> Either way - I'll give it a try.
>
>
> Hey Alex,
>
> Did perf from the tip tree work for you?
Howdy,
Sorry - I left for vacation without replying :).
I tried perf from tip with kvm.git kernel and that did show the same
effects. I didn't get around to also try to run the tip kernel, and
won't be within this week :o
Greetings from Gran Canaria,
Alex
>
^ permalink raw reply
* Re: [PATCH RESEND 3/3] i2c/ibm-iic: drop NO_IRQ
From: Wolfram Sang @ 2010-04-27 7:12 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, linux-i2c, Ben Dooks, Sean MacLennan
In-Reply-To: <1272351974.24542.9.camel@pasglop>
[-- Attachment #1: Type: text/plain, Size: 642 bytes --]
On Tue, Apr 27, 2010 at 05:06:14PM +1000, Benjamin Herrenschmidt wrote:
> On Fri, 2010-04-02 at 02:17 +0200, Wolfram Sang wrote:
> > Drop NO_IRQ as 0 is the preferred way to describe 'no irq'
> > (http://lkml.org/lkml/2005/11/21/221). This change is safe, as the driver is
> > only used on powerpc, where NO_IRQ is 0 anyhow.
>
> Oops... forgot those. Applied, will show up in -next soon.
Ah, thanks. I also asked Ben Dooks to pick them up, but better twice than never
;)
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: [PATCH RESEND 3/3] i2c/ibm-iic: drop NO_IRQ
From: Benjamin Herrenschmidt @ 2010-04-27 7:06 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linuxppc-dev, linux-i2c, Ben Dooks, Sean MacLennan
In-Reply-To: <1270167421-5205-4-git-send-email-w.sang@pengutronix.de>
On Fri, 2010-04-02 at 02:17 +0200, Wolfram Sang wrote:
> Drop NO_IRQ as 0 is the preferred way to describe 'no irq'
> (http://lkml.org/lkml/2005/11/21/221). This change is safe, as the driver is
> only used on powerpc, where NO_IRQ is 0 anyhow.
Oops... forgot those. Applied, will show up in -next soon.
Cheers,
Ben.
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> Acked-by: Grant Likely <grant.likely@secretlab.ca>
> Cc: Sean MacLennan <smaclennan@pikatech.com>
> Cc: Ben Dooks <ben-linux@fluff.org>
> ---
> drivers/i2c/busses/i2c-ibm_iic.c | 14 +++++++-------
> 1 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
> index b1bc6e2..2bef534 100644
> --- a/drivers/i2c/busses/i2c-ibm_iic.c
> +++ b/drivers/i2c/busses/i2c-ibm_iic.c
> @@ -668,12 +668,12 @@ static int __devinit iic_request_irq(struct of_device *ofdev,
> int irq;
>
> if (iic_force_poll)
> - return NO_IRQ;
> + return 0;
>
> irq = irq_of_parse_and_map(np, 0);
> - if (irq == NO_IRQ) {
> + if (!irq) {
> dev_err(&ofdev->dev, "irq_of_parse_and_map failed\n");
> - return NO_IRQ;
> + return 0;
> }
>
> /* Disable interrupts until we finish initialization, assumes
> @@ -683,7 +683,7 @@ static int __devinit iic_request_irq(struct of_device *ofdev,
> if (request_irq(irq, iic_handler, 0, "IBM IIC", dev)) {
> dev_err(&ofdev->dev, "request_irq %d failed\n", irq);
> /* Fallback to the polling mode */
> - return NO_IRQ;
> + return 0;
> }
>
> return irq;
> @@ -719,7 +719,7 @@ static int __devinit iic_probe(struct of_device *ofdev,
> init_waitqueue_head(&dev->wq);
>
> dev->irq = iic_request_irq(ofdev, dev);
> - if (dev->irq == NO_IRQ)
> + if (!dev->irq)
> dev_warn(&ofdev->dev, "using polling mode\n");
>
> /* Board specific settings */
> @@ -766,7 +766,7 @@ static int __devinit iic_probe(struct of_device *ofdev,
> return 0;
>
> error_cleanup:
> - if (dev->irq != NO_IRQ) {
> + if (dev->irq) {
> iic_interrupt_mode(dev, 0);
> free_irq(dev->irq, dev);
> }
> @@ -790,7 +790,7 @@ static int __devexit iic_remove(struct of_device *ofdev)
>
> i2c_del_adapter(&dev->adap);
>
> - if (dev->irq != NO_IRQ) {
> + if (dev->irq) {
> iic_interrupt_mode(dev, 0);
> free_irq(dev->irq, dev);
> }
^ permalink raw reply
* Re: 2.6.34-rc3 : Badness at lib/dma-debug.c:820 during ibmvscsi init
From: Benjamin Herrenschmidt @ 2010-04-27 7:05 UTC (permalink / raw)
To: FUJITA Tomonori; +Cc: brking, linuxppc-dev, linux-scsi
In-Reply-To: <20100402154959K.fujita.tomonori@lab.ntt.co.jp>
On Fri, 2010-04-02 at 15:50 +0900, FUJITA Tomonori wrote:
> Thanks, here's the patch in the proper format.
>
> =
> From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> Subject: [PATCH] ibmvscsi: fix DMA API misuse
>
> ibmvscsi uses dma_unmap_single() for buffers mapped via
> dma_map_sg(). It works however it's the API violation. The DMA debug
> facility complains about it:
Hi folks !
Is this going to be merged via the scsi tree ?
Thanks !
Cheers,
Ben.
> http://marc.info/?l=linux-scsi&m=127018555013151&w=2
>
> Reported-by: Sachin Sant <sachinp@in.ibm.com>
> Tested-by: Sachin Sant <sachinp@in.ibm.com>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> ---
> drivers/scsi/ibmvscsi/ibmvscsi.c | 29 ++---------------------------
> 1 files changed, 2 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
> index dc1bcbe..0856436 100644
> --- a/drivers/scsi/ibmvscsi/ibmvscsi.c
> +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
> @@ -322,16 +322,6 @@ static void set_srp_direction(struct scsi_cmnd *cmd,
> srp_cmd->buf_fmt = fmt;
> }
>
> -static void unmap_sg_list(int num_entries,
> - struct device *dev,
> - struct srp_direct_buf *md)
> -{
> - int i;
> -
> - for (i = 0; i < num_entries; ++i)
> - dma_unmap_single(dev, md[i].va, md[i].len, DMA_BIDIRECTIONAL);
> -}
> -
> /**
> * unmap_cmd_data: - Unmap data pointed in srp_cmd based on the format
> * @cmd: srp_cmd whose additional_data member will be unmapped
> @@ -349,24 +339,9 @@ static void unmap_cmd_data(struct srp_cmd *cmd,
>
> if (out_fmt == SRP_NO_DATA_DESC && in_fmt == SRP_NO_DATA_DESC)
> return;
> - else if (out_fmt == SRP_DATA_DESC_DIRECT ||
> - in_fmt == SRP_DATA_DESC_DIRECT) {
> - struct srp_direct_buf *data =
> - (struct srp_direct_buf *) cmd->add_data;
> - dma_unmap_single(dev, data->va, data->len, DMA_BIDIRECTIONAL);
> - } else {
> - struct srp_indirect_buf *indirect =
> - (struct srp_indirect_buf *) cmd->add_data;
> - int num_mapped = indirect->table_desc.len /
> - sizeof(struct srp_direct_buf);
>
> - if (num_mapped <= MAX_INDIRECT_BUFS) {
> - unmap_sg_list(num_mapped, dev, &indirect->desc_list[0]);
> - return;
> - }
> -
> - unmap_sg_list(num_mapped, dev, evt_struct->ext_list);
> - }
> + if (evt_struct->cmnd)
> + scsi_dma_unmap(evt_struct->cmnd);
> }
>
> static int map_sg_list(struct scsi_cmnd *cmd, int nseg,
^ permalink raw reply
* Re: [PATCH] booke_wdt: Fix build (unconstify watchdog_info)
From: Benjamin Herrenschmidt @ 2010-04-27 6:37 UTC (permalink / raw)
To: Anton Vorontsov; +Cc: linuxppc-dev, Wim Van Sebroeck, Andrew Morton
In-Reply-To: <20100426174358.GA16889@oksana.dev.rtsoft.ru>
On Mon, 2010-04-26 at 21:43 +0400, Anton Vorontsov wrote:
> commit 42747d712de56cf2087b702d2ad90af114c53138 ("[WATCHDOG]
> watchdog_info constify") introduced the following build failure:
>
> CC booke_wdt.o
> booke_wdt.c: In function 'booke_wdt_init':
> booke_wdt.c:220: error: assignment of read-only variable 'ident'
>
> Fix this by removing 'const' qualifier from watchdog_info struct.
Should this go via powerpc.git ? If yes, I'll send to Linus asap.
Cheers,
Ben.
> Signed-off-by: Anton Vorontsov <avorontsov@mvista.com>
> ---
> drivers/watchdog/booke_wdt.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-
>
> diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c
> index 500d383..801ead1 100644
> --- a/drivers/watchdog/booke_wdt.c
> +++ b/drivers/watchdog/booke_wdt.c
> @@ -121,7 +121,7 @@ static ssize_t booke_wdt_write(struct file *file, const char __user *buf,
> return count;
> }
>
> -static const struct watchdog_info ident = {
> +static struct watchdog_info ident = {
> .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
> .identity = "PowerPC Book-E Watchdog",
> };
^ permalink raw reply
* Re: [PATCH 1/2] powerpc: add platform registration for ALSA SoC drivers
From: Benjamin Herrenschmidt @ 2010-04-27 6:36 UTC (permalink / raw)
To: Timur Tabi; +Cc: alsa-devel, kumar.gala, broonie, linuxppc-dev, lrg
In-Reply-To: <1272314980-23679-1-git-send-email-timur@freescale.com>
On Mon, 2010-04-26 at 15:49 -0500, Timur Tabi wrote:
> An upcoming change in the architecture of ALSA SoC (ASoC) will require the
> MPC8610 HPCD's ASoC fabric driver to register as a standard platform driver.
> Therefore, we need to call platform_device_register_simple() from the board's
> platform code.
>
> Signed-off-by: Timur Tabi <timur@freescale.com>
> ---
Gross. Loses the linkage to device-tree etc... which is useful for audio
especially. You should at least make sure the device node follows for
the target driver to be able to use it :-) I'd like you to sync with
Grant work on that matter if you are going to convert of_devices into
platform_devices.
Cheers,
Ben.
> Kumar, the ASoC mainters are willing to pick up this patch, but they want an
> ACK from you first. Or, you could pick it up, since by itself it's harmless.
>
> arch/powerpc/platforms/86xx/mpc8610_hpcd.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
> index 5abe137..66afff3 100644
> --- a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
> +++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
> @@ -98,6 +98,9 @@ static int __init mpc8610_declare_of_platform_devices(void)
> /* Without this call, the SSI device driver won't get probed. */
> of_platform_bus_probe(NULL, mpc8610_ids, NULL);
>
> + /* Register the platform device for the ASoC fabric driver */
> + platform_device_register_simple("snd-soc-mpc8610-hpcd", 0, NULL, 0);
> +
> return 0;
> }
> machine_device_initcall(mpc86xx_hpcd, mpc8610_declare_of_platform_devices);
^ permalink raw reply
* [git pull] Please pull powerpc.git merge branch
From: Benjamin Herrenschmidt @ 2010-04-27 5:56 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linuxppc-dev list, Andrew Morton, Linux Kernel list
Hi Linus !
PowerPC has been a bit quiet this time around :-) That is until Kumar
woke me up with a few fixes and defconfig updates for the freescale
embedded platforms.
Cheers,
Ben.
The following changes since commit b91ce4d14a21fc04d165be30319541e0f9204f15:
Linus Torvalds (1):
Merge git://git.kernel.org/.../davem/net-2.6
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git merge
Anton Vorontsov (1):
powerpc/85xx/86xx: Fix build w/ CONFIG_PCI=n
Becky Bruce (1):
powerpc/fsl_booke: Correct test for MMU_FTR_BIG_PHYS
Kim Phillips (4):
powerpc/83xx: add RTC drivers in 83xx defconfig
powerpc/83xx: enable EPOLL syscall in defconfig
powerpc/83xx: configure SIL SATA driver in 83xx-wide defconfig
powerpc/mpc8xxx defconfigs - turn off SYSFS_DEPRECATED
Kumar Gala (2):
powerpc: 2.6.34 update of defconfigs for embedded 6xx/7xxx, 8xx, 8xxx
powerpc/fsl-booke: Fix CONFIG_RELOCATABLE support on FSL Book-E ppc32
Wolfgang Ocker (1):
powerpc/fsl-cpm: Configure clock correctly for SCC
arch/powerpc/configs/83xx/asp8347_defconfig | 44 ++++----
arch/powerpc/configs/83xx/kmeter1_defconfig | 28 +++--
arch/powerpc/configs/83xx/mpc8313_rdb_defconfig | 49 +++++----
arch/powerpc/configs/83xx/mpc8315_rdb_defconfig | 50 +++++----
arch/powerpc/configs/83xx/mpc832x_mds_defconfig | 45 ++++----
arch/powerpc/configs/83xx/mpc832x_rdb_defconfig | 49 ++++----
arch/powerpc/configs/83xx/mpc834x_itx_defconfig | 44 ++++----
arch/powerpc/configs/83xx/mpc834x_itxgp_defconfig | 43 ++++----
arch/powerpc/configs/83xx/mpc834x_mds_defconfig | 46 +++++----
arch/powerpc/configs/83xx/mpc836x_mds_defconfig | 45 ++++----
arch/powerpc/configs/83xx/mpc836x_rdk_defconfig | 44 ++++---
arch/powerpc/configs/83xx/mpc837x_mds_defconfig | 46 +++++----
arch/powerpc/configs/83xx/mpc837x_rdb_defconfig | 51 +++++----
arch/powerpc/configs/83xx/sbc834x_defconfig | 44 ++++----
arch/powerpc/configs/85xx/ksi8560_defconfig | 23 +++-
arch/powerpc/configs/85xx/mpc8540_ads_defconfig | 25 +++--
arch/powerpc/configs/85xx/mpc8560_ads_defconfig | 34 ++++--
arch/powerpc/configs/85xx/mpc85xx_cds_defconfig | 31 ++++--
arch/powerpc/configs/85xx/sbc8548_defconfig | 31 ++++--
arch/powerpc/configs/85xx/sbc8560_defconfig | 25 +++--
arch/powerpc/configs/85xx/socrates_defconfig | 51 +++++----
arch/powerpc/configs/85xx/stx_gp3_defconfig | 51 +++++----
arch/powerpc/configs/85xx/tqm8540_defconfig | 48 +++++---
arch/powerpc/configs/85xx/tqm8541_defconfig | 54 ++++++---
arch/powerpc/configs/85xx/tqm8548_defconfig | 47 +++++---
arch/powerpc/configs/85xx/tqm8555_defconfig | 54 ++++++---
arch/powerpc/configs/85xx/tqm8560_defconfig | 54 ++++++---
arch/powerpc/configs/85xx/xes_mpc85xx_defconfig | 59 +++++++---
arch/powerpc/configs/86xx/gef_ppc9a_defconfig | 102 +++++++++++-------
arch/powerpc/configs/86xx/gef_sbc310_defconfig | 53 ++++++----
arch/powerpc/configs/86xx/gef_sbc610_defconfig | 96 +++++++++++------
arch/powerpc/configs/86xx/mpc8610_hpcd_defconfig | 34 +++---
arch/powerpc/configs/86xx/mpc8641_hpcn_defconfig | 48 +++++---
arch/powerpc/configs/86xx/sbc8641d_defconfig | 40 ++++---
arch/powerpc/configs/adder875_defconfig | 18 ++--
arch/powerpc/configs/c2k_defconfig | 55 ++++-----
arch/powerpc/configs/ep8248e_defconfig | 20 +++-
arch/powerpc/configs/ep88xc_defconfig | 17 ++--
arch/powerpc/configs/linkstation_defconfig | 48 +++++---
arch/powerpc/configs/mgcoge_defconfig | 31 ++++--
arch/powerpc/configs/mgsuvd_defconfig | 19 ++--
arch/powerpc/configs/mpc7448_hpc2_defconfig | 26 +++--
arch/powerpc/configs/mpc8272_ads_defconfig | 23 +++-
arch/powerpc/configs/mpc83xx_defconfig | 124 ++++++++++++++++-----
arch/powerpc/configs/mpc85xx_defconfig | 62 +++++++----
arch/powerpc/configs/mpc85xx_smp_defconfig | 64 +++++++----
arch/powerpc/configs/mpc866_ads_defconfig | 20 ++--
arch/powerpc/configs/mpc86xx_defconfig | 57 ++++++----
arch/powerpc/configs/mpc885_ads_defconfig | 20 ++--
arch/powerpc/configs/pq2fads_defconfig | 22 +++-
arch/powerpc/configs/prpmc2800_defconfig | 52 ++++++---
arch/powerpc/configs/storcenter_defconfig | 33 +++---
arch/powerpc/include/asm/page.h | 15 +++-
arch/powerpc/mm/fsl_booke_mmu.c | 4 +-
arch/powerpc/platforms/85xx/Kconfig | 4 +-
arch/powerpc/platforms/86xx/Kconfig | 4 +-
arch/powerpc/sysdev/cpm1.c | 14 ++-
arch/powerpc/sysdev/cpm2.c | 11 ++-
58 files changed, 1446 insertions(+), 905 deletions(-)
^ permalink raw reply
* Re: [git pull] Please pull powerpc.git merge branch
From: Kumar Gala @ 2010-04-27 4:55 UTC (permalink / raw)
To: Felix Radensky; +Cc: linuxppc-dev@ozlabs.org list
In-Reply-To: <4BD66378.1010603@embedded-sol.com>
On Apr 26, 2010, at 11:09 PM, Felix Radensky wrote:
> Hi Kumar,
>=20
> On 4/27/2010 2:05 AM, Kumar Gala wrote:
>> Ben,
>>=20
>> I've updated this to include this one additional patch for dealing =
with CONFIG_RELOCATE on FSL-BookE ppc32
>>=20
>> http://patchwork.ozlabs.org/patch/51011/
>>=20
>> =20
>=20
> Can this patch also be included: =
http://patchwork.ozlabs.org/patch/50289/
>=20
> Thanks.
>=20
> Felix.
I didn't consider this a bug fix and thus didn't include it. It will go =
in for 2.6.35.
- k=
^ permalink raw reply
* Re: [git pull] Please pull powerpc.git merge branch
From: Felix Radensky @ 2010-04-27 4:09 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev@ozlabs.org list
In-Reply-To: <2009D70F-BBE3-4D4D-B1BA-C92041AFE9C9@kernel.crashing.org>
Hi Kumar,
On 4/27/2010 2:05 AM, Kumar Gala wrote:
> Ben,
>
> I've updated this to include this one additional patch for dealing with CONFIG_RELOCATE on FSL-BookE ppc32
>
> http://patchwork.ozlabs.org/patch/51011/
>
>
Can this patch also be included: http://patchwork.ozlabs.org/patch/50289/
Thanks.
Felix.
^ permalink raw reply
* [patch 15/15] powerpc: cpumask: Add DEBUG_PER_CPU_MAPS option
From: Anton Blanchard @ 2010-04-27 1:32 UTC (permalink / raw)
To: benh, rusty; +Cc: linuxppc-dev
In-Reply-To: <20100427013231.510168034@samba.org>
Enable the DEBUG_PER_CPU_MAPS option so we can look for problems with
cpumasks .
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-cpumask/arch/powerpc/Kconfig.debug
===================================================================
--- linux-cpumask.orig/arch/powerpc/Kconfig.debug 2010-04-22 14:51:36.359196562 +1000
+++ linux-cpumask/arch/powerpc/Kconfig.debug 2010-04-22 14:52:04.845445439 +1000
@@ -44,6 +44,18 @@ config DEBUG_STACK_USAGE
This option will slow down process creation somewhat.
+config DEBUG_PER_CPU_MAPS
+ bool "Debug access to per_cpu maps"
+ depends on DEBUG_KERNEL
+ depends on SMP
+ default n
+ ---help---
+ Say Y to verify that the per_cpu map being accessed has
+ been setup. Adds a fair amount of code to kernel memory
+ and decreases performance.
+
+ Say N if unsure.
+
config HCALL_STATS
bool "Hypervisor call instrumentation"
depends on PPC_PSERIES && DEBUG_FS && TRACEPOINTS
^ permalink raw reply
* [patch 14/15] powerpc: cpumask: Convert mpic driver to new cpumask API
From: Anton Blanchard @ 2010-04-27 1:32 UTC (permalink / raw)
To: benh, rusty; +Cc: linuxppc-dev
In-Reply-To: <20100427013231.510168034@samba.org>
Convert to the new cpumask API.
irq_choose_cpu can be simplified by using cpumask_next and cpumask_first.
smp_mpic_message_pass was doing open coded cpumask manipulation and passing an
int for a cpumask into mpic_send_ipi. Since mpic_send_ipi is only used
locally, make it static and convert it to take a cpumask. This allows us
to clean up the mess in smp_mpic_message_pass.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-cpumask/arch/powerpc/sysdev/mpic.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/sysdev/mpic.c 2010-04-22 14:52:08.876696006 +1000
+++ linux-cpumask/arch/powerpc/sysdev/mpic.c 2010-04-22 14:58:13.495445579 +1000
@@ -568,12 +568,12 @@ static void __init mpic_scan_ht_pics(str
#endif /* CONFIG_MPIC_U3_HT_IRQS */
#ifdef CONFIG_SMP
-static int irq_choose_cpu(const cpumask_t *mask)
+static int irq_choose_cpu(const struct cpumask *mask)
{
int cpuid;
if (cpumask_equal(mask, cpu_all_mask)) {
- static int irq_rover;
+ static int irq_rover = 0;
static DEFINE_RAW_SPINLOCK(irq_rover_lock);
unsigned long flags;
@@ -581,15 +581,11 @@ static int irq_choose_cpu(const cpumask_
do_round_robin:
raw_spin_lock_irqsave(&irq_rover_lock, flags);
- while (!cpu_online(irq_rover)) {
- if (++irq_rover >= NR_CPUS)
- irq_rover = 0;
- }
+ irq_rover = cpumask_next(irq_rover, cpu_online_mask);
+ if (irq_rover >= nr_cpu_ids)
+ irq_rover = cpumask_first(cpu_online_mask);
+
cpuid = irq_rover;
- do {
- if (++irq_rover >= NR_CPUS)
- irq_rover = 0;
- } while (!cpu_online(irq_rover));
raw_spin_unlock_irqrestore(&irq_rover_lock, flags);
} else {
@@ -601,7 +597,7 @@ static int irq_choose_cpu(const cpumask_
return get_hard_smp_processor_id(cpuid);
}
#else
-static int irq_choose_cpu(const cpumask_t *mask)
+static int irq_choose_cpu(const struct cpumask *mask)
{
return hard_smp_processor_id();
}
@@ -814,12 +810,16 @@ int mpic_set_affinity(unsigned int irq,
mpic_irq_write(src, MPIC_INFO(IRQ_DESTINATION), 1 << cpuid);
} else {
- cpumask_t tmp;
+ cpumask_var_t tmp;
+
+ alloc_cpumask_var(&tmp, GFP_KERNEL);
- cpumask_and(&tmp, cpumask, cpu_online_mask);
+ cpumask_and(tmp, cpumask, cpu_online_mask);
mpic_irq_write(src, MPIC_INFO(IRQ_DESTINATION),
- mpic_physmask(cpus_addr(tmp)[0]));
+ mpic_physmask(cpumask_bits(tmp)[0]));
+
+ free_cpumask_var(tmp);
}
return 0;
@@ -1479,7 +1479,7 @@ void mpic_teardown_this_cpu(int secondar
}
-void mpic_send_ipi(unsigned int ipi_no, unsigned int cpu_mask)
+static void mpic_send_ipi(unsigned int ipi_no, const struct cpumask *cpu_mask)
{
struct mpic *mpic = mpic_primary;
@@ -1491,7 +1491,7 @@ void mpic_send_ipi(unsigned int ipi_no,
mpic_cpu_write(MPIC_INFO(CPU_IPI_DISPATCH_0) +
ipi_no * MPIC_INFO(CPU_IPI_DISPATCH_STRIDE),
- mpic_physmask(cpu_mask & cpus_addr(cpu_online_map)[0]));
+ mpic_physmask(cpumask_bits(cpu_mask)[0]));
}
static unsigned int _mpic_get_one_irq(struct mpic *mpic, int reg)
@@ -1591,6 +1591,8 @@ void mpic_request_ipis(void)
void smp_mpic_message_pass(int target, int msg)
{
+ cpumask_var_t tmp;
+
/* make sure we're sending something that translates to an IPI */
if ((unsigned int)msg > 3) {
printk("SMP %d: smp_message_pass: unknown msg %d\n",
@@ -1599,13 +1601,17 @@ void smp_mpic_message_pass(int target, i
}
switch (target) {
case MSG_ALL:
- mpic_send_ipi(msg, 0xffffffff);
+ mpic_send_ipi(msg, cpu_online_mask);
break;
case MSG_ALL_BUT_SELF:
- mpic_send_ipi(msg, 0xffffffff & ~(1 << smp_processor_id()));
+ alloc_cpumask_var(&tmp, GFP_NOWAIT);
+ cpumask_andnot(tmp, cpu_online_mask,
+ cpumask_of(smp_processor_id()));
+ mpic_send_ipi(msg, tmp);
+ free_cpumask_var(tmp);
break;
default:
- mpic_send_ipi(msg, 1 << target);
+ mpic_send_ipi(msg, cpumask_of(target));
break;
}
}
@@ -1616,7 +1622,7 @@ int __init smp_mpic_probe(void)
DBG("smp_mpic_probe()...\n");
- nr_cpus = cpus_weight(cpu_possible_map);
+ nr_cpus = cpumask_weight(cpu_possible_mask);
DBG("nr_cpus: %d\n", nr_cpus);
Index: linux-cpumask/arch/powerpc/include/asm/mpic.h
===================================================================
--- linux-cpumask.orig/arch/powerpc/include/asm/mpic.h 2010-04-22 14:52:08.896696998 +1000
+++ linux-cpumask/arch/powerpc/include/asm/mpic.h 2010-04-22 14:52:19.915447374 +1000
@@ -463,9 +463,6 @@ extern void mpic_cpu_set_priority(int pr
/* Request IPIs on primary mpic */
extern void mpic_request_ipis(void);
-/* Send an IPI (non offseted number 0..3) */
-extern void mpic_send_ipi(unsigned int ipi_no, unsigned int cpu_mask);
-
/* Send a message (IPI) to a given target (cpu number or MSG_*) */
void smp_mpic_message_pass(int target, int msg);
^ permalink raw reply
* [patch 13/15] powerpc: cpumask: Update some comments
From: Anton Blanchard @ 2010-04-27 1:32 UTC (permalink / raw)
To: benh, rusty; +Cc: linuxppc-dev
In-Reply-To: <20100427013231.510168034@samba.org>
Since the *_map cpumask variants are deprecated, change the comments to
instead refer to *_mask.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-cpumask/arch/powerpc/kernel/setup-common.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/kernel/setup-common.c 2010-04-22 13:19:24.536696551 +1000
+++ linux-cpumask/arch/powerpc/kernel/setup-common.c 2010-04-22 13:25:56.655446062 +1000
@@ -394,14 +394,14 @@ static void __init cpu_init_thread_core_
/**
* setup_cpu_maps - initialize the following cpu maps:
- * cpu_possible_map
- * cpu_present_map
+ * cpu_possible_mask
+ * cpu_present_mask
*
* Having the possible map set up early allows us to restrict allocations
* of things like irqstacks to num_possible_cpus() rather than NR_CPUS.
*
* We do not initialize the online map here; cpus set their own bits in
- * cpu_online_map as they come up.
+ * cpu_online_mask as they come up.
*
* This function is valid only for Open Firmware systems. finish_device_tree
* must be called before using this.
Index: linux-cpumask/arch/powerpc/kernel/smp.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/kernel/smp.c 2010-04-22 13:03:22.545446024 +1000
+++ linux-cpumask/arch/powerpc/kernel/smp.c 2010-04-22 13:25:56.655446062 +1000
@@ -468,7 +468,7 @@ out:
return id;
}
-/* Must be called when no change can occur to cpu_present_map,
+/* Must be called when no change can occur to cpu_present_mask,
* i.e. during cpu online or offline.
*/
static struct device_node *cpu_to_l2cache(int cpu)
Index: linux-cpumask/arch/powerpc/platforms/powermac/setup.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/platforms/powermac/setup.c 2010-04-07 09:18:12.016695779 +1000
+++ linux-cpumask/arch/powerpc/platforms/powermac/setup.c 2010-04-22 13:25:56.665445906 +1000
@@ -480,7 +480,7 @@ static void __init pmac_init_early(void)
#endif
/* SMP Init has to be done early as we need to patch up
- * cpu_possible_map before interrupt stacks are allocated
+ * cpu_possible_mask before interrupt stacks are allocated
* or kaboom...
*/
#ifdef CONFIG_SMP
Index: linux-cpumask/arch/powerpc/platforms/powermac/smp.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/platforms/powermac/smp.c 2010-02-27 09:45:02.816822011 +1100
+++ linux-cpumask/arch/powerpc/platforms/powermac/smp.c 2010-04-22 13:26:27.485445638 +1000
@@ -315,7 +315,7 @@ static int __init smp_psurge_probe(void)
/* This is necessary because OF doesn't know about the
* secondary cpu(s), and thus there aren't nodes in the
* device tree for them, and smp_setup_cpu_maps hasn't
- * set their bits in cpu_present_map.
+ * set their bits in cpu_present_mask.
*/
if (ncpus > NR_CPUS)
ncpus = NR_CPUS;
@@ -944,7 +944,7 @@ void __init pmac_setup_smp(void)
}
#ifdef CONFIG_PPC32
else {
- /* We have to set bits in cpu_possible_map here since the
+ /* We have to set bits in cpu_possible_mask here since the
* secondary CPU(s) aren't in the device tree. Various
* things won't be initialized for CPUs not in the possible
* map, so we really need to fix it up here.
Index: linux-cpumask/arch/powerpc/platforms/pseries/hotplug-cpu.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/platforms/pseries/hotplug-cpu.c 2010-04-22 13:27:02.755445663 +1000
+++ linux-cpumask/arch/powerpc/platforms/pseries/hotplug-cpu.c 2010-04-22 13:27:13.025733412 +1000
@@ -245,7 +245,7 @@ static void pseries_cpu_die(unsigned int
}
/*
- * Update cpu_present_map and paca(s) for a new cpu node. The wrinkle
+ * Update cpu_present_mask and paca(s) for a new cpu node. The wrinkle
* here is that a cpu device node may represent up to two logical cpus
* in the SMT case. We must honor the assumption in other code that
* the logical ids for sibling SMT threads x and y are adjacent, such
@@ -293,7 +293,7 @@ static int pseries_add_processor(struct
cpumask_shift_left(tmp, tmp, nthreads);
if (cpumask_empty(tmp)) {
- printk(KERN_ERR "Unable to find space in cpu_present_map for"
+ printk(KERN_ERR "Unable to find space in cpu_present_mask for"
" processor %s with %d thread(s)\n", np->name,
nthreads);
goto out_unlock;
^ permalink raw reply
* [patch 12/15] powerpc: cpumask: Convert NUMA code to new cpumask API
From: Anton Blanchard @ 2010-04-27 1:32 UTC (permalink / raw)
To: benh, rusty; +Cc: linuxppc-dev
In-Reply-To: <20100427013231.510168034@samba.org>
Convert NUMA code to new cpumask API. We shift the node to cpumask
setup code until after we complete bootmem allocation so we can
dynamically allocate the cpumasks.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-cpumask/arch/powerpc/include/asm/mmzone.h
===================================================================
--- linux-cpumask.orig/arch/powerpc/include/asm/mmzone.h 2010-04-12 09:17:47.847946437 +1000
+++ linux-cpumask/arch/powerpc/include/asm/mmzone.h 2010-04-22 13:03:26.335446079 +1000
@@ -30,7 +30,7 @@ extern struct pglist_data *node_data[];
*/
extern int numa_cpu_lookup_table[];
-extern cpumask_t numa_cpumask_lookup_table[];
+extern cpumask_var_t node_to_cpumask_map[];
#ifdef CONFIG_MEMORY_HOTPLUG
extern unsigned long max_pfn;
#endif
Index: linux-cpumask/arch/powerpc/mm/numa.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/mm/numa.c 2010-04-12 09:17:47.817946138 +1000
+++ linux-cpumask/arch/powerpc/mm/numa.c 2010-04-22 13:03:26.335446079 +1000
@@ -33,16 +33,41 @@ static int numa_debug;
#define dbg(args...) if (numa_debug) { printk(KERN_INFO args); }
int numa_cpu_lookup_table[NR_CPUS];
-cpumask_t numa_cpumask_lookup_table[MAX_NUMNODES];
+cpumask_var_t node_to_cpumask_map[MAX_NUMNODES];
struct pglist_data *node_data[MAX_NUMNODES];
EXPORT_SYMBOL(numa_cpu_lookup_table);
-EXPORT_SYMBOL(numa_cpumask_lookup_table);
+EXPORT_SYMBOL(node_to_cpumask_map);
EXPORT_SYMBOL(node_data);
static int min_common_depth;
static int n_mem_addr_cells, n_mem_size_cells;
+/*
+ * Allocate node_to_cpumask_map based on number of available nodes
+ * Requires node_possible_map to be valid.
+ *
+ * Note: node_to_cpumask() is not valid until after this is done.
+ */
+static void __init setup_node_to_cpumask_map(void)
+{
+ unsigned int node, num = 0;
+
+ /* setup nr_node_ids if not done yet */
+ if (nr_node_ids == MAX_NUMNODES) {
+ for_each_node_mask(node, node_possible_map)
+ num = node;
+ nr_node_ids = num + 1;
+ }
+
+ /* allocate the map */
+ for (node = 0; node < nr_node_ids; node++)
+ alloc_bootmem_cpumask_var(&node_to_cpumask_map[node]);
+
+ /* cpumask_of_node() will now work */
+ dbg("Node to cpumask map for %d nodes\n", nr_node_ids);
+}
+
static int __cpuinit fake_numa_create_new_node(unsigned long end_pfn,
unsigned int *nid)
{
@@ -138,8 +163,8 @@ static void __cpuinit map_cpu_to_node(in
dbg("adding cpu %d to node %d\n", cpu, node);
- if (!(cpu_isset(cpu, numa_cpumask_lookup_table[node])))
- cpu_set(cpu, numa_cpumask_lookup_table[node]);
+ if (!(cpumask_test_cpu(cpu, node_to_cpumask_map[node])))
+ cpumask_set_cpu(cpu, node_to_cpumask_map[node]);
}
#ifdef CONFIG_HOTPLUG_CPU
@@ -149,8 +174,8 @@ static void unmap_cpu_from_node(unsigned
dbg("removing cpu %lu from node %d\n", cpu, node);
- if (cpu_isset(cpu, numa_cpumask_lookup_table[node])) {
- cpu_clear(cpu, numa_cpumask_lookup_table[node]);
+ if (cpumask_test_cpu(cpu, node_to_cpumask_map[node])) {
+ cpumask_set_cpu(cpu, node_to_cpumask_map[node]);
} else {
printk(KERN_ERR "WARNING: cpu %lu not found in node %d\n",
cpu, node);
@@ -737,8 +762,9 @@ void __init dump_numa_cpu_topology(void)
* If we used a CPU iterator here we would miss printing
* the holes in the cpumap.
*/
- for (cpu = 0; cpu < NR_CPUS; cpu++) {
- if (cpu_isset(cpu, numa_cpumask_lookup_table[node])) {
+ for (cpu = 0; cpu < nr_cpu_ids; cpu++) {
+ if (cpumask_test_cpu(cpu,
+ node_to_cpumask_map[node])) {
if (count == 0)
printk(" %u", cpu);
++count;
@@ -750,7 +776,7 @@ void __init dump_numa_cpu_topology(void)
}
if (count > 1)
- printk("-%u", NR_CPUS - 1);
+ printk("-%u", nr_cpu_ids - 1);
printk("\n");
}
}
@@ -926,10 +952,6 @@ void __init do_init_bootmem(void)
else
dump_numa_memory_topology();
- register_cpu_notifier(&ppc64_numa_nb);
- cpu_numa_callback(&ppc64_numa_nb, CPU_UP_PREPARE,
- (void *)(unsigned long)boot_cpuid);
-
for_each_online_node(nid) {
unsigned long start_pfn, end_pfn;
void *bootmem_vaddr;
@@ -983,6 +1005,16 @@ void __init do_init_bootmem(void)
}
init_bootmem_done = 1;
+
+ /*
+ * Now bootmem is initialised we can create the node to cpumask
+ * lookup tables and setup the cpu callback to populate them.
+ */
+ setup_node_to_cpumask_map();
+
+ register_cpu_notifier(&ppc64_numa_nb);
+ cpu_numa_callback(&ppc64_numa_nb, CPU_UP_PREPARE,
+ (void *)(unsigned long)boot_cpuid);
}
void __init paging_init(void)
Index: linux-cpumask/arch/powerpc/include/asm/topology.h
===================================================================
--- linux-cpumask.orig/arch/powerpc/include/asm/topology.h 2010-04-22 13:03:22.535446350 +1000
+++ linux-cpumask/arch/powerpc/include/asm/topology.h 2010-04-22 13:03:26.345446035 +1000
@@ -19,7 +19,7 @@ static inline int cpu_to_node(int cpu)
#define cpumask_of_node(node) ((node) == -1 ? \
cpu_all_mask : \
- &numa_cpumask_lookup_table[node])
+ node_to_cpumask_map[node])
int of_node_to_nid(struct device_node *device);
^ permalink raw reply
* [patch 11/15] powerpc: cpumask: Convert hotplug-cpu code to new cpumask API
From: Anton Blanchard @ 2010-04-27 1:32 UTC (permalink / raw)
To: benh, rusty; +Cc: linuxppc-dev
In-Reply-To: <20100427013231.510168034@samba.org>
Convert hotplug-cpu code to new cpumask API.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-cpumask/arch/powerpc/platforms/pseries/hotplug-cpu.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/platforms/pseries/hotplug-cpu.c 2010-04-08 19:46:03.437946780 +1000
+++ linux-cpumask/arch/powerpc/platforms/pseries/hotplug-cpu.c 2010-04-22 13:03:25.075445756 +1000
@@ -187,7 +187,7 @@ static int pseries_cpu_disable(void)
/*fix boot_cpuid here*/
if (cpu == boot_cpuid)
- boot_cpuid = any_online_cpu(cpu_online_map);
+ boot_cpuid = cpumask_any(cpu_online_mask);
/* FIXME: abstract this to not be platform specific later on */
xics_migrate_irqs_away();
@@ -254,7 +254,7 @@ static void pseries_cpu_die(unsigned int
static int pseries_add_processor(struct device_node *np)
{
unsigned int cpu;
- cpumask_t candidate_map, tmp = CPU_MASK_NONE;
+ cpumask_var_t candidate_mask, tmp;
int err = -ENOSPC, len, nthreads, i;
const u32 *intserv;
@@ -262,48 +262,53 @@ static int pseries_add_processor(struct
if (!intserv)
return 0;
+ zalloc_cpumask_var(&candidate_mask, GFP_KERNEL);
+ zalloc_cpumask_var(&tmp, GFP_KERNEL);
+
nthreads = len / sizeof(u32);
for (i = 0; i < nthreads; i++)
- cpu_set(i, tmp);
+ cpumask_set_cpu(i, tmp);
cpu_maps_update_begin();
- BUG_ON(!cpus_subset(cpu_present_map, cpu_possible_map));
+ BUG_ON(!cpumask_subset(cpu_present_mask, cpu_possible_mask));
/* Get a bitmap of unoccupied slots. */
- cpus_xor(candidate_map, cpu_possible_map, cpu_present_map);
- if (cpus_empty(candidate_map)) {
+ cpumask_xor(candidate_mask, cpu_possible_mask, cpu_present_mask);
+ if (cpumask_empty(candidate_mask)) {
/* If we get here, it most likely means that NR_CPUS is
* less than the partition's max processors setting.
*/
printk(KERN_ERR "Cannot add cpu %s; this system configuration"
" supports %d logical cpus.\n", np->full_name,
- cpus_weight(cpu_possible_map));
+ cpumask_weight(cpu_possible_mask));
goto out_unlock;
}
- while (!cpus_empty(tmp))
- if (cpus_subset(tmp, candidate_map))
+ while (!cpumask_empty(tmp))
+ if (cpumask_subset(tmp, candidate_mask))
/* Found a range where we can insert the new cpu(s) */
break;
else
- cpus_shift_left(tmp, tmp, nthreads);
+ cpumask_shift_left(tmp, tmp, nthreads);
- if (cpus_empty(tmp)) {
+ if (cpumask_empty(tmp)) {
printk(KERN_ERR "Unable to find space in cpu_present_map for"
" processor %s with %d thread(s)\n", np->name,
nthreads);
goto out_unlock;
}
- for_each_cpu_mask(cpu, tmp) {
- BUG_ON(cpu_isset(cpu, cpu_present_map));
+ for_each_cpu(cpu, tmp) {
+ BUG_ON(cpumask_test_cpu(cpu, cpu_present_mask));
set_cpu_present(cpu, true);
set_hard_smp_processor_id(cpu, *intserv++);
}
err = 0;
out_unlock:
cpu_maps_update_done();
+ free_cpumask_var(candidate_mask);
+ free_cpumask_var(tmp);
return err;
}
@@ -334,7 +339,7 @@ static void pseries_remove_processor(str
set_hard_smp_processor_id(cpu, -1);
break;
}
- if (cpu == NR_CPUS)
+ if (cpu >= nr_cpu_ids)
printk(KERN_WARNING "Could not find cpu to remove "
"with physical id 0x%x\n", intserv[i]);
}
^ permalink raw reply
* [patch 10/15] powerpc: cpumask: Dynamically allocate cpu_sibling_map and cpu_core_map cpumasks
From: Anton Blanchard @ 2010-04-27 1:32 UTC (permalink / raw)
To: benh, rusty; +Cc: linuxppc-dev
In-Reply-To: <20100427013231.510168034@samba.org>
Dynamically allocate cpu_sibling_map and cpu_core_map cpumasks.
We don't need to set_cpu_online() the boot cpu in smp_prepare_boot_cpu,
init/main.c does it for us.
We also postpone setting of the boot cpu in cpu_sibling_map and cpu_core_map
until when the memory allocator is available (smp_prepare_cpus), similar
to x86.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-cpumask/arch/powerpc/include/asm/smp.h
===================================================================
--- linux-cpumask.orig/arch/powerpc/include/asm/smp.h 2010-04-22 13:03:14.635445670 +1000
+++ linux-cpumask/arch/powerpc/include/asm/smp.h 2010-04-22 13:03:22.525445945 +1000
@@ -68,8 +68,19 @@ static inline void set_hard_smp_processo
}
#endif
-DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
-DECLARE_PER_CPU(cpumask_t, cpu_core_map);
+DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_map);
+DECLARE_PER_CPU(cpumask_var_t, cpu_core_map);
+
+static inline struct cpumask *cpu_sibling_mask(int cpu)
+{
+ return per_cpu(cpu_sibling_map, cpu);
+}
+
+static inline struct cpumask *cpu_core_mask(int cpu)
+{
+ return per_cpu(cpu_core_map, cpu);
+}
+
extern int cpu_to_core_id(int cpu);
/* Since OpenPIC has only 4 IPIs, we use slightly different message numbers.
@@ -93,7 +104,6 @@ void smp_init_pSeries(void);
void smp_init_cell(void);
void smp_init_celleb(void);
void smp_setup_cpu_maps(void);
-void smp_setup_cpu_sibling_map(void);
extern int __cpu_disable(void);
extern void __cpu_die(unsigned int cpu);
Index: linux-cpumask/arch/powerpc/include/asm/topology.h
===================================================================
--- linux-cpumask.orig/arch/powerpc/include/asm/topology.h 2010-04-12 09:17:47.827945841 +1000
+++ linux-cpumask/arch/powerpc/include/asm/topology.h 2010-04-22 13:03:22.535446350 +1000
@@ -102,8 +102,8 @@ static inline void sysfs_remove_device_f
#ifdef CONFIG_PPC64
#include <asm/smp.h>
-#define topology_thread_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu))
-#define topology_core_cpumask(cpu) (&per_cpu(cpu_core_map, cpu))
+#define topology_thread_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu))
+#define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu))
#define topology_core_id(cpu) (cpu_to_core_id(cpu))
#endif
#endif
Index: linux-cpumask/arch/powerpc/kernel/smp.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/kernel/smp.c 2010-04-22 13:03:14.615446106 +1000
+++ linux-cpumask/arch/powerpc/kernel/smp.c 2010-04-22 13:03:22.545446024 +1000
@@ -59,8 +59,8 @@
struct thread_info *secondary_ti;
-DEFINE_PER_CPU(cpumask_t, cpu_sibling_map) = CPU_MASK_NONE;
-DEFINE_PER_CPU(cpumask_t, cpu_core_map) = CPU_MASK_NONE;
+DEFINE_PER_CPU(cpumask_var_t, cpu_sibling_map);
+DEFINE_PER_CPU(cpumask_var_t, cpu_core_map);
EXPORT_PER_CPU_SYMBOL(cpu_sibling_map);
EXPORT_PER_CPU_SYMBOL(cpu_core_map);
@@ -271,6 +271,16 @@ void __init smp_prepare_cpus(unsigned in
smp_store_cpu_info(boot_cpuid);
cpu_callin_map[boot_cpuid] = 1;
+ for_each_possible_cpu(cpu) {
+ zalloc_cpumask_var_node(&per_cpu(cpu_sibling_map, cpu),
+ GFP_KERNEL, cpu_to_node(cpu));
+ zalloc_cpumask_var_node(&per_cpu(cpu_core_map, cpu),
+ GFP_KERNEL, cpu_to_node(cpu));
+ }
+
+ cpumask_set_cpu(boot_cpuid, cpu_sibling_mask(boot_cpuid));
+ cpumask_set_cpu(boot_cpuid, cpu_core_mask(boot_cpuid));
+
if (smp_ops)
if (smp_ops->probe)
max_cpus = smp_ops->probe();
@@ -289,10 +299,6 @@ void __init smp_prepare_cpus(unsigned in
void __devinit smp_prepare_boot_cpu(void)
{
BUG_ON(smp_processor_id() != boot_cpuid);
-
- set_cpu_online(boot_cpuid, true);
- cpu_set(boot_cpuid, per_cpu(cpu_sibling_map, boot_cpuid));
- cpu_set(boot_cpuid, per_cpu(cpu_core_map, boot_cpuid));
#ifdef CONFIG_PPC64
paca[boot_cpuid].__current = current;
#endif
@@ -517,15 +523,15 @@ int __devinit start_secondary(void *unus
for (i = 0; i < threads_per_core; i++) {
if (cpu_is_offline(base + i))
continue;
- cpu_set(cpu, per_cpu(cpu_sibling_map, base + i));
- cpu_set(base + i, per_cpu(cpu_sibling_map, cpu));
+ cpumask_set_cpu(cpu, cpu_sibling_mask(base + i));
+ cpumask_set_cpu(base + i, cpu_sibling_mask(cpu));
/* cpu_core_map should be a superset of
* cpu_sibling_map even if we don't have cache
* information, so update the former here, too.
*/
- cpu_set(cpu, per_cpu(cpu_core_map, base +i));
- cpu_set(base + i, per_cpu(cpu_core_map, cpu));
+ cpumask_set_cpu(cpu, cpu_core_mask(base + i));
+ cpumask_set_cpu(base + i, cpu_core_mask(cpu));
}
l2_cache = cpu_to_l2cache(cpu);
for_each_online_cpu(i) {
@@ -533,8 +539,8 @@ int __devinit start_secondary(void *unus
if (!np)
continue;
if (np == l2_cache) {
- cpu_set(cpu, per_cpu(cpu_core_map, i));
- cpu_set(i, per_cpu(cpu_core_map, cpu));
+ cpumask_set_cpu(cpu, cpu_core_mask(i));
+ cpumask_set_cpu(i, cpu_core_mask(cpu));
}
of_node_put(np);
}
@@ -594,10 +600,10 @@ int __cpu_disable(void)
/* Update sibling maps */
base = cpu_first_thread_in_core(cpu);
for (i = 0; i < threads_per_core; i++) {
- cpu_clear(cpu, per_cpu(cpu_sibling_map, base + i));
- cpu_clear(base + i, per_cpu(cpu_sibling_map, cpu));
- cpu_clear(cpu, per_cpu(cpu_core_map, base +i));
- cpu_clear(base + i, per_cpu(cpu_core_map, cpu));
+ cpumask_clear_cpu(cpu, cpu_sibling_mask(base + i));
+ cpumask_clear_cpu(base + i, cpu_sibling_mask(cpu));
+ cpumask_clear_cpu(cpu, cpu_core_mask(base + i));
+ cpumask_clear_cpu(base + i, cpu_core_mask(cpu));
}
l2_cache = cpu_to_l2cache(cpu);
@@ -606,8 +612,8 @@ int __cpu_disable(void)
if (!np)
continue;
if (np == l2_cache) {
- cpu_clear(cpu, per_cpu(cpu_core_map, i));
- cpu_clear(i, per_cpu(cpu_core_map, cpu));
+ cpumask_clear_cpu(cpu, cpu_core_mask(i));
+ cpumask_clear_cpu(i, cpu_core_mask(cpu));
}
of_node_put(np);
}
Index: linux-cpumask/arch/powerpc/platforms/cell/cbe_cpufreq.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/platforms/cell/cbe_cpufreq.c 2010-04-08 19:46:03.749196323 +1000
+++ linux-cpumask/arch/powerpc/platforms/cell/cbe_cpufreq.c 2010-04-22 13:03:22.545446024 +1000
@@ -118,7 +118,7 @@ static int cbe_cpufreq_cpu_init(struct c
policy->cur = cbe_freqs[cur_pmode].frequency;
#ifdef CONFIG_SMP
- cpumask_copy(policy->cpus, &per_cpu(cpu_sibling_map, policy->cpu));
+ cpumask_copy(policy->cpus, cpu_sibling_mask(policy->cpu));
#endif
cpufreq_frequency_table_get_attr(cbe_freqs, policy->cpu);
^ permalink raw reply
* [patch 09/15] powerpc: cpumask: Convert /proc/cpuinfo to new cpumask API
From: Anton Blanchard @ 2010-04-27 1:32 UTC (permalink / raw)
To: benh, rusty; +Cc: linuxppc-dev
In-Reply-To: <20100427013231.510168034@samba.org>
Use new cpumask API in /proc/cpuinfo code.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-cpumask/arch/powerpc/kernel/setup-common.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/kernel/setup-common.c 2010-04-22 13:03:19.866696740 +1000
+++ linux-cpumask/arch/powerpc/kernel/setup-common.c 2010-04-22 13:03:21.075446071 +1000
@@ -200,11 +200,6 @@ static int show_cpuinfo(struct seq_file
unsigned short maj;
unsigned short min;
- if (cpu_id == NR_CPUS) {
- show_cpuinfo_summary(m);
- return 0;
- }
-
/* We only show online cpus: disable preempt (overzealous, I
* knew) to prevent cpu going down. */
preempt_disable();
@@ -312,19 +307,28 @@ static int show_cpuinfo(struct seq_file
#endif
preempt_enable();
+
+ /* If this is the last cpu, print the summary */
+ if (cpumask_next(cpu_id, cpu_online_mask) >= nr_cpu_ids)
+ show_cpuinfo_summary(m);
+
return 0;
}
static void *c_start(struct seq_file *m, loff_t *pos)
{
- unsigned long i = *pos;
-
- return i <= NR_CPUS ? (void *)(i + 1) : NULL;
+ if (*pos == 0) /* just in case, cpu 0 is not the first */
+ *pos = cpumask_first(cpu_online_mask);
+ else
+ *pos = cpumask_next(*pos - 1, cpu_online_mask);
+ if ((*pos) < nr_cpu_ids)
+ return (void *)(*pos + 1);
+ return NULL;
}
static void *c_next(struct seq_file *m, void *v, loff_t *pos)
{
- ++*pos;
+ (*pos)++;
return c_start(m, pos);
}
^ permalink raw reply
* [patch 08/15] powerpc: cpumask: Refactor /proc/cpuinfo code
From: Anton Blanchard @ 2010-04-27 1:32 UTC (permalink / raw)
To: benh, rusty; +Cc: linuxppc-dev
In-Reply-To: <20100427013231.510168034@samba.org>
This separates the per cpu output from the summary output at the end of the
file, making it easier to convert to the new cpumask API in a subsequent
patch.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-cpumask/arch/powerpc/kernel/setup-common.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/kernel/setup-common.c 2010-04-08 19:46:03.999199713 +1000
+++ linux-cpumask/arch/powerpc/kernel/setup-common.c 2010-04-22 13:03:19.866696740 +1000
@@ -161,43 +161,47 @@ extern u32 cpu_temp_both(unsigned long c
DEFINE_PER_CPU(unsigned int, cpu_pvr);
#endif
-static int show_cpuinfo(struct seq_file *m, void *v)
+static void show_cpuinfo_summary(struct seq_file *m)
{
- unsigned long cpu_id = (unsigned long)v - 1;
- unsigned int pvr;
- unsigned short maj;
- unsigned short min;
-
- if (cpu_id == NR_CPUS) {
- struct device_node *root;
- const char *model = NULL;
+ struct device_node *root;
+ const char *model = NULL;
#if defined(CONFIG_SMP) && defined(CONFIG_PPC32)
- unsigned long bogosum = 0;
- int i;
- for_each_online_cpu(i)
- bogosum += loops_per_jiffy;
- seq_printf(m, "total bogomips\t: %lu.%02lu\n",
- bogosum/(500000/HZ), bogosum/(5000/HZ) % 100);
+ unsigned long bogosum = 0;
+ int i;
+ for_each_online_cpu(i)
+ bogosum += loops_per_jiffy;
+ seq_printf(m, "total bogomips\t: %lu.%02lu\n",
+ bogosum/(500000/HZ), bogosum/(5000/HZ) % 100);
#endif /* CONFIG_SMP && CONFIG_PPC32 */
- seq_printf(m, "timebase\t: %lu\n", ppc_tb_freq);
- if (ppc_md.name)
- seq_printf(m, "platform\t: %s\n", ppc_md.name);
- root = of_find_node_by_path("/");
- if (root)
- model = of_get_property(root, "model", NULL);
- if (model)
- seq_printf(m, "model\t\t: %s\n", model);
- of_node_put(root);
+ seq_printf(m, "timebase\t: %lu\n", ppc_tb_freq);
+ if (ppc_md.name)
+ seq_printf(m, "platform\t: %s\n", ppc_md.name);
+ root = of_find_node_by_path("/");
+ if (root)
+ model = of_get_property(root, "model", NULL);
+ if (model)
+ seq_printf(m, "model\t\t: %s\n", model);
+ of_node_put(root);
- if (ppc_md.show_cpuinfo != NULL)
- ppc_md.show_cpuinfo(m);
+ if (ppc_md.show_cpuinfo != NULL)
+ ppc_md.show_cpuinfo(m);
#ifdef CONFIG_PPC32
- /* Display the amount of memory */
- seq_printf(m, "Memory\t\t: %d MB\n",
- (unsigned int)(total_memory / (1024 * 1024)));
+ /* Display the amount of memory */
+ seq_printf(m, "Memory\t\t: %d MB\n",
+ (unsigned int)(total_memory / (1024 * 1024)));
#endif
+}
+static int show_cpuinfo(struct seq_file *m, void *v)
+{
+ unsigned long cpu_id = (unsigned long)v - 1;
+ unsigned int pvr;
+ unsigned short maj;
+ unsigned short min;
+
+ if (cpu_id == NR_CPUS) {
+ show_cpuinfo_summary(m);
return 0;
}
^ permalink raw reply
* [patch 07/15] powerpc: cpumask: Convert xics driver to new cpumask API
From: Anton Blanchard @ 2010-04-27 1:32 UTC (permalink / raw)
To: benh, rusty; +Cc: linuxppc-dev
In-Reply-To: <20100427013231.510168034@samba.org>
Use the new cpumask API and add some comments to clarify how get_irq_server
works.
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-04-08 19:46:04.039197077 +1000
+++ linux-cpumask/arch/powerpc/platforms/pseries/xics.c 2010-04-22 13:03:18.825447113 +1000
@@ -163,29 +163,37 @@ static inline void lpar_qirr_info(int n_
/* Interface to generic irq subsystem */
#ifdef CONFIG_SMP
-static int get_irq_server(unsigned int virq, cpumask_t cpumask,
+/*
+ * For the moment we only implement delivery to all cpus or one cpu.
+ *
+ * If the requested affinity is cpu_all_mask, we set global affinity.
+ * If not we set it to the first cpu in the mask, even if multiple cpus
+ * are set. This is so things like irqbalance (which set core and package
+ * wide affinities) do the right thing.
+ */
+static int get_irq_server(unsigned int virq, const struct cpumask *cpumask,
unsigned int strict_check)
{
- int server;
- /* For the moment only implement delivery to all cpus or one cpu */
- cpumask_t tmp = CPU_MASK_NONE;
if (!distribute_irqs)
return default_server;
- if (!cpus_equal(cpumask, CPU_MASK_ALL)) {
- cpus_and(tmp, cpu_online_map, cpumask);
-
- server = first_cpu(tmp);
+ if (!cpumask_equal(cpumask, cpu_all_mask)) {
+ int server = cpumask_first_and(cpu_online_mask, cpumask);
- if (server < NR_CPUS)
+ if (server < nr_cpu_ids)
return get_hard_smp_processor_id(server);
if (strict_check)
return -1;
}
- if (cpus_equal(cpu_online_map, cpu_present_map))
+ /*
+ * Workaround issue with some versions of JS20 firmware that
+ * deliver interrupts to cpus which haven't been started. This
+ * happens when using the maxcpus= boot option.
+ */
+ if (cpumask_equal(cpu_online_mask, cpu_present_mask))
return default_distrib_server;
return default_server;
@@ -207,7 +215,7 @@ static void xics_unmask_irq(unsigned int
if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS)
return;
- server = get_irq_server(virq, *(irq_to_desc(virq)->affinity), 0);
+ server = get_irq_server(virq, irq_to_desc(virq)->affinity, 0);
call_status = rtas_call(ibm_set_xive, 3, 1, NULL, irq, server,
DEFAULT_PRIORITY);
@@ -398,11 +406,7 @@ static int xics_set_affinity(unsigned in
return -1;
}
- /*
- * For the moment only implement delivery to all cpus or one cpu.
- * Get current irq_server for the given irq
- */
- irq_server = get_irq_server(virq, *cpumask, 1);
+ irq_server = get_irq_server(virq, cpumask, 1);
if (irq_server == -1) {
char cpulist[128];
cpumask_scnprintf(cpulist, sizeof(cpulist), cpumask);
@@ -611,7 +615,7 @@ int __init smp_xics_probe(void)
{
xics_request_ipi();
- return cpus_weight(cpu_possible_map);
+ return cpumask_weight(cpu_possible_mask);
}
#endif /* CONFIG_SMP */
^ permalink raw reply
* [patch 06/15] powerpc: cpumask: Convert pseries SMP code to new cpumask API
From: Anton Blanchard @ 2010-04-27 1:32 UTC (permalink / raw)
To: benh, rusty; +Cc: linuxppc-dev
In-Reply-To: <20100427013231.510168034@samba.org>
Use new cpumask functions in pseries SMP startup code.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-cpumask/arch/powerpc/platforms/pseries/smp.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/platforms/pseries/smp.c 2010-04-08 19:46:04.089198328 +1000
+++ linux-cpumask/arch/powerpc/platforms/pseries/smp.c 2010-04-22 13:03:17.517946041 +1000
@@ -55,7 +55,7 @@
* The Primary thread of each non-boot processor was started from the OF client
* interface by prom_hold_cpus and is spinning on secondary_hold_spinloop.
*/
-static cpumask_t of_spin_map;
+static cpumask_var_t of_spin_mask;
/**
* smp_startup_cpu() - start the given cpu
@@ -76,7 +76,7 @@ static inline int __devinit smp_startup_
unsigned int pcpu;
int start_cpu;
- if (cpu_isset(lcpu, of_spin_map))
+ if (cpumask_test_cpu(lcpu, of_spin_mask))
/* Already started by OF and sitting in spin loop */
return 1;
@@ -115,7 +115,7 @@ static void __devinit smp_xics_setup_cpu
if (firmware_has_feature(FW_FEATURE_SPLPAR))
vpa_init(cpu);
- cpu_clear(cpu, of_spin_map);
+ cpumask_clear_cpu(cpu, of_spin_mask);
set_cpu_current_state(cpu, CPU_STATE_ONLINE);
set_default_offline_state(cpu);
@@ -186,17 +186,19 @@ static void __init smp_init_pseries(void
pr_debug(" -> smp_init_pSeries()\n");
+ alloc_bootmem_cpumask_var(&of_spin_mask);
+
/* Mark threads which are still spinning in hold loops. */
if (cpu_has_feature(CPU_FTR_SMT)) {
for_each_present_cpu(i) {
if (cpu_thread_in_core(i) == 0)
- cpu_set(i, of_spin_map);
+ cpumask_set_cpu(i, of_spin_mask);
}
} else {
- of_spin_map = cpu_present_map;
+ cpumask_copy(of_spin_mask, cpu_present_mask);
}
- cpu_clear(boot_cpuid, of_spin_map);
+ cpumask_clear_cpu(boot_cpuid, of_spin_mask);
/* Non-lpar has additional take/give timebase */
if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) {
^ permalink raw reply
* [patch 05/15] powerpc: cpumask: Convert iseries SMP code to new cpumask API
From: Anton Blanchard @ 2010-04-27 1:32 UTC (permalink / raw)
To: benh, rusty; +Cc: linuxppc-dev
In-Reply-To: <20100427013231.510168034@samba.org>
Use new cpumask functions in iseries SMP startup code.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-cpumask/arch/powerpc/platforms/iseries/smp.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/platforms/iseries/smp.c 2010-04-08 19:46:04.129196495 +1000
+++ linux-cpumask/arch/powerpc/platforms/iseries/smp.c 2010-04-22 13:03:16.326695430 +1000
@@ -83,7 +83,7 @@ static void smp_iSeries_message_pass(int
static int smp_iSeries_probe(void)
{
- return cpus_weight(cpu_possible_map);
+ return cpumask_weight(cpu_possible_mask);
}
static void smp_iSeries_kick_cpu(int nr)
^ permalink raw reply
* [patch 04/15] powerpc: cpumask: Convert fixup_irqs to new cpumask API
From: Anton Blanchard @ 2010-04-27 1:32 UTC (permalink / raw)
To: benh, rusty; +Cc: linuxppc-dev
In-Reply-To: <20100427013231.510168034@samba.org>
Use new cpumask_* functions, and dynamically allocate cpumask in fixup_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-04-08 19:46:04.269196650 +1000
+++ linux-cpumask/arch/powerpc/kernel/irq.c 2010-04-22 13:03:14.615446106 +1000
@@ -290,30 +290,33 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
}
#ifdef CONFIG_HOTPLUG_CPU
-void fixup_irqs(cpumask_t map)
+void fixup_irqs(const struct cpumask *map)
{
struct irq_desc *desc;
unsigned int irq;
static int warned;
+ cpumask_var_t mask;
- for_each_irq(irq) {
- cpumask_t mask;
+ alloc_cpumask_var(&mask, GFP_KERNEL);
+ for_each_irq(irq) {
desc = irq_to_desc(irq);
if (desc && desc->status & IRQ_PER_CPU)
continue;
- cpumask_and(&mask, desc->affinity, &map);
- if (any_online_cpu(mask) == NR_CPUS) {
+ cpumask_and(mask, desc->affinity, map);
+ if (cpumask_any(mask) >= nr_cpu_ids) {
printk("Breaking affinity for irq %i\n", irq);
- mask = map;
+ cpumask_copy(mask, map);
}
if (desc->chip->set_affinity)
- desc->chip->set_affinity(irq, &mask);
+ desc->chip->set_affinity(irq, mask);
else if (desc->action && !(warned++))
printk("Cannot set affinity for irq %i\n", irq);
}
+ free_cpumask_var(mask);
+
local_irq_enable();
mdelay(1);
local_irq_disable();
Index: linux-cpumask/arch/powerpc/kernel/smp.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/kernel/smp.c 2010-04-22 13:03:13.025446124 +1000
+++ linux-cpumask/arch/powerpc/kernel/smp.c 2010-04-22 13:03:14.615446106 +1000
@@ -313,7 +313,7 @@ int generic_cpu_disable(void)
set_cpu_online(cpu, false);
#ifdef CONFIG_PPC64
vdso_data->processorCount--;
- fixup_irqs(cpu_online_map);
+ fixup_irqs(cpu_online_mask);
#endif
return 0;
}
@@ -333,7 +333,7 @@ int generic_cpu_enable(unsigned int cpu)
cpu_relax();
#ifdef CONFIG_PPC64
- fixup_irqs(cpu_online_map);
+ fixup_irqs(cpu_online_mask);
/* counter the irq disable in fixup_irqs */
local_irq_enable();
#endif
Index: linux-cpumask/arch/powerpc/include/asm/smp.h
===================================================================
--- linux-cpumask.orig/arch/powerpc/include/asm/smp.h 2010-04-08 19:46:04.299203515 +1000
+++ linux-cpumask/arch/powerpc/include/asm/smp.h 2010-04-22 13:03:14.635445670 +1000
@@ -40,7 +40,7 @@ extern void smp_message_recv(int);
DECLARE_PER_CPU(unsigned int, cpu_pvr);
#ifdef CONFIG_HOTPLUG_CPU
-extern void fixup_irqs(cpumask_t map);
+extern void fixup_irqs(const struct cpumask *map);
int generic_cpu_disable(void);
int generic_cpu_enable(unsigned int cpu);
void generic_cpu_die(unsigned int cpu);
^ permalink raw reply
* [patch 03/15] powerpc: cpumask: Convert smp_cpus_done to new cpumask API
From: Anton Blanchard @ 2010-04-27 1:32 UTC (permalink / raw)
To: benh, rusty; +Cc: linuxppc-dev
In-Reply-To: <20100427013231.510168034@samba.org>
Use the new cpumask_* functions and dynamically allocate the cpumask in
smp_cpus_done.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-cpumask/arch/powerpc/kernel/smp.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/kernel/smp.c 2010-04-08 19:46:04.379196361 +1000
+++ linux-cpumask/arch/powerpc/kernel/smp.c 2010-04-22 13:03:13.025446124 +1000
@@ -554,19 +554,22 @@ int setup_profiling_timer(unsigned int m
void __init smp_cpus_done(unsigned int max_cpus)
{
- cpumask_t old_mask;
+ cpumask_var_t old_mask;
/* We want the setup_cpu() here to be called from CPU 0, but our
* init thread may have been "borrowed" by another CPU in the meantime
* se we pin us down to CPU 0 for a short while
*/
- old_mask = current->cpus_allowed;
- set_cpus_allowed(current, cpumask_of_cpu(boot_cpuid));
-
+ alloc_cpumask_var(&old_mask, GFP_NOWAIT);
+ cpumask_copy(old_mask, ¤t->cpus_allowed);
+ set_cpus_allowed_ptr(current, cpumask_of(boot_cpuid));
+
if (smp_ops && smp_ops->setup_cpu)
smp_ops->setup_cpu(boot_cpuid);
- set_cpus_allowed(current, old_mask);
+ set_cpus_allowed_ptr(current, old_mask);
+
+ free_cpumask_var(old_mask);
snapshot_timebases();
^ permalink raw reply
* [patch 02/15] powerpc: cpumask: Convert rtasd to new cpumask API
From: Anton Blanchard @ 2010-04-27 1:32 UTC (permalink / raw)
To: benh, rusty; +Cc: linuxppc-dev
In-Reply-To: <20100427013231.510168034@samba.org>
Use cpumask_first, cpumask_next in rtasd code.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-cpumask/arch/powerpc/kernel/rtasd.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/kernel/rtasd.c 2010-04-08 19:46:04.419206665 +1000
+++ linux-cpumask/arch/powerpc/kernel/rtasd.c 2010-04-22 13:03:10.035445948 +1000
@@ -411,9 +411,9 @@ static void rtas_event_scan(struct work_
get_online_cpus();
- cpu = next_cpu(smp_processor_id(), cpu_online_map);
- if (cpu == NR_CPUS) {
- cpu = first_cpu(cpu_online_map);
+ cpu = cpumask_next(smp_processor_id(), cpu_online_mask);
+ if (cpu >= nr_cpu_ids) {
+ cpu = cpumask_first(cpu_online_mask);
if (first_pass) {
first_pass = 0;
@@ -466,8 +466,8 @@ static void start_event_scan(void)
/* Retreive errors from nvram if any */
retreive_nvram_error_log();
- schedule_delayed_work_on(first_cpu(cpu_online_map), &event_scan_work,
- event_scan_delay);
+ schedule_delayed_work_on(cpumask_first(cpu_online_mask),
+ &event_scan_work, event_scan_delay);
}
static int __init rtas_init(void)
^ permalink raw reply
* [patch 01/15] powerpc: cpumask: Use cpu_online_mask
From: Anton Blanchard @ 2010-04-27 1:32 UTC (permalink / raw)
To: benh, rusty; +Cc: linuxppc-dev
In-Reply-To: <20100427013231.510168034@samba.org>
Change &cpu_online_map to cpu_online_mask.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-cpumask/arch/powerpc/platforms/pasemi/cpufreq.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/platforms/pasemi/cpufreq.c 2010-04-08 19:46:04.459196015 +1000
+++ linux-cpumask/arch/powerpc/platforms/pasemi/cpufreq.c 2010-04-22 13:02:53.536695878 +1000
@@ -213,7 +213,7 @@ static int pas_cpufreq_cpu_init(struct c
pr_debug("current astate is at %d\n",cur_astate);
policy->cur = pas_freqs[cur_astate].frequency;
- cpumask_copy(policy->cpus, &cpu_online_map);
+ cpumask_copy(policy->cpus, cpu_online_mask);
ppc_proc_freq = policy->cur * 1000ul;
Index: linux-cpumask/arch/powerpc/platforms/powermac/cpufreq_64.c
===================================================================
--- linux-cpumask.orig/arch/powerpc/platforms/powermac/cpufreq_64.c 2010-04-08 19:46:04.479196466 +1000
+++ linux-cpumask/arch/powerpc/platforms/powermac/cpufreq_64.c 2010-04-22 13:02:53.546695890 +1000
@@ -362,7 +362,7 @@ static int g5_cpufreq_cpu_init(struct cp
/* secondary CPUs are tied to the primary one by the
* cpufreq core if in the secondary policy we tell it that
* it actually must be one policy together with all others. */
- cpumask_copy(policy->cpus, &cpu_online_map);
+ cpumask_copy(policy->cpus, cpu_online_mask);
cpufreq_frequency_table_get_attr(g5_cpu_freqs, policy->cpu);
return cpufreq_frequency_table_cpuinfo(policy,
^ permalink raw reply
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