Skip to content

Commit 78a3cc3

Browse files
committed
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: arch/powerpc: use printk_ratelimited instead of printk_ratelimit powerpc/rtas-rtc: remove sideeffects of printk_ratelimit powerpc/pseries: remove duplicate SCSI_BNX2_ISCSI in pseries_defconfig powerpc/e500: fix breakage with fsl_rio_mcheck_exception powerpc/p1022ds: fix audio-related properties in the device tree powerpc/85xx: fix NAND_CMD_READID read bytes number
2 parents 4974317 + 7646223 commit 78a3cc3

File tree

10 files changed

+105
-94
lines changed

10 files changed

+105
-94
lines changed

arch/powerpc/boot/dts/p1022ds.dts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,10 @@
209209
wm8776:codec@1a {
210210
compatible = "wlf,wm8776";
211211
reg = <0x1a>;
212-
/* MCLK source is a stand-alone oscillator */
213-
clock-frequency = <12288000>;
212+
/*
213+
* clock-frequency will be set by U-Boot if
214+
* the clock is enabled.
215+
*/
214216
};
215217
};
216218

@@ -280,7 +282,8 @@
280282
codec-handle = <&wm8776>;
281283
fsl,playback-dma = <&dma00>;
282284
fsl,capture-dma = <&dma01>;
283-
fsl,fifo-depth = <16>;
285+
fsl,fifo-depth = <15>;
286+
fsl,ssi-asynchronous;
284287
};
285288

286289
dma@c300 {

arch/powerpc/configs/pseries_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ CONFIG_SCSI_SAS_ATTRS=m
148148
CONFIG_SCSI_CXGB3_ISCSI=m
149149
CONFIG_SCSI_CXGB4_ISCSI=m
150150
CONFIG_SCSI_BNX2_ISCSI=m
151-
CONFIG_SCSI_BNX2_ISCSI=m
152151
CONFIG_BE2ISCSI=m
153152
CONFIG_SCSI_IBMVSCSI=y
154153
CONFIG_SCSI_IBMVFC=m

arch/powerpc/kernel/rtas-rtc.c

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <linux/init.h>
55
#include <linux/rtc.h>
66
#include <linux/delay.h>
7+
#include <linux/ratelimit.h>
78
#include <asm/prom.h>
89
#include <asm/rtas.h>
910
#include <asm/time.h>
@@ -29,9 +30,10 @@ unsigned long __init rtas_get_boot_time(void)
2930
}
3031
} while (wait_time && (get_tb() < max_wait_tb));
3132

32-
if (error != 0 && printk_ratelimit()) {
33-
printk(KERN_WARNING "error: reading the clock failed (%d)\n",
34-
error);
33+
if (error != 0) {
34+
printk_ratelimited(KERN_WARNING
35+
"error: reading the clock failed (%d)\n",
36+
error);
3537
return 0;
3638
}
3739

@@ -55,19 +57,21 @@ void rtas_get_rtc_time(struct rtc_time *rtc_tm)
5557

5658
wait_time = rtas_busy_delay_time(error);
5759
if (wait_time) {
58-
if (in_interrupt() && printk_ratelimit()) {
60+
if (in_interrupt()) {
5961
memset(rtc_tm, 0, sizeof(struct rtc_time));
60-
printk(KERN_WARNING "error: reading clock"
61-
" would delay interrupt\n");
62+
printk_ratelimited(KERN_WARNING
63+
"error: reading clock "
64+
"would delay interrupt\n");
6265
return; /* delay not allowed */
6366
}
6467
msleep(wait_time);
6568
}
6669
} while (wait_time && (get_tb() < max_wait_tb));
6770

68-
if (error != 0 && printk_ratelimit()) {
69-
printk(KERN_WARNING "error: reading the clock failed (%d)\n",
70-
error);
71+
if (error != 0) {
72+
printk_ratelimited(KERN_WARNING
73+
"error: reading the clock failed (%d)\n",
74+
error);
7175
return;
7276
}
7377

@@ -99,9 +103,10 @@ int rtas_set_rtc_time(struct rtc_time *tm)
99103
}
100104
} while (wait_time && (get_tb() < max_wait_tb));
101105

102-
if (error != 0 && printk_ratelimit())
103-
printk(KERN_WARNING "error: setting the clock failed (%d)\n",
104-
error);
106+
if (error != 0)
107+
printk_ratelimited(KERN_WARNING
108+
"error: setting the clock failed (%d)\n",
109+
error);
105110

106111
return 0;
107112
}

arch/powerpc/kernel/signal_32.c

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/errno.h>
2626
#include <linux/elf.h>
2727
#include <linux/ptrace.h>
28+
#include <linux/ratelimit.h>
2829
#ifdef CONFIG_PPC64
2930
#include <linux/syscalls.h>
3031
#include <linux/compat.h>
@@ -892,11 +893,12 @@ int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka,
892893
printk("badframe in handle_rt_signal, regs=%p frame=%p newsp=%lx\n",
893894
regs, frame, newsp);
894895
#endif
895-
if (show_unhandled_signals && printk_ratelimit())
896-
printk(KERN_INFO "%s[%d]: bad frame in handle_rt_signal32: "
897-
"%p nip %08lx lr %08lx\n",
898-
current->comm, current->pid,
899-
addr, regs->nip, regs->link);
896+
if (show_unhandled_signals)
897+
printk_ratelimited(KERN_INFO
898+
"%s[%d]: bad frame in handle_rt_signal32: "
899+
"%p nip %08lx lr %08lx\n",
900+
current->comm, current->pid,
901+
addr, regs->nip, regs->link);
900902

901903
force_sigsegv(sig, current);
902904
return 0;
@@ -1058,11 +1060,12 @@ long sys_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
10581060
return 0;
10591061

10601062
bad:
1061-
if (show_unhandled_signals && printk_ratelimit())
1062-
printk(KERN_INFO "%s[%d]: bad frame in sys_rt_sigreturn: "
1063-
"%p nip %08lx lr %08lx\n",
1064-
current->comm, current->pid,
1065-
rt_sf, regs->nip, regs->link);
1063+
if (show_unhandled_signals)
1064+
printk_ratelimited(KERN_INFO
1065+
"%s[%d]: bad frame in sys_rt_sigreturn: "
1066+
"%p nip %08lx lr %08lx\n",
1067+
current->comm, current->pid,
1068+
rt_sf, regs->nip, regs->link);
10661069

10671070
force_sig(SIGSEGV, current);
10681071
return 0;
@@ -1149,12 +1152,12 @@ int sys_debug_setcontext(struct ucontext __user *ctx,
11491152
* We kill the task with a SIGSEGV in this situation.
11501153
*/
11511154
if (do_setcontext(ctx, regs, 1)) {
1152-
if (show_unhandled_signals && printk_ratelimit())
1153-
printk(KERN_INFO "%s[%d]: bad frame in "
1154-
"sys_debug_setcontext: %p nip %08lx "
1155-
"lr %08lx\n",
1156-
current->comm, current->pid,
1157-
ctx, regs->nip, regs->link);
1155+
if (show_unhandled_signals)
1156+
printk_ratelimited(KERN_INFO "%s[%d]: bad frame in "
1157+
"sys_debug_setcontext: %p nip %08lx "
1158+
"lr %08lx\n",
1159+
current->comm, current->pid,
1160+
ctx, regs->nip, regs->link);
11581161

11591162
force_sig(SIGSEGV, current);
11601163
goto out;
@@ -1236,11 +1239,12 @@ int handle_signal32(unsigned long sig, struct k_sigaction *ka,
12361239
printk("badframe in handle_signal, regs=%p frame=%p newsp=%lx\n",
12371240
regs, frame, newsp);
12381241
#endif
1239-
if (show_unhandled_signals && printk_ratelimit())
1240-
printk(KERN_INFO "%s[%d]: bad frame in handle_signal32: "
1241-
"%p nip %08lx lr %08lx\n",
1242-
current->comm, current->pid,
1243-
frame, regs->nip, regs->link);
1242+
if (show_unhandled_signals)
1243+
printk_ratelimited(KERN_INFO
1244+
"%s[%d]: bad frame in handle_signal32: "
1245+
"%p nip %08lx lr %08lx\n",
1246+
current->comm, current->pid,
1247+
frame, regs->nip, regs->link);
12441248

12451249
force_sigsegv(sig, current);
12461250
return 0;
@@ -1288,11 +1292,12 @@ long sys_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
12881292
return 0;
12891293

12901294
badframe:
1291-
if (show_unhandled_signals && printk_ratelimit())
1292-
printk(KERN_INFO "%s[%d]: bad frame in sys_sigreturn: "
1293-
"%p nip %08lx lr %08lx\n",
1294-
current->comm, current->pid,
1295-
addr, regs->nip, regs->link);
1295+
if (show_unhandled_signals)
1296+
printk_ratelimited(KERN_INFO
1297+
"%s[%d]: bad frame in sys_sigreturn: "
1298+
"%p nip %08lx lr %08lx\n",
1299+
current->comm, current->pid,
1300+
addr, regs->nip, regs->link);
12961301

12971302
force_sig(SIGSEGV, current);
12981303
return 0;

arch/powerpc/kernel/signal_64.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <linux/elf.h>
2525
#include <linux/ptrace.h>
2626
#include <linux/module.h>
27+
#include <linux/ratelimit.h>
2728

2829
#include <asm/sigcontext.h>
2930
#include <asm/ucontext.h>
@@ -380,10 +381,10 @@ int sys_rt_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
380381
printk("badframe in sys_rt_sigreturn, regs=%p uc=%p &uc->uc_mcontext=%p\n",
381382
regs, uc, &uc->uc_mcontext);
382383
#endif
383-
if (show_unhandled_signals && printk_ratelimit())
384-
printk(regs->msr & MSR_64BIT ? fmt64 : fmt32,
385-
current->comm, current->pid, "rt_sigreturn",
386-
(long)uc, regs->nip, regs->link);
384+
if (show_unhandled_signals)
385+
printk_ratelimited(regs->msr & MSR_64BIT ? fmt64 : fmt32,
386+
current->comm, current->pid, "rt_sigreturn",
387+
(long)uc, regs->nip, regs->link);
387388

388389
force_sig(SIGSEGV, current);
389390
return 0;
@@ -468,10 +469,10 @@ int handle_rt_signal64(int signr, struct k_sigaction *ka, siginfo_t *info,
468469
printk("badframe in setup_rt_frame, regs=%p frame=%p newsp=%lx\n",
469470
regs, frame, newsp);
470471
#endif
471-
if (show_unhandled_signals && printk_ratelimit())
472-
printk(regs->msr & MSR_64BIT ? fmt64 : fmt32,
473-
current->comm, current->pid, "setup_rt_frame",
474-
(long)frame, regs->nip, regs->link);
472+
if (show_unhandled_signals)
473+
printk_ratelimited(regs->msr & MSR_64BIT ? fmt64 : fmt32,
474+
current->comm, current->pid, "setup_rt_frame",
475+
(long)frame, regs->nip, regs->link);
475476

476477
force_sigsegv(signr, current);
477478
return 0;

arch/powerpc/kernel/traps.c

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <linux/bug.h>
3535
#include <linux/kdebug.h>
3636
#include <linux/debugfs.h>
37+
#include <linux/ratelimit.h>
3738

3839
#include <asm/emulated_ops.h>
3940
#include <asm/pgtable.h>
@@ -197,12 +198,11 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
197198
if (die("Exception in kernel mode", regs, signr))
198199
return;
199200
} else if (show_unhandled_signals &&
200-
unhandled_signal(current, signr) &&
201-
printk_ratelimit()) {
202-
printk(regs->msr & MSR_64BIT ? fmt64 : fmt32,
203-
current->comm, current->pid, signr,
204-
addr, regs->nip, regs->link, code);
205-
}
201+
unhandled_signal(current, signr)) {
202+
printk_ratelimited(regs->msr & MSR_64BIT ? fmt64 : fmt32,
203+
current->comm, current->pid, signr,
204+
addr, regs->nip, regs->link, code);
205+
}
206206

207207
memset(&info, 0, sizeof(info));
208208
info.si_signo = signr;
@@ -425,7 +425,7 @@ int machine_check_e500mc(struct pt_regs *regs)
425425
unsigned long reason = mcsr;
426426
int recoverable = 1;
427427

428-
if (reason & MCSR_BUS_RBERR) {
428+
if (reason & MCSR_LD) {
429429
recoverable = fsl_rio_mcheck_exception(regs);
430430
if (recoverable == 1)
431431
goto silent_out;
@@ -1342,9 +1342,8 @@ void altivec_assist_exception(struct pt_regs *regs)
13421342
} else {
13431343
/* didn't recognize the instruction */
13441344
/* XXX quick hack for now: set the non-Java bit in the VSCR */
1345-
if (printk_ratelimit())
1346-
printk(KERN_ERR "Unrecognized altivec instruction "
1347-
"in %s at %lx\n", current->comm, regs->nip);
1345+
printk_ratelimited(KERN_ERR "Unrecognized altivec instruction "
1346+
"in %s at %lx\n", current->comm, regs->nip);
13481347
current->thread.vscr.u[3] |= 0x10000;
13491348
}
13501349
}
@@ -1548,9 +1547,8 @@ u32 ppc_warn_emulated;
15481547

15491548
void ppc_warn_emulated_print(const char *type)
15501549
{
1551-
if (printk_ratelimit())
1552-
pr_warning("%s used emulated %s instruction\n", current->comm,
1553-
type);
1550+
pr_warn_ratelimited("%s used emulated %s instruction\n", current->comm,
1551+
type);
15541552
}
15551553

15561554
static int __init ppc_warn_emulated_init(void)

arch/powerpc/mm/fault.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <linux/kdebug.h>
3232
#include <linux/perf_event.h>
3333
#include <linux/magic.h>
34+
#include <linux/ratelimit.h>
3435

3536
#include <asm/firmware.h>
3637
#include <asm/page.h>
@@ -346,11 +347,10 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address,
346347
return 0;
347348
}
348349

349-
if (is_exec && (error_code & DSISR_PROTFAULT)
350-
&& printk_ratelimit())
351-
printk(KERN_CRIT "kernel tried to execute NX-protected"
352-
" page (%lx) - exploit attempt? (uid: %d)\n",
353-
address, current_uid());
350+
if (is_exec && (error_code & DSISR_PROTFAULT))
351+
printk_ratelimited(KERN_CRIT "kernel tried to execute NX-protected"
352+
" page (%lx) - exploit attempt? (uid: %d)\n",
353+
address, current_uid());
354354

355355
return SIGSEGV;
356356

arch/powerpc/sysdev/fsl_rio.c

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -283,23 +283,24 @@ static void __iomem *rio_regs_win;
283283
#ifdef CONFIG_E500
284284
int fsl_rio_mcheck_exception(struct pt_regs *regs)
285285
{
286-
const struct exception_table_entry *entry = NULL;
287-
unsigned long reason = mfspr(SPRN_MCSR);
288-
289-
if (reason & MCSR_BUS_RBERR) {
290-
reason = in_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR));
291-
if (reason & (RIO_LTLEDCSR_IER | RIO_LTLEDCSR_PRT)) {
292-
/* Check if we are prepared to handle this fault */
293-
entry = search_exception_tables(regs->nip);
294-
if (entry) {
295-
pr_debug("RIO: %s - MC Exception handled\n",
296-
__func__);
297-
out_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR),
298-
0);
299-
regs->msr |= MSR_RI;
300-
regs->nip = entry->fixup;
301-
return 1;
302-
}
286+
const struct exception_table_entry *entry;
287+
unsigned long reason;
288+
289+
if (!rio_regs_win)
290+
return 0;
291+
292+
reason = in_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR));
293+
if (reason & (RIO_LTLEDCSR_IER | RIO_LTLEDCSR_PRT)) {
294+
/* Check if we are prepared to handle this fault */
295+
entry = search_exception_tables(regs->nip);
296+
if (entry) {
297+
pr_debug("RIO: %s - MC Exception handled\n",
298+
__func__);
299+
out_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR),
300+
0);
301+
regs->msr |= MSR_RI;
302+
regs->nip = entry->fixup;
303+
return 1;
303304
}
304305
}
305306

arch/powerpc/sysdev/mpic.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <linux/pci.h>
3030
#include <linux/slab.h>
3131
#include <linux/syscore_ops.h>
32+
#include <linux/ratelimit.h>
3233

3334
#include <asm/ptrace.h>
3435
#include <asm/signal.h>
@@ -1648,9 +1649,8 @@ static unsigned int _mpic_get_one_irq(struct mpic *mpic, int reg)
16481649
return NO_IRQ;
16491650
}
16501651
if (unlikely(mpic->protected && test_bit(src, mpic->protected))) {
1651-
if (printk_ratelimit())
1652-
printk(KERN_WARNING "%s: Got protected source %d !\n",
1653-
mpic->name, (int)src);
1652+
printk_ratelimited(KERN_WARNING "%s: Got protected source %d !\n",
1653+
mpic->name, (int)src);
16541654
mpic_eoi(mpic);
16551655
return NO_IRQ;
16561656
}
@@ -1688,9 +1688,8 @@ unsigned int mpic_get_coreint_irq(void)
16881688
return NO_IRQ;
16891689
}
16901690
if (unlikely(mpic->protected && test_bit(src, mpic->protected))) {
1691-
if (printk_ratelimit())
1692-
printk(KERN_WARNING "%s: Got protected source %d !\n",
1693-
mpic->name, (int)src);
1691+
printk_ratelimited(KERN_WARNING "%s: Got protected source %d !\n",
1692+
mpic->name, (int)src);
16941693
return NO_IRQ;
16951694
}
16961695

0 commit comments

Comments
 (0)