linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: Mikael Pettersson <mikpe@csd.uu.se>
Cc: John Levon <levon@movementarian.org>, linux-kernel@vger.kernel.org
Subject: Re: Switch APIC (+nmi, +oprofile) to driver model
Date: Sun, 16 Feb 2003 13:05:16 +0100	[thread overview]
Message-ID: <20030216120515.GB589@elf.ucw.cz> (raw)
In-Reply-To: <15947.41003.250547.617866@kim.it.uu.se>

Hi!

> Here is my modified version of Pavel's latest patch to convert
> apm/apic/nmi to the driver model. It's a minimalistic patch,
> intendended ONLY to convert the old-fashioned PM support code
> to the driver model. It seems to work for me, except that
> initiating a suspend (via apm --suspend) triggers a BUG_ON
> somewhere in ide-disk.c, which prevents the suspend and causes a
> hang at shutdown.



> --- linux-2.5.60/arch/i386/kernel/apm.c.~1~	2003-02-10 23:36:54.000000000 +0100
> +++ linux-2.5.60/arch/i386/kernel/apm.c	2003-02-12 21:01:51.000000000 +0100
> @@ -218,6 +218,7 @@
>  #include <linux/time.h>
>  #include <linux/sched.h>
>  #include <linux/pm.h>
> +#include <linux/device.h>
>  #include <linux/kernel.h>
>  #include <linux/smp.h>
>  #include <linux/smp_lock.h>
> @@ -1263,6 +1264,11 @@
>  		}
>  		printk(KERN_CRIT "apm: suspend was vetoed, but suspending anyway.\n");
>  	}
> +
> +	device_suspend(3, SUSPEND_NOTIFY);
> +	device_suspend(3, SUSPEND_SAVE_STATE);

Comment these two lines... and all RESTORE_STATEs. System needs to be
stopped in order for SAVE_STATE to work, and it is not in apm case.

> +static struct device_driver local_apic_nmi_driver = {
> +	.name		= "local_apic_nmi",
> +	.bus		= &system_bus_type,
> +	.resume		= nmi_resume,
> +	.suspend	= nmi_suspend,
> +};

Do you think it is neccessary to call it "*local_*apic_nmi_driver"? It
seems way too long.

> +extern struct sys_device device_local_apic;
> +
> +static struct sys_device device_local_apic_nmi = {
> +	.name		= "local_apic_nmi",
> +	.id		= 0,
> +	.dev		= {
> +		.name	= "local_apic_nmi",
> +		.driver	= &local_apic_nmi_driver,
> +		.parent = &device_local_apic.dev,
> +	},
> +};

Why did you convert device_apic_nmi to *sys_*device?

> @@ -402,3 +423,7 @@
>  		wrmsr(nmi_perfctr_msr, -(cpu_khz/nmi_hz*1000), -1);
>  	}
>  }
> +
> +EXPORT_SYMBOL(nmi_watchdog);
> +EXPORT_SYMBOL(disable_local_apic_nmi_watchdog);
> +EXPORT_SYMBOL(enable_local_apic_nmi_watchdog);

This is good, if we have disable_, we should have enable_, not setup_;
but I killed _local_ part as it is way too long, then.

								Pavel

-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

  parent reply	other threads:[~2003-02-16 11:57 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-09 14:07 Switch APIC (+nmi, +oprofile) to driver model Mikael Pettersson
2003-02-09 14:11 ` John Levon
2003-02-10 11:01 ` Pavel Machek
2003-02-10 11:50   ` John Levon
2003-02-10 20:06     ` Pavel Machek
2003-02-11 11:12       ` John Levon
2003-02-11 12:01         ` Pavel Machek
2003-02-13 13:39           ` Mikael Pettersson
2003-02-13 13:46             ` Pavel Machek
2003-02-14  9:08             ` Maciej W. Rozycki
2003-02-14 10:32               ` Mikael Pettersson
2003-02-14 10:54                 ` Maciej W. Rozycki
2003-02-14 11:25                   ` Mikael Pettersson
2003-02-14 11:32                     ` Maciej W. Rozycki
2003-02-16 12:05             ` Pavel Machek [this message]
2003-02-10 16:10 ` Pavel Machek
2003-02-11 11:43   ` Mikael Pettersson
  -- strict thread matches above, loose matches on Subject: below --
2003-02-16 12:43 Mikael Pettersson
2003-02-16 16:01 ` Pavel Machek
2003-02-26 21:59 ` Pavel Machek
2003-02-10 19:05 Mikael Pettersson
2003-02-11 11:39 ` Pavel Machek
2003-02-11 11:53 ` Pavel Machek
2003-02-09 14:42 Mikael Pettersson
2003-02-09 11:32 Pavel Machek
2003-02-09 11:54 ` John Levon
2003-02-09 12:03 ` John Levon

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=20030216120515.GB589@elf.ucw.cz \
    --to=pavel@suse.cz \
    --cc=levon@movementarian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikpe@csd.uu.se \
    /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;
as well as URLs for NNTP newsgroup(s).