From: "Александр Новосёлов" <n_list@mail.ru>
To: ALT Linux kernel packages development <devel-kernel@altlinux.ru>
Subject: Re: [d-kernel] Опять проблемы acpi?
Date: Sun, 16 May 2004 18:37:38 +0400
Message-ID: <E1BPMlh-000ADN-00.n_list-mail-ru@mx2.mail.ru> (raw)
In-Reply-To: <200405161604.36640.darkstar@altlinux.ru>
On Sun, 16 May 2004 16:04:32 +0400
"Albert R. Valiev" <darkstar@altlinux.ru> wrote:
> В сообщении от 16 Май 2004 01:16 Александр Новосёлов
> написал(a):
> > с новым ядром 2.6.6 появился глюк - при перезагрузке командой
> > reboot выключается питание харда.
>
> Проблема не в acpi, проблема в том, что при перезагрузке
> драйвером ide посылается ненужный suspend на диски. Посмотрим,
> что мона сделать.
http://bugzilla.kernel.org/show_bug.cgi?id=2672
этот патч помог:
diff -urN linux-2.6.6.orig/drivers/ide/ide-disk.c
linux-2.6.6/drivers/ide/ide-disk.c---
linux-2.6.6.orig/drivers/ide/ide-disk.c 2004-05-11
12:40:53.000000000 +0200+++ linux-2.6.6/drivers/ide/ide-disk.c 2004-05-11 12:09:30.000000000
+0200@@ -1704,10 +1704,11 @@
static void ide_device_shutdown(struct device *dev)
{
- ide_drive_t *drive = container_of(dev, ide_drive_t, gendev);
-
- printk("Shutdown: %s\n", drive->name);
- dev->bus->suspend(dev, PM_SUSPEND_STANDBY);
+ if (system_state != SYSTEM_RESTART) {
+ ide_drive_t *drive = container_of(dev, ide_drive_t,
gendev);+ printk("Shutdown: %s\n", drive->name);
+ dev->bus->suspend(dev, PM_SUSPEND_STANDBY);
+ }
}
/*
@@ -1758,6 +1759,8 @@
if (drive->doorlocking && ide_raw_taskfile(drive, &args,
NULL)) drive->doorlocking = 0;
}
+ if (drive->usage != 1 || !drive->removable)
+ return 0;
drive->wcache = 0;
/* Cache enabled? */
if (drive->id->csfo & 1)
diff -urN linux-2.6.6.orig/include/linux/kernel.h
linux-2.6.6/include/linux/kernel.h---
linux-2.6.6.orig/include/linux/kernel.h 2004-05-10
09:31:47.000000000 +0200+++ linux-2.6.6/include/linux/kernel.h 2004-05-11 11:18:09.000000000
+0200@@ -109,14 +109,17 @@
extern void bust_spinlocks(int yes);
extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is
in progress */ extern int panic_on_oops;
-extern int system_state; /* See values below */
extern int tainted;
extern const char *print_tainted(void);
/* Values used for system_state */
-#define SYSTEM_BOOTING 0
-#define SYSTEM_RUNNING 1
-#define SYSTEM_SHUTDOWN 2
+extern enum system_states {
+ SYSTEM_BOOTING,
+ SYSTEM_RUNNING,
+ SYSTEM_HALT,
+ SYSTEM_POWER_OFF,
+ SYSTEM_RESTART,
+} system_state;
#define TAINT_PROPRIETARY_MODULE (1<<0)
#define TAINT_FORCED_MODULE (1<<1)
diff -urN linux-2.6.6.orig/init/main.c linux-2.6.6/init/main.c
--- linux-2.6.6.orig/init/main.c 2004-05-10 09:31:47.000000000 +0200
+++ linux-2.6.6/init/main.c 2004-05-11 11:18:09.000000000 +0200
@@ -95,7 +95,8 @@
extern void tc_init(void);
#endif
-int system_state; /* SYSTEM_BOOTING/RUNNING/SHUTDOWN */
+enum system_states system_state;
+EXPORT_SYMBOL(system_state);
/*
* Boot command-line arguments
diff -urN linux-2.6.6.orig/kernel/sys.c linux-2.6.6/kernel/sys.c
--- linux-2.6.6.orig/kernel/sys.c 2004-05-10 09:31:47.000000000 +0200
+++ linux-2.6.6/kernel/sys.c 2004-05-11 11:18:09.000000000 +0200
@@ -447,7 +447,7 @@
switch (cmd) {
case LINUX_REBOOT_CMD_RESTART:
notifier_call_chain(&reboot_notifier_list, SYS_RESTART,
NULL);- system_state = SYSTEM_SHUTDOWN;
+ system_state = SYSTEM_RESTART;
device_shutdown();
printk(KERN_EMERG "Restarting system.\n");
machine_restart(NULL);
@@ -463,7 +463,7 @@
case LINUX_REBOOT_CMD_HALT:
notifier_call_chain(&reboot_notifier_list, SYS_HALT,
NULL);- system_state = SYSTEM_SHUTDOWN;
+ system_state = SYSTEM_HALT;
device_shutdown();
printk(KERN_EMERG "System halted.\n");
machine_halt();
@@ -473,7 +473,7 @@
case LINUX_REBOOT_CMD_POWER_OFF:
notifier_call_chain(&reboot_notifier_list,
SYS_POWER_OFF, NULL);- system_state = SYSTEM_SHUTDOWN;
+ system_state = SYSTEM_POWER_OFF;
device_shutdown();
printk(KERN_EMERG "Power down.\n");
machine_power_off();
@@ -489,7 +489,7 @@
buffer[sizeof(buffer) - 1] = '\0';
notifier_call_chain(&reboot_notifier_list, SYS_RESTART,
buffer);- system_state = SYSTEM_SHUTDOWN;
+ system_state = SYSTEM_RESTART;
device_shutdown();
printk(KERN_EMERG "Restarting system with command
'%s'.\n", buffer); machine_restart(buffer);
next prev parent reply other threads:[~2004-05-16 14:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-15 21:16 Александр Новосёлов
2004-05-15 21:27 ` [d-kernel] " Konstantin A. Lepikhov
2004-05-16 6:18 ` Александр Новосёлов
2004-05-16 8:21 ` Konstantin A. Lepikhov
2004-05-16 10:18 ` [d-kernel] " Sergey Vlasov
2004-05-16 12:04 ` Albert R. Valiev
2004-05-16 14:37 ` Александр Новосёлов [this message]
2004-05-16 17:23 ` Sergey Vlasov
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=E1BPMlh-000ADN-00.n_list-mail-ru@mx2.mail.ru \
--to=n_list@mail.ru \
--cc=devel-kernel@altlinux.ru \
/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
ALT Linux kernel packages development
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel-kernel/0 devel-kernel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel-kernel devel-kernel/ http://lore.altlinux.org/devel-kernel \
devel-kernel@altlinux.org devel-kernel@altlinux.ru devel-kernel@altlinux.com
public-inbox-index devel-kernel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel-kernel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git