* [PATCH] MIPS: Replace printk calls in cpu-bugs64.c with pr_info/pr_cont
@ 2017-02-02 8:56 Joshua Kinard
2017-02-02 10:00 ` James Hogan
0 siblings, 1 reply; 4+ messages in thread
From: Joshua Kinard @ 2017-02-02 8:56 UTC (permalink / raw)
To: Ralf Baechle, Maciej W. Rozycki; +Cc: Linux/MIPS
From: Joshua Kinard <kumba@gentoo.org>
In arch/mips/kernel/cpu-bugs64.c, replace initial printk's in three
bug-checking functions with pr_info and replace several continuation
printk's with pr_info/pr_cont calls to avoid kernel log output like
this:
[ 0.899065] Checking for the daddi bug...
[ 0.899098] no.
This makes the output appear correctly:
[ 0.898643] Checking for the daddi bug... no.
Signed-off-by: Joshua Kinard <kumba@gentoo.org>
---
arch/mips/kernel/cpu-bugs64.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/arch/mips/kernel/cpu-bugs64.c b/arch/mips/kernel/cpu-bugs64.c
index a378e44688f5..d4483551a926 100644
--- a/arch/mips/kernel/cpu-bugs64.c
+++ b/arch/mips/kernel/cpu-bugs64.c
@@ -122,7 +122,7 @@ static inline void check_mult_sh(void)
long v1[8], v2[8], w[8];
int bug, fix, i;
- printk("Checking for the multiply/shift bug... ");
+ pr_info("Checking for the multiply/shift bug... ");
/*
* Testing discovered false negatives for certain code offsets
@@ -148,11 +148,11 @@ static inline void check_mult_sh(void)
bug = 1;
if (bug == 0) {
- printk("no.\n");
+ pr_cont("no.\n");
return;
}
- printk("yes, workaround... ");
+ pr_cont("yes, workaround... ");
fix = 1;
for (i = 0; i < 8; i++)
@@ -160,11 +160,11 @@ static inline void check_mult_sh(void)
fix = 0;
if (fix == 1) {
- printk("yes.\n");
+ pr_cont("yes.\n");
return;
}
- printk("no.\n");
+ pr_cont("no.\n");
panic(bug64hit, !R4000_WAR ? r4kwar : nowar);
}
@@ -187,7 +187,7 @@ static inline void check_daddi(void)
void *handler;
long v, tmp;
- printk("Checking for the daddi bug... ");
+ pr_info("Checking for the daddi bug... ");
local_irq_save(flags);
handler = set_except_vector(EXCCODE_OV, handle_daddi_ov);
@@ -218,11 +218,11 @@ static inline void check_daddi(void)
local_irq_restore(flags);
if (daddi_ov) {
- printk("no.\n");
+ pr_cont("no.\n");
return;
}
- printk("yes, workaround... ");
+ pr_cont("yes, workaround... ");
local_irq_save(flags);
handler = set_except_vector(EXCCODE_OV, handle_daddi_ov);
@@ -236,11 +236,11 @@ static inline void check_daddi(void)
local_irq_restore(flags);
if (daddi_ov) {
- printk("yes.\n");
+ pr_cont("yes.\n");
return;
}
- printk("no.\n");
+ pr_cont("no.\n");
panic(bug64hit, !DADDI_WAR ? daddiwar : nowar);
}
@@ -250,7 +250,7 @@ static inline void check_daddiu(void)
{
long v, w, tmp;
- printk("Checking for the daddiu bug... ");
+ pr_info("Checking for the daddiu bug... ");
/*
* The following code leads to a wrong result of daddiu when
@@ -288,11 +288,11 @@ static inline void check_daddiu(void)
daddiu_bug = v != w;
if (!daddiu_bug) {
- printk("no.\n");
+ pr_cont("no.\n");
return;
}
- printk("yes, workaround... ");
+ pr_cont("yes, workaround... ");
asm volatile(
"addiu %2, $0, %3\n\t"
@@ -304,11 +304,11 @@ static inline void check_daddiu(void)
: "I" (0xffffffffffffdb9aUL), "I" (0x1234));
if (v == w) {
- printk("yes.\n");
+ pr_cont("yes.\n");
return;
}
- printk("no.\n");
+ pr_cont("no.\n");
panic(bug64hit, !DADDI_WAR ? daddiwar : nowar);
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] MIPS: Replace printk calls in cpu-bugs64.c with pr_info/pr_cont
2017-02-02 8:56 [PATCH] MIPS: Replace printk calls in cpu-bugs64.c with pr_info/pr_cont Joshua Kinard
@ 2017-02-02 10:00 ` James Hogan
2017-02-02 10:41 ` Joshua Kinard
0 siblings, 1 reply; 4+ messages in thread
From: James Hogan @ 2017-02-02 10:00 UTC (permalink / raw)
To: Joshua Kinard; +Cc: Ralf Baechle, Maciej W. Rozycki, Linux/MIPS
Hi Joshua,
On Thu, Feb 02, 2017 at 03:56:26AM -0500, Joshua Kinard wrote:
> From: Joshua Kinard <kumba@gentoo.org>
>
> In arch/mips/kernel/cpu-bugs64.c, replace initial printk's in three
> bug-checking functions with pr_info and replace several continuation
> printk's with pr_info/pr_cont calls to avoid kernel log output like
> this:
>
> [ 0.899065] Checking for the daddi bug...
> [ 0.899098] no.
>
> This makes the output appear correctly:
>
> [ 0.898643] Checking for the daddi bug... no.
>
> Signed-off-by: Joshua Kinard <kumba@gentoo.org>
A variation of this patch is already applied, but without the change of
printk -> pr_info:
https://patchwork.linux-mips.org/patch/14916/
https://git.linux-mips.org/cgit/ralf/upstream-sfr.git/commit/?id=35e7f7885e1b1b272a73c0de3227fc9a3e95a7e3
Cheers
James
> ---
> arch/mips/kernel/cpu-bugs64.c | 30 +++++++++++++++---------------
> 1 file changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/arch/mips/kernel/cpu-bugs64.c b/arch/mips/kernel/cpu-bugs64.c
> index a378e44688f5..d4483551a926 100644
> --- a/arch/mips/kernel/cpu-bugs64.c
> +++ b/arch/mips/kernel/cpu-bugs64.c
> @@ -122,7 +122,7 @@ static inline void check_mult_sh(void)
> long v1[8], v2[8], w[8];
> int bug, fix, i;
>
> - printk("Checking for the multiply/shift bug... ");
> + pr_info("Checking for the multiply/shift bug... ");
>
> /*
> * Testing discovered false negatives for certain code offsets
> @@ -148,11 +148,11 @@ static inline void check_mult_sh(void)
> bug = 1;
>
> if (bug == 0) {
> - printk("no.\n");
> + pr_cont("no.\n");
> return;
> }
>
> - printk("yes, workaround... ");
> + pr_cont("yes, workaround... ");
>
> fix = 1;
> for (i = 0; i < 8; i++)
> @@ -160,11 +160,11 @@ static inline void check_mult_sh(void)
> fix = 0;
>
> if (fix == 1) {
> - printk("yes.\n");
> + pr_cont("yes.\n");
> return;
> }
>
> - printk("no.\n");
> + pr_cont("no.\n");
> panic(bug64hit, !R4000_WAR ? r4kwar : nowar);
> }
>
> @@ -187,7 +187,7 @@ static inline void check_daddi(void)
> void *handler;
> long v, tmp;
>
> - printk("Checking for the daddi bug... ");
> + pr_info("Checking for the daddi bug... ");
>
> local_irq_save(flags);
> handler = set_except_vector(EXCCODE_OV, handle_daddi_ov);
> @@ -218,11 +218,11 @@ static inline void check_daddi(void)
> local_irq_restore(flags);
>
> if (daddi_ov) {
> - printk("no.\n");
> + pr_cont("no.\n");
> return;
> }
>
> - printk("yes, workaround... ");
> + pr_cont("yes, workaround... ");
>
> local_irq_save(flags);
> handler = set_except_vector(EXCCODE_OV, handle_daddi_ov);
> @@ -236,11 +236,11 @@ static inline void check_daddi(void)
> local_irq_restore(flags);
>
> if (daddi_ov) {
> - printk("yes.\n");
> + pr_cont("yes.\n");
> return;
> }
>
> - printk("no.\n");
> + pr_cont("no.\n");
> panic(bug64hit, !DADDI_WAR ? daddiwar : nowar);
> }
>
> @@ -250,7 +250,7 @@ static inline void check_daddiu(void)
> {
> long v, w, tmp;
>
> - printk("Checking for the daddiu bug... ");
> + pr_info("Checking for the daddiu bug... ");
>
> /*
> * The following code leads to a wrong result of daddiu when
> @@ -288,11 +288,11 @@ static inline void check_daddiu(void)
> daddiu_bug = v != w;
>
> if (!daddiu_bug) {
> - printk("no.\n");
> + pr_cont("no.\n");
> return;
> }
>
> - printk("yes, workaround... ");
> + pr_cont("yes, workaround... ");
>
> asm volatile(
> "addiu %2, $0, %3\n\t"
> @@ -304,11 +304,11 @@ static inline void check_daddiu(void)
> : "I" (0xffffffffffffdb9aUL), "I" (0x1234));
>
> if (v == w) {
> - printk("yes.\n");
> + pr_cont("yes.\n");
> return;
> }
>
> - printk("no.\n");
> + pr_cont("no.\n");
> panic(bug64hit, !DADDI_WAR ? daddiwar : nowar);
> }
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] MIPS: Replace printk calls in cpu-bugs64.c with pr_info/pr_cont
2017-02-02 10:00 ` James Hogan
@ 2017-02-02 10:41 ` Joshua Kinard
2017-02-02 10:48 ` James Hogan
0 siblings, 1 reply; 4+ messages in thread
From: Joshua Kinard @ 2017-02-02 10:41 UTC (permalink / raw)
To: James Hogan; +Cc: Ralf Baechle, Maciej W. Rozycki, Linux/MIPS
On 02/02/2017 05:00, James Hogan wrote:
> Hi Joshua,
>
> On Thu, Feb 02, 2017 at 03:56:26AM -0500, Joshua Kinard wrote:
>> From: Joshua Kinard <kumba@gentoo.org>
>>
>> In arch/mips/kernel/cpu-bugs64.c, replace initial printk's in three
>> bug-checking functions with pr_info and replace several continuation
>> printk's with pr_info/pr_cont calls to avoid kernel log output like
>> this:
>>
>> [ 0.899065] Checking for the daddi bug...
>> [ 0.899098] no.
>>
>> This makes the output appear correctly:
>>
>> [ 0.898643] Checking for the daddi bug... no.
>>
>> Signed-off-by: Joshua Kinard <kumba@gentoo.org>
>
> A variation of this patch is already applied, but without the change of
> printk -> pr_info:
>
> https://patchwork.linux-mips.org/patch/14916/
>
> https://git.linux-mips.org/cgit/ralf/upstream-sfr.git/commit/?id=35e7f7885e1b1b272a73c0de3227fc9a3e95a7e3
Oh, thanks for that. I keep forgetting to go look at the upstream git queue.
I noticed the issue when trying to boot my Onyx2 back up and only checked the
main tree to see if it was fixed.
Shouldn't the printk's have a log level, though? I thought that was the
motivation behind using the various pr_* calls.
--J
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] MIPS: Replace printk calls in cpu-bugs64.c with pr_info/pr_cont
2017-02-02 10:41 ` Joshua Kinard
@ 2017-02-02 10:48 ` James Hogan
0 siblings, 0 replies; 4+ messages in thread
From: James Hogan @ 2017-02-02 10:48 UTC (permalink / raw)
To: Joshua Kinard; +Cc: Ralf Baechle, Maciej W. Rozycki, Linux/MIPS
[-- Attachment #1: Type: text/plain, Size: 1589 bytes --]
On Thu, Feb 02, 2017 at 05:41:48AM -0500, Joshua Kinard wrote:
> On 02/02/2017 05:00, James Hogan wrote:
> > Hi Joshua,
> >
> > On Thu, Feb 02, 2017 at 03:56:26AM -0500, Joshua Kinard wrote:
> >> From: Joshua Kinard <kumba@gentoo.org>
> >>
> >> In arch/mips/kernel/cpu-bugs64.c, replace initial printk's in three
> >> bug-checking functions with pr_info and replace several continuation
> >> printk's with pr_info/pr_cont calls to avoid kernel log output like
> >> this:
> >>
> >> [ 0.899065] Checking for the daddi bug...
> >> [ 0.899098] no.
> >>
> >> This makes the output appear correctly:
> >>
> >> [ 0.898643] Checking for the daddi bug... no.
> >>
> >> Signed-off-by: Joshua Kinard <kumba@gentoo.org>
> >
> > A variation of this patch is already applied, but without the change of
> > printk -> pr_info:
> >
> > https://patchwork.linux-mips.org/patch/14916/
> >
> > https://git.linux-mips.org/cgit/ralf/upstream-sfr.git/commit/?id=35e7f7885e1b1b272a73c0de3227fc9a3e95a7e3
>
> Oh, thanks for that. I keep forgetting to go look at the upstream git queue.
> I noticed the issue when trying to boot my Onyx2 back up and only checked the
> main tree to see if it was fixed.
>
> Shouldn't the printk's have a log level, though? I thought that was the
> motivation behind using the various pr_* calls.
Yes probably. I'd consider that a separate change to fixing the
continuations though (according to a quick git grep there are 422
printks without log levels remaining in mips-for-linux-next arch/mips).
Cheers
James
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-02-02 10:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-02 8:56 [PATCH] MIPS: Replace printk calls in cpu-bugs64.c with pr_info/pr_cont Joshua Kinard
2017-02-02 10:00 ` James Hogan
2017-02-02 10:41 ` Joshua Kinard
2017-02-02 10:48 ` James Hogan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox