* Re: [PATCH] drivers: char: hvc: add arm JTAG DCC console support
From: Tony Lindgren @ 2011-01-14 19:19 UTC (permalink / raw)
To: Stephen Boyd
Cc: Randy Dunlap, Daniel Walker, Mike Frysinger, Arnd Bergmann,
Nicolas Pitre, linux-arm-msm, Greg Kroah-Hartman, linux-kernel,
FUJITA Tomonori, Andrew Morton, linuxppc-dev, Alan Cox
In-Reply-To: <4CFE86AC.9010801@codeaurora.org>
* Stephen Boyd <sboyd@codeaurora.org> [101207 11:00]:
> On 12/01/2010 12:20 PM, Stephen Boyd wrote:
> > Definitely for TX since it seems like a redundant loop, but I agree RX
> > code has changed. Instead of
> >
> > If RX buffer full
> > Poll for RX buffer full
> > Read character from RX buffer
> >
> > we would have
> >
> > If RX buffer full
> > Read character from RX buffer
> >
> > which doesn't seem all that different assuming the RX buffer doesn't go
> > from full to empty between the If and Poll steps. Hopefully Tony knows more.
> >
>
> Tony, any thoughts?
Sorry for the delay, looks like I'm only 1 month behind with email..
Sounds like it should work to me. I can try it out if you point me
to a patch.
Regards,
Tony
^ permalink raw reply
* Re: [PATCH] drivers: char: hvc: add arm JTAG DCC console support
From: Stephen Boyd @ 2011-01-14 23:49 UTC (permalink / raw)
To: Tony Lindgren
Cc: Randy Dunlap, Daniel Walker, Mike Frysinger, Arnd Bergmann,
Nicolas Pitre, linux-arm-msm, Greg Kroah-Hartman, linux-kernel,
FUJITA Tomonori, Andrew Morton, linuxppc-dev, Alan Cox
In-Reply-To: <20110114191956.GK4957@atomide.com>
On 01/14/2011 11:19 AM, Tony Lindgren wrote:
> * Stephen Boyd <sboyd@codeaurora.org> [101207 11:00]:
>> On 12/01/2010 12:20 PM, Stephen Boyd wrote:
>>> Definitely for TX since it seems like a redundant loop, but I agree RX
>>> code has changed. Instead of
>>>
>>> If RX buffer full
>>> Poll for RX buffer full
>>> Read character from RX buffer
>>>
>>> we would have
>>>
>>> If RX buffer full
>>> Read character from RX buffer
>>>
>>> which doesn't seem all that different assuming the RX buffer doesn't go
>>> from full to empty between the If and Poll steps. Hopefully Tony knows more.
>>>
>>
>> Tony, any thoughts?
>
> Sorry for the delay, looks like I'm only 1 month behind with email..
> Sounds like it should work to me. I can try it out if you point me
> to a patch.
I think you acked the patches to make this change. You can test them out
by applying the "hvc_dcc cleanups and fixes" patches (Message-Id:
<1292875718-7980-1-git-send-email-sboyd@codeaurora.org>) on top of this
patch. They were sent as a reply to this thread.
Stephen
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply
* [PATCH v4 03/24] powerpc: introduce little-endian bitops
From: Akinobu Mita @ 2011-01-16 13:08 UTC (permalink / raw)
To: linux-kernel, linux-arch, akpm; +Cc: linuxppc-dev, Paul Mackerras, Akinobu Mita
In-Reply-To: <1295183333-13802-1-git-send-email-akinobu.mita@gmail.com>
Introduce little-endian bit operations by renaming existing powerpc
native little-endian bit operations.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
---
The whole series is available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/mita/linux-2.6.git le-bitops-v4
arch/powerpc/include/asm/bitops.h | 38 ++++++++++++++++++------------------
1 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h
index e903264..7b1c5a9 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -281,29 +281,29 @@ unsigned long __arch_hweight64(__u64 w);
/* Little-endian versions */
-static __inline__ int test_le_bit(unsigned long nr,
+static __inline__ int test_bit_le(unsigned long nr,
__const__ unsigned long *addr)
{
__const__ unsigned char *tmp = (__const__ unsigned char *) addr;
return (tmp[nr >> 3] >> (nr & 7)) & 1;
}
-#define __set_le_bit(nr, addr) \
+#define __set_bit_le(nr, addr) \
__set_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-#define __clear_le_bit(nr, addr) \
+#define __clear_bit_le(nr, addr) \
__clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-#define test_and_set_le_bit(nr, addr) \
+#define test_and_set_bit_le(nr, addr) \
test_and_set_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-#define test_and_clear_le_bit(nr, addr) \
+#define test_and_clear_bit_le(nr, addr) \
test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-#define __test_and_set_le_bit(nr, addr) \
+#define __test_and_set_bit_le(nr, addr) \
__test_and_set_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-#define __test_and_clear_le_bit(nr, addr) \
+#define __test_and_clear_bit_le(nr, addr) \
__test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
-#define find_first_zero_le_bit(addr, size) \
+#define find_first_zero_bit_le(addr, size) \
find_next_zero_bit_le((addr), (size), 0)
unsigned long find_next_zero_bit_le(const unsigned long *addr,
unsigned long size, unsigned long offset);
@@ -313,19 +313,19 @@ unsigned long find_next_bit_le(const unsigned long *addr,
/* Bitmap functions for the ext2 filesystem */
#define ext2_set_bit(nr,addr) \
- __test_and_set_le_bit((nr), (unsigned long*)addr)
+ __test_and_set_bit_le((nr), (unsigned long*)addr)
#define ext2_clear_bit(nr, addr) \
- __test_and_clear_le_bit((nr), (unsigned long*)addr)
+ __test_and_clear_bit_le((nr), (unsigned long*)addr)
#define ext2_set_bit_atomic(lock, nr, addr) \
- test_and_set_le_bit((nr), (unsigned long*)addr)
+ test_and_set_bit_le((nr), (unsigned long*)addr)
#define ext2_clear_bit_atomic(lock, nr, addr) \
- test_and_clear_le_bit((nr), (unsigned long*)addr)
+ test_and_clear_bit_le((nr), (unsigned long*)addr)
-#define ext2_test_bit(nr, addr) test_le_bit((nr),(unsigned long*)addr)
+#define ext2_test_bit(nr, addr) test_bit_le((nr),(unsigned long*)addr)
#define ext2_find_first_zero_bit(addr, size) \
- find_first_zero_le_bit((unsigned long*)addr, size)
+ find_first_zero_bit_le((unsigned long*)addr, size)
#define ext2_find_next_zero_bit(addr, size, off) \
find_next_zero_bit_le((unsigned long *)addr, size, off)
@@ -334,16 +334,16 @@ unsigned long find_next_bit_le(const unsigned long *addr,
/* Bitmap functions for the minix filesystem. */
#define minix_test_and_set_bit(nr,addr) \
- __test_and_set_le_bit(nr, (unsigned long *)addr)
+ __test_and_set_bit_le(nr, (unsigned long *)addr)
#define minix_set_bit(nr,addr) \
- __set_le_bit(nr, (unsigned long *)addr)
+ __set_bit_le(nr, (unsigned long *)addr)
#define minix_test_and_clear_bit(nr,addr) \
- __test_and_clear_le_bit(nr, (unsigned long *)addr)
+ __test_and_clear_bit_le(nr, (unsigned long *)addr)
#define minix_test_bit(nr,addr) \
- test_le_bit(nr, (unsigned long *)addr)
+ test_bit_le(nr, (unsigned long *)addr)
#define minix_find_first_zero_bit(addr,size) \
- find_first_zero_le_bit((unsigned long *)addr, size)
+ find_first_zero_bit_le((unsigned long *)addr, size)
#include <asm-generic/bitops/sched.h>
--
1.7.3.4
^ permalink raw reply related
* [PATCH] m68k/amiga: Reclaim Chip RAM for PPC exception handlers
From: Geert Uytterhoeven @ 2011-01-16 18:36 UTC (permalink / raw)
To: Linux/m68k, Roman Zippel; +Cc: Linux/PPC Development, Linux Kernel Development
On m68k, it doesn't make sense to reserve memory for the PPC exception
handlers, and APUS support is dead.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
Or does this impact Amigas with APUS boards running in m68k mode?
As we don't (no longer) modify the start address, we were actually stealing the
_last_ 4 pages.
arch/m68k/amiga/chipram.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/arch/m68k/amiga/chipram.c b/arch/m68k/amiga/chipram.c
index 61df1d3..dd0447d 100644
--- a/arch/m68k/amiga/chipram.c
+++ b/arch/m68k/amiga/chipram.c
@@ -33,10 +33,6 @@ void __init amiga_chip_init(void)
if (!AMIGAHW_PRESENT(CHIP_RAM))
return;
- /*
- * Remove the first 4 pages where PPC exception handlers will be located
- */
- amiga_chip_size -= 0x4000;
chipram_res.end = amiga_chip_size-1;
request_resource(&iomem_resource, &chipram_res);
--
1.7.0.4
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply related
* Re: gianfar: incorrect TCP checksum when timestamps are enabled
From: Alex Dubov @ 2011-01-17 3:10 UTC (permalink / raw)
To: linuxppc-dev
Hi.=0A=0AIt seems, to have TCP working at all with the recent kernel git I =
have to=0Aclear the NETIF_F_IP_CSUM feature of the gianfar driver, otherwis=
e checksums=0Aturn out to be incorrect.=0A=0ADoes anybody have a clue on wh=
ere the actual problem may be?=0A=0A=0A=0A
^ permalink raw reply
* [PATCH] powerpc: perf: Fix frequency calculation for overflowing counters
From: Anton Blanchard @ 2011-01-17 5:17 UTC (permalink / raw)
To: Paul Mackerras, Peter Zijlstra, Ingo Molnar,
Arnaldo Carvalho de Melo, Benjamin Herrenschmidt
Cc: linuxppc-dev, linux-kernel
When profiling a benchmark that is almost 100% userspace, I noticed some
wildly inaccurate profiles that showed almost all time spent in the kernel.
Closer examination shows we were programming a tiny number of cycles into
the PMU after each overflow (about ~200 away from the next overflow). This
gets us stuck in a loop which we eventually break out of by throttling the
PMU (there are regular throttle/unthrottle events in the log).
It looks like we aren't setting event->hw.last_period to something same
and the frequency to period calculations in perf are going haywire. With
the following patch we find the correct period after a few interrupts and
stay there. I also see no more throttle events.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
diff --git a/arch/powerpc/kernel/perf_event.c b/arch/powerpc/kernel/perf_event.c
index 5674807..ab6f6be 100644
--- a/arch/powerpc/kernel/perf_event.c
+++ b/arch/powerpc/kernel/perf_event.c
@@ -1212,6 +1212,7 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
if (left <= 0)
left = period;
record = 1;
+ event->hw.last_period = event->hw.sample_period;
}
if (left < 0x80000000LL)
val = 0x80000000LL - left;
^ permalink raw reply related
* [PATCH] ATA: Add FSL sata v2 controller support
From: Xulei @ 2011-01-17 7:10 UTC (permalink / raw)
To: linuxppc-dev; +Cc: linux-ide, kumar.gala, jgarzik, Xulei
In FSL sata v2 block, the snoop bit of PRDT Word3 description
information is at bit28 instead of bit22.
This patch adds FSL sata v2 probe and resolve this difference.
Signed-off-by: Xulei <B33228@freescale.com>
Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
---
arch/powerpc/boot/dts/p1022ds.dts | 4 ++--
drivers/ata/sata_fsl.c | 24 ++++++++++++++++++------
2 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/arch/powerpc/boot/dts/p1022ds.dts b/arch/powerpc/boot/dts/p1022ds.dts
index 2bbecbb..9ad41dd 100644
--- a/arch/powerpc/boot/dts/p1022ds.dts
+++ b/arch/powerpc/boot/dts/p1022ds.dts
@@ -475,14 +475,14 @@
};
sata@18000 {
- compatible = "fsl,mpc8536-sata", "fsl,pq-sata";
+ compatible = "fsl,p1022-sata", "fsl,pq-sata-v2";
reg = <0x18000 0x1000>;
cell-index = <1>;
interrupts = <74 0x2>;
};
sata@19000 {
- compatible = "fsl,mpc8536-sata", "fsl,pq-sata";
+ compatible = "fsl,p1022-sata", "fsl,pq-sata-v2";
reg = <0x19000 0x1000>;
cell-index = <2>;
interrupts = <41 0x2>;
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index b0214d0..a56399a 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -6,7 +6,7 @@
* Author: Ashish Kalra <ashish.kalra@freescale.com>
* Li Yang <leoli@freescale.com>
*
- * Copyright (c) 2006-2007 Freescale Semiconductor, Inc.
+ * Copyright (c) 2006-2007, 2011 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -158,7 +158,8 @@ enum {
IE_ON_SINGL_DEVICE_ERR | IE_ON_CMD_COMPLETE,
EXT_INDIRECT_SEG_PRD_FLAG = (1 << 31),
- DATA_SNOOP_ENABLE = (1 << 22),
+ DATA_SNOOP_ENABLE_V1 = (1 << 22),
+ DATA_SNOOP_ENABLE_V2 = (1 << 28),
};
/*
@@ -256,6 +257,7 @@ struct sata_fsl_host_priv {
void __iomem *ssr_base;
void __iomem *csr_base;
int irq;
+ int data_snoop;
};
static inline unsigned int sata_fsl_tag(unsigned int tag,
@@ -308,7 +310,8 @@ static void sata_fsl_setup_cmd_hdr_entry(struct sata_fsl_port_priv *pp,
}
static unsigned int sata_fsl_fill_sg(struct ata_queued_cmd *qc, void *cmd_desc,
- u32 *ttl, dma_addr_t cmd_desc_paddr)
+ u32 *ttl, dma_addr_t cmd_desc_paddr,
+ int data_snoop)
{
struct scatterlist *sg;
unsigned int num_prde = 0;
@@ -359,7 +362,7 @@ static unsigned int sata_fsl_fill_sg(struct ata_queued_cmd *qc, void *cmd_desc,
ttl_dwords += sg_len;
prd->dba = cpu_to_le32(sg_addr);
prd->ddc_and_ext =
- cpu_to_le32(DATA_SNOOP_ENABLE | (sg_len & ~0x03));
+ cpu_to_le32(data_snoop | (sg_len & ~0x03));
VPRINTK("sg_fill, ttl=%d, dba=0x%x, ddc=0x%x\n",
ttl_dwords, prd->dba, prd->ddc_and_ext);
@@ -374,7 +377,7 @@ static unsigned int sata_fsl_fill_sg(struct ata_queued_cmd *qc, void *cmd_desc,
/* set indirect extension flag along with indirect ext. size */
prd_ptr_to_indirect_ext->ddc_and_ext =
cpu_to_le32((EXT_INDIRECT_SEG_PRD_FLAG |
- DATA_SNOOP_ENABLE |
+ data_snoop |
(indirect_ext_segment_sz & ~0x03)));
}
@@ -417,7 +420,8 @@ static void sata_fsl_qc_prep(struct ata_queued_cmd *qc)
if (qc->flags & ATA_QCFLAG_DMAMAP)
num_prde = sata_fsl_fill_sg(qc, (void *)cd,
- &ttl_dwords, cd_paddr);
+ &ttl_dwords, cd_paddr,
+ host_priv->data_snoop);
if (qc->tf.protocol == ATA_PROT_NCQ)
desc_info |= FPDMA_QUEUED_CMD;
@@ -1336,6 +1340,11 @@ static int sata_fsl_probe(struct platform_device *ofdev,
}
host_priv->irq = irq;
+ if (of_device_is_compatible(ofdev->dev.of_node, "fsl,pq-sata-v2"))
+ host_priv->data_snoop = DATA_SNOOP_ENABLE_V2;
+ else
+ host_priv->data_snoop = DATA_SNOOP_ENABLE_V1;
+
/* allocate host structure */
host = ata_host_alloc_pinfo(&ofdev->dev, ppi, SATA_FSL_MAX_PORTS);
@@ -1418,6 +1427,9 @@ static struct of_device_id fsl_sata_match[] = {
{
.compatible = "fsl,pq-sata",
},
+ {
+ .compatible = "fsl,pq-sata-v2",
+ },
{},
};
--
1.7.0.4
^ permalink raw reply related
* [PATCH] sched: provide scheduler_ipi() callback in response to smp_send_reschedule()
From: Peter Zijlstra @ 2011-01-17 11:07 UTC (permalink / raw)
To: Richard Henderson, Ivan Kokshaysky, Matt Turner, Russell King,
Mike Frysinger, Mikael Starvik, Jesper Nilsson, Tony Luck,
Fenghua Yu, Hirokazu Takata, Ralf Baechle, David Howells,
Koichi Yasutake, Kyle McMartin, Helge Deller,
James E.J. Bottomley, Benjamin Herrenschmidt, Paul Mackerras,
Martin Schwidefsky, Heiko Carstens, linux390, Paul Mundt,
David S. Miller, Chris Metcalf, Jeff Dike, Thomas Gleixner,
Ingo Molnar, H. Peter Anvin, x86, Jeremy Fitzhardinge,
Konrad Rzeszutek Wilk, linux-alpha, linux-kernel,
linux-arm-kernel, uclinux-dist-devel, linux-cris-kernel,
linux-ia64, linux-m32r, linux-m32r-ja, linux-mips,
linux-am33-list, linux-parisc, linuxppc-dev, linux-s390, linux-sh,
sparclinux, user-mode-linux-devel, user-mode-linux-user,
xen-devel, virtualization, Linux-Arch
For future rework of try_to_wake_up() we'd like to push part of that
onto the CPU the task is actually going to run on, in order to do so we
need a generic callback from the existing scheduler IPI.
This patch introduces such a generic callback: scheduler_ipi() and
implements it as a NOP.
I visited existing smp_send_reschedule() implementations and tried to
add a call to scheduler_ipi() in their handler part, but esp. for MIPS
I'm not quite sure I actually got all of them.
Also, while reading through all this, I noticed the blackfin SMP code
looks to be broken, it simply discards any IPI when low on memory.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
arch/alpha/kernel/smp.c | 1 +
arch/arm/kernel/smp.c | 1 +
arch/blackfin/mach-common/smp.c | 3 ++-
arch/cris/arch-v32/kernel/smp.c | 13 ++++++++-----
arch/ia64/kernel/irq_ia64.c | 2 ++
arch/ia64/xen/irq_xen.c | 10 +++++++++-
arch/m32r/kernel/smp.c | 2 +-
arch/mips/kernel/smtc.c | 1 +
arch/mips/sibyte/bcm1480/smp.c | 7 +++----
arch/mips/sibyte/sb1250/smp.c | 7 +++----
arch/mn10300/kernel/smp.c | 2 +-
arch/parisc/kernel/smp.c | 1 +
arch/powerpc/kernel/smp.c | 1 +
arch/s390/kernel/smp.c | 6 +++---
arch/sh/kernel/smp.c | 2 ++
arch/sparc/kernel/smp_32.c | 2 +-
arch/sparc/kernel/smp_64.c | 1 +
arch/tile/kernel/smp.c | 1 +
arch/um/kernel/smp.c | 2 +-
arch/x86/kernel/smp.c | 1 +
arch/x86/xen/smp.c | 1 +
include/linux/sched.h | 1 +
22 files changed, 46 insertions(+), 22 deletions(-)
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
index 42aa078..c4a570b 100644
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -587,6 +587,7 @@ handle_ipi(struct pt_regs *regs)
case IPI_RESCHEDULE:
/* Reschedule callback. Everything to be done
is done by the interrupt return path. */
+ scheduler_ipi();
break;
=20
case IPI_CALL_FUNC:
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 9066473..ffde790 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -579,6 +579,7 @@ asmlinkage void __exception do_IPI(struct pt_regs *regs=
)
* nothing more to do - eveything is
* done on the interrupt return path
*/
+ scheduler_ipi();
break;
=20
case IPI_CALL_FUNC:
diff --git a/arch/blackfin/mach-common/smp.c b/arch/blackfin/mach-common/sm=
p.c
index a17107a..e210f8a 100644
--- a/arch/blackfin/mach-common/smp.c
+++ b/arch/blackfin/mach-common/smp.c
@@ -156,6 +156,7 @@ static irqreturn_t ipi_handler(int irq, void *dev_insta=
nce)
case BFIN_IPI_RESCHEDULE:
/* That's the easiest one; leave it to
* return_from_int. */
+ scheduler_ipi();
kfree(msg);
break;
case BFIN_IPI_CALL_FUNC:
@@ -301,7 +302,7 @@ void smp_send_reschedule(int cpu)
=20
msg =3D kzalloc(sizeof(*msg), GFP_ATOMIC);
if (!msg)
- return;
+ return; /* XXX unreliable needs fixing ! */
INIT_LIST_HEAD(&msg->list);
msg->type =3D BFIN_IPI_RESCHEDULE;
=20
diff --git a/arch/cris/arch-v32/kernel/smp.c b/arch/cris/arch-v32/kernel/sm=
p.c
index 84fed3b..86e3c76 100644
--- a/arch/cris/arch-v32/kernel/smp.c
+++ b/arch/cris/arch-v32/kernel/smp.c
@@ -340,15 +340,18 @@ irqreturn_t crisv32_ipi_interrupt(int irq, void *dev_=
id)
=20
ipi =3D REG_RD(intr_vect, irq_regs[smp_processor_id()], rw_ipi);
=20
+ if (ipi.vector & IPI_SCHEDULE) {
+ scheduler_ipi();
+ }
if (ipi.vector & IPI_CALL) {
- func(info);
+ func(info);
}
if (ipi.vector & IPI_FLUSH_TLB) {
- if (flush_mm =3D=3D FLUSH_ALL)
- __flush_tlb_all();
- else if (flush_vma =3D=3D FLUSH_ALL)
+ if (flush_mm =3D=3D FLUSH_ALL)
+ __flush_tlb_all();
+ else if (flush_vma =3D=3D FLUSH_ALL)
__flush_tlb_mm(flush_mm);
- else
+ else
__flush_tlb_page(flush_vma, flush_addr);
}
=20
diff --git a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c
index 9a26015..a580230 100644
--- a/arch/ia64/kernel/irq_ia64.c
+++ b/arch/ia64/kernel/irq_ia64.c
@@ -31,6 +31,7 @@
#include <linux/irq.h>
#include <linux/ratelimit.h>
#include <linux/acpi.h>
+#include <linux/sched.h>
=20
#include <asm/delay.h>
#include <asm/intrinsics.h>
@@ -496,6 +497,7 @@ ia64_handle_irq (ia64_vector vector, struct pt_regs *re=
gs)
smp_local_flush_tlb();
kstat_incr_irqs_this_cpu(irq, desc);
} else if (unlikely(IS_RESCHEDULE(vector))) {
+ scheduler_ipi();
kstat_incr_irqs_this_cpu(irq, desc);
} else {
ia64_setreg(_IA64_REG_CR_TPR, vector);
diff --git a/arch/ia64/xen/irq_xen.c b/arch/ia64/xen/irq_xen.c
index a3fb7cf..2f235a3 100644
--- a/arch/ia64/xen/irq_xen.c
+++ b/arch/ia64/xen/irq_xen.c
@@ -92,6 +92,8 @@ static unsigned short saved_irq_cnt;
static int xen_slab_ready;
=20
#ifdef CONFIG_SMP
+#include <linux/sched.h>
+
/* Dummy stub. Though we may check XEN_RESCHEDULE_VECTOR before __do_IRQ,
* it ends up to issue several memory accesses upon percpu data and
* thus adds unnecessary traffic to other paths.
@@ -99,7 +101,13 @@ static int xen_slab_ready;
static irqreturn_t
xen_dummy_handler(int irq, void *dev_id)
{
+ return IRQ_HANDLED;
+}
=20
+static irqreturn_t
+xen_resched_handler(int irq, void *dev_id)
+{
+ scheduler_ipi();
return IRQ_HANDLED;
}
=20
@@ -110,7 +118,7 @@ static struct irqaction xen_ipi_irqaction =3D {
};
=20
static struct irqaction xen_resched_irqaction =3D {
- .handler =3D xen_dummy_handler,
+ .handler =3D xen_resched_handler,
.flags =3D IRQF_DISABLED,
.name =3D "resched"
};
diff --git a/arch/m32r/kernel/smp.c b/arch/m32r/kernel/smp.c
index 31cef20..f0ecc3f 100644
--- a/arch/m32r/kernel/smp.c
+++ b/arch/m32r/kernel/smp.c
@@ -138,7 +138,7 @@ void smp_send_reschedule(int cpu_id)
*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
*/
void smp_reschedule_interrupt(void)
{
- /* nothing to do */
+ scheduler_ipi();
}
=20
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
*
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c
index 39c0825..0443e91 100644
--- a/arch/mips/kernel/smtc.c
+++ b/arch/mips/kernel/smtc.c
@@ -931,6 +931,7 @@ static void post_direct_ipi(int cpu, struct smtc_ipi *p=
ipi)
static void ipi_resched_interrupt(void)
{
/* Return from interrupt should be enough to cause scheduler check */
+ scheduler_ipi();
}
=20
static void ipi_call_interrupt(void)
diff --git a/arch/mips/sibyte/bcm1480/smp.c b/arch/mips/sibyte/bcm1480/smp.=
c
index 47b347c..513a301 100644
--- a/arch/mips/sibyte/bcm1480/smp.c
+++ b/arch/mips/sibyte/bcm1480/smp.c
@@ -20,6 +20,7 @@
#include <linux/delay.h>
#include <linux/smp.h>
#include <linux/kernel_stat.h>
+#include <linux/sched.h>
=20
#include <asm/mmu_context.h>
#include <asm/io.h>
@@ -189,10 +190,8 @@ void bcm1480_mailbox_interrupt(void)
/* Clear the mailbox to clear the interrupt */
__raw_writeq(((u64)action)<<48, mailbox_0_clear_regs[cpu]);
=20
- /*
- * Nothing to do for SMP_RESCHEDULE_YOURSELF; returning from the
- * interrupt will do the reschedule for us
- */
+ if (actione & SMP_RESCHEDULE_YOURSELF)
+ scheduler_ipi();
=20
if (action & SMP_CALL_FUNCTION)
smp_call_function_interrupt();
diff --git a/arch/mips/sibyte/sb1250/smp.c b/arch/mips/sibyte/sb1250/smp.c
index c00a5cb..38e7f6b 100644
--- a/arch/mips/sibyte/sb1250/smp.c
+++ b/arch/mips/sibyte/sb1250/smp.c
@@ -21,6 +21,7 @@
#include <linux/interrupt.h>
#include <linux/smp.h>
#include <linux/kernel_stat.h>
+#include <linux/sched.h>
=20
#include <asm/mmu_context.h>
#include <asm/io.h>
@@ -177,10 +178,8 @@ void sb1250_mailbox_interrupt(void)
/* Clear the mailbox to clear the interrupt */
____raw_writeq(((u64)action) << 48, mailbox_clear_regs[cpu]);
=20
- /*
- * Nothing to do for SMP_RESCHEDULE_YOURSELF; returning from the
- * interrupt will do the reschedule for us
- */
+ if (action & SMP_RESCHEDULE_YOURSELF)
+ scheduler_ipi();
=20
if (action & SMP_CALL_FUNCTION)
smp_call_function_interrupt();
diff --git a/arch/mn10300/kernel/smp.c b/arch/mn10300/kernel/smp.c
index 0dcd1c6..17f16ca 100644
--- a/arch/mn10300/kernel/smp.c
+++ b/arch/mn10300/kernel/smp.c
@@ -471,7 +471,7 @@ void smp_send_stop(void)
*/
static irqreturn_t smp_reschedule_interrupt(int irq, void *dev_id)
{
- /* do nothing */
+ scheduler_ipi();
return IRQ_HANDLED;
}
=20
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index 69d63d3..f8f7970 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -155,6 +155,7 @@ ipi_interrupt(int irq, void *dev_id)
=09
case IPI_RESCHEDULE:
smp_debug(100, KERN_DEBUG "CPU%d IPI_RESCHEDULE\n", this_cpu);
+ scheduler_ipi();
/*
* Reschedule callback. Everything to be
* done is done by the interrupt return path.
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 68034bb..7ee0fc3 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -128,6 +128,7 @@ static irqreturn_t call_function_action(int irq, void *=
data)
static irqreturn_t reschedule_action(int irq, void *data)
{
/* we just need the return path side effect of checking need_resched */
+ scheduler_ipi();
return IRQ_HANDLED;
}
=20
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 94cf510..61789e8 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -163,12 +163,12 @@ static void do_ext_call_interrupt(unsigned int ext_in=
t_code,
=20
/*
* handle bit signal external calls
- *
- * For the ec_schedule signal we have to do nothing. All the work
- * is done automatically when we return from the interrupt.
*/
bits =3D xchg(&S390_lowcore.ext_call_fast, 0);
=20
+ if (test_bit(ec_schedule, &bits))
+ scheduler_ipi();
+
if (test_bit(ec_call_function, &bits))
generic_smp_call_function_interrupt();
=20
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c
index 509b36b..6207561 100644
--- a/arch/sh/kernel/smp.c
+++ b/arch/sh/kernel/smp.c
@@ -20,6 +20,7 @@
#include <linux/module.h>
#include <linux/cpu.h>
#include <linux/interrupt.h>
+#include <linux/sched.h>
#include <asm/atomic.h>
#include <asm/processor.h>
#include <asm/system.h>
@@ -323,6 +324,7 @@ void smp_message_recv(unsigned int msg)
generic_smp_call_function_interrupt();
break;
case SMP_MSG_RESCHEDULE:
+ scheduler_ipi();
break;
case SMP_MSG_FUNCTION_SINGLE:
generic_smp_call_function_single_interrupt();
diff --git a/arch/sparc/kernel/smp_32.c b/arch/sparc/kernel/smp_32.c
index 91c10fb..042d8c9 100644
--- a/arch/sparc/kernel/smp_32.c
+++ b/arch/sparc/kernel/smp_32.c
@@ -125,7 +125,7 @@ struct linux_prom_registers smp_penguin_ctable __cpuini=
tdata =3D { 0 };
=20
void smp_send_reschedule(int cpu)
{
- /* See sparc64 */
+ scheduler_ipi();
}
=20
void smp_send_stop(void)
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index b6a2b8f..68e26e2 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -1369,6 +1369,7 @@ void smp_send_reschedule(int cpu)
void __irq_entry smp_receive_signal_client(int irq, struct pt_regs *regs)
{
clear_softint(1 << irq);
+ scheduler_ipi();
}
=20
/* This is a nop because we capture all other cpus
diff --git a/arch/tile/kernel/smp.c b/arch/tile/kernel/smp.c
index 9575b37..91a1ddf 100644
--- a/arch/tile/kernel/smp.c
+++ b/arch/tile/kernel/smp.c
@@ -190,6 +190,7 @@ static irqreturn_t handle_reschedule_ipi(int irq, void =
*token)
* profiler count in the meantime.
*/
__get_cpu_var(irq_stat).irq_resched_count++;
+ scheduler_ipi();
=20
return IRQ_HANDLED;
}
diff --git a/arch/um/kernel/smp.c b/arch/um/kernel/smp.c
index 106bf27..eefb107 100644
--- a/arch/um/kernel/smp.c
+++ b/arch/um/kernel/smp.c
@@ -173,7 +173,7 @@ void IPI_handler(int cpu)
break;
=20
case 'R':
- set_tsk_need_resched(current);
+ scheduler_ipi();
break;
=20
case 'S':
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index 513deac..e38c2d8 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -202,6 +202,7 @@ void smp_reschedule_interrupt(struct pt_regs *regs)
{
ack_APIC_irq();
inc_irq_stat(irq_resched_count);
+ scheduler_ipi();
/*
* KVM uses this interrupt to force a cpu out of guest mode
*/
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index 72a4c79..6196fb1 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -53,6 +53,7 @@ static irqreturn_t xen_call_function_single_interrupt(int=
irq, void *dev_id);
static irqreturn_t xen_reschedule_interrupt(int irq, void *dev_id)
{
inc_irq_stat(irq_resched_count);
+ scheduler_ipi();
=20
return IRQ_HANDLED;
}
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 341acbb..aa458dc 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2183,6 +2183,7 @@ extern void set_task_comm(struct task_struct *tsk, ch=
ar *from);
extern char *get_task_comm(char *to, struct task_struct *tsk);
=20
#ifdef CONFIG_SMP
+static inline void scheduler_ipi(void) { }
extern unsigned long wait_task_inactive(struct task_struct *, long match_s=
tate);
#else
static inline unsigned long wait_task_inactive(struct task_struct *p,
^ permalink raw reply related
* Re: [PATCH] sched: provide scheduler_ipi() callback in response to smp_send_reschedule()
From: Peter Zijlstra @ 2011-01-17 11:31 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: linux-m32r-ja, linux-mips, linux-ia64, linux-sh, H. Peter Anvin,
Heiko Carstens, Paul Mackerras, Helge Deller, sparclinux,
Linux-Arch, linux-s390, Jesper Nilsson, Jeremy Fitzhardinge,
Hirokazu Takata, x86, James E.J. Bottomley, virtualization,
Ingo Molnar, Matt Turner, Fenghua Yu, Mike Frysinger,
user-mode-linux-devel, Konrad Rzeszutek Wilk, Jeff Dike,
Chris Metcalf, xen-devel, Mikael Starvik, linux-m32r,
Ivan Kokshaysky, user-mode-linux-user, uclinux-dist-devel,
Thomas Gleixner, linux-arm-kernel, Richard Henderson, Tony Luck,
linux-parisc, linux-cris-kernel, linux-am33-list, linux-kernel,
Ralf Baechle, Kyle McMartin, Paul Mundt, linux-alpha,
Martin Schwidefsky, linux390, Koichi Yasutake, linuxppc-dev,
David S. Miller
In-Reply-To: <20110117112637.GA18599@n2100.arm.linux.org.uk>
On Mon, 2011-01-17 at 11:26 +0000, Russell King - ARM Linux wrote:
> On Mon, Jan 17, 2011 at 12:07:13PM +0100, Peter Zijlstra wrote:
> > diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
> > index 42aa078..c4a570b 100644
> > --- a/arch/alpha/kernel/smp.c
> > +++ b/arch/alpha/kernel/smp.c
> > @@ -587,6 +587,7 @@ handle_ipi(struct pt_regs *regs)
> > case IPI_RESCHEDULE:
> > /* Reschedule callback. Everything to be done
> > is done by the interrupt return path. */
> > + scheduler_ipi();
> > break;
> > =20
> > case IPI_CALL_FUNC:
> > diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
> > index 9066473..ffde790 100644
> > --- a/arch/arm/kernel/smp.c
> > +++ b/arch/arm/kernel/smp.c
> > @@ -579,6 +579,7 @@ asmlinkage void __exception do_IPI(struct pt_regs *=
regs)
> > * nothing more to do - eveything is
> > * done on the interrupt return path
> > */
> > + scheduler_ipi();
>=20
> Maybe remove the comment "everything is done on the interrupt return path=
"
> as with this function call, that is no longer the case.
>=20
> Looks like the same is true for Alpha as well?
Right, will do, thanks! It looks like I've somewhat inconsistent with
that.
^ permalink raw reply
* Re: [PATCH] sched: provide scheduler_ipi() callback in response to smp_send_reschedule()
From: Peter Zijlstra @ 2011-01-17 11:41 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: linux-mips, linux-ia64, linux-sh, H. Peter Anvin, Heiko Carstens,
Paul Mackerras, Helge Deller, sparclinux, Linux-Arch, linux-s390,
Jesper Nilsson, Jeremy Fitzhardinge, Hirokazu Takata, x86,
James E.J. Bottomley, virtualization, Ingo Molnar, Matt Turner,
Fenghua Yu, Mike Frysinger, user-mode-linux-devel,
Konrad Rzeszutek Wilk, Jeff Dike, Chris Metcalf, Mikael Starvik,
xen-devel, Ivan Kokshaysky, user-mode-linux-user,
uclinux-dist-devel, Thomas Gleixner, Richard Henderson, Tony Luck,
linux-parisc, linux-cris-kernel, linux-kernel, Ralf Baechle,
Kyle McMartin, Paul Mundt, linux-alpha, Martin Schwidefsky,
linux390, Koichi Yasutake, linuxppc-dev, David S. Miller
In-Reply-To: <1295263884.30950.54.camel@laptop>
On Mon, 2011-01-17 at 12:31 +0100, Peter Zijlstra wrote:
> On Mon, 2011-01-17 at 11:26 +0000, Russell King - ARM Linux wrote:
> > Maybe remove the comment "everything is done on the interrupt return pa=
th"
> > as with this function call, that is no longer the case.
(Removed am33, m32r-ka, m32r, arm-kernel lists because they kept sending
bounces)
---
Subject: sched: provide scheduler_ipi() callback in response to smp_send_re=
schedule()
From: Peter Zijlstra <peterz@infradead.org>
Date: Mon, 17 Jan 2011 12:07:13 +0100
For future rework of try_to_wake_up() we'd like to push part of that
onto the CPU the task is actually going to run on, in order to do so we
need a generic callback from the existing scheduler IPI.
This patch introduces such a generic callback: scheduler_ipi() and
implements it as a NOP.
I visited existing smp_send_reschedule() implementations and tried to
add a call to scheduler_ipi() in their handler part, but esp. for MIPS
I'm not quite sure I actually got all of them.
Also, while reading through all this, I noticed the blackfin SMP code
looks to be broken, it simply discards any IPI when low on memory.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
---
arch/alpha/kernel/smp.c | 3 +--
arch/arm/kernel/smp.c | 5 +----
arch/blackfin/mach-common/smp.c | 5 ++---
arch/cris/arch-v32/kernel/smp.c | 13 ++++++++-----
arch/ia64/kernel/irq_ia64.c | 2 ++
arch/ia64/xen/irq_xen.c | 10 +++++++++-
arch/m32r/kernel/smp.c | 4 +---
arch/mips/kernel/smtc.c | 2 +-
arch/mips/sibyte/bcm1480/smp.c | 7 +++----
arch/mips/sibyte/sb1250/smp.c | 7 +++----
arch/mn10300/kernel/smp.c | 5 +----
arch/parisc/kernel/smp.c | 5 +----
arch/powerpc/kernel/smp.c | 2 +-
arch/s390/kernel/smp.c | 6 +++---
arch/sh/kernel/smp.c | 2 ++
arch/sparc/kernel/smp_32.c | 2 +-
arch/sparc/kernel/smp_64.c | 1 +
arch/tile/kernel/smp.c | 6 +-----
arch/um/kernel/smp.c | 2 +-
arch/x86/kernel/smp.c | 5 ++---
arch/x86/xen/smp.c | 5 ++---
include/linux/sched.h | 1 +
22 files changed, 48 insertions(+), 52 deletions(-)
Index: linux-2.6/arch/alpha/kernel/smp.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-2.6.orig/arch/alpha/kernel/smp.c
+++ linux-2.6/arch/alpha/kernel/smp.c
@@ -585,8 +585,7 @@ handle_ipi(struct pt_regs *regs)
=20
switch (which) {
case IPI_RESCHEDULE:
- /* Reschedule callback. Everything to be done
- is done by the interrupt return path. */
+ scheduler_ipi();
break;
=20
case IPI_CALL_FUNC:
Index: linux-2.6/arch/arm/kernel/smp.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-2.6.orig/arch/arm/kernel/smp.c
+++ linux-2.6/arch/arm/kernel/smp.c
@@ -575,10 +575,7 @@ asmlinkage void __exception do_IPI(struc
break;
=20
case IPI_RESCHEDULE:
- /*
- * nothing more to do - eveything is
- * done on the interrupt return path
- */
+ scheduler_ipi();
break;
=20
case IPI_CALL_FUNC:
Index: linux-2.6/arch/blackfin/mach-common/smp.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-2.6.orig/arch/blackfin/mach-common/smp.c
+++ linux-2.6/arch/blackfin/mach-common/smp.c
@@ -154,8 +154,7 @@ static irqreturn_t ipi_handler(int irq,=20
list_del(&msg->list);
switch (msg->type) {
case BFIN_IPI_RESCHEDULE:
- /* That's the easiest one; leave it to
- * return_from_int. */
+ scheduler_ipi();
kfree(msg);
break;
case BFIN_IPI_CALL_FUNC:
@@ -301,7 +300,7 @@ void smp_send_reschedule(int cpu)
=20
msg =3D kzalloc(sizeof(*msg), GFP_ATOMIC);
if (!msg)
- return;
+ return; /* XXX unreliable needs fixing ! */
INIT_LIST_HEAD(&msg->list);
msg->type =3D BFIN_IPI_RESCHEDULE;
=20
Index: linux-2.6/arch/cris/arch-v32/kernel/smp.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-2.6.orig/arch/cris/arch-v32/kernel/smp.c
+++ linux-2.6/arch/cris/arch-v32/kernel/smp.c
@@ -340,15 +340,18 @@ irqreturn_t crisv32_ipi_interrupt(int ir
=20
ipi =3D REG_RD(intr_vect, irq_regs[smp_processor_id()], rw_ipi);
=20
+ if (ipi.vector & IPI_SCHEDULE) {
+ scheduler_ipi();
+ }
if (ipi.vector & IPI_CALL) {
- func(info);
+ func(info);
}
if (ipi.vector & IPI_FLUSH_TLB) {
- if (flush_mm =3D=3D FLUSH_ALL)
- __flush_tlb_all();
- else if (flush_vma =3D=3D FLUSH_ALL)
+ if (flush_mm =3D=3D FLUSH_ALL)
+ __flush_tlb_all();
+ else if (flush_vma =3D=3D FLUSH_ALL)
__flush_tlb_mm(flush_mm);
- else
+ else
__flush_tlb_page(flush_vma, flush_addr);
}
=20
Index: linux-2.6/arch/ia64/kernel/irq_ia64.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-2.6.orig/arch/ia64/kernel/irq_ia64.c
+++ linux-2.6/arch/ia64/kernel/irq_ia64.c
@@ -31,6 +31,7 @@
#include <linux/irq.h>
#include <linux/ratelimit.h>
#include <linux/acpi.h>
+#include <linux/sched.h>
=20
#include <asm/delay.h>
#include <asm/intrinsics.h>
@@ -496,6 +497,7 @@ ia64_handle_irq (ia64_vector vector, str
smp_local_flush_tlb();
kstat_incr_irqs_this_cpu(irq, desc);
} else if (unlikely(IS_RESCHEDULE(vector))) {
+ scheduler_ipi();
kstat_incr_irqs_this_cpu(irq, desc);
} else {
ia64_setreg(_IA64_REG_CR_TPR, vector);
Index: linux-2.6/arch/ia64/xen/irq_xen.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-2.6.orig/arch/ia64/xen/irq_xen.c
+++ linux-2.6/arch/ia64/xen/irq_xen.c
@@ -92,6 +92,8 @@ static unsigned short saved_irq_cnt;
static int xen_slab_ready;
=20
#ifdef CONFIG_SMP
+#include <linux/sched.h>
+
/* Dummy stub. Though we may check XEN_RESCHEDULE_VECTOR before __do_IRQ,
* it ends up to issue several memory accesses upon percpu data and
* thus adds unnecessary traffic to other paths.
@@ -99,7 +101,13 @@ static int xen_slab_ready;
static irqreturn_t
xen_dummy_handler(int irq, void *dev_id)
{
+ return IRQ_HANDLED;
+}
=20
+static irqreturn_t
+xen_resched_handler(int irq, void *dev_id)
+{
+ scheduler_ipi();
return IRQ_HANDLED;
}
=20
@@ -110,7 +118,7 @@ static struct irqaction xen_ipi_irqactio
};
=20
static struct irqaction xen_resched_irqaction =3D {
- .handler =3D xen_dummy_handler,
+ .handler =3D xen_resched_handler,
.flags =3D IRQF_DISABLED,
.name =3D "resched"
};
Index: linux-2.6/arch/m32r/kernel/smp.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-2.6.orig/arch/m32r/kernel/smp.c
+++ linux-2.6/arch/m32r/kernel/smp.c
@@ -122,8 +122,6 @@ void smp_send_reschedule(int cpu_id)
*
* Description: This routine executes on CPU which received
* 'RESCHEDULE_IPI'.
- * Rescheduling is processed at the exit of interrupt
- * operation.
*
* Born on Date: 2002.02.05
*
@@ -138,7 +136,7 @@ void smp_send_reschedule(int cpu_id)
*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
*/
void smp_reschedule_interrupt(void)
{
- /* nothing to do */
+ scheduler_ipi();
}
=20
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
*
Index: linux-2.6/arch/mips/kernel/smtc.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-2.6.orig/arch/mips/kernel/smtc.c
+++ linux-2.6/arch/mips/kernel/smtc.c
@@ -930,7 +930,7 @@ static void post_direct_ipi(int cpu, str
=20
static void ipi_resched_interrupt(void)
{
- /* Return from interrupt should be enough to cause scheduler check */
+ scheduler_ipi();
}
=20
static void ipi_call_interrupt(void)
Index: linux-2.6/arch/mips/sibyte/bcm1480/smp.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-2.6.orig/arch/mips/sibyte/bcm1480/smp.c
+++ linux-2.6/arch/mips/sibyte/bcm1480/smp.c
@@ -20,6 +20,7 @@
#include <linux/delay.h>
#include <linux/smp.h>
#include <linux/kernel_stat.h>
+#include <linux/sched.h>
=20
#include <asm/mmu_context.h>
#include <asm/io.h>
@@ -189,10 +190,8 @@ void bcm1480_mailbox_interrupt(void)
/* Clear the mailbox to clear the interrupt */
__raw_writeq(((u64)action)<<48, mailbox_0_clear_regs[cpu]);
=20
- /*
- * Nothing to do for SMP_RESCHEDULE_YOURSELF; returning from the
- * interrupt will do the reschedule for us
- */
+ if (actione & SMP_RESCHEDULE_YOURSELF)
+ scheduler_ipi();
=20
if (action & SMP_CALL_FUNCTION)
smp_call_function_interrupt();
Index: linux-2.6/arch/mips/sibyte/sb1250/smp.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-2.6.orig/arch/mips/sibyte/sb1250/smp.c
+++ linux-2.6/arch/mips/sibyte/sb1250/smp.c
@@ -21,6 +21,7 @@
#include <linux/interrupt.h>
#include <linux/smp.h>
#include <linux/kernel_stat.h>
+#include <linux/sched.h>
=20
#include <asm/mmu_context.h>
#include <asm/io.h>
@@ -177,10 +178,8 @@ void sb1250_mailbox_interrupt(void)
/* Clear the mailbox to clear the interrupt */
____raw_writeq(((u64)action) << 48, mailbox_clear_regs[cpu]);
=20
- /*
- * Nothing to do for SMP_RESCHEDULE_YOURSELF; returning from the
- * interrupt will do the reschedule for us
- */
+ if (action & SMP_RESCHEDULE_YOURSELF)
+ scheduler_ipi();
=20
if (action & SMP_CALL_FUNCTION)
smp_call_function_interrupt();
Index: linux-2.6/arch/mn10300/kernel/smp.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-2.6.orig/arch/mn10300/kernel/smp.c
+++ linux-2.6/arch/mn10300/kernel/smp.c
@@ -464,14 +464,11 @@ void smp_send_stop(void)
* @irq: The interrupt number.
* @dev_id: The device ID.
*
- * We need do nothing here, since the scheduling will be effected on our w=
ay
- * back through entry.S.
- *
* Returns IRQ_HANDLED to indicate we handled the interrupt successfully.
*/
static irqreturn_t smp_reschedule_interrupt(int irq, void *dev_id)
{
- /* do nothing */
+ scheduler_ipi();
return IRQ_HANDLED;
}
=20
Index: linux-2.6/arch/parisc/kernel/smp.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-2.6.orig/arch/parisc/kernel/smp.c
+++ linux-2.6/arch/parisc/kernel/smp.c
@@ -155,10 +155,7 @@ ipi_interrupt(int irq, void *dev_id)=20
=09
case IPI_RESCHEDULE:
smp_debug(100, KERN_DEBUG "CPU%d IPI_RESCHEDULE\n", this_cpu);
- /*
- * Reschedule callback. Everything to be
- * done is done by the interrupt return path.
- */
+ scheduler_ipi();
break;
=20
case IPI_CALL_FUNC:
Index: linux-2.6/arch/powerpc/kernel/smp.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-2.6.orig/arch/powerpc/kernel/smp.c
+++ linux-2.6/arch/powerpc/kernel/smp.c
@@ -127,7 +127,7 @@ static irqreturn_t call_function_action(
=20
static irqreturn_t reschedule_action(int irq, void *data)
{
- /* we just need the return path side effect of checking need_resched */
+ scheduler_ipi();
return IRQ_HANDLED;
}
=20
Index: linux-2.6/arch/s390/kernel/smp.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-2.6.orig/arch/s390/kernel/smp.c
+++ linux-2.6/arch/s390/kernel/smp.c
@@ -163,12 +163,12 @@ static void do_ext_call_interrupt(unsign
=20
/*
* handle bit signal external calls
- *
- * For the ec_schedule signal we have to do nothing. All the work
- * is done automatically when we return from the interrupt.
*/
bits =3D xchg(&S390_lowcore.ext_call_fast, 0);
=20
+ if (test_bit(ec_schedule, &bits))
+ scheduler_ipi();
+
if (test_bit(ec_call_function, &bits))
generic_smp_call_function_interrupt();
=20
Index: linux-2.6/arch/sh/kernel/smp.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-2.6.orig/arch/sh/kernel/smp.c
+++ linux-2.6/arch/sh/kernel/smp.c
@@ -20,6 +20,7 @@
#include <linux/module.h>
#include <linux/cpu.h>
#include <linux/interrupt.h>
+#include <linux/sched.h>
#include <asm/atomic.h>
#include <asm/processor.h>
#include <asm/system.h>
@@ -323,6 +324,7 @@ void smp_message_recv(unsigned int msg)
generic_smp_call_function_interrupt();
break;
case SMP_MSG_RESCHEDULE:
+ scheduler_ipi();
break;
case SMP_MSG_FUNCTION_SINGLE:
generic_smp_call_function_single_interrupt();
Index: linux-2.6/arch/sparc/kernel/smp_32.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-2.6.orig/arch/sparc/kernel/smp_32.c
+++ linux-2.6/arch/sparc/kernel/smp_32.c
@@ -125,7 +125,7 @@ struct linux_prom_registers smp_penguin_
=20
void smp_send_reschedule(int cpu)
{
- /* See sparc64 */
+ scheduler_ipi();
}
=20
void smp_send_stop(void)
Index: linux-2.6/arch/sparc/kernel/smp_64.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-2.6.orig/arch/sparc/kernel/smp_64.c
+++ linux-2.6/arch/sparc/kernel/smp_64.c
@@ -1369,6 +1369,7 @@ void smp_send_reschedule(int cpu)
void __irq_entry smp_receive_signal_client(int irq, struct pt_regs *regs)
{
clear_softint(1 << irq);
+ scheduler_ipi();
}
=20
/* This is a nop because we capture all other cpus
Index: linux-2.6/arch/tile/kernel/smp.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-2.6.orig/arch/tile/kernel/smp.c
+++ linux-2.6/arch/tile/kernel/smp.c
@@ -184,12 +184,8 @@ void flush_icache_range(unsigned long st
/* Called when smp_send_reschedule() triggers IRQ_RESCHEDULE. */
static irqreturn_t handle_reschedule_ipi(int irq, void *token)
{
- /*
- * Nothing to do here; when we return from interrupt, the
- * rescheduling will occur there. But do bump the interrupt
- * profiler count in the meantime.
- */
__get_cpu_var(irq_stat).irq_resched_count++;
+ scheduler_ipi();
=20
return IRQ_HANDLED;
}
Index: linux-2.6/arch/um/kernel/smp.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-2.6.orig/arch/um/kernel/smp.c
+++ linux-2.6/arch/um/kernel/smp.c
@@ -173,7 +173,7 @@ void IPI_handler(int cpu)
break;
=20
case 'R':
- set_tsk_need_resched(current);
+ scheduler_ipi();
break;
=20
case 'S':
Index: linux-2.6/arch/x86/kernel/smp.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-2.6.orig/arch/x86/kernel/smp.c
+++ linux-2.6/arch/x86/kernel/smp.c
@@ -194,14 +194,13 @@ static void native_stop_other_cpus(int w
}
=20
/*
- * Reschedule call back. Nothing to do,
- * all the work is done automatically when
- * we return from the interrupt.
+ * Reschedule call back.
*/
void smp_reschedule_interrupt(struct pt_regs *regs)
{
ack_APIC_irq();
inc_irq_stat(irq_resched_count);
+ scheduler_ipi();
/*
* KVM uses this interrupt to force a cpu out of guest mode
*/
Index: linux-2.6/arch/x86/xen/smp.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-2.6.orig/arch/x86/xen/smp.c
+++ linux-2.6/arch/x86/xen/smp.c
@@ -46,13 +46,12 @@ static irqreturn_t xen_call_function_int
static irqreturn_t xen_call_function_single_interrupt(int irq, void *dev_i=
d);
=20
/*
- * Reschedule call back. Nothing to do,
- * all the work is done automatically when
- * we return from the interrupt.
+ * Reschedule call back.
*/
static irqreturn_t xen_reschedule_interrupt(int irq, void *dev_id)
{
inc_irq_stat(irq_resched_count);
+ scheduler_ipi();
=20
return IRQ_HANDLED;
}
Index: linux-2.6/include/linux/sched.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-2.6.orig/include/linux/sched.h
+++ linux-2.6/include/linux/sched.h
@@ -2183,6 +2183,7 @@ extern void set_task_comm(struct task_st
extern char *get_task_comm(char *to, struct task_struct *tsk);
=20
#ifdef CONFIG_SMP
+static inline void scheduler_ipi(void) { }
extern unsigned long wait_task_inactive(struct task_struct *, long match_s=
tate);
#else
static inline unsigned long wait_task_inactive(struct task_struct *p,
^ permalink raw reply
* Re: [PATCH] ATA: Add FSL sata v2 controller support
From: Sergei Shtylyov @ 2011-01-17 11:47 UTC (permalink / raw)
To: Xulei; +Cc: jgarzik, kumar.gala, linuxppc-dev, linux-ide
In-Reply-To: <1295248259-14752-1-git-send-email-B33228@freescale.com>
Hello.
On 17-01-2011 10:10, Xulei wrote:
> In FSL sata v2 block, the snoop bit of PRDT Word3 description
> information is at bit28 instead of bit22.
> This patch adds FSL sata v2 probe and resolve this difference.
> Signed-off-by: Xulei <B33228@freescale.com>
AFAIK, full name is required.
> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
[...]
> diff --git a/arch/powerpc/boot/dts/p1022ds.dts b/arch/powerpc/boot/dts/p1022ds.dts
> index 2bbecbb..9ad41dd 100644
> --- a/arch/powerpc/boot/dts/p1022ds.dts
> +++ b/arch/powerpc/boot/dts/p1022ds.dts
> @@ -475,14 +475,14 @@
> };
>
> sata@18000 {
> - compatible = "fsl,mpc8536-sata", "fsl,pq-sata";
> + compatible = "fsl,p1022-sata", "fsl,pq-sata-v2";
> reg =<0x18000 0x1000>;
> cell-index =<1>;
> interrupts =<74 0x2>;
> };
>
> sata@19000 {
> - compatible = "fsl,mpc8536-sata", "fsl,pq-sata";
> + compatible = "fsl,p1022-sata", "fsl,pq-sata-v2";
> reg =<0x19000 0x1000>;
> cell-index =<2>;
> interrupts =<41 0x2>;
Please put this into the separate patch and push thru the PPC tree.
> diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
> index b0214d0..a56399a 100644
> --- a/drivers/ata/sata_fsl.c
> +++ b/drivers/ata/sata_fsl.c
[...]
> @@ -417,7 +420,8 @@ static void sata_fsl_qc_prep(struct ata_queued_cmd *qc)
>
> if (qc->flags& ATA_QCFLAG_DMAMAP)
> num_prde = sata_fsl_fill_sg(qc, (void *)cd,
> - &ttl_dwords, cd_paddr);
> + &ttl_dwords, cd_paddr,
> + host_priv->data_snoop);
Please align these lines uniformly.
WBR, Sergei
^ permalink raw reply
* Re: [PATCH] sched: provide scheduler_ipi() callback in response to smp_send_reschedule()
From: Russell King - ARM Linux @ 2011-01-17 11:26 UTC (permalink / raw)
To: Peter Zijlstra
Cc: linux-m32r-ja, linux-mips, linux-ia64, linux-sh, H. Peter Anvin,
Heiko Carstens, Paul Mackerras, Helge Deller, sparclinux,
Linux-Arch, linux-s390, Jesper Nilsson, Jeremy Fitzhardinge,
Hirokazu Takata, x86, James E.J. Bottomley, virtualization,
Ingo Molnar, Matt Turner, Fenghua Yu, Mike Frysinger,
user-mode-linux-devel, Konrad Rzeszutek Wilk, Jeff Dike,
Chris Metcalf, xen-devel, Mikael Starvik, linux-m32r,
Ivan Kokshaysky, user-mode-linux-user, uclinux-dist-devel,
Thomas Gleixner, linux-arm-kernel, Richard Henderson, Tony Luck,
linux-parisc, linux-cris-kernel, linux-am33-list, linux-kernel,
Ralf Baechle, Kyle McMartin, Paul Mundt, linux-alpha,
Martin Schwidefsky, linux390, Koichi Yasutake, linuxppc-dev,
David S. Miller
In-Reply-To: <1295262433.30950.53.camel@laptop>
On Mon, Jan 17, 2011 at 12:07:13PM +0100, Peter Zijlstra wrote:
> diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
> index 42aa078..c4a570b 100644
> --- a/arch/alpha/kernel/smp.c
> +++ b/arch/alpha/kernel/smp.c
> @@ -587,6 +587,7 @@ handle_ipi(struct pt_regs *regs)
> case IPI_RESCHEDULE:
> /* Reschedule callback. Everything to be done
> is done by the interrupt return path. */
> + scheduler_ipi();
> break;
>
> case IPI_CALL_FUNC:
> diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
> index 9066473..ffde790 100644
> --- a/arch/arm/kernel/smp.c
> +++ b/arch/arm/kernel/smp.c
> @@ -579,6 +579,7 @@ asmlinkage void __exception do_IPI(struct pt_regs *regs)
> * nothing more to do - eveything is
> * done on the interrupt return path
> */
> + scheduler_ipi();
Maybe remove the comment "everything is done on the interrupt return path"
as with this function call, that is no longer the case.
Looks like the same is true for Alpha as well?
^ permalink raw reply
* RE: [PATCH] ATA: Add FSL sata v2 controller support
From: Aggrwal Poonam-B10812 @ 2011-01-17 11:58 UTC (permalink / raw)
To: Sergei Shtylyov, Xu Lei-B33228
Cc: linuxppc-dev@lists.ozlabs.org, Gala Kumar-B11780,
jgarzik@pobox.com, linux-ide@vger.kernel.org
In-Reply-To: <4D342C6E.6000608@ru.mvista.com>
> -----Original Message-----
> From: linuxppc-dev-bounces+poonam.aggrwal=3Dfreescale.com@lists.ozlabs.or=
g
> [mailto:linuxppc-dev-
> bounces+poonam.aggrwal=3Dfreescale.com@lists.ozlabs.org] On Behalf Of
> Sergei Shtylyov
> Sent: Monday, January 17, 2011 5:18 PM
> To: Xu Lei-B33228
> Cc: jgarzik@pobox.com; Gala Kumar-B11780; linuxppc-dev@lists.ozlabs.org;
> linux-ide@vger.kernel.org
> Subject: Re: [PATCH] ATA: Add FSL sata v2 controller support
>=20
> Hello.
>=20
> On 17-01-2011 10:10, Xulei wrote:
>=20
> > In FSL sata v2 block, the snoop bit of PRDT Word3 description
> > information is at bit28 instead of bit22.
>=20
> > This patch adds FSL sata v2 probe and resolve this difference.
>=20
> > Signed-off-by: Xulei <B33228@freescale.com>
>=20
> AFAIK, full name is required.
>=20
> > Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
> [...]
>=20
> > diff --git a/arch/powerpc/boot/dts/p1022ds.dts
> > b/arch/powerpc/boot/dts/p1022ds.dts
> > index 2bbecbb..9ad41dd 100644
> > --- a/arch/powerpc/boot/dts/p1022ds.dts
> > +++ b/arch/powerpc/boot/dts/p1022ds.dts
> > @@ -475,14 +475,14 @@
> > };
> >
> > sata@18000 {
> > - compatible =3D "fsl,mpc8536-sata", "fsl,pq-sata";
> > + compatible =3D "fsl,p1022-sata", "fsl,pq-sata-v2";
Can we fix this compatibity at run time by u-boot?
> > reg =3D<0x18000 0x1000>;
> > cell-index =3D<1>;
> > interrupts =3D<74 0x2>;
> > };
> >
> > sata@19000 {
> > - compatible =3D "fsl,mpc8536-sata", "fsl,pq-sata";
> > + compatible =3D "fsl,p1022-sata", "fsl,pq-sata-v2";
> > reg =3D<0x19000 0x1000>;
> > cell-index =3D<2>;
> > interrupts =3D<41 0x2>;
>=20
> Please put this into the separate patch and push thru the PPC tree.
>=20
> > diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index
> > b0214d0..a56399a 100644
> > --- a/drivers/ata/sata_fsl.c
> > +++ b/drivers/ata/sata_fsl.c
> [...]
> > @@ -417,7 +420,8 @@ static void sata_fsl_qc_prep(struct ata_queued_cmd
> > *qc)
> >
> > if (qc->flags& ATA_QCFLAG_DMAMAP)
> > num_prde =3D sata_fsl_fill_sg(qc, (void *)cd,
> > - &ttl_dwords, cd_paddr);
> > + &ttl_dwords, cd_paddr,
> > + host_priv->data_snoop);
>=20
> Please align these lines uniformly.
>=20
> WBR, Sergei
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply
* Re: [PATCH] sched: provide scheduler_ipi() callback in response to smp_send_reschedule()
From: Russell King - ARM Linux @ 2011-01-17 11:57 UTC (permalink / raw)
To: Peter Zijlstra
Cc: linux-mips, linux-ia64, linux-sh, H. Peter Anvin, Heiko Carstens,
Paul Mackerras, Helge Deller, sparclinux, Linux-Arch, linux-s390,
Jesper Nilsson, Jeremy Fitzhardinge, Hirokazu Takata, x86,
James E.J. Bottomley, virtualization, Ingo Molnar, Matt Turner,
Fenghua Yu, Mike Frysinger, user-mode-linux-devel,
Konrad Rzeszutek Wilk, Jeff Dike, Chris Metcalf, Mikael Starvik,
xen-devel, Ivan Kokshaysky, user-mode-linux-user,
uclinux-dist-devel, Thomas Gleixner, Richard Henderson, Tony Luck,
linux-parisc, linux-cris-kernel, linux-kernel, Ralf Baechle,
Kyle McMartin, Paul Mundt, linux-alpha, Martin Schwidefsky,
linux390, Koichi Yasutake, linuxppc-dev, David S. Miller
In-Reply-To: <1295264509.30950.59.camel@laptop>
On Mon, Jan 17, 2011 at 12:41:49PM +0100, Peter Zijlstra wrote:
> ===================================================================
> --- linux-2.6.orig/arch/arm/kernel/smp.c
> +++ linux-2.6/arch/arm/kernel/smp.c
> @@ -575,10 +575,7 @@ asmlinkage void __exception do_IPI(struc
> break;
>
> case IPI_RESCHEDULE:
> - /*
> - * nothing more to do - eveything is
> - * done on the interrupt return path
> - */
> + scheduler_ipi();
> break;
>
> case IPI_CALL_FUNC:
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
^ permalink raw reply
* Re: [PATCH] sched: provide scheduler_ipi() callback in response to smp_send_reschedule()
From: Martin Schwidefsky @ 2011-01-17 12:18 UTC (permalink / raw)
To: Peter Zijlstra
Cc: linux-m32r-ja, linux-mips, linux-ia64, linux-sh, H. Peter Anvin,
Heiko Carstens, Paul Mackerras, Helge Deller, sparclinux,
Linux-Arch, linux-s390, Jesper Nilsson, Jeremy Fitzhardinge,
Russell King, Hirokazu Takata, x86, James E.J. Bottomley,
virtualization, Ingo Molnar, Matt Turner, Fenghua Yu,
Mike Frysinger, user-mode-linux-devel, Konrad Rzeszutek Wilk,
Jeff Dike, Chris Metcalf, xen-devel, Mikael Starvik, linux-m32r,
Ivan Kokshaysky, user-mode-linux-user, uclinux-dist-devel,
Thomas Gleixner, linux-arm-kernel, Richard Henderson, Tony Luck,
linux-parisc, linux-cris-kernel, linux-am33-list, linux-kernel,
Ralf Baechle, Kyle McMartin, Paul Mundt, linux-alpha, linux390,
Koichi Yasutake, linuxppc-dev, David S. Miller
In-Reply-To: <1295262433.30950.53.camel@laptop>
On Mon, 17 Jan 2011 12:07:13 +0100
Peter Zijlstra <peterz@infradead.org> wrote:
> I visited existing smp_send_reschedule() implementations and tried to
> add a call to scheduler_ipi() in their handler part, but esp. for MIPS
> I'm not quite sure I actually got all of them.
>
> diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
> index 94cf510..61789e8 100644
> --- a/arch/s390/kernel/smp.c
> +++ b/arch/s390/kernel/smp.c
> @@ -163,12 +163,12 @@ static void do_ext_call_interrupt(unsigned int ext_int_code,
>
> /*
> * handle bit signal external calls
> - *
> - * For the ec_schedule signal we have to do nothing. All the work
> - * is done automatically when we return from the interrupt.
> */
> bits = xchg(&S390_lowcore.ext_call_fast, 0);
>
> + if (test_bit(ec_schedule, &bits))
> + scheduler_ipi();
> +
> if (test_bit(ec_call_function, &bits))
> generic_smp_call_function_interrupt();
>
s390 bits are fine.
--
blue skies,
Martin.
"Reality continues to ruin my life." - Calvin.
^ permalink raw reply
* Re: [PATCH] sched: provide scheduler_ipi() callback in response to smp_send_reschedule()
From: Chris Metcalf @ 2011-01-17 13:52 UTC (permalink / raw)
To: Peter Zijlstra
Cc: linux-mips, linux-ia64, linux-sh, Heiko Carstens, Paul Mackerras,
H. Peter Anvin, sparclinux, Linux-Arch, linux-s390,
Jesper Nilsson, Jeremy Fitzhardinge, Russell King - ARM Linux,
Hirokazu Takata, x86, James E.J. Bottomley, virtualization,
Ingo Molnar, Matt Turner, Fenghua Yu, Mike Frysinger,
user-mode-linux-devel, Konrad Rzeszutek Wilk, Jeff Dike,
Mikael Starvik, xen-devel, Ivan Kokshaysky, user-mode-linux-user,
uclinux-dist-devel, Thomas Gleixner, Richard Henderson, Tony Luck,
linux-parisc, linux-cris-kernel, linux-kernel, Ralf Baechle,
David S. Miller, Kyle McMartin, Paul Mundt, linux-alpha,
Martin Schwidefsky, linux390, Koichi Yasutake, linuxppc-dev,
Helge Deller
In-Reply-To: <1295264509.30950.59.camel@laptop>
On 1/17/2011 6:41 AM, Peter Zijlstra wrote:
> Index: linux-2.6/arch/tile/kernel/smp.c
> ===================================================================
> --- linux-2.6.orig/arch/tile/kernel/smp.c
> +++ linux-2.6/arch/tile/kernel/smp.c
> @@ -184,12 +184,8 @@ void flush_icache_range(unsigned long st
> /* Called when smp_send_reschedule() triggers IRQ_RESCHEDULE. */
> static irqreturn_t handle_reschedule_ipi(int irq, void *token)
> {
> - /*
> - * Nothing to do here; when we return from interrupt, the
> - * rescheduling will occur there. But do bump the interrupt
> - * profiler count in the meantime.
> - */
> __get_cpu_var(irq_stat).irq_resched_count++;
> + scheduler_ipi();
>
> return IRQ_HANDLED;
> }
Acked-by: Chris Metcalf <cmetcalf@tilera.com>
--
Chris Metcalf, Tilera Corp.
http://www.tilera.com
^ permalink raw reply
* Re: [PATCH] sched: provide scheduler_ipi() callback in response to smp_send_reschedule()
From: Jesper Nilsson @ 2011-01-17 13:58 UTC (permalink / raw)
To: Peter Zijlstra
Cc: linux-mips@linux-mips.org, linux-ia64@vger.kernel.org,
linux-sh@vger.kernel.org, H. Peter Anvin, Heiko Carstens,
Paul Mackerras, Helge Deller, sparclinux@vger.kernel.org,
Linux-Arch, linux-s390@vger.kernel.org, Jeremy Fitzhardinge,
Russell King - ARM Linux, Hirokazu Takata, x86@kernel.org,
James E.J. Bottomley, virtualization@lists.osdl.org, Ingo Molnar,
Matt Turner, Fenghua Yu, Mike Frysinger,
user-mode-linux-devel@lists.sourceforge.net,
Konrad Rzeszutek Wilk, Jeff Dike, Chris Metcalf, Mikael Starvik,
xen-devel@lists.xensource.com, Ivan Kokshaysky,
user-mode-linux-user@lists.sourceforge.net,
uclinux-dist-devel@blackfin.uclinux.org, Thomas Gleixner,
Richard Henderson, Tony Luck, linux-parisc@vger.kernel.org,
linux-cris-kernel, linux-kernel@vger.kernel.org, Ralf Baechle,
Kyle McMartin, Paul Mundt, linux-alpha@vger.kernel.org,
Martin Schwidefsky, linux390@de.ibm.com, Koichi Yasutake,
linuxppc-dev@lists.ozlabs.org, David S. Miller
In-Reply-To: <1295264509.30950.59.camel@laptop>
On Mon, Jan 17, 2011 at 12:41:49PM +0100, Peter Zijlstra wrote:
> Index: linux-2.6/arch/cris/arch-v32/kernel/smp.c
> ===================================================================
> --- linux-2.6.orig/arch/cris/arch-v32/kernel/smp.c
> +++ linux-2.6/arch/cris/arch-v32/kernel/smp.c
> @@ -340,15 +340,18 @@ irqreturn_t crisv32_ipi_interrupt(int ir
>
> ipi = REG_RD(intr_vect, irq_regs[smp_processor_id()], rw_ipi);
>
> + if (ipi.vector & IPI_SCHEDULE) {
> + scheduler_ipi();
> + }
> if (ipi.vector & IPI_CALL) {
> - func(info);
> + func(info);
> }
> if (ipi.vector & IPI_FLUSH_TLB) {
> - if (flush_mm == FLUSH_ALL)
> - __flush_tlb_all();
> - else if (flush_vma == FLUSH_ALL)
> + if (flush_mm == FLUSH_ALL)
> + __flush_tlb_all();
> + else if (flush_vma == FLUSH_ALL)
> __flush_tlb_mm(flush_mm);
> - else
> + else
> __flush_tlb_page(flush_vma, flush_addr);
> }
>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
/^JN - Jesper Nilsson
--
Jesper Nilsson -- jesper.nilsson@axis.com
^ permalink raw reply
* Re: [PATCH] ATA: Add FSL sata v2 controller support
From: Kumar Gala @ 2011-01-17 14:57 UTC (permalink / raw)
To: Aggrwal Poonam-B10812
Cc: Xu Lei-B33228, Sergei Shtylyov, linuxppc-dev@lists.ozlabs.org,
linux-ide@vger.kernel.org, Gala Kumar-B11780, jgarzik@pobox.com
In-Reply-To: <45903308677306428B6EE7E6FF5A520408654D@039-SN1MPN1-004.039d.mgd.msft.net>
On Jan 17, 2011, at 5:58 AM, Aggrwal Poonam-B10812 wrote:
>
>
>> -----Original Message-----
>> From: linuxppc-dev-bounces+poonam.aggrwal=freescale.com@lists.ozlabs.org
>> [mailto:linuxppc-dev-
>> bounces+poonam.aggrwal=freescale.com@lists.ozlabs.org] On Behalf Of
>> Sergei Shtylyov
>> Sent: Monday, January 17, 2011 5:18 PM
>> To: Xu Lei-B33228
>> Cc: jgarzik@pobox.com; Gala Kumar-B11780; linuxppc-dev@lists.ozlabs.org;
>> linux-ide@vger.kernel.org
>> Subject: Re: [PATCH] ATA: Add FSL sata v2 controller support
>>
>> Hello.
>>
>> On 17-01-2011 10:10, Xulei wrote:
>>
>>> In FSL sata v2 block, the snoop bit of PRDT Word3 description
>>> information is at bit28 instead of bit22.
>>
>>> This patch adds FSL sata v2 probe and resolve this difference.
>>
>>> Signed-off-by: Xulei <B33228@freescale.com>
>>
>> AFAIK, full name is required.
>>
>>> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
>> [...]
>>
>>> diff --git a/arch/powerpc/boot/dts/p1022ds.dts
>>> b/arch/powerpc/boot/dts/p1022ds.dts
>>> index 2bbecbb..9ad41dd 100644
>>> --- a/arch/powerpc/boot/dts/p1022ds.dts
>>> +++ b/arch/powerpc/boot/dts/p1022ds.dts
>>> @@ -475,14 +475,14 @@
>>> };
>>>
>>> sata@18000 {
>>> - compatible = "fsl,mpc8536-sata", "fsl,pq-sata";
>>> + compatible = "fsl,p1022-sata", "fsl,pq-sata-v2";
>
> Can we fix this compatibity at run time by u-boot?
We can, but its not reason not to update the .dts as well.
- k
^ permalink raw reply
* Re: [PATCH 5/7] powerpc: add the mpic timer support
From: Jean-Michel Hautbois @ 2011-01-17 16:24 UTC (permalink / raw)
To: Li Yang; +Cc: linuxppc-dev
In-Reply-To: <1291379651-8822-5-git-send-email-leoli@freescale.com>
Hi,
I am interested by this implementation.
> +static ssize_t mpic_tm_timeout_store(struct device *dev,
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 struct device_attribute *attr,
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 const char *buf, size_t count)
> +{
<snip>
> +
> + =C2=A0 =C2=A0 =C2=A0 spin_lock_irq(&priv->lock);
> +
> + =C2=A0 =C2=A0 =C2=A0 /* stop timer 0 */
> + =C2=A0 =C2=A0 =C2=A0 temp =3D in_be32(&priv->regs->gtbcr);
> + =C2=A0 =C2=A0 =C2=A0 temp |=3D MPIC_TIMER_STOP; /* counting inhibited *=
/
> + =C2=A0 =C2=A0 =C2=A0 out_be32(&priv->regs->gtbcr, temp);
> +
> + =C2=A0 =C2=A0 =C2=A0 if (interval !=3D 0) {
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* start timer */
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 out_be32(&priv->regs->=
gtbcr, interval | MPIC_TIMER_STOP);
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 out_be32(&priv->regs->=
gtbcr, interval);
> + =C2=A0 =C2=A0 =C2=A0 }
> +
> + =C2=A0 =C2=A0 =C2=A0 spin_unlock_irq(&priv->lock);
> + =C2=A0 =C2=A0 =C2=A0 return count;
> +}
What is the delay when doing that stop/start thing ?
Is this delay variable and/or big or not ?
I would imagine a timer which would see its interval regularly
corrected, and I would like to know if this is really really fast
(say, less than some ticks) or not.
Thanks in advance for any answer !
Regards,
JM
^ permalink raw reply
* [PATCH v2] ppc: update dynamic dma support
From: Nishanth Aravamudan @ 2011-01-17 17:32 UTC (permalink / raw)
To: sonnyrao, miltonm, Benjamin Herrenschmidt, Paul Mackerras,
Grant Likely, Anton Blanchard, linuxppc-dev
In-Reply-To: <20110108025334.GA13468@us.ibm.com>
On 07.01.2011 [18:53:34 -0800], Nishanth Aravamudan wrote:
> On 10.12.2010 [16:07:44 -0800], Nishanth Aravamudan wrote:
> > On 09.12.2010 [11:09:20 -0800], Nishanth Aravamudan wrote:
> > > On 26.10.2010 [20:35:17 -0700], Nishanth Aravamudan wrote:
> > > > If firmware allows us to map all of a partition's memory for DMA on a
> > > > particular bridge, create a 1:1 mapping of that memory. Add hooks for
> > > > dealing with hotplug events. Dyanmic DMA windows can use larger than the
> > > > default page size, and we use the largest one possible.
> > > >
> > > > Not-yet-signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
> > > >
> > > > ---
> > > >
> > > > I've tested this briefly on a machine with suitable firmware/hardware.
> > > > Things seem to work well, but I want to do more exhaustive I/O testing
> > > > before asking for upstream merging. I would really appreciate any
> > > > feedback on the updated approach.
> > > >
> > > > Specific questions:
> > > >
> > > > Ben, did I hook into the dma_set_mask() platform callback as you
> > > > expected? Anything I can do better or which perhaps might lead to
> > > > gotchas later?
> > > >
> > > > I've added a disable_ddw option, but perhaps it would be better to
> > > > just disable the feature if iommu=force?
> > >
> > > So for the final version, I probably should document this option in
> > > kernel-parameters.txt w/ the patch, right?
> >
> > Here's an updated version. Ben, think you can pick this up to your tree?
>
> Hi Ben,
>
> I have a small follow-on patch that tidies up the code a bit and deals
> with an error condition on dlpar remove of ddw slots. I'm putting it
> below as a follow-on patch, but I can roll it into the v3 patch and post
> a v4 if you'd prefer?
Sorry, found a few more cleanups (spaces instead of tabs, etc.).
pseries: ddw cleanups
Use symbolic constants to access RTAS responses.
Disable reconfig notifier's clearing of TCEs and removal of DMA window.
This is handled by firmware currently. If the kernel were to do it, we'd
need a new callback action before the isolation of the slot in question,
or else we'd always get permission errors (firmware revokes the window
automatically).
Fix-up a few whitespace issues.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
diff --git a/arch/powerpc/include/asm/ppc-pci.h b/arch/powerpc/include/asm/ppc-pci.h
index 43268f1..ab37004 100644
--- a/arch/powerpc/include/asm/ppc-pci.h
+++ b/arch/powerpc/include/asm/ppc-pci.h
@@ -47,6 +47,20 @@ extern int rtas_setup_phb(struct pci_controller *phb);
extern unsigned long pci_probe_only;
+/* Dynamic DMA Window support */
+struct ddw_query_response {
+ u32 windows_available;
+ u32 largest_available_block;
+ u32 page_size;
+ u32 migration_capable;
+};
+
+struct ddw_create_response {
+ u32 liobn;
+ u32 addr_hi;
+ u32 addr_lo;
+};
+
/* ---- EEH internal-use-only related routines ---- */
#ifdef CONFIG_EEH
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index 4ba2338..28cf227 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -323,7 +323,7 @@ static int tce_clearrange_multi_pSeriesLP(unsigned long start_pfn,
dma_offset = next + be64_to_cpu(maprange->dma_base);
rc = plpar_tce_stuff((u64)be32_to_cpu(maprange->liobn),
- (u64)dma_offset,
+ dma_offset,
0, limit);
num_tce -= limit;
} while (num_tce > 0 && !rc);
@@ -383,7 +383,7 @@ static int tce_setrange_multi_pSeriesLP(unsigned long start_pfn,
}
rc = plpar_tce_put_indirect(liobn,
- (u64)dma_offset,
+ dma_offset,
(u64)virt_to_abs(tcep),
limit);
@@ -731,7 +731,8 @@ static u64 dupe_ddw_if_kexec(struct pci_dev *dev, struct device_node *pdn)
return dma_addr;
}
-static int query_ddw(struct pci_dev *dev, const u32 *ddr_avail, u32 *query)
+static int query_ddw(struct pci_dev *dev, const u32 *ddr_avail,
+ struct ddw_query_response *query)
{
struct device_node *dn;
struct pci_dn *pcidn;
@@ -751,7 +752,7 @@ static int query_ddw(struct pci_dev *dev, const u32 *ddr_avail, u32 *query)
if (pcidn->eeh_pe_config_addr)
cfg_addr = pcidn->eeh_pe_config_addr;
buid = pcidn->phb->buid;
- ret = rtas_call(ddr_avail[0], 3, 5, query,
+ ret = rtas_call(ddr_avail[0], 3, 5, (u32 *)query,
cfg_addr, BUID_HI(buid), BUID_LO(buid));
dev_info(&dev->dev, "ibm,query-pe-dma-windows(%x) %x %x %x"
" returned %d\n", ddr_avail[0], cfg_addr, BUID_HI(buid),
@@ -759,7 +760,9 @@ static int query_ddw(struct pci_dev *dev, const u32 *ddr_avail, u32 *query)
return ret;
}
-static int create_ddw(struct pci_dev *dev, const u32 *ddr_avail, u32 *create, int page_shift, int window_shift)
+static int create_ddw(struct pci_dev *dev, const u32 *ddr_avail,
+ struct ddw_create_response *create, int page_shift,
+ int window_shift)
{
struct device_node *dn;
struct pci_dn *pcidn;
@@ -782,15 +785,15 @@ static int create_ddw(struct pci_dev *dev, const u32 *ddr_avail, u32 *create, in
do {
/* extra outputs are LIOBN and dma-addr (hi, lo) */
- ret = rtas_call(ddr_avail[1], 5, 4, &create[0], cfg_addr,
+ ret = rtas_call(ddr_avail[1], 5, 4, (u32 *)create, cfg_addr,
BUID_HI(buid), BUID_LO(buid), page_shift, window_shift);
- } while(rtas_busy_delay(ret));
+ } while (rtas_busy_delay(ret));
dev_info(&dev->dev,
"ibm,create-pe-dma-window(%x) %x %x %x %x %x returned %d "
"(liobn = 0x%x starting addr = %x %x)\n", ddr_avail[1],
cfg_addr, BUID_HI(buid), BUID_LO(buid), page_shift,
- window_shift, ret, create[0], create[1], create[2]);
-
+ window_shift, ret, create->liobn, create->addr_hi, create->addr_lo);
+
return ret;
}
@@ -808,7 +811,8 @@ static int create_ddw(struct pci_dev *dev, const u32 *ddr_avail, u32 *create, in
static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)
{
int len, ret;
- u32 query[4], create[3];
+ struct ddw_query_response query;
+ struct ddw_create_response create;
int page_shift;
u64 dma_addr, max_addr;
struct device_node *dn;
@@ -846,11 +850,11 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)
* of page sizes: supported and supported for migrate-dma.
*/
dn = pci_device_to_OF_node(dev);
- ret = query_ddw(dev, ddr_avail, &query[0]);
+ ret = query_ddw(dev, ddr_avail, &query);
if (ret != 0)
goto out_unlock;
- if (!query[0]) {
+ if (query.windows_available == 0) {
/*
* no additional windows are available for this device.
* We might be able to reallocate the existing window,
@@ -859,23 +863,23 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)
dev_dbg(&dev->dev, "no free dynamic windows");
goto out_unlock;
}
- if (query[2] & 4) {
+ if (query.page_size & 4) {
page_shift = 24; /* 16MB */
- } else if (query[2] & 2) {
+ } else if (query.page_size & 2) {
page_shift = 16; /* 64kB */
- } else if (query[2] & 1) {
+ } else if (query.page_size & 1) {
page_shift = 12; /* 4kB */
} else {
dev_dbg(&dev->dev, "no supported direct page size in mask %x",
- query[2]);
+ query.page_size);
goto out_unlock;
}
/* verify the window * number of ptes will map the partition */
/* check largest block * page size > max memory hotplug addr */
max_addr = memory_hotplug_max();
- if (query[1] < (max_addr >> page_shift)) {
+ if (query.largest_available_block < (max_addr >> page_shift)) {
dev_dbg(&dev->dev, "can't map partiton max 0x%llx with %u "
- "%llu-sized pages\n", max_addr, query[1],
+ "%llu-sized pages\n", max_addr, query.largest_available_block,
1ULL << page_shift);
goto out_unlock;
}
@@ -894,19 +898,17 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)
goto out_free_prop;
}
- ret = create_ddw(dev, ddr_avail, &create[0], page_shift, len);
+ ret = create_ddw(dev, ddr_avail, &create, page_shift, len);
if (ret != 0)
goto out_free_prop;
- *ddwprop = (struct dynamic_dma_window_prop) {
- .liobn = cpu_to_be32(create[0]),
- .dma_base = cpu_to_be64(((u64)create[1] << 32) + (u64)create[2]),
- .tce_shift = cpu_to_be32(page_shift),
- .window_shift = cpu_to_be32(len)
- };
+ ddwprop->liobn = cpu_to_be32(create.liobn);
+ ddwprop->dma_base = cpu_to_be64(of_read_number(&create.addr_hi, 2));
+ ddwprop->tce_shift = cpu_to_be32(page_shift);
+ ddwprop->window_shift = cpu_to_be32(len);
dev_dbg(&dev->dev, "created tce table LIOBN 0x%x for %s\n",
- create[0], dn->full_name);
+ create.liobn, dn->full_name);
window = kzalloc(sizeof(*window), GFP_KERNEL);
if (!window)
@@ -933,7 +935,7 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)
list_add(&window->list, &direct_window_list);
spin_unlock(&direct_window_list_lock);
- dma_addr = of_read_number(&create[1], 2);
+ dma_addr = of_read_number(&create.addr_hi, 2);
set_dma_offset(&dev->dev, dma_addr);
goto out_unlock;
@@ -1015,7 +1017,7 @@ static int dma_set_mask_pSeriesLP(struct device *dev, u64 dma_mask)
dn = pci_device_to_OF_node(pdev);
dev_dbg(dev, "node is %s\n", dn->full_name);
- /*
+ /*
* the device tree might contain the dma-window properties
* per-device and not neccesarily for the bus. So we need to
* search upwards in the tree until we either hit a dma-window
@@ -1118,7 +1120,15 @@ static int iommu_reconfig_notifier(struct notifier_block *nb, unsigned long acti
}
spin_unlock(&direct_window_list_lock);
- remove_ddw(np);
+ /*
+ * Because the notifier runs after isolation of the
+ * slot, we are guaranteed any DMA window has already
+ * been revoked and the TCEs have been marked invalid,
+ * so we don't need a call to remove_ddw(np). However,
+ * if an additional notifier action is added before the
+ * isolate call, we should update this code for
+ * completeness with such a call.
+ */
break;
default:
err = NOTIFY_DONE;
--
Nishanth Aravamudan <nacc@us.ibm.com>
IBM Linux Technology Center
^ permalink raw reply related
* Re: [PATCH] powerpc: perf: Fix frequency calculation for overflowing counters
From: Scott Wood @ 2011-01-17 17:32 UTC (permalink / raw)
To: Anton Blanchard
Cc: Peter Zijlstra, linux-kernel, Paul Mackerras,
Arnaldo Carvalho de Melo, Ingo Molnar, linuxppc-dev
In-Reply-To: <20110117161742.5feb3761@kryten>
On Mon, 17 Jan 2011 16:17:42 +1100
Anton Blanchard <anton@samba.org> wrote:
>
> When profiling a benchmark that is almost 100% userspace, I noticed some
> wildly inaccurate profiles that showed almost all time spent in the kernel.
> Closer examination shows we were programming a tiny number of cycles into
> the PMU after each overflow (about ~200 away from the next overflow). This
> gets us stuck in a loop which we eventually break out of by throttling the
> PMU (there are regular throttle/unthrottle events in the log).
>
> It looks like we aren't setting event->hw.last_period to something same
> and the frequency to period calculations in perf are going haywire. With
> the following patch we find the correct period after a few interrupts and
> stay there. I also see no more throttle events.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
>
> diff --git a/arch/powerpc/kernel/perf_event.c b/arch/powerpc/kernel/perf_event.c
> index 5674807..ab6f6be 100644
> --- a/arch/powerpc/kernel/perf_event.c
> +++ b/arch/powerpc/kernel/perf_event.c
> @@ -1212,6 +1212,7 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
> if (left <= 0)
> left = period;
> record = 1;
> + event->hw.last_period = event->hw.sample_period;
> }
> if (left < 0x80000000LL)
> val = 0x80000000LL - left;
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>
Does perf_event_fsl_emb.c need this as well (it has almost the same
record_and_restart code)?
-Scott
^ permalink raw reply
* Re: [PATCH] powerpc: perf: Fix frequency calculation for overflowing counters
From: Peter Zijlstra @ 2011-01-17 17:38 UTC (permalink / raw)
To: Scott Wood
Cc: linux-kernel, Paul Mackerras, Anton Blanchard,
Arnaldo Carvalho de Melo, Ingo Molnar, linuxppc-dev
In-Reply-To: <20110117113250.48098aaa@udp111988uds.am.freescale.net>
On Mon, 2011-01-17 at 11:32 -0600, Scott Wood wrote:
> > diff --git a/arch/powerpc/kernel/perf_event.c b/arch/powerpc/kernel/per=
f_event.c
> > index 5674807..ab6f6be 100644
> > --- a/arch/powerpc/kernel/perf_event.c
> > +++ b/arch/powerpc/kernel/perf_event.c
> > @@ -1212,6 +1212,7 @@ static void record_and_restart(struct perf_event =
*event, unsigned long val,
> > if (left <=3D 0)
> > left =3D period;
> > record =3D 1;
> > + event->hw.last_period =3D event->hw.sample_period=
;
> > }
> > if (left < 0x80000000LL)
> > val =3D 0x80000000LL - left;
> Does perf_event_fsl_emb.c need this as well (it has almost the same
> record_and_restart code)?=20
I would think so.
^ permalink raw reply
* Re: [PATCH] sched: provide scheduler_ipi() callback in response to smp_send_reschedule()
From: David Daney @ 2011-01-17 19:18 UTC (permalink / raw)
To: Peter Zijlstra
Cc: linux-m32r-ja, linux-mips, linux-ia64, linux-sh, Heiko Carstens,
Paul Mackerras, H. Peter Anvin, sparclinux, Linux-Arch,
linux-s390, Jesper Nilsson, Jeremy Fitzhardinge, Russell King,
Hirokazu Takata, x86, James E.J. Bottomley, virtualization,
Ingo Molnar, Matt Turner, Fenghua Yu, Mike Frysinger,
user-mode-linux-devel, Konrad Rzeszutek Wilk, Jeff Dike,
Chris Metcalf, xen-devel, Mikael Starvik, linux-m32r,
Ivan Kokshaysky, user-mode-linux-user, uclinux-dist-devel,
Thomas Gleixner, linux-arm-kernel, Richard Henderson, Tony Luck,
linux-parisc, linux-cris-kernel, linux-am33-list, linux-kernel,
Ralf Baechle, David S. Miller, Kyle McMartin, Paul Mundt,
linux-alpha, Martin Schwidefsky, linux390, Koichi Yasutake,
linuxppc-dev, Helge Deller
In-Reply-To: <1295262433.30950.53.camel@laptop>
On 01/17/2011 03:07 AM, Peter Zijlstra wrote:
> For future rework of try_to_wake_up() we'd like to push part of that
> onto the CPU the task is actually going to run on, in order to do so we
> need a generic callback from the existing scheduler IPI.
>
> This patch introduces such a generic callback: scheduler_ipi() and
> implements it as a NOP.
>
> I visited existing smp_send_reschedule() implementations and tried to
> add a call to scheduler_ipi() in their handler part, but esp. for MIPS
> I'm not quite sure I actually got all of them.
>
> Also, while reading through all this, I noticed the blackfin SMP code
> looks to be broken, it simply discards any IPI when low on memory.
>
> Signed-off-by: Peter Zijlstra<a.p.zijlstra@chello.nl>
> ---
> arch/alpha/kernel/smp.c | 1 +
> arch/arm/kernel/smp.c | 1 +
> arch/blackfin/mach-common/smp.c | 3 ++-
> arch/cris/arch-v32/kernel/smp.c | 13 ++++++++-----
> arch/ia64/kernel/irq_ia64.c | 2 ++
> arch/ia64/xen/irq_xen.c | 10 +++++++++-
> arch/m32r/kernel/smp.c | 2 +-
> arch/mips/kernel/smtc.c | 1 +
> arch/mips/sibyte/bcm1480/smp.c | 7 +++----
> arch/mips/sibyte/sb1250/smp.c | 7 +++----
[...]
Peter,
You will also have to patch the mailbox_interrupt() function in
arch/mips/cavium-octeon/smp.c
David Daney.
^ permalink raw reply
* Re: [uclinux-dist-devel] [PATCH] sched: provide scheduler_ipi() callback in response to smp_send_reschedule()
From: Mike Frysinger @ 2011-01-17 19:49 UTC (permalink / raw)
To: Peter Zijlstra
Cc: linux-m32r-ja, linux-mips, linux-ia64, linux-sh, H. Peter Anvin,
Heiko Carstens, Paul Mackerras, Helge Deller, sparclinux,
Linux-Arch, linux-s390, Jesper Nilsson, Jeremy Fitzhardinge,
Russell King, Hirokazu Takata, x86, James E.J. Bottomley,
virtualization, Ingo Molnar, Matt Turner, Fenghua Yu,
user-mode-linux-devel, Konrad Rzeszutek Wilk, Jeff Dike,
Chris Metcalf, xen-devel, Mikael Starvik, linux-m32r,
Ivan Kokshaysky, user-mode-linux-user, uclinux-dist-devel,
Thomas Gleixner, linux-arm-kernel, Richard Henderson, Tony Luck,
linux-parisc, linux-cris-kernel, linux-am33-list, linux-kernel,
Ralf Baechle, Kyle McMartin, Paul Mundt, linux-alpha,
Martin Schwidefsky, linux390, Koichi Yasutake, linuxppc-dev,
David S. Miller
In-Reply-To: <1295262433.30950.53.camel@laptop>
On Mon, Jan 17, 2011 at 06:07, Peter Zijlstra wrote:
> Also, while reading through all this, I noticed the blackfin SMP code
> looks to be broken, it simply discards any IPI when low on memory.
not really. see changelog of commit 73a400646b8e26615f3ef1a0a4bc0cd0d5bd284c.
-mike
^ permalink raw reply
* Re: [uclinux-dist-devel] [PATCH] sched: provide scheduler_ipi() callback in response to smp_send_reschedule()
From: Peter Zijlstra @ 2011-01-17 20:16 UTC (permalink / raw)
To: Mike Frysinger
Cc: linux-m32r-ja, linux-mips, linux-ia64, linux-sh, H. Peter Anvin,
Heiko Carstens, Paul Mackerras, Helge Deller, sparclinux,
Linux-Arch, linux-s390, Jesper Nilsson, Jeremy Fitzhardinge,
Russell King, Hirokazu Takata, x86, James E.J. Bottomley,
virtualization, Ingo Molnar, Matt Turner, Fenghua Yu,
user-mode-linux-devel, Konrad Rzeszutek Wilk, Jeff Dike,
Chris Metcalf, xen-devel, Mikael Starvik, linux-m32r,
Ivan Kokshaysky, user-mode-linux-user, uclinux-dist-devel,
Thomas Gleixner, linux-arm-kernel, Richard Henderson, Tony Luck,
linux-parisc, linux-cris-kernel, linux-am33-list, linux-kernel,
Ralf Baechle, Kyle McMartin, Paul Mundt, linux-alpha,
Martin Schwidefsky, linux390, Koichi Yasutake, linuxppc-dev,
David S. Miller
In-Reply-To: <AANLkTik3hE=_34Lbs944MzKpkNzqY+kCxpxmncUM2HB7@mail.gmail.com>
On Mon, 2011-01-17 at 14:49 -0500, Mike Frysinger wrote:
> On Mon, Jan 17, 2011 at 06:07, Peter Zijlstra wrote:
> > Also, while reading through all this, I noticed the blackfin SMP code
> > looks to be broken, it simply discards any IPI when low on memory.
>=20
> not really. see changelog of commit 73a400646b8e26615f3ef1a0a4bc0cd0d5bd=
284c.
Ah, indeed, it appears my tree was simply out of date, very good!
^ 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