public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Schlichter <thomas.schlichter@web.de>
To: Philippe Elie <phil.el@wanadoo.fr>, Andrew Morton <akpm@osdl.org>
Cc: Andreas Schwab <schwab@suse.de>, linux-kernel@vger.kernel.org
Subject: Re: [2.6.4-rc2] bogus semicolon behind if()
Date: Tue, 9 Mar 2004 12:08:17 +0100	[thread overview]
Message-ID: <200403091208.20556.thomas.schlichter@web.de> (raw)
In-Reply-To: <20040309070127.GA2958@zaniah>

[-- Attachment #1: Type: text/plain, Size: 1472 bytes --]

Am Dienstag, 9. März 2004 08:01 schrieb Philippe Elie:
> On Mon, 08 Mar 2004 at 16:29 +0000, Andrew Morton wrote:

~~ snip ~~

> > Rename Thomas's script to crappy-code-detector.sh and its hit rate goes
> > to 100% ;)
>
> Was this patch so crappy ? http://tinyurl.com/2jbe4 ,
>
> -				check_nmi_watchdog();
> +				if (check_nmi_watchdog() < 0);
> +					timer_ack = !cpu_has_tsc

Well, exactly this code made me look for other possible problems... ;-)
As I wrote a few days ago I have problems with that ChangeSet,
  (http://marc.theaimsgroup.com/?l=linux-kernel&m=107840458123059&w=2)
so I did examine it closer.

My results are:
1. The semicolons behind the if()'s cannot be there intentionally.
2. To fix my problem, timer_ack must be set to 1 for my (integrated) APIC, and 
as my CPU has a TSC, this cannot be correct for me:
-	timer_ack = 1;
+	if (nmi_watchdog == NMI_IO_APIC && !APIC_INTEGRATED(ver))
+		timer_ack = 1;
+	else
+		timer_ack = !cpu_has_tsc;

I changed that if(...) to
	if (nmi_watchdog == NMI_IO_APIC || APIC_INTEGRATED(ver))
which works fine for me here, but I am not 100% sure if this is what the 
author of the original patch ment and if it still fixes the original 
problem...

The patch which makes these changes is attached. Perhaps someone else wants to 
test it, too...

   Thomas Schlichter

P.S.: I tested it with an AMD Athlon 3000+ on a board with a VIA KT400 chipset 
and enabled ACPI and IO-APIC.

[-- Attachment #2: fix-8259-timer-ack.diff --]
[-- Type: text/x-diff, Size: 1021 bytes --]

--- linux-2.6.4-rc2-mm1/arch/i386/kernel/io_apic.c.orig	2004-03-08 16:29:14.000000000 +0100
+++ linux-2.6.4-rc2-mm1/arch/i386/kernel/io_apic.c	2004-03-08 17:26:40.000000000 +0100
@@ -2181,7 +2181,7 @@ static inline void check_timer(void)
 	 */
 	apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
 	init_8259A(1);
-	if (nmi_watchdog == NMI_IO_APIC && !APIC_INTEGRATED(ver))
+	if (nmi_watchdog == NMI_IO_APIC || APIC_INTEGRATED(ver))
 		timer_ack = 1;
 	else
 		timer_ack = !cpu_has_tsc;
@@ -2202,7 +2202,7 @@ static inline void check_timer(void)
 				disable_8259A_irq(0);
 				setup_nmi();
 				enable_8259A_irq(0);
-				if (check_nmi_watchdog() < 0);
+				if (check_nmi_watchdog() < 0)
 					timer_ack = !cpu_has_tsc;
 			}
 			return;
@@ -2226,7 +2226,7 @@ static inline void check_timer(void)
 				add_pin_to_irq(0, 0, pin2);
 			if (nmi_watchdog == NMI_IO_APIC) {
 				setup_nmi();
-				if (check_nmi_watchdog() < 0);
+				if (check_nmi_watchdog() < 0)
 					timer_ack = !cpu_has_tsc;
 			}
 			return;

  reply	other threads:[~2004-03-09 11:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-08 23:14 [2.6.4-rc2] bogus semicolon behind if() Thomas Schlichter
2004-03-08 23:43 ` Andreas Schwab
2004-03-08 23:56   ` Thomas Schlichter
2004-03-09  0:29   ` Andrew Morton
2004-03-09  7:01     ` Philippe Elie
2004-03-09 11:08       ` Thomas Schlichter [this message]
2004-03-10  6:08         ` Philippe Elie
2004-03-10 16:20           ` Zwane Mwaikambo
2004-03-17 17:20           ` Maciej W. Rozycki
2004-03-17 16:51         ` Maciej W. Rozycki
2004-03-17 18:25           ` Andrew Morton
2004-03-17 18:50             ` Maciej W. Rozycki
2004-03-18  9:46               ` Mikael Pettersson
2004-03-18  9:52                 ` Andrew Morton
2004-03-21  3:51             ` Zwane Mwaikambo
2004-03-21  3:55               ` Zwane Mwaikambo
2004-03-19 19:01           ` Thomas Schlichter
2004-03-19 20:30             ` Maciej W. Rozycki
2004-03-19 23:13               ` Thomas Schlichter
2004-03-09  0:33 ` Andrew Morton
2004-03-09 11:09   ` Thomas Schlichter
  -- strict thread matches above, loose matches on Subject: below --
2004-03-20 17:04 Mikael Pettersson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200403091208.20556.thomas.schlichter@web.de \
    --to=thomas.schlichter@web.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phil.el@wanadoo.fr \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox