* Re: sym scsi driver problem with 2.6.26 or newer debian kernel on p610 (fwd)
From: Laszlo Fekete @ 2009-06-17 9:33 UTC (permalink / raw)
To: Guennadi Liakhovetski; +Cc: linuxppc-dev, debian-powerpc
In-Reply-To: <Pine.LNX.4.64.0906141105050.4412@axis700.grange>
Hello!
I'm sorry about the annoyances, but I'd welcome all ideas, suggestions
to see what needs to be done or should be tested for the solution.
Thank you very much!
Guennadi Liakhovetski wrote:
> Ok, first attempt to forward this to scsi was wrong, as pointed out by
> Matthew Wilcox this does indeed look like an interrupt problem - no
> interrupts drom SCSI, IDE, keyboar. Might be a known problem, I guess. In
> any case, I think, the OP would be grateful for any hints.
>
> Thanks
> Guennadi
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer
> http://www.open-technology.de/
>
> ---------- Forwarded message ----------
> Date: Sat, 13 Jun 2009 16:22:07 +0200
> From: Laszlo Fekete <blackluck@ktk.bme.hu>
> To: debian-powerpc@lists.debian.org
> Subject: sym scsi driver problem with 2.6.26 or newer debian kernel on p610
> Resent-Date: Sat, 13 Jun 2009 14:29:55 +0000 (UTC)
> Resent-From: debian-powerpc@lists.debian.org
>
> This is a multi-part message in MIME format.
> ------------------------------------------------------------------------
>
> Hello!
>
>
>
>
>
> Pls help me with sym scsi driver problem.
>
>
>
> I have Ibm P610 (and tested it on P630 and P640 too), installed debian
>
> etch and upgraded to lenny.
>
>
>
> But with 2.6.26 or newer kernel it's not booting, it's hang on sym scsi
>
> bus scan.
>
>
>
>
>
> Whats the problem with it, or how can I fix this?
>
>
>
>
>
> I attach the output from minicom with 2.6.29, 2.6.26, and the working
>
> 2.6.24 kernel booting.
>
>
>
>
>
> Thank you very much!
>
>
>
^ permalink raw reply
* Re: [PATCH] powerpc/mm: Fix potential access to freed pages when using hugetlbfs
From: Sachin Sant @ 2009-06-17 9:18 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <20090616025419.A5581DDD1B@ozlabs.org>
Benjamin Herrenschmidt wrote:
> When using 64k page sizes, our PTE pages are split in two halves,
> the second half containing the "extension" used to keep track of
> individual 4k pages when not using HW 64k pages.
>
> However, our page tables used for hugetlb have a slightly different
> format and don't carry that "second half".
>
> Our code that batched PTEs to be invalidated unconditionally reads
> the "second half" (to put it into the batch), which means that when
> called to invalidate hugetlb PTEs, it will access unrelated memory.
>
> It breaks when CONFIG_DEBUG_PAGEALLOC is enabled.
>
> This fixes it by only accessing the second half when the _PAGE_COMBO
> bit is set in the first half, which indicates that we are dealing with
> a "combo" page which represents 16x4k subpages. Anything else shouldn't
> have this bit set and thus not require loading from the second half.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Thanks for the patch. The machine survived after two days of
testing with hugetlbfs tests.
Regards
-Sachin
--
---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------
^ permalink raw reply
* [PATCH] powerpc: Add irqtrace support for 32-bit powerpc
From: Benjamin Herrenschmidt @ 2009-06-17 9:01 UTC (permalink / raw)
To: linuxppc-dev
Based on initial work from: Dale Farnsworth <dale@farnsworth.org>
Add the low level irq tracing hooks for 32-bit powerpc needed
to enable full lockdep functionality.
The approach taken to deal with the code in entry_32.S is that
we don't trace all the transitions of MSR:EE when we just turn
it off to peek at TI_FLAGS without races. Only when we are
calling into C code or returning from exceptions with a state
that have changed from what lockdep thinks.
There's a little bugger though: If we take an exception that
keeps interrupts enabled (such as an alignment exception) while
interrupts are enabled, we will call trace_hardirqs_on() on the
way back spurriously. Not a big deal, but to get rid of it would
require remembering in pt_regs that the exception was one of the
type that kept interrupts enabled which we don't know at this
stage. (Well, we could test all cases for regs->trap but that
sucks too much).
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
Not very well tested ... got issues with my u-boot on the 440
board and I didn't have much time to test elsewhere. FSL welcome
to test on funky configs. It's likely to still be subtely broken :-)
arch/powerpc/Kconfig | 1
arch/powerpc/include/asm/hw_irq.h | 20 +++---
arch/powerpc/kernel/entry_32.S | 126 ++++++++++++++++++++++++++++++++++++--
arch/powerpc/kernel/setup_32.c | 2
arch/powerpc/kernel/udbg.c | 1
5 files changed, 135 insertions(+), 15 deletions(-)
--- linux-work.orig/arch/powerpc/Kconfig 2009-06-17 16:45:15.000000000 +1000
+++ linux-work/arch/powerpc/Kconfig 2009-06-17 16:45:36.000000000 +1000
@@ -62,7 +62,6 @@ config HAVE_LATENCYTOP_SUPPORT
config TRACE_IRQFLAGS_SUPPORT
bool
- depends on PPC64
default y
config LOCKDEP_SUPPORT
Index: linux-work/arch/powerpc/kernel/entry_32.S
===================================================================
--- linux-work.orig/arch/powerpc/kernel/entry_32.S 2009-06-17 16:45:15.000000000 +1000
+++ linux-work/arch/powerpc/kernel/entry_32.S 2009-06-17 18:29:23.000000000 +1000
@@ -191,11 +191,49 @@ transfer_to_handler_cont:
mflr r9
lwz r11,0(r9) /* virtual address of handler */
lwz r9,4(r9) /* where to go when done */
+#ifdef CONFIG_TRACE_IRQFLAGS
+ lis r12,reenable_mmu@h
+ ori r12,r12,reenable_mmu@l
+ mtspr SPRN_SRR0,r12
+ mtspr SPRN_SRR1,r10
+ SYNC
+ RFI
+reenable_mmu: /* re-enable mmu so we can */
+ mfmsr r10
+ lwz r12,_MSR(r1)
+ xor r10,r10,r12
+ andi. r10,r10,MSR_EE /* Did EE change? */
+ beq 1f
+
+ /* Save handler and return address into the 2 unused words
+ * of the STACK_FRAME_OVERHEAD (sneak sneak sneak). Everything
+ * else can be recovered from the pt_regs except r3 which for
+ * normal interrupts has been set to pt_regs and for syscalls
+ * is an argument, so we temporarily use ORIG_GPR3 to save it
+ */
+ stw r9,8(r1)
+ stw r11,12(r1)
+ stw r3,ORIG_GPR3(r1)
+ bl trace_hardirqs_off
+ lwz r0,GPR0(r1)
+ lwz r3,ORIG_GPR3(r1)
+ lwz r4,GPR4(r1)
+ lwz r5,GPR5(r1)
+ lwz r6,GPR6(r1)
+ lwz r7,GPR7(r1)
+ lwz r8,GPR8(r1)
+ lwz r9,8(r1)
+ lwz r11,12(r1)
+1: mtctr r11
+ mtlr r9
+ bctr /* jump to handler */
+#else /* CONFIG_TRACE_IRQFLAGS */
mtspr SPRN_SRR0,r11
mtspr SPRN_SRR1,r10
mtlr r9
SYNC
RFI /* jump to handler, enable MMU */
+#endif /* CONFIG_TRACE_IRQFLAGS */
#if defined (CONFIG_6xx) || defined(CONFIG_E500)
4: rlwinm r12,r12,0,~_TLF_NAPPING
@@ -251,6 +289,31 @@ _GLOBAL(DoSyscall)
#ifdef SHOW_SYSCALLS
bl do_show_syscall
#endif /* SHOW_SYSCALLS */
+#ifdef CONFIG_TRACE_IRQFLAGS
+ /* Return from syscalls can (and generally will) hard enable
+ * interrupts. You aren't supposed to call a syscall with
+ * interrupts disabled in the first place. However, to ensure
+ * that we get it right vs. lockdep if it happens, we force
+ * that hard enable here with appropriate tracing if we see
+ * that we have been called with interrupts off
+ */
+ mfmsr r11
+ andi. r12,r11,MSR_EE
+ bne+ 1f
+ /* We came in with interrupts disabled, we enable them now */
+ bl trace_hardirqs_on
+ mfmsr r11
+ lwz r0,GPR0(r1)
+ lwz r3,GPR3(r1)
+ lwz r4,GPR4(r1)
+ ori r11,r11,MSR_EE
+ lwz r5,GPR5(r1)
+ lwz r6,GPR6(r1)
+ lwz r7,GPR7(r1)
+ lwz r8,GPR8(r1)
+ mtmsr r11
+1:
+#endif /* CONFIG_TRACE_IRQFLAGS */
rlwinm r10,r1,0,0,(31-THREAD_SHIFT) /* current_thread_info() */
lwz r11,TI_FLAGS(r10)
andi. r11,r11,_TIF_SYSCALL_T_OR_A
@@ -275,6 +338,7 @@ ret_from_syscall:
rlwinm r12,r1,0,0,(31-THREAD_SHIFT) /* current_thread_info() */
/* disable interrupts so current_thread_info()->flags can't change */
LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */
+ /* Note: We don't bother telling lockdep about it */
SYNC
MTMSRD(r10)
lwz r9,TI_FLAGS(r12)
@@ -288,6 +352,19 @@ ret_from_syscall:
oris r11,r11,0x1000 /* Set SO bit in CR */
stw r11,_CCR(r1)
syscall_exit_cont:
+ lwz r8,_MSR(r1)
+#ifdef CONFIG_TRACE_IRQFLAGS
+ /* If we are going to return from the syscall with interrupts
+ * off, we trace that here. It shouldn't happen though but we
+ * want to catch the bugger if it does right ?
+ */
+ andi. r10,r8,MSR_EE
+ bne+ 1f
+ stw r3,GPR3(r1)
+ bl trace_hardirqs_off
+ lwz r3,GPR3(r1)
+1:
+#endif /* CONFIG_TRACE_IRQFLAGS */
#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
/* If the process has its own DBCR0 value, load it up. The internal
debug mode bit tells us that dbcr0 should be loaded. */
@@ -311,7 +388,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRE
mtlr r4
mtcr r5
lwz r7,_NIP(r1)
- lwz r8,_MSR(r1)
FIX_SRR1(r8, r0)
lwz r2,GPR2(r1)
lwz r1,GPR1(r1)
@@ -394,7 +470,9 @@ syscall_exit_work:
andi. r0,r9,(_TIF_SYSCALL_T_OR_A|_TIF_SINGLESTEP)
beq ret_from_except
- /* Re-enable interrupts */
+ /* Re-enable interrupts. There is no need to trace that with
+ * lockdep as we are supposed to have IRQs on at this point
+ */
ori r10,r10,MSR_EE
SYNC
MTMSRD(r10)
@@ -705,6 +783,7 @@ ret_from_except:
/* Hard-disable interrupts so that current_thread_info()->flags
* can't change between when we test it and when we return
* from the interrupt. */
+ /* Note: We don't bother telling lockdep about it */
LOAD_MSR_KERNEL(r10,MSR_KERNEL)
SYNC /* Some chip revs have problems here... */
MTMSRD(r10) /* disable interrupts */
@@ -744,11 +823,24 @@ resume_kernel:
beq+ restore
andi. r0,r3,MSR_EE /* interrupts off? */
beq restore /* don't schedule if so */
+#ifdef CONFIG_TRACE_IRQFLAGS
+ /* Lockdep thinks irqs are enabled, we need to call
+ * preempt_schedule_irq with IRQs off, so we inform lockdep
+ * now that we -did- turn them off already
+ */
+ bl trace_hardirqs_off
+#endif
1: bl preempt_schedule_irq
rlwinm r9,r1,0,0,(31-THREAD_SHIFT)
lwz r3,TI_FLAGS(r9)
andi. r0,r3,_TIF_NEED_RESCHED
bne- 1b
+#ifdef CONFIG_TRACE_IRQFLAGS
+ /* And now, to properly rebalance the above, we tell lockdep they
+ * are being turned back on, which will happen when we return
+ */
+ bl trace_hardirqs_on
+#endif
#else
resume_kernel:
#endif /* CONFIG_PREEMPT */
@@ -781,8 +873,28 @@ BEGIN_FTR_SECTION
END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRED_STWCX)
stwcx. r0,0,r1 /* to clear the reservation */
-#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
lwz r9,_MSR(r1)
+#ifdef CONFIG_TRACE_IRQFLAGS
+ /* Lockdep doesn't know about the fact that IRQs are temporarily turned
+ * off in this assembly code while peeking at TI_FLAGS() and such. However
+ * we need to inform it if the exception turned interrupts off, and we
+ * are about to trun them back on.
+ *
+ * The problem here sadly is that we don't know whether the exceptions was
+ * one that turned interrupts off or not. So we always tell lockdep about
+ * turning them on here when we go back to wherever we came from with EE
+ * on, even if that may meen some redudant calls being tracked. Maybe later
+ * we could encode what the exception did somewhere or test the exception
+ * type in the pt_regs but that sounds overkill
+ */
+ andi. r10,r9,MSR_EE
+ beq 1f
+ bl trace_hardirqs_on
+ lwz r9,_MSR(r1)
+1:
+#endif /* CONFIG_TRACE_IRQFLAGS */
+
+#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
andi. r10,r9,MSR_RI /* check if this exception occurred */
beql nonrecoverable /* at a bad place (MSR:RI = 0) */
@@ -805,7 +917,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_NEED_PAIRE
MTMSRD(r10) /* clear the RI bit */
.globl exc_exit_restart
exc_exit_restart:
- lwz r9,_MSR(r1)
lwz r12,_NIP(r1)
FIX_SRR1(r9,r10)
mtspr SPRN_SRR0,r12
@@ -1035,11 +1146,18 @@ do_work: /* r10 contains MSR_KERNEL he
beq do_user_signal
do_resched: /* r10 contains MSR_KERNEL here */
+ /* Note: We don't need to inform lockdep that we are enabling
+ * interrupts here. As far as it knows, they are already enabled
+ */
ori r10,r10,MSR_EE
SYNC
MTMSRD(r10) /* hard-enable interrupts */
bl schedule
recheck:
+ /* Note: And we don't tell it we are disabling them again
+ * neither. Those disable/enable cycles used to peek at
+ * TI_FLAGS aren't advertised.
+ */
LOAD_MSR_KERNEL(r10,MSR_KERNEL)
SYNC
MTMSRD(r10) /* disable interrupts */
Index: linux-work/arch/powerpc/kernel/setup_32.c
===================================================================
--- linux-work.orig/arch/powerpc/kernel/setup_32.c 2009-06-17 16:45:15.000000000 +1000
+++ linux-work/arch/powerpc/kernel/setup_32.c 2009-06-17 18:29:37.000000000 +1000
@@ -119,6 +119,8 @@ notrace unsigned long __init early_init(
*/
notrace void __init machine_init(unsigned long dt_ptr)
{
+ lockdep_init();
+
/* Enable early debugging if any specified (see udbg.h) */
udbg_early_init();
Index: linux-work/arch/powerpc/include/asm/hw_irq.h
===================================================================
--- linux-work.orig/arch/powerpc/include/asm/hw_irq.h 2009-06-17 16:45:15.000000000 +1000
+++ linux-work/arch/powerpc/include/asm/hw_irq.h 2009-06-17 16:45:36.000000000 +1000
@@ -68,13 +68,13 @@ static inline int irqs_disabled_flags(un
#if defined(CONFIG_BOOKE)
#define SET_MSR_EE(x) mtmsr(x)
-#define local_irq_restore(flags) __asm__ __volatile__("wrtee %0" : : "r" (flags) : "memory")
+#define raw_local_irq_restore(flags) __asm__ __volatile__("wrtee %0" : : "r" (flags) : "memory")
#else
#define SET_MSR_EE(x) mtmsr(x)
-#define local_irq_restore(flags) mtmsr(flags)
+#define raw_local_irq_restore(flags) mtmsr(flags)
#endif
-static inline void local_irq_disable(void)
+static inline void raw_local_irq_disable(void)
{
#ifdef CONFIG_BOOKE
__asm__ __volatile__("wrteei 0": : :"memory");
@@ -86,7 +86,7 @@ static inline void local_irq_disable(voi
#endif
}
-static inline void local_irq_enable(void)
+static inline void raw_local_irq_enable(void)
{
#ifdef CONFIG_BOOKE
__asm__ __volatile__("wrteei 1": : :"memory");
@@ -98,7 +98,7 @@ static inline void local_irq_enable(void
#endif
}
-static inline void local_irq_save_ptr(unsigned long *flags)
+static inline void raw_local_irq_save_ptr(unsigned long *flags)
{
unsigned long msr;
msr = mfmsr();
@@ -110,12 +110,12 @@ static inline void local_irq_save_ptr(un
#endif
}
-#define local_save_flags(flags) ((flags) = mfmsr())
-#define local_irq_save(flags) local_irq_save_ptr(&flags)
-#define irqs_disabled() ((mfmsr() & MSR_EE) == 0)
+#define raw_local_save_flags(flags) ((flags) = mfmsr())
+#define raw_local_irq_save(flags) raw_local_irq_save_ptr(&flags)
+#define raw_irqs_disabled() ((mfmsr() & MSR_EE) == 0)
+#define raw_irqs_disabled_flags(flags) (((flags) & MSR_EE) == 0)
-#define hard_irq_enable() local_irq_enable()
-#define hard_irq_disable() local_irq_disable()
+#define hard_irq_disable() raw_local_irq_disable()
static inline int irqs_disabled_flags(unsigned long flags)
{
Index: linux-work/arch/powerpc/kernel/udbg.c
===================================================================
--- linux-work.orig/arch/powerpc/kernel/udbg.c 2009-06-17 17:14:41.000000000 +1000
+++ linux-work/arch/powerpc/kernel/udbg.c 2009-06-17 17:14:43.000000000 +1000
@@ -65,6 +65,7 @@ void __init udbg_early_init(void)
#ifdef CONFIG_PPC_EARLY_DEBUG
console_loglevel = 10;
#endif
+ register_early_udbg_console();
}
/* udbg library, used by xmon et al */
^ permalink raw reply
* Re: MPC83xx watchdog reset board dead lock
From: Norbert van Bolhuis @ 2009-06-17 8:35 UTC (permalink / raw)
To: Leon Woestenberg; +Cc: Linux PPC
In-Reply-To: <c384c5ea0906160852l4845760cp8594463a866683dc@mail.gmail.com>
Hi Leon,
I doubt if there are working designs for this.
In u-boot the watchdog (if enabled with CONFIG_WATCHDOG) is normally
strobed in the decrementer interrupt routine (timer_interrupt). So
I guess there's not a big chance it triggers a reset.
It is possible to configure the WD to issue a machine check interrupt
(i.s.o. HRESET). Maybe it's possible (or even done already) to put the
flash into READ-mode from the isr ?
---
N. van Bolhuis.
Leon Woestenberg wrote:
> Hello,
>
> this is a hardware, even board issue, but I hope to find the right
> target audience here.
>
>
> In our MPC83xx design I would like to prevent dead lock in case where
> a field upgrade is performed, i.e. NOR Flash is erased or written, and
> the MPC83xx built-in hardware watchdog triggers.
>
> In u-boot the scenario can be easily reproduced by running this
> command (WARNING, erases some sectors!) on an MPC8313E-RDB:
>
> erase_wdg=mw.l 0xe0000204 0x10000007 1;mw.w 0xe000020e 0x556c 1;mw.w
> 0xe000020e 0xaa39 1;erase 1:10-30
>
> This sets up the watchdog to reset soonish, then starts erasing NOR
> sectors. Watchdog triggers and resets -> Dead lock.
>
>
> Most MPC8xxx board designs I have seen suffer from this possible dead lock:
> - NOR Flash is put in erase mode or write mode
> - Hardware watchdog triggers
> - HRESET# is asserted by the processor, during which the configuration
> words are read from NOR Flash.
>
> Either
> HRESET# is not attached to NOR, NOR stays in erase/write mode and
> invalid words will be read -> dead lock
>
> or either:
> HRESET# is attached to NOR reset, NOR is reset, but stays in reset as
> HRESET# stays asserted.
>
>
>
> We have been looking at several solutions hardware wise that reset the
> NOR flash on HRESET# going low, but the processors are stubborn,
> read the config words only once, than dead lock.
>
> I wonder if there are known-working designs for this.
>
> Regards,
^ permalink raw reply
* Re: PowerPC PCI DMA issues (prefetch/coherency?)
From: Chris Pringle @ 2009-06-17 7:58 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev@ozlabs.org list, linux-kernel
In-Reply-To: <4A37D073.6020802@freescale.com>
> You could enable CONFIG_NOT_COHERENT_CACHE.
>
I've just tried this (I had to edit Kconfig in power/platforms to make
the build system accept it), and interestingly it's making no
difference. I'm using streaming mappings, and are using the pci_map_sg
functions to ensure the memory is mapped/flushed correctly. I've also
explicitly put in a pci_dma_sync_sg_for_device, however that's also not
made any difference. Turning the cpu cache snoop off has the same affect
as it did without CONFIG_NOT_COHERENT_CACHE; it gets much worse. Any
other ideas?
Will back off the low latency patches next, and give 2.6.30 a try - see
if that makes any difference.
--
______________________________
Chris Pringle
Software Engineer
Miranda Technologies Ltd.
Hithercroft Road
Wallingford
Oxfordshire OX10 9DG
UK
Tel. +44 1491 820206
Fax. +44 1491 820001
www.miranda.com
____________________________
Miranda Technologies Limited
Registered in England and Wales CN 02017053
Registered Office: James House, Mere Park, Dedmere Road, Marlow, Bucks, SL7 1FJ
^ permalink raw reply
* Please pull mpc5xxx & virtex merge branch
From: Grant Likely @ 2009-06-17 7:22 UTC (permalink / raw)
To: Benjamin Herrenschmidt, linuxppc-dev; +Cc: Wolfgang Denk
Hi Ben,
Here's the xilinxfb fix plus some outstanding 5xxx changes that I
didn't get to the first time around.
Cheers,
g.
The following changes since commit 313485175da221c388f6a8ecf4c30062ba9bea17:
Geert Uytterhoeven (1):
usb/ps3: Add missing annotations
are available in the git repository at:
git://git.secretlab.ca/git/linux-2.6 merge
Anton Vorontsov (1):
powerpc/5200: convert mpc52xx_psc_spi to use cs_control callback
Grant Likely (1):
fbdev/xilinxfb: Fix improper casting and tighen up probe path
Wolfgang Denk (1):
powerpc/5xxx: Add common mpc5xxx_get_bus_frequency() function
Wolfram Sang (2):
powerpc/5200: Update pcm030.dts to add i2c eeprom and delete cruft
powerpc/5121: make clock debug output more readable
arch/powerpc/boot/dts/pcm030.dts | 26 ++--------
arch/powerpc/include/asm/mpc52xx.h | 2 +-
arch/powerpc/include/asm/{mpc512x.h => mpc5xxx.h} | 10 ++--
arch/powerpc/platforms/512x/clock.c | 10 ++--
arch/powerpc/platforms/512x/mpc512x.h | 1 -
arch/powerpc/platforms/512x/mpc512x_shared.c | 23 --------
arch/powerpc/platforms/52xx/mpc52xx_common.c | 32 +-----------
arch/powerpc/sysdev/Makefile | 3 +
arch/powerpc/sysdev/mpc5xxx_clocks.c | 33 ++++++++++++
drivers/ata/pata_mpc52xx.c | 2 +-
drivers/i2c/busses/i2c-mpc.c | 2 +-
drivers/net/fec_mpc52xx.c | 2 +-
drivers/net/fec_mpc52xx_phy.c | 2 +-
drivers/serial/mpc52xx_uart.c | 5 +-
drivers/spi/mpc52xx_psc_spi.c | 22 +++-----
drivers/video/xilinxfb.c | 59 ++++++++-------------
drivers/watchdog/mpc5200_wdt.c | 2 +-
include/linux/fsl_devices.h | 4 --
18 files changed, 91 insertions(+), 149 deletions(-)
rename arch/powerpc/include/asm/{mpc512x.h => mpc5xxx.h} (65%)
create mode 100644 arch/powerpc/sysdev/mpc5xxx_clocks.c
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [ewg] Re: [PATCH 2.6.31] ehca: Tolerate dynamic memory operations and huge pages
From: Alexander Schmidt @ 2009-06-17 6:41 UTC (permalink / raw)
To: Roland Dreier; +Cc: linuxppc-dev, Hoang-Nam Nguyen, raisch, linux-kernel, ewg
In-Reply-To: <adazlc8w45c.fsf@cisco.com>
On Tue, 16 Jun 2009 09:10:39 -0700
Roland Dreier <rdreier@cisco.com> wrote:
>
> > Yeah, the notifier code remains untouched as we still do not allow dynamic
> > memory operations _while_ our module is loaded. The patch allows the driver to
> > cope with DMEM operations that happened before the module was loaded, which
> > might result in a non-contiguous memory layout. When the driver registers
> > its global memory region in the system, the memory layout must be considered.
> >
> > We chose the term "toleration" instead of "support" to illustrate this.
>
> I see. So things just silently broke in some cases when the driver was
> loaded after operations you didn't tolerate?
>
> Anyway, thanks for the explanation.
Well, things did not break silently. The registration of the MR failed with
an error code which was reported to userspace.
Will you push the patch for .31 or .32?
Thanks,
Alex
^ permalink raw reply
* Re: [PATCH] mpc5xxx_get_bus_frequency(): use common code on MPC512x and MPC52xx
From: Grant Likely @ 2009-06-17 6:21 UTC (permalink / raw)
To: Wolfgang Denk; +Cc: linuxppc-dev
In-Reply-To: <fa686aa40906162314p3e308bc4j2420a5f5570d5ae@mail.gmail.com>
On Wed, Jun 17, 2009 at 12:14 AM, Grant Likely<grant.likely@secretlab.ca> w=
rote:
> On Thu, Jun 11, 2009 at 2:19 PM, Wolfgang Denk<wd@denx.de> wrote:
>> So far, MPC512x used mpc512x_find_ips_freq() to get the bus frequency,
>> while MPC52xx used mpc52xx_find_ipb_freq(). =A0Despite the different
>> clock names (IPS vs. IPB) the code was identical.
>>
>> Use common code for both processor families.
>>
>> Signed-off-by: Wolfgang Denk <wd@denx.de>
>> Cc: Grant Likely <grant.likely@secretlab.ca>
>> Cc: Kumar Gala <galak@kernel.crashing.org>
>
> You probably already know this, but this patch doesn't apply against
> mainline, so I won't merge for 2.6.31.
Never mind; I'm smoking something. The patch applies fine.
g.
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [PATCH] mpc5xxx_get_bus_frequency(): use common code on MPC512x and MPC52xx
From: Grant Likely @ 2009-06-17 6:14 UTC (permalink / raw)
To: Wolfgang Denk; +Cc: linuxppc-dev
In-Reply-To: <1244751543-21977-1-git-send-email-wd@denx.de>
On Thu, Jun 11, 2009 at 2:19 PM, Wolfgang Denk<wd@denx.de> wrote:
> So far, MPC512x used mpc512x_find_ips_freq() to get the bus frequency,
> while MPC52xx used mpc52xx_find_ipb_freq(). =A0Despite the different
> clock names (IPS vs. IPB) the code was identical.
>
> Use common code for both processor families.
>
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: Kumar Gala <galak@kernel.crashing.org>
You probably already know this, but this patch doesn't apply against
mainline, so I won't merge for 2.6.31.
g.
> ---
>
> This patch is not only intended to avoid code duplication, but it
> will be needed in a following patch that fixes a MII speed
> miscalculation in drivers/net/fs_enet/mii-fec.c - this patch allows
> for a clean solution that works both on MPC512x and MPC52x systems.
>
> =A0arch/powerpc/include/asm/mpc512x.h =A0 =A0 =A0 =A0 =A0 | =A0 22 ------=
-----------
> =A0arch/powerpc/include/asm/mpc52xx.h =A0 =A0 =A0 =A0 =A0 | =A0 =A02 +-
> =A0arch/powerpc/include/asm/mpc5xxx.h =A0 =A0 =A0 =A0 =A0 | =A0 22 ++++++=
+++++++++++
> =A0arch/powerpc/platforms/512x/clock.c =A0 =A0 =A0 =A0 =A0| =A0 =A02 +-
> =A0arch/powerpc/platforms/512x/mpc512x.h =A0 =A0 =A0 =A0| =A0 =A01 -
> =A0arch/powerpc/platforms/512x/mpc512x_shared.c | =A0 23 ----------------=
--
> =A0arch/powerpc/platforms/52xx/mpc52xx_common.c | =A0 32 +---------------=
---------
> =A0arch/powerpc/sysdev/Makefile =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A0=
3 ++
> =A0arch/powerpc/sysdev/mpc5xxx_clocks.c =A0 =A0 =A0 =A0 | =A0 33 ++++++++=
++++++++++++++++++
> =A0drivers/ata/pata_mpc52xx.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =
=A02 +-
> =A0drivers/i2c/busses/i2c-mpc.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A0=
2 +-
> =A0drivers/net/fec_mpc52xx.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0=
=A02 +-
> =A0drivers/net/fec_mpc52xx_phy.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A0=
2 +-
> =A0drivers/serial/mpc52xx_uart.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A0=
5 +--
> =A0drivers/watchdog/mpc5200_wdt.c =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A02 =
+-
> =A015 files changed, 68 insertions(+), 87 deletions(-)
> =A0delete mode 100644 arch/powerpc/include/asm/mpc512x.h
> =A0create mode 100644 arch/powerpc/include/asm/mpc5xxx.h
> =A0create mode 100644 arch/powerpc/sysdev/mpc5xxx_clocks.c
>
> diff --git a/arch/powerpc/include/asm/mpc512x.h b/arch/powerpc/include/as=
m/mpc512x.h
> deleted file mode 100644
> index c48a165..0000000
> --- a/arch/powerpc/include/asm/mpc512x.h
> +++ /dev/null
> @@ -1,22 +0,0 @@
> -/*
> - * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
> - *
> - * Author: John Rigby, <jrigby@freescale.com>, Friday Apr 13 2007
> - *
> - * Description:
> - * MPC5121 Prototypes and definitions
> - *
> - * This is free software; you can redistribute it and/or modify it
> - * under the terms of the GNU General Public License as published by
> - * the Free Software Foundation; either version 2 of the License, or
> - * (at your option) any later version.
> - *
> - */
> -
> -#ifndef __ASM_POWERPC_MPC512x_H__
> -#define __ASM_POWERPC_MPC512x_H__
> -
> -extern unsigned long mpc512x_find_ips_freq(struct device_node *node);
> -
> -#endif /* __ASM_POWERPC_MPC512x_H__ */
> -
> diff --git a/arch/powerpc/include/asm/mpc52xx.h b/arch/powerpc/include/as=
m/mpc52xx.h
> index 52e049c..1b4f697 100644
> --- a/arch/powerpc/include/asm/mpc52xx.h
> +++ b/arch/powerpc/include/asm/mpc52xx.h
> @@ -16,6 +16,7 @@
> =A0#ifndef __ASSEMBLY__
> =A0#include <asm/types.h>
> =A0#include <asm/prom.h>
> +#include <asm/mpc5xxx.h>
> =A0#endif /* __ASSEMBLY__ */
>
> =A0#include <linux/suspend.h>
> @@ -268,7 +269,6 @@ struct mpc52xx_intr {
> =A0#ifndef __ASSEMBLY__
>
> =A0/* mpc52xx_common.c */
> -extern unsigned int mpc52xx_find_ipb_freq(struct device_node *node);
> =A0extern void mpc5200_setup_xlb_arbiter(void);
> =A0extern void mpc52xx_declare_of_platform_devices(void);
> =A0extern void mpc52xx_map_common_devices(void);
> diff --git a/arch/powerpc/include/asm/mpc5xxx.h b/arch/powerpc/include/as=
m/mpc5xxx.h
> new file mode 100644
> index 0000000..5ce9c5f
> --- /dev/null
> +++ b/arch/powerpc/include/asm/mpc5xxx.h
> @@ -0,0 +1,22 @@
> +/*
> + * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
> + *
> + * Author: John Rigby, <jrigby@freescale.com>, Friday Apr 13 2007
> + *
> + * Description:
> + * MPC5xxx Prototypes and definitions
> + *
> + * This is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + */
> +
> +#ifndef __ASM_POWERPC_MPC5xxx_H__
> +#define __ASM_POWERPC_MPC5xxx_H__
> +
> +extern unsigned long mpc5xxx_get_bus_frequency(struct device_node *node)=
;
> +
> +#endif /* __ASM_POWERPC_MPC5xxx_H__ */
> +
> diff --git a/arch/powerpc/platforms/512x/clock.c b/arch/powerpc/platforms=
/512x/clock.c
> index 1bcff94..f4c4c6f 100644
> --- a/arch/powerpc/platforms/512x/clock.c
> +++ b/arch/powerpc/platforms/512x/clock.c
> @@ -24,7 +24,7 @@
> =A0#include <linux/io.h>
>
> =A0#include <linux/of_platform.h>
> -#include <asm/mpc512x.h>
> +#include <asm/mpc5xxx.h>
> =A0#include <asm/clk_interface.h>
>
> =A0#undef CLK_DEBUG
> diff --git a/arch/powerpc/platforms/512x/mpc512x.h b/arch/powerpc/platfor=
ms/512x/mpc512x.h
> index 9c03693..22a5352 100644
> --- a/arch/powerpc/platforms/512x/mpc512x.h
> +++ b/arch/powerpc/platforms/512x/mpc512x.h
> @@ -11,7 +11,6 @@
>
> =A0#ifndef __MPC512X_H__
> =A0#define __MPC512X_H__
> -extern unsigned long mpc512x_find_ips_freq(struct device_node *node);
> =A0extern void __init mpc512x_init_IRQ(void);
> =A0void __init mpc512x_declare_of_platform_devices(void);
> =A0#endif =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* __MPC512X_H_=
_ */
> diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/=
platforms/512x/mpc512x_shared.c
> index d8cd579..434d683 100644
> --- a/arch/powerpc/platforms/512x/mpc512x_shared.c
> +++ b/arch/powerpc/platforms/512x/mpc512x_shared.c
> @@ -24,29 +24,6 @@
>
> =A0#include "mpc512x.h"
>
> -unsigned long
> -mpc512x_find_ips_freq(struct device_node *node)
> -{
> - =A0 =A0 =A0 struct device_node *np;
> - =A0 =A0 =A0 const unsigned int *p_ips_freq =3D NULL;
> -
> - =A0 =A0 =A0 of_node_get(node);
> - =A0 =A0 =A0 while (node) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 p_ips_freq =3D of_get_property(node, "bus-f=
requency", NULL);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (p_ips_freq)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> -
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 np =3D of_get_parent(node);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_node_put(node);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 node =3D np;
> - =A0 =A0 =A0 }
> - =A0 =A0 =A0 if (node)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_node_put(node);
> -
> - =A0 =A0 =A0 return p_ips_freq ? *p_ips_freq : 0;
> -}
> -EXPORT_SYMBOL(mpc512x_find_ips_freq);
> -
> =A0void __init mpc512x_init_IRQ(void)
> =A0{
> =A0 =A0 =A0 =A0struct device_node *np;
> diff --git a/arch/powerpc/platforms/52xx/mpc52xx_common.c b/arch/powerpc/=
platforms/52xx/mpc52xx_common.c
> index 8e3dd5a..a46bad0 100644
> --- a/arch/powerpc/platforms/52xx/mpc52xx_common.c
> +++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c
> @@ -47,36 +47,6 @@ static DEFINE_SPINLOCK(mpc52xx_lock);
> =A0static struct mpc52xx_gpt __iomem *mpc52xx_wdt;
> =A0static struct mpc52xx_cdm __iomem *mpc52xx_cdm;
>
> -/**
> - * =A0 =A0 mpc52xx_find_ipb_freq - Find the IPB bus frequency for a devi=
ce
> - * =A0 =A0 @node: =A0device node
> - *
> - * =A0 =A0 Returns IPB bus frequency, or 0 if the bus frequency cannot b=
e found.
> - */
> -unsigned int
> -mpc52xx_find_ipb_freq(struct device_node *node)
> -{
> - =A0 =A0 =A0 struct device_node *np;
> - =A0 =A0 =A0 const unsigned int *p_ipb_freq =3D NULL;
> -
> - =A0 =A0 =A0 of_node_get(node);
> - =A0 =A0 =A0 while (node) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 p_ipb_freq =3D of_get_property(node, "bus-f=
requency", NULL);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (p_ipb_freq)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> -
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 np =3D of_get_parent(node);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_node_put(node);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 node =3D np;
> - =A0 =A0 =A0 }
> - =A0 =A0 =A0 if (node)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_node_put(node);
> -
> - =A0 =A0 =A0 return p_ipb_freq ? *p_ipb_freq : 0;
> -}
> -EXPORT_SYMBOL(mpc52xx_find_ipb_freq);
> -
> -
> =A0/*
> =A0* Configure the XLB arbiter settings to match what Linux expects.
> =A0*/
> @@ -221,7 +191,7 @@ unsigned int mpc52xx_get_xtal_freq(struct device_node=
*node)
> =A0 =A0 =A0 =A0if (!mpc52xx_cdm)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return 0;
>
> - =A0 =A0 =A0 freq =3D mpc52xx_find_ipb_freq(node);
> + =A0 =A0 =A0 freq =3D mpc5xxx_get_bus_frequency(node);
> =A0 =A0 =A0 =A0if (!freq)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return 0;
>
> diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
> index b33b28a..2a1df88 100644
> --- a/arch/powerpc/sysdev/Makefile
> +++ b/arch/powerpc/sysdev/Makefile
> @@ -47,6 +47,9 @@ obj-$(CONFIG_PPC_DCR) =A0 =A0 =A0 =A0 +=3D dcr.o
> =A0obj-$(CONFIG_8xx) =A0 =A0 =A0 =A0 =A0 =A0 =A0+=3D mpc8xx_pic.o cpm1.o
> =A0obj-$(CONFIG_UCODE_PATCH) =A0 =A0 =A0+=3D micropatch.o
>
> +obj-$(CONFIG_PPC_MPC512x) =A0 =A0 =A0+=3D mpc5xxx_clocks.o
> +obj-$(CONFIG_PPC_MPC52xx) =A0 =A0 =A0+=3D mpc5xxx_clocks.o
> +
> =A0ifeq ($(CONFIG_SUSPEND),y)
> =A0obj-$(CONFIG_6xx) =A0 =A0 =A0 =A0 =A0 =A0 =A0+=3D 6xx-suspend.o
> =A0endif
> diff --git a/arch/powerpc/sysdev/mpc5xxx_clocks.c b/arch/powerpc/sysdev/m=
pc5xxx_clocks.c
> new file mode 100644
> index 0000000..34e12f9
> --- /dev/null
> +++ b/arch/powerpc/sysdev/mpc5xxx_clocks.c
> @@ -0,0 +1,33 @@
> +/**
> + * =A0 =A0 mpc5xxx_get_bus_frequency - Find the bus frequency for a devi=
ce
> + * =A0 =A0 @node: =A0device node
> + *
> + * =A0 =A0 Returns bus frequency (IPS on MPC512x, IPB on MPC52xx),
> + * =A0 =A0 or 0 if the bus frequency cannot be found.
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/of_platform.h>
> +
> +unsigned int
> +mpc5xxx_get_bus_frequency(struct device_node *node)
> +{
> + =A0 =A0 =A0 struct device_node *np;
> + =A0 =A0 =A0 const unsigned int *p_bus_freq =3D NULL;
> +
> + =A0 =A0 =A0 of_node_get(node);
> + =A0 =A0 =A0 while (node) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 p_bus_freq =3D of_get_property(node, "bus-f=
requency", NULL);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (p_bus_freq)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> +
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 np =3D of_get_parent(node);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_node_put(node);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 node =3D np;
> + =A0 =A0 =A0 }
> + =A0 =A0 =A0 if (node)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 of_node_put(node);
> +
> + =A0 =A0 =A0 return p_bus_freq ? *p_bus_freq : 0;
> +}
> +EXPORT_SYMBOL(mpc5xxx_get_bus_frequency);
> diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c
> index 68d27bc..2bc2dbe 100644
> --- a/drivers/ata/pata_mpc52xx.c
> +++ b/drivers/ata/pata_mpc52xx.c
> @@ -694,7 +694,7 @@ mpc52xx_ata_probe(struct of_device *op, const struct =
of_device_id *match)
> =A0 =A0 =A0 =A0struct bcom_task *dmatsk =3D NULL;
>
> =A0 =A0 =A0 =A0/* Get ipb frequency */
> - =A0 =A0 =A0 ipb_freq =3D mpc52xx_find_ipb_freq(op->node);
> + =A0 =A0 =A0 ipb_freq =3D mpc5xxx_get_bus_frequency(op->node);
> =A0 =A0 =A0 =A0if (!ipb_freq) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0dev_err(&op->dev, "could not determine IPB=
bus frequency\n");
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -ENODEV;
> diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
> index dd778d7..d325e86 100644
> --- a/drivers/i2c/busses/i2c-mpc.c
> +++ b/drivers/i2c/busses/i2c-mpc.c
> @@ -197,7 +197,7 @@ int mpc_i2c_get_fdr_52xx(struct device_node *node, u3=
2 clock, int prescaler)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -EINVAL;
>
> =A0 =A0 =A0 =A0/* Determine divider value */
> - =A0 =A0 =A0 divider =3D mpc52xx_find_ipb_freq(node) / clock;
> + =A0 =A0 =A0 divider =3D mpc5xxx_get_bus_frequency(node) / clock;
>
> =A0 =A0 =A0 =A0/*
> =A0 =A0 =A0 =A0 * We want to choose an FDR/DFSR that generates an I2C bus=
speed that
> diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
> index 8bbe7f6..5ddf033 100644
> --- a/drivers/net/fec_mpc52xx.c
> +++ b/drivers/net/fec_mpc52xx.c
> @@ -1006,7 +1006,7 @@ mpc52xx_fec_probe(struct of_device *op, const struc=
t of_device_id *match)
> =A0 =A0 =A0 =A0priv->phy_addr =3D FEC5200_PHYADDR_NONE;
> =A0 =A0 =A0 =A0priv->speed =3D 100;
> =A0 =A0 =A0 =A0priv->duplex =3D DUPLEX_HALF;
> - =A0 =A0 =A0 priv->phy_speed =3D ((mpc52xx_find_ipb_freq(op->node) >> 20=
) / 5) << 1;
> + =A0 =A0 =A0 priv->phy_speed =3D ((mpc5xxx_get_bus_frequency(op->node) >=
> 20) / 5) << 1;
>
> =A0 =A0 =A0 =A0/* the 7-wire property means don't use MII mode */
> =A0 =A0 =A0 =A0if (of_find_property(op->node, "fsl,7-wire-mode", NULL))
> diff --git a/drivers/net/fec_mpc52xx_phy.c b/drivers/net/fec_mpc52xx_phy.=
c
> index dd9bfa4..176e9b8 100644
> --- a/drivers/net/fec_mpc52xx_phy.c
> +++ b/drivers/net/fec_mpc52xx_phy.c
> @@ -120,7 +120,7 @@ static int mpc52xx_fec_mdio_probe(struct of_device *o=
f,
>
> =A0 =A0 =A0 =A0/* set MII speed */
> =A0 =A0 =A0 =A0out_be32(&priv->regs->mii_speed,
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 ((mpc52xx_find_ipb_freq(of->node) >> 20) / =
5) << 1);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ((mpc5xxx_get_bus_frequency(of->node) >> 20=
) / 5) << 1);
>
> =A0 =A0 =A0 =A0err =3D mdiobus_register(bus);
> =A0 =A0 =A0 =A0if (err)
> diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.=
c
> index b3feb61..abbd146 100644
> --- a/drivers/serial/mpc52xx_uart.c
> +++ b/drivers/serial/mpc52xx_uart.c
> @@ -76,7 +76,6 @@
> =A0#include <linux/of_platform.h>
>
> =A0#include <asm/mpc52xx.h>
> -#include <asm/mpc512x.h>
> =A0#include <asm/mpc52xx_psc.h>
>
> =A0#if defined(CONFIG_SERIAL_MPC52xx_CONSOLE) && defined(CONFIG_MAGIC_SYS=
RQ)
> @@ -254,7 +253,7 @@ static unsigned long mpc52xx_getuartclk(void *p)
> =A0 =A0 =A0 =A0 * but the generic serial code assumes 16
> =A0 =A0 =A0 =A0 * so return ipb freq / 2
> =A0 =A0 =A0 =A0 */
> - =A0 =A0 =A0 return mpc52xx_find_ipb_freq(p) / 2;
> + =A0 =A0 =A0 return mpc5xxx_get_bus_frequency(p) / 2;
> =A0}
>
> =A0static struct psc_ops mpc52xx_psc_ops =3D {
> @@ -391,7 +390,7 @@ static void mpc512x_psc_cw_restore_ints(struct uart_p=
ort *port)
>
> =A0static unsigned long mpc512x_getuartclk(void *p)
> =A0{
> - =A0 =A0 =A0 return mpc512x_find_ips_freq(p);
> + =A0 =A0 =A0 return mpc5xxx_get_bus_frequency(p);
> =A0}
>
> =A0static struct psc_ops mpc512x_psc_ops =3D {
> diff --git a/drivers/watchdog/mpc5200_wdt.c b/drivers/watchdog/mpc5200_wd=
t.c
> index 465fe36..fa9c47c 100644
> --- a/drivers/watchdog/mpc5200_wdt.c
> +++ b/drivers/watchdog/mpc5200_wdt.c
> @@ -188,7 +188,7 @@ static int mpc5200_wdt_probe(struct of_device *op,
> =A0 =A0 =A0 =A0if (!wdt)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -ENOMEM;
>
> - =A0 =A0 =A0 wdt->ipb_freq =3D mpc52xx_find_ipb_freq(op->node);
> + =A0 =A0 =A0 wdt->ipb_freq =3D mpc5xxx_get_bus_frequency(op->node);
>
> =A0 =A0 =A0 =A0err =3D of_address_to_resource(op->node, 0, &wdt->mem);
> =A0 =A0 =A0 =A0if (err)
> --
> 1.6.0.6
>
>
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [PATCH 1/3 v3] mtd: physmap_of: Add multiple regions and concatenation support
From: Grant Likely @ 2009-06-17 5:53 UTC (permalink / raw)
To: Stefan Roese, David Woodhouse; +Cc: linuxppc-dev, devicetree-discuss, linux-mtd
In-Reply-To: <fa686aa40904160646v75a98e02s446fd89c08cfebae@mail.gmail.com>
On Thu, Apr 16, 2009 at 7:46 AM, Grant Likely<grant.likely@secretlab.ca> wr=
ote:
> On Thu, Apr 16, 2009 at 7:37 AM, Stefan Roese <sr@denx.de> wrote:
>> On Thursday 16 April 2009, Grant Likely wrote:
>>> > Signed-off-by: Stefan Roese <sr@denx.de>
>>> > Reviewd-by: Grant Likely <grant.likely@secretlab.ca>
>>>
>>> Yup, still looks good to me. =A0What boards has this been tested on?
>>
>> I tested this version on PPC405EX Kilauea equipped only one "standard"
>> Spansion S29GL512 NOR chip. And a slightly modified version on an MPC836=
0
>> board (kmeter1) which is equipped with the Intel P30 part mentioned in t=
he
>> bindings description. Slightly modified since this board support is not =
yet
>> pushed upstream and currently using v2.6.28 (physmap_of.c has received m=
inor
>> modifications after 2.6.28 release).
>
> Okay. =A0It will be good to get this one into -next for some testing
> exposure. =A0Unless he asks me to do otherwise, I'll leave this one to
> David to pick up.
David, what's the status of this patch? Will it be merged for 2.6.31?
g.
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* Re: [Patch 2/6] Introduce PPC64 specific Hardware Breakpoint interfaces
From: David Gibson @ 2009-06-17 4:45 UTC (permalink / raw)
To: K.Prasad
Cc: Michael Neuling, Benjamin Herrenschmidt, linuxppc-dev, paulus,
Alan Stern, Roland McGrath
In-Reply-To: <20090615071828.GA7608@in.ibm.com>
On Mon, Jun 15, 2009 at 12:48:28PM +0530, K.Prasad wrote:
> On Mon, Jun 15, 2009 at 04:40:45PM +1000, David Gibson wrote:
> > On Wed, Jun 10, 2009 at 12:13:49PM +0530, K.Prasad wrote:
> > > On Fri, Jun 05, 2009 at 03:11:58PM +1000, David Gibson wrote:
> > > > On Wed, Jun 03, 2009 at 10:05:11PM +0530, K.Prasad wrote:
> > >
> > > > > + else {
> > > > > + /*
> > > > > + * This exception is triggered not because of a memory access on
> > > > > + * the monitored variable but in the double-word address range
> > > > > + * in which it is contained. We will consume this exception,
> > > > > + * considering it as 'noise'.
> > > > > + */
> > > > > + rc = NOTIFY_STOP;
> > > > > + goto out;
> > > > > + }
> > > > > + is_one_shot = (bp->triggered == ptrace_triggered) ? 1 : 0;
> > > >
> > > > Ouch, explicitly special-casing ptrace_triggered is pretty nasty.
> > > > Since the bp_info is already arch specific, maybe it should include a
> > > > flag to indicate whether the breakpoint is one-shot or not.
> > > >
> > >
> > > The reason to check for ptrace_triggered is to contain the one-shot
> > > behaviour only to ptrace (thus retaining the semantics) and not to extend
> > > them to all user-space requests through
> > > register_user_hw_breakpoint().
> >
> > Right, but couldn't you implement that withing ptrace_triggered
> > itself, without a special test here, by having it cancel the
> > breakpoint.
>
> A special check (either using the callback routine as above, or using a
> special flag) will be required in hw_breakpoint_handler() to enable
> early return (without single-stepping). I'm not sure if I got your
> suggestion right, and let me know if you think so.
Well.. you could also recheck after calling triggered whether the
breakpoint is still in existence. So cancelling the breakpoint in
triggered would.
Or you could change the signature for the triggered function, so it
returns whether to leave the breakpoint active or not. That would
have some advantages you could easily implement either one-shot,
continuous or N-shot, or keep firing until some specific event
behaviour from within the triggered function.
But all that's a bit moot, because of the fact that you try to make
the TRAP timing consistent (before or after execution of triggering
instruction) but you don't do so for a general triggered hook.
> > > A one-shot behaviour for all user-space requests would create more work
> > > for the user-space programs (such as re-registration) and will leave open
> > > a small window of opportunity for debug register grabbing by kernel-space
> > > requests.
> > >
> > > So, in effect a request through register_user_hw_breakpoint() interface
> > > will behave as under:
> > > - Single-step over the causative instruction that triggered the
> > > breakpoint exception handler.
> > > - Deliver the SIGTRAP signal to user-space after executing the causative
> > > instruction.
> > >
> > > This behaviour is in consonance with that of kernel-space requests and
> > > those on x86 processors, and helps define a consistent behaviour across
> > > architectures for user-space.
> > >
> > > Let me know what you think on the same.
> >
> > I certainly see the value in consistent semantics across archs.
> > However, I can also see uses for the powerpc trap-before-execute
> > behaviour. That's why I'm suggesting it might be worth having an
> > arch-specific flag.
> >
> > [snip]
>
> So, you suggest that the 'one-shot' behaviour should be driven by
> user-request and not just confined to ptrace? (The default behaviour for
> all breakpoints-minus-ptrace will remain 'continuous' though).
Not one-shot behaviour as such, but whether the trigger fires before
or after execution of the triggering instruction. The complication is
that combining fire-before semantics with continuous firing becomes
tricky.
> It can be implemented through an additional flag in 'struct
> arch_hw_breakpoint'. I can send a new version 7 of the patchset with this
> change (with the hope that the version 6 of the patchset looks fine in
> its present form!). Meanwhile, we'd like to know what uses you see in
> addition to the present one if the one-shot behaviour is made
> user-defined. Are those uses beyond what can be achieved through the
> present ptrace interface?
>
> > > > > +int __kprobes single_step_dabr_instruction(struct die_args *args)
> > > > > +{
> > > > > + struct pt_regs *regs = args->regs;
> > > > > + int cpu = get_cpu();
> > > > > + int ret = NOTIFY_DONE;
> > > > > + siginfo_t info;
> > > > > + unsigned long this_dabr_data = per_cpu(dabr_data, cpu);
> > > > > +
> > > > > + /*
> > > > > + * Check if we are single-stepping as a result of a
> > > > > + * previous HW Breakpoint exception
> > > > > + */
> > > > > + if (this_dabr_data == 0)
> > > > > + goto out;
> > > > > +
> > > > > + regs->msr &= ~MSR_SE;
> > > > > + /* Deliver signal to user-space */
> > > > > + if (this_dabr_data < TASK_SIZE) {
> > > > > + info.si_signo = SIGTRAP;
> > > > > + info.si_errno = 0;
> > > > > + info.si_code = TRAP_HWBKPT;
> > > > > + info.si_addr = (void __user *)(per_cpu(dabr_data, cpu));
> > > > > + force_sig_info(SIGTRAP, &info, current);
> > > >
> > > > Uh.. I recall mentioning in my previous review that in order to match
> > > > previous behaviour we need to deliver the userspace signal *before*
> > > > stepping over the breakpointed instruction, rather than after (which
> > > > I guess is why breakpoints are one-shot in the old scheme).
> > >
> > > This code would implement the behaviour as stated in the comment for
> > > user-space requests above.
> >
> > And you're relying on the old trap-sending code in do_dabr for ptrace
> > requests?
>
> Yes.
Yeah, since you're taking over the whole breakpoint infrastructure, I
really think you should rewrite do_dabr completely as part of your code.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply
* Re: [Patch 4/6] Modify process and processor handling code to recognise hardware debug registers
From: David Gibson @ 2009-06-17 4:14 UTC (permalink / raw)
To: K.Prasad
Cc: Michael Neuling, Benjamin Herrenschmidt, linuxppc-dev, paulus,
Alan Stern, Roland McGrath
In-Reply-To: <20090610090818.GE14478@in.ibm.com>
On Wed, Jun 10, 2009 at 02:38:18PM +0530, K.Prasad wrote:
> Modify process handling code to recognise hardware debug registers during copy
> and flush operations. Introduce a new TIF_DEBUG task flag to indicate a
> process's use of debug register. Load the debug register values into a
> new CPU during initialisation.
>
> Signed-off-by: K.Prasad <prasad@linux.vnet.ibm.com>
> ---
> arch/powerpc/kernel/process.c | 15 +++++++++++++++
> arch/powerpc/kernel/smp.c | 2 ++
> 2 files changed, 17 insertions(+)
>
> Index: linux-2.6-tip.hbkpt/arch/powerpc/kernel/process.c
> ===================================================================
> --- linux-2.6-tip.hbkpt.orig/arch/powerpc/kernel/process.c
> +++ linux-2.6-tip.hbkpt/arch/powerpc/kernel/process.c
> @@ -50,6 +50,7 @@
> #include <asm/syscalls.h>
> #ifdef CONFIG_PPC64
> #include <asm/firmware.h>
> +#include <asm/hw_breakpoint.h>
> #endif
> #include <linux/kprobes.h>
> #include <linux/kdebug.h>
> @@ -254,8 +255,10 @@ void do_dabr(struct pt_regs *regs, unsig
> 11, SIGSEGV) == NOTIFY_STOP)
> return;
>
> +#ifndef CONFIG_PPC64
> if (debugger_dabr_match(regs))
> return;
> +#endif
Won't this disable the check for breakpoints set by xmon - but I don't
see anything in this patch series to convert xmon to use the new
breakpoint interface instead.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply
* Re: [Patch 5/6] Modify Data storage exception code to recognise DABR match first
From: David Gibson @ 2009-06-17 4:13 UTC (permalink / raw)
To: K.Prasad
Cc: Michael Neuling, Benjamin Herrenschmidt, linuxppc-dev, paulus,
Alan Stern, Roland McGrath
In-Reply-To: <20090610090824.GF14478@in.ibm.com>
On Wed, Jun 10, 2009 at 02:38:24PM +0530, K.Prasad wrote:
> Modify Data storage exception code to first lookout for a DABR match before
> recognising a kprobe or xmon exception.
>
> Signed-off-by: K.Prasad <prasad@linux.vnet.ibm.com>
> ---
> arch/powerpc/mm/fault.c | 14 ++++++--------
> 1 file changed, 6 insertions(+), 8 deletions(-)
>
> Index: linux-2.6-tip.hbkpt/arch/powerpc/mm/fault.c
> ===================================================================
> --- linux-2.6-tip.hbkpt.orig/arch/powerpc/mm/fault.c
> +++ linux-2.6-tip.hbkpt/arch/powerpc/mm/fault.c
> @@ -136,6 +136,12 @@ int __kprobes do_page_fault(struct pt_re
> error_code &= 0x48200000;
> else
> is_write = error_code & DSISR_ISSTORE;
> +
> + if (error_code & DSISR_DABRMATCH) {
> + /* DABR match */
> + do_dabr(regs, address, error_code);
> + return 0;
> + }
Again, given the amount of work you're doing on all the breakpoint
paths, I really think you should be rewriting do_dabr(), not just
hooking in around it.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply
* Re: [Patch 2/6] Introduce PPC64 specific Hardware Breakpoint interfaces
From: David Gibson @ 2009-06-17 4:32 UTC (permalink / raw)
To: K.Prasad
Cc: Michael Neuling, Benjamin Herrenschmidt, linuxppc-dev, paulus,
Alan Stern, Roland McGrath
In-Reply-To: <20090610090806.GC14478@in.ibm.com>
On Wed, Jun 10, 2009 at 02:38:06PM +0530, K.Prasad wrote:
> Introduce PPC64 implementation for the generic hardware breakpoint interfaces
> defined in kernel/hw_breakpoint.c. Enable the HAVE_HW_BREAKPOINT flag and the
> Makefile.
[snip]
> +void arch_update_kernel_hw_breakpoint(void *unused)
> +{
> + struct hw_breakpoint *bp;
> +
> + /* Check if there is nothing to update */
> + if (hbp_kernel_pos == HBP_NUM)
> + return;
> +
> + per_cpu(this_hbp_kernel[hbp_kernel_pos], get_cpu()) = bp =
> + hbp_kernel[hbp_kernel_pos];
> + if (bp == NULL)
> + kdabr = 0;
> + else
> + kdabr = (bp->info.address & ~HW_BREAKPOINT_ALIGN) |
> + bp->info.type | DABR_TRANSLATION;
> + set_dabr(kdabr);
> + put_cpu_no_resched();
> +}
> +
> +/*
> + * Install the thread breakpoints in their debug registers.
> + */
> +void arch_install_thread_hw_breakpoint(struct task_struct *tsk)
> +{
> + set_dabr(tsk->thread.dabr);
> +}
> +
> +/*
> + * Clear the DABR which contains the thread-specific breakpoint address
> + */
> +void arch_uninstall_thread_hw_breakpoint()
> +{
> + set_dabr(0);
> +}
> +
> +/*
> + * Store a breakpoint's encoded address, length, and type.
> + */
> +int arch_store_info(struct hw_breakpoint *bp, struct task_struct *tsk)
> +{
> + /* Symbol names from user-space are rejected */
> + if (tsk) {
> + if (bp->info.name)
> + return -EINVAL;
> + else
> + return 0;
> + }
> + /*
> + * User-space requests will always have the address field populated
> + * For kernel-addresses, either the address or symbol name can be
> + * specified.
> + */
> + if (bp->info.name)
> + bp->info.address = (unsigned long)
> + kallsyms_lookup_name(bp->info.name);
> + if (bp->info.address)
> + if (kallsyms_lookup_size_offset(bp->info.address,
> + &(bp->info.symbolsize), NULL))
> + return 0;
> + return -EINVAL;
> +}
> +
> +/*
> + * Validate the arch-specific HW Breakpoint register settings
> + */
> +int arch_validate_hwbkpt_settings(struct hw_breakpoint *bp,
> + struct task_struct *tsk)
> +{
> + int is_kernel, ret = -EINVAL;
> +
> + if (!bp)
> + return ret;
> +
> + switch (bp->info.type) {
> + case HW_BREAKPOINT_READ:
> + case HW_BREAKPOINT_WRITE:
> + case HW_BREAKPOINT_RW:
> + break;
> + default:
> + return ret;
> + }
> +
> + if (bp->triggered)
> + ret = arch_store_info(bp, tsk);
Under what circumstances would triggered be NULL? It's not clear to
me that you wouldn't still need arch_store_info() in this case.
> +
> + is_kernel = is_kernel_addr(bp->info.address);
> + if ((tsk && is_kernel) || (!tsk && !is_kernel))
> + return -EINVAL;
> +
> + return ret;
> +}
> +
> +void arch_update_user_hw_breakpoint(int pos, struct task_struct *tsk)
> +{
> + struct thread_struct *thread = &(tsk->thread);
> + struct hw_breakpoint *bp = thread->hbp[0];
> +
> + if (bp)
> + thread->dabr = (bp->info.address & ~HW_BREAKPOINT_ALIGN) |
> + bp->info.type | DABR_TRANSLATION;
> + else
> + thread->dabr = 0;
> +}
> +
> +void arch_flush_thread_hw_breakpoint(struct task_struct *tsk)
> +{
> + struct thread_struct *thread = &(tsk->thread);
> +
> + thread->dabr = 0;
> +}
> +
> +/*
> + * Handle debug exception notifications.
> + */
> +int __kprobes hw_breakpoint_handler(struct die_args *args)
> +{
> + int rc = NOTIFY_STOP;
> + struct hw_breakpoint *bp;
> + struct pt_regs *regs = args->regs;
> + unsigned long dar = regs->dar;
> + int cpu, is_one_shot, stepped = 1;
> +
> + /* Disable breakpoints during exception handling */
> + set_dabr(0);
> +
> + cpu = get_cpu();
> + /* Determine whether kernel- or user-space address is the trigger */
> + bp = (hbp_kernel_pos == HBP_NUM) ? current->thread.hbp[0] :
> + per_cpu(this_hbp_kernel[0], cpu);
> + /*
> + * bp can be NULL due to lazy debug register switching
> + * or due to the delay between updates of hbp_kernel_pos
> + * and this_hbp_kernel.
> + */
> + if (!bp)
> + goto out;
> +
> + is_one_shot = (bp->triggered == ptrace_triggered) ? 1 : 0;
> + per_cpu(dabr_data, cpu) = (hbp_kernel_pos == HBP_NUM) ?
> + current->thread.dabr : kdabr;
> +
> + /* Verify if dar lies within the address range occupied by the symbol
> + * being watched. Since we cannot get the symbol size for
> + * user-space requests we skip this check in that case
> + */
> + if ((hbp_kernel_pos == 0) &&
> + !((bp->info.address <= dar) &&
> + (dar <= (bp->info.address + bp->info.symbolsize))))
> + /*
> + * This exception is triggered not because of a memory access on
> + * the monitored variable but in the double-word address range
> + * in which it is contained. We will consume this exception,
> + * considering it as 'noise'.
> + */
> + goto out;
> +
> + (bp->triggered)(bp, regs);
So this confuses me. You go to great efforts to step over the
instruction to generate a SIGTRAP after the instruction, for
consistency with x86. But that SIGTRAP is *never* used, since the
only way to set userspace breakpoints is through ptrace at the moment.
At the same time, the triggered function is called here before the
instruction is executed, so not consistent with x86 anyway.
It just seems strange to me that sending a SIGTRAP is a special case
anyway. Why can't sending a SIGTRAP be just a particular triggered
function.
> + /*
> + * Ptrace expects the HW Breakpoints to be one-shot. We will return
> + * NOTIFY_DONE without restoring DABR with the breakpoint address. The
> + * downstream code will generate SIGTRAP to the process
> + */
> + if (is_one_shot) {
> + rc = NOTIFY_DONE;
> + goto out;
> + }
> +
> + stepped = emulate_step(regs, regs->nip);
> + /*
> + * Single-step the causative instruction manually if
> + * emulate_step() could not execute it
> + */
> + if (stepped == 0) {
> + regs->msr |= MSR_SE;
> + goto out;
> + }
> + set_dabr(per_cpu(dabr_data, cpu));
> +
> +out:
> + /* Enable pre-emption only if single-stepping is finished */
> + if (stepped) {
> + per_cpu(dabr_data, cpu) = 0;
> + put_cpu_no_resched();
> + }
> + return rc;
> +}
> +
> +/*
> + * Handle single-step exceptions following a DABR hit.
> + */
> +int __kprobes single_step_dabr_instruction(struct die_args *args)
> +{
> + struct pt_regs *regs = args->regs;
> + int cpu = get_cpu();
> + int ret = NOTIFY_DONE;
> + siginfo_t info;
> + unsigned long this_dabr_data = per_cpu(dabr_data, cpu);
> +
> + /*
> + * Check if we are single-stepping as a result of a
> + * previous HW Breakpoint exception
> + */
> + if (this_dabr_data == 0)
> + goto out;
> +
> + regs->msr &= ~MSR_SE;
> + /* Deliver signal to user-space */
> + if (this_dabr_data < TASK_SIZE) {
> + info.si_signo = SIGTRAP;
> + info.si_errno = 0;
> + info.si_code = TRAP_HWBKPT;
> + info.si_addr = (void __user *)(per_cpu(dabr_data, cpu));
> + force_sig_info(SIGTRAP, &info, current);
> + }
> +
> + set_dabr(this_dabr_data);
> + per_cpu(dabr_data, cpu) = 0;
> + ret = NOTIFY_STOP;
> + /*
> + * If single-stepped after hw_breakpoint_handler(), pre-emption is
> + * already disabled.
> + */
> + put_cpu_no_resched();
> +
> +out:
> + /*
> + * A put_cpu_no_resched() call is required to complement the get_cpu()
> + * call used initially
> + */
> + put_cpu_no_resched();
> + return ret;
> +}
> +
> +/*
> + * Handle debug exception notifications.
> + */
> +int __kprobes hw_breakpoint_exceptions_notify(
> + struct notifier_block *unused, unsigned long val, void *data)
> +{
> + int ret = NOTIFY_DONE;
> +
> + switch (val) {
> + case DIE_DABR_MATCH:
> + ret = hw_breakpoint_handler(data);
> + break;
> + case DIE_SSTEP:
> + ret = single_step_dabr_instruction(data);
> + break;
> + }
> +
> + return ret;
> +}
> Index: linux-2.6-tip.hbkpt/arch/powerpc/kernel/ptrace.c
> ===================================================================
> --- linux-2.6-tip.hbkpt.orig/arch/powerpc/kernel/ptrace.c
> +++ linux-2.6-tip.hbkpt/arch/powerpc/kernel/ptrace.c
> @@ -735,6 +735,10 @@ void user_disable_single_step(struct tas
> clear_tsk_thread_flag(task, TIF_SINGLESTEP);
> }
>
> +void ptrace_triggered(struct hw_breakpoint *bp, struct pt_regs *regs)
> +{
> +}
> +
> int ptrace_set_debugreg(struct task_struct *task, unsigned long addr,
> unsigned long data)
> {
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply
* linux-next: kvm/powerpc tree build failure
From: Stephen Rothwell @ 2009-06-17 5:04 UTC (permalink / raw)
To: Avi Kivity, Benjamin Herrenschmidt; +Cc: linuxppc-dev, linux-next, linux-kernel
Hi Avi, Ben,
Today's linux-next build (powerpc ppc44x_defconfig) failed like this:
cc1: warnings being treated as errors
arch/powerpc/kvm/../../../virt/kvm/kvm_main.c: In function '__kvm_set_memory_region':
arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:1178: error: integer overflow in expression
Probably caused by commit ac04527f7947020c5890090b2ac87af4e98d977e ("KVM:
Disable large pages on misaligned memory slots"). The build fails because
arch/powerpc is now being built (mostly) with -Werror.
arch/powerpc/include/asm/kvm_host.h:#define KVM_PAGES_PER_HPAGE (1<<31)
this needs to be (1UL << 31) or ((unsigned int)1 << 31).
I applied the following patch for today.
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Wed, 17 Jun 2009 14:57:29 +1000
Subject: [PATCH] kvm/powerpc: make 32 bit constant unsigned long
KVM_PAGES_PER_HPAGE needs to be unsigned long since its value is 2^31.
Eliminates this compiler warning:
arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:1178: error: integer overflow in expression
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/include/asm/kvm_host.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h
index 3625424..d4caa61 100644
--- a/arch/powerpc/include/asm/kvm_host.h
+++ b/arch/powerpc/include/asm/kvm_host.h
@@ -34,7 +34,7 @@
#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
/* We don't currently support large pages. */
-#define KVM_PAGES_PER_HPAGE (1<<31)
+#define KVM_PAGES_PER_HPAGE (1UL << 31)
struct kvm;
struct kvm_run;
--
1.6.3.1
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
^ permalink raw reply related
* Re: Warning in block code
From: Jens Axboe @ 2009-06-17 4:36 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list
In-Reply-To: <1245202783.21602.5.camel@pasglop>
On Wed, Jun 17 2009, Benjamin Herrenschmidt wrote:
> Hoy !
>
> I see that:
>
> block/blk-settings.c: In function ???blk_set_default_limits???:
> block/blk-settings.c:115: warning: large integer implicitly truncated to unsigned type
>
> Comes from
>
> lim->bounce_pfn = BLK_BOUNCE_ANY;
>
> With BLK_BOUNCE_ANY being a
>
> include/linux/blkdev.h:#define BLK_BOUNCE_ANY (-1ULL)
>
> And struct queue_limit.bounce_pfn is:
>
> unsigned long bounce_pfn;
>
> (The warning is fishy as both quantities are unsigned, but there -is-
> truncation happening here).
Should be safe to just make it -1UL now.
--
Jens Axboe
^ permalink raw reply
* Re: mm: Move pgtable_cache_init() earlier
From: Pekka Enberg @ 2009-06-17 4:16 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: linuxppc-dev list, linux-mm, Linus Torvalds, David S. Miller,
Chris Zankel
In-Reply-To: <1245210519.21602.16.camel@pasglop>
Hi Ben,
On Wed, Jun 17, 2009 at 6:48 AM, Benjamin
Herrenschmidt<benh@kernel.crashing.org> wrote:
> Some architectures need to initialize SLAB caches to be able
> to allocate page tables. They do that from pgtable_cache_init()
> so the later should be called earlier now, best is before
> vmalloc_init().
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Looks good to me!
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
^ permalink raw reply
* mm: Move pgtable_cache_init() earlier
From: Benjamin Herrenschmidt @ 2009-06-17 3:48 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linuxppc-dev list, linux-mm, David S. Miller, Chris Zankel
Some architectures need to initialize SLAB caches to be able
to allocate page tables. They do that from pgtable_cache_init()
so the later should be called earlier now, best is before
vmalloc_init().
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
Note: Only powerpc, sparc and xtensa use this and only to
call kmem_cache_create() so with a bit of luck it should
just work...
Index: linux-work/init/main.c
===================================================================
--- linux-work.orig/init/main.c 2009-06-17 13:41:33.000000000 +1000
+++ linux-work/init/main.c 2009-06-17 13:41:45.000000000 +1000
@@ -546,6 +546,7 @@ static void __init mm_init(void)
page_cgroup_init_flatmem();
mem_init();
kmem_cache_init();
+ pgtable_cache_init();
vmalloc_init();
}
@@ -684,7 +685,6 @@ asmlinkage void __init start_kernel(void
late_time_init();
calibrate_delay();
pidmap_init();
- pgtable_cache_init();
anon_vma_init();
#ifdef CONFIG_X86
if (efi_enabled)
^ permalink raw reply
* [PATCH 3/3] powerpc/pasemi: Use raw spinlock in SMP TB sync
From: Benjamin Herrenschmidt @ 2009-06-17 2:42 UTC (permalink / raw)
To: linuxppc-dev
spin_lock() can hang if called while the timebase is frozen,
so use a raw lock instead, also disable interrupts while
at it.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/platforms/pasemi/setup.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
--- linux-work.orig/arch/powerpc/platforms/pasemi/setup.c 2009-06-17 12:13:33.000000000 +1000
+++ linux-work/arch/powerpc/platforms/pasemi/setup.c 2009-06-17 12:15:01.000000000 +1000
@@ -71,20 +71,25 @@ static void pas_restart(char *cmd)
}
#ifdef CONFIG_SMP
-static DEFINE_SPINLOCK(timebase_lock);
+static raw_spinlock_t timebase_lock;
static unsigned long timebase;
static void __devinit pas_give_timebase(void)
{
- spin_lock(&timebase_lock);
+ unsigned long flags;
+
+ local_irq_save(flags);
+ hard_irq_disable();
+ __raw_spin_lock(&timebase_lock);
mtspr(SPRN_TBCTL, TBCTL_FREEZE);
isync();
timebase = get_tb();
- spin_unlock(&timebase_lock);
+ __raw_spin_unlock(&timebase_lock);
while (timebase)
barrier();
mtspr(SPRN_TBCTL, TBCTL_RESTART);
+ local_irq_restore(flags);
}
static void __devinit pas_take_timebase(void)
@@ -92,10 +97,10 @@ static void __devinit pas_take_timebase(
while (!timebase)
smp_rmb();
- spin_lock(&timebase_lock);
+ __raw_spin_lock(&timebase_lock);
set_tb(timebase >> 32, timebase & 0xffffffff);
timebase = 0;
- spin_unlock(&timebase_lock);
+ __raw_spin_unlock(&timebase_lock);
}
struct smp_ops_t pas_smp_ops = {
^ permalink raw reply
* [PATCH 2/3] powerpc: Use one common impl. of RTAS timebase sync and use raw spinlock
From: Benjamin Herrenschmidt @ 2009-06-17 2:42 UTC (permalink / raw)
To: linuxppc-dev
Several platforms use their own copy of what is essentially the same code,
using RTAS to synchronize the timebases when bringing up new CPUs. This
moves it all into a single common implementation and additionally
turns the spinlock into a raw spinlock since the former can rely on
the timebase not being frozen when spinlock debugging is enabled, and finally
masks interrupts while the timebase is disabled.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/include/asm/rtas.h | 3 +++
arch/powerpc/kernel/rtas.c | 31 +++++++++++++++++++++++++++++++
arch/powerpc/platforms/cell/smp.c | 30 ++----------------------------
arch/powerpc/platforms/chrp/smp.c | 30 ++----------------------------
arch/powerpc/platforms/pseries/smp.c | 30 ++----------------------------
5 files changed, 40 insertions(+), 84 deletions(-)
--- linux-work.orig/arch/powerpc/platforms/cell/smp.c 2009-06-17 11:56:31.000000000 +1000
+++ linux-work/arch/powerpc/platforms/cell/smp.c 2009-06-17 11:56:42.000000000 +1000
@@ -36,7 +36,6 @@
#include <asm/prom.h>
#include <asm/smp.h>
#include <asm/paca.h>
-#include <asm/time.h>
#include <asm/machdep.h>
#include <asm/cputable.h>
#include <asm/firmware.h>
@@ -140,31 +139,6 @@ static void __devinit smp_cell_setup_cpu
mtspr(SPRN_DABRX, DABRX_KERNEL | DABRX_USER);
}
-static DEFINE_SPINLOCK(timebase_lock);
-static unsigned long timebase = 0;
-
-static void __devinit cell_give_timebase(void)
-{
- spin_lock(&timebase_lock);
- rtas_call(rtas_token("freeze-time-base"), 0, 1, NULL);
- timebase = get_tb();
- spin_unlock(&timebase_lock);
-
- while (timebase)
- barrier();
- rtas_call(rtas_token("thaw-time-base"), 0, 1, NULL);
-}
-
-static void __devinit cell_take_timebase(void)
-{
- while (!timebase)
- barrier();
- spin_lock(&timebase_lock);
- set_tb(timebase >> 32, timebase & 0xffffffff);
- timebase = 0;
- spin_unlock(&timebase_lock);
-}
-
static void __devinit smp_cell_kick_cpu(int nr)
{
BUG_ON(nr < 0 || nr >= NR_CPUS);
@@ -224,8 +198,8 @@ void __init smp_init_cell(void)
/* Non-lpar has additional take/give timebase */
if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) {
- smp_ops->give_timebase = cell_give_timebase;
- smp_ops->take_timebase = cell_take_timebase;
+ smp_ops->give_timebase = rtas_give_timebase;
+ smp_ops->take_timebase = rtas_take_timebase;
}
DBG(" <- smp_init_cell()\n");
Index: linux-work/arch/powerpc/platforms/chrp/smp.c
===================================================================
--- linux-work.orig/arch/powerpc/platforms/chrp/smp.c 2009-06-17 11:56:31.000000000 +1000
+++ linux-work/arch/powerpc/platforms/chrp/smp.c 2009-06-17 11:56:42.000000000 +1000
@@ -26,7 +26,6 @@
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/smp.h>
-#include <asm/time.h>
#include <asm/machdep.h>
#include <asm/mpic.h>
#include <asm/rtas.h>
@@ -45,37 +44,12 @@ static void __devinit smp_chrp_setup_cpu
static DEFINE_SPINLOCK(timebase_lock);
static unsigned int timebase_upper = 0, timebase_lower = 0;
-void __devinit smp_chrp_give_timebase(void)
-{
- spin_lock(&timebase_lock);
- rtas_call(rtas_token("freeze-time-base"), 0, 1, NULL);
- timebase_upper = get_tbu();
- timebase_lower = get_tbl();
- spin_unlock(&timebase_lock);
-
- while (timebase_upper || timebase_lower)
- barrier();
- rtas_call(rtas_token("thaw-time-base"), 0, 1, NULL);
-}
-
-void __devinit smp_chrp_take_timebase(void)
-{
- while (!(timebase_upper || timebase_lower))
- barrier();
- spin_lock(&timebase_lock);
- set_tb(timebase_upper, timebase_lower);
- timebase_upper = 0;
- timebase_lower = 0;
- spin_unlock(&timebase_lock);
- printk("CPU %i taken timebase\n", smp_processor_id());
-}
-
/* CHRP with openpic */
struct smp_ops_t chrp_smp_ops = {
.message_pass = smp_mpic_message_pass,
.probe = smp_mpic_probe,
.kick_cpu = smp_chrp_kick_cpu,
.setup_cpu = smp_chrp_setup_cpu,
- .give_timebase = smp_chrp_give_timebase,
- .take_timebase = smp_chrp_take_timebase,
+ .give_timebase = rtas_give_timebase,
+ .take_timebase = rtas_take_timebase,
};
Index: linux-work/arch/powerpc/platforms/pseries/smp.c
===================================================================
--- linux-work.orig/arch/powerpc/platforms/pseries/smp.c 2009-06-17 11:56:31.000000000 +1000
+++ linux-work/arch/powerpc/platforms/pseries/smp.c 2009-06-17 11:56:42.000000000 +1000
@@ -35,7 +35,6 @@
#include <asm/prom.h>
#include <asm/smp.h>
#include <asm/paca.h>
-#include <asm/time.h>
#include <asm/machdep.h>
#include <asm/cputable.h>
#include <asm/firmware.h>
@@ -118,31 +117,6 @@ static void __devinit smp_xics_setup_cpu
}
#endif /* CONFIG_XICS */
-static DEFINE_SPINLOCK(timebase_lock);
-static unsigned long timebase = 0;
-
-static void __devinit pSeries_give_timebase(void)
-{
- spin_lock(&timebase_lock);
- rtas_call(rtas_token("freeze-time-base"), 0, 1, NULL);
- timebase = get_tb();
- spin_unlock(&timebase_lock);
-
- while (timebase)
- barrier();
- rtas_call(rtas_token("thaw-time-base"), 0, 1, NULL);
-}
-
-static void __devinit pSeries_take_timebase(void)
-{
- while (!timebase)
- barrier();
- spin_lock(&timebase_lock);
- set_tb(timebase >> 32, timebase & 0xffffffff);
- timebase = 0;
- spin_unlock(&timebase_lock);
-}
-
static void __devinit smp_pSeries_kick_cpu(int nr)
{
BUG_ON(nr < 0 || nr >= NR_CPUS);
@@ -209,8 +183,8 @@ static void __init smp_init_pseries(void
/* Non-lpar has additional take/give timebase */
if (rtas_token("freeze-time-base") != RTAS_UNKNOWN_SERVICE) {
- smp_ops->give_timebase = pSeries_give_timebase;
- smp_ops->take_timebase = pSeries_take_timebase;
+ smp_ops->give_timebase = rtas_give_timebase;
+ smp_ops->take_timebase = rtas_take_timebase;
}
pr_debug(" <- smp_init_pSeries()\n");
Index: linux-work/arch/powerpc/include/asm/rtas.h
===================================================================
--- linux-work.orig/arch/powerpc/include/asm/rtas.h 2009-06-17 11:56:31.000000000 +1000
+++ linux-work/arch/powerpc/include/asm/rtas.h 2009-06-17 11:56:42.000000000 +1000
@@ -245,5 +245,8 @@ static inline u32 rtas_config_addr(int b
(devfn << 8) | (reg & 0xff);
}
+extern void __cpuinit rtas_give_timebase(void);
+extern void __cpuinit rtas_take_timebase(void);
+
#endif /* __KERNEL__ */
#endif /* _POWERPC_RTAS_H */
Index: linux-work/arch/powerpc/kernel/rtas.c
===================================================================
--- linux-work.orig/arch/powerpc/kernel/rtas.c 2009-06-17 11:56:31.000000000 +1000
+++ linux-work/arch/powerpc/kernel/rtas.c 2009-06-17 11:59:58.000000000 +1000
@@ -38,6 +38,7 @@
#include <asm/syscalls.h>
#include <asm/smp.h>
#include <asm/atomic.h>
+#include <asm/time.h>
struct rtas_t rtas = {
.lock = __RAW_SPIN_LOCK_UNLOCKED
@@ -971,3 +972,33 @@ int __init early_init_dt_scan_rtas(unsig
/* break now */
return 1;
}
+
+static raw_spinlock_t timebase_lock;
+static u64 timebase = 0;
+
+void __cpuinit rtas_give_timebase(void)
+{
+ unsigned long flags;
+
+ local_irq_save(flags);
+ hard_irq_disable();
+ __raw_spin_lock(&timebase_lock);
+ rtas_call(rtas_token("freeze-time-base"), 0, 1, NULL);
+ timebase = get_tb();
+ __raw_spin_unlock(&timebase_lock);
+
+ while (timebase)
+ barrier();
+ rtas_call(rtas_token("thaw-time-base"), 0, 1, NULL);
+ local_irq_restore(flags);
+}
+
+void __cpuinit rtas_take_timebase(void)
+{
+ while (!timebase)
+ barrier();
+ __raw_spin_lock(&timebase_lock);
+ set_tb(timebase >> 32, timebase & 0xffffffff);
+ timebase = 0;
+ __raw_spin_unlock(&timebase_lock);
+}
^ permalink raw reply
* [PATCH 1/3] powerpc/rtas: Turn rtas lock into a raw spinlock
From: Benjamin Herrenschmidt @ 2009-06-17 2:42 UTC (permalink / raw)
To: linuxppc-dev
RTAS currently uses a normal spinlock. However it can be called from
contexts where this is not necessarily a good idea. For example, it
can be called while syncing timebases, with the core timebase being
frozen. Unfortunately, that will deadlock in case of lock contention
when spinlock debugging is enabled as the spin lock debugging code
will try to use __delay() which ... relies on the timebase being
enabled.
Also RTAS can be used in some low level IRQ handling code path so it
may as well be a raw spinlock for -rt sake.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/include/asm/rtas.h | 2 +-
arch/powerpc/kernel/rtas.c | 38 +++++++++++++++++++++++++++++---------
2 files changed, 30 insertions(+), 10 deletions(-)
--- linux-work.orig/arch/powerpc/include/asm/rtas.h 2009-06-10 16:09:36.000000000 +1000
+++ linux-work/arch/powerpc/include/asm/rtas.h 2009-06-10 16:40:50.000000000 +1000
@@ -58,7 +58,7 @@ struct rtas_t {
unsigned long entry; /* physical address pointer */
unsigned long base; /* physical address pointer */
unsigned long size;
- spinlock_t lock;
+ raw_spinlock_t lock;
struct rtas_args args;
struct device_node *dev; /* virtual address pointer */
};
Index: linux-work/arch/powerpc/kernel/rtas.c
===================================================================
--- linux-work.orig/arch/powerpc/kernel/rtas.c 2009-06-10 16:09:36.000000000 +1000
+++ linux-work/arch/powerpc/kernel/rtas.c 2009-06-10 16:40:50.000000000 +1000
@@ -40,7 +40,7 @@
#include <asm/atomic.h>
struct rtas_t rtas = {
- .lock = SPIN_LOCK_UNLOCKED
+ .lock = __RAW_SPIN_LOCK_UNLOCKED
};
EXPORT_SYMBOL(rtas);
@@ -67,6 +67,28 @@ unsigned long rtas_rmo_buf;
void (*rtas_flash_term_hook)(int);
EXPORT_SYMBOL(rtas_flash_term_hook);
+/* RTAS use home made raw locking instead of spin_lock_irqsave
+ * because those can be called from within really nasty contexts
+ * such as having the timebase stopped which would lockup with
+ * normal locks and spinlock debugging enabled
+ */
+static unsigned long lock_rtas(void)
+{
+ unsigned long flags;
+
+ local_irq_save(flags);
+ preempt_disable();
+ __raw_spin_lock_flags(&rtas.lock, flags);
+ return flags;
+}
+
+static void unlock_rtas(unsigned long flags)
+{
+ __raw_spin_unlock(&rtas.lock);
+ local_irq_restore(flags);
+ preempt_enable();
+}
+
/*
* call_rtas_display_status and call_rtas_display_status_delay
* are designed only for very early low-level debugging, which
@@ -79,7 +101,7 @@ static void call_rtas_display_status(cha
if (!rtas.base)
return;
- spin_lock_irqsave(&rtas.lock, s);
+ s = lock_rtas();
args->token = 10;
args->nargs = 1;
@@ -89,7 +111,7 @@ static void call_rtas_display_status(cha
enter_rtas(__pa(args));
- spin_unlock_irqrestore(&rtas.lock, s);
+ unlock_rtas(s);
}
static void call_rtas_display_status_delay(char c)
@@ -411,8 +433,7 @@ int rtas_call(int token, int nargs, int
if (!rtas.entry || token == RTAS_UNKNOWN_SERVICE)
return -1;
- /* Gotta do something different here, use global lock for now... */
- spin_lock_irqsave(&rtas.lock, s);
+ s = lock_rtas();
rtas_args = &rtas.args;
rtas_args->token = token;
@@ -439,8 +460,7 @@ int rtas_call(int token, int nargs, int
outputs[i] = rtas_args->rets[i+1];
ret = (nret > 0)? rtas_args->rets[0]: 0;
- /* Gotta do something different here, use global lock for now... */
- spin_unlock_irqrestore(&rtas.lock, s);
+ unlock_rtas(s);
if (buff_copy) {
log_error(buff_copy, ERR_TYPE_RTAS_LOG, 0);
@@ -837,7 +857,7 @@ asmlinkage int ppc_rtas(struct rtas_args
buff_copy = get_errorlog_buffer();
- spin_lock_irqsave(&rtas.lock, flags);
+ flags = lock_rtas();
rtas.args = args;
enter_rtas(__pa(&rtas.args));
@@ -848,7 +868,7 @@ asmlinkage int ppc_rtas(struct rtas_args
if (args.rets[0] == -1)
errbuf = __fetch_rtas_last_error(buff_copy);
- spin_unlock_irqrestore(&rtas.lock, flags);
+ unlock_rtas(flags);
if (buff_copy) {
if (errbuf)
^ permalink raw reply
* Re: [PATCH] powerpc: Update Warp defconfig
From: Sean MacLennan @ 2009-06-17 2:04 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20090616112435.20f7b3d9@lappy.seanm.ca>
On Tue, 16 Jun 2009 11:24:35 -0400
Sean MacLennan <smaclennan@pikatech.com> wrote:
> I forgot to include the defconfig in the last set of patches. So you
> don't get to use the shiny new LEDS driver on the warp unless you turn
> it on.
>
> Enabling hotplug is also very important since we have moved to udev on
> the warp.
>
> Like most defconfig patches, most of the changes are just the normal
> kernel changes, not warp specific.
>
> If it is too early, and we want to hold off until say rc4 with
> defconfigs I have no problem with that. I have tried to outline all
> the changes we specifically made. If anybody sees any bad choices with
> options, let me know!
>
> Cheers,
> Sean
>
> * Enable GPIO LEDS
> * Enable LED triggers
> * Move to slub
> * Enable hotplug
> * Enable timestamps on printks
> * Enable UBIFS
Oops, missed an important option in the list:
* Enable in kernel config
If you use Pika's development environment (PADS), you need this
enabled. We use the config to enable certain features, mainly udev.
Without this config, we will assume you have an old Pika kernel without
new features.
Cheers,
Sean
^ permalink raw reply
* [PATCH 2/2] powerpc/440: Fix warning early debug code
From: Benjamin Herrenschmidt @ 2009-06-17 1:55 UTC (permalink / raw)
To: linuxppc-dev
The function udbg_44x_as1_flush() has the wrong prototype causing
a warning when enabling 440 early debug.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/kernel/udbg_16550.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-work.orig/arch/powerpc/kernel/udbg_16550.c 2009-06-17 11:52:05.000000000 +1000
+++ linux-work/arch/powerpc/kernel/udbg_16550.c 2009-06-17 11:52:08.000000000 +1000
@@ -219,7 +219,7 @@ void udbg_init_pas_realmode(void)
#ifdef CONFIG_PPC_EARLY_DEBUG_44x
#include <platforms/44x/44x.h>
-static int udbg_44x_as1_flush(void)
+static void udbg_44x_as1_flush(void)
{
if (udbg_comport) {
while ((as1_readb(&udbg_comport->lsr) & LSR_THRE) == 0)
^ permalink raw reply
* [PATCH 1/2] powerpc/of: Fix usage of dev_set_name() in of_device_alloc()
From: Benjamin Herrenschmidt @ 2009-06-17 1:55 UTC (permalink / raw)
To: linuxppc-dev
dev_set_name() takes a format string, so use it properly and avoid
a warning with recent gcc's
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/kernel/of_device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-work.orig/arch/powerpc/kernel/of_device.c 2009-06-17 11:34:54.000000000 +1000
+++ linux-work/arch/powerpc/kernel/of_device.c 2009-06-17 11:35:04.000000000 +1000
@@ -76,7 +76,7 @@ struct of_device *of_device_alloc(struct
dev->dev.archdata.of_node = np;
if (bus_id)
- dev_set_name(&dev->dev, bus_id);
+ dev_set_name(&dev->dev, "%s", bus_id);
else
of_device_make_bus_id(dev);
^ permalink raw reply
* Warning in block code
From: Benjamin Herrenschmidt @ 2009-06-17 1:39 UTC (permalink / raw)
To: Jens Axboe; +Cc: linuxppc-dev list
Hoy !
I see that:
block/blk-settings.c: In function ‘blk_set_default_limits’:
block/blk-settings.c:115: warning: large integer implicitly truncated to unsigned type
Comes from
lim->bounce_pfn = BLK_BOUNCE_ANY;
With BLK_BOUNCE_ANY being a
include/linux/blkdev.h:#define BLK_BOUNCE_ANY (-1ULL)
And struct queue_limit.bounce_pfn is:
unsigned long bounce_pfn;
(The warning is fishy as both quantities are unsigned, but there -is- truncation
happening here).
Cheers,
Ben.
^ 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