2000-11-22 18:41:25

by Alan Cox

[permalink] [raw]
Subject: Linux 2.4.0test11-ac2


Changes in 2.4.0test11ac2

o Fix pcnet32 printk problems (Vojtech Pavlik)
o Fix kd_mksound declaration (Geert Uytterhoeven)
o m68k config fixes (Geert Uytterhoeven)
o Make uid16 macros safer (Andreas Schwab)
o Fix dquot overflow/recovery (Jan Kara)
o Rename block_til_ready in generic_serial (Patrick van de Lageweg)
o Fix missing Config doc and sound doc error (Thierry Vignaud)
o Fix Ruffian Alpha boot (Ivan Kokshaysky)
o Bridge handling patches needed for Alpha (Ivan Kokshaysky /
Richard Henderson)
o APM update (Stephen Rothwell)
o Fix SMP build on x86 (Steven Cole)
o Remove unneeded inits to 0 in ide code (Bartlomiej Zolnierkiewicz)
o IDE documentation fixes (Bartlomiej Zolnierkiewicz)
o Maestro ioctl locking fix (Zach Brown)
o NFS atomic fixes (Trond Myklebust)
o Drop out escaped hp-plus noise (me)
o Make console_* static inline not extern (Jeff Garzik)
o Update to new ramfs patches (David Gibson)
o Work arounds for broken Dell laptop APM (me)
| If you have an Inspiron 5000e please send
| me the dmesg of this kernel booting. Thanks
o Fix aha1542 memory scribbles (Phil Stracchino)
o Fix O_SYNC for ext2fs (Stephen Tweedie)
o Fix ide scsi printk (Geert Uytterhoeven)
o Change the SMP but no apic check to handle
older Intel boards with 82489DX devices (me)

Differences between 2.4.0test11ac1 and 2.4.0test11, pretty much all merged
from stuff off the maintainers and kernel list.

o Documentation for CONFIG_TOSHIBA
o Updated version of Rusty's kernel-hacking doc
o Updated SubmittingDrivers
o Added SubmittingPatches
o Updated procfs docs
o Updated initrd docs

o Support kgcc autodetect
o Link correctly with ACPI on ACPI_INTERPRETER off
o Rusty's fixes/review of unsafe set_bit usage
o Cleanup console_verbose() dunplication
o MTRR updates (36bit etc)
o Dont crash on boot with a dual cpu board holding a non intel cpu
o Ramdisk missing blkdev_put
o Radio driver cleanups
o BTTV radio config option
o Fix qcam VIDIOCGWIN bugs
o 3c503 error return cleanup
o 8390 seperate tx timeout path
o Acenic update
o Network driver check/request region fixes
o Epic100 update
o Tulip crash fix on weird eeproms
o ISAPnP hang on boot port fix
o CS46xx update
o Maestro pci_enable fix
o Support mixed pnp and legacy sb cards
o Fix function prototype in wacom drivr
o Hopefully fix the bugs in the FAT and HPFS file systems that
caused fs corruption
o Fix cramfs vanishing data bug
o Fix NLS config.in bug for SMB
o Fix generic bitops bugs
o Power management locking fixes
o filemap posix compliance fix
o Fix pte handling race

Also the ramfs changes are in my tree. I don't plan to submit the ramfs bits
to Linus in their current state, thats just an Alan Convenience



2000-11-23 03:21:24

by Stephen Rothwell

[permalink] [raw]
Subject: Re: Linux 2.4.0test11-ac2

Hi Alan,

Alan Cox <[email protected]> writes:
>
> Changes in 2.4.0test11ac2
>
> o APM update (Stephen Rothwell)
> o Work arounds for broken Dell laptop APM (me)

Here is (in my opinion) a better patch. It also means that we can
use apm as a module and have the Dell workaround work.

Most of this patch is a change of mind on my part after I posted
my previous patch ... (sorry about that).

This patch also make unloading of the apm module impossible is
someone has /proc/apm open ... (BUG FIX)

Patch against 2.4.0test11ac2.

Cheers,
Stephen
--
Stephen Rothwell, Open Source Researcher, Linuxcare, Inc.
+61-2-62628990 tel, +61-2-62628991 fax
[email protected], http://www.linuxcare.com/
Linuxcare. Support for the revolution.

diff -ruN 2.4.0-test11-ac2/arch/i386/kernel/apm.c 2.4.0-test11-ac2-APM.2/arch/i386/kernel/apm.c
--- 2.4.0-test11-ac2/arch/i386/kernel/apm.c Thu Nov 23 10:29:19 2000
+++ 2.4.0-test11-ac2-APM.2/arch/i386/kernel/apm.c Thu Nov 23 12:47:02 2000
@@ -338,7 +338,6 @@
#endif
static int debug;
static int apm_disabled;
-static int dell_crap; /* Set for broken 5000e */
#ifdef CONFIG_SMP
static int power_off;
#else
@@ -564,7 +563,7 @@
#ifdef ALWAYS_CALL_BUSY
clock_slowed = 1;
#else
- clock_slowed = (apm_info.bios_info.flags & APM_IDLE_SLOWS_CLOCK) != 0;
+ clock_slowed = (apm_info.bios.flags & APM_IDLE_SLOWS_CLOCK) != 0;
#endif
return 1;
}
@@ -675,15 +674,15 @@
{
u32 eax;

- if ((enable == 0) && (apm_info.bios_info.flags & APM_BIOS_DISENGAGED))
+ if ((enable == 0) && (apm_info.bios.flags & APM_BIOS_DISENGAGED))
return APM_NOT_ENGAGED;
if (apm_bios_call_simple(APM_FUNC_ENABLE_PM, APM_DEVICE_BALL,
enable, &eax))
return (eax >> 8) & 0xff;
if (enable)
- apm_info.bios_info.flags &= ~APM_BIOS_DISABLED;
+ apm_info.bios.flags &= ~APM_BIOS_DISABLED;
else
- apm_info.bios_info.flags |= APM_BIOS_DISABLED;
+ apm_info.bios.flags |= APM_BIOS_DISABLED;
return APM_SUCCESS;
}
#endif
@@ -696,6 +695,8 @@
u32 edx;
u32 dummy;

+ if (apm_info.get_power_status_broken)
+ return APM_32_UNSUPPORTED;
if (apm_bios_call(APM_FUNC_GET_STATUS, APM_DEVICE_ALL, 0,
&eax, &ebx, &ecx, &edx, &dummy))
return (eax >> 8) & 0xff;
@@ -739,15 +740,15 @@
u32 eax;

if ((enable == 0) && (device == APM_DEVICE_ALL)
- && (apm_info.bios_info.flags & APM_BIOS_DISABLED))
+ && (apm_info.bios.flags & APM_BIOS_DISABLED))
return APM_DISABLED;
if (apm_bios_call_simple(APM_FUNC_ENGAGE_PM, device, enable, &eax))
return (eax >> 8) & 0xff;
if (device == APM_DEVICE_ALL) {
if (enable)
- apm_info.bios_info.flags &= ~APM_BIOS_DISENGAGED;
+ apm_info.bios.flags &= ~APM_BIOS_DISENGAGED;
else
- apm_info.bios_info.flags |= APM_BIOS_DISENGAGED;
+ apm_info.bios.flags |= APM_BIOS_DISENGAGED;
}
return APM_SUCCESS;
}
@@ -1333,19 +1334,6 @@
return 0;
}

-/*
- * This is called by the DMI code when it finds an Inspiron 5000e
- * (aka compal reference board). We actually do the check by the BIOS
- * vendor name, version and serial so we can extend it to try and catch
- * non Dell stuff later.
- */
-
-void apm_battery_horked(void)
-{
- dell_crap = 1;
-}
-
-
static int apm_get_info(char *buf, char **start, off_t fpos, int length)
{
char * p;
@@ -1362,7 +1350,7 @@

p = buf;

- if ((smp_num_cpus == 1) && !dell_crap &&
+ if ((smp_num_cpus == 1) &&
!(error = apm_get_power_status(&bx, &cx, &dx))) {
ac_line_status = (bx >> 8) & 0xff;
battery_status = bx & 0xff;
@@ -1417,9 +1405,9 @@

p += sprintf(p, "%s %d.%d 0x%02x 0x%02x 0x%02x 0x%02x %d%% %d %s\n",
driver_version,
- (apm_info.bios_info.version >> 8) & 0xff,
- apm_info.bios_info.version & 0xff,
- apm_info.bios_info.flags,
+ (apm_info.bios.version >> 8) & 0xff,
+ apm_info.bios.version & 0xff,
+ apm_info.bios.flags,
ac_line_status,
battery_status,
battery_flag,
@@ -1448,7 +1436,7 @@
current->tty = NULL; /* get rid of controlling tty */

if (apm_info.connection_version == 0) {
- apm_info.connection_version = apm_info.bios_info.version;
+ apm_info.connection_version = apm_info.bios.version;
if (apm_info.connection_version > 0x100) {
/*
* We only support BIOSs up to version 1.2
@@ -1470,7 +1458,7 @@
apm_info.connection_version & 0xff);

#ifdef CONFIG_APM_DO_ENABLE
- if (apm_info.bios_info.flags & APM_BIOS_DISABLED) {
+ if (apm_info.bios.flags & APM_BIOS_DISABLED) {
/*
* This call causes my NEC UltraLite Versa 33/C to hang if it
* is booted with PM disabled but not in the docking station.
@@ -1484,7 +1472,7 @@
}
#endif

- if ((apm_info.bios_info.flags & APM_BIOS_DISENGAGED)
+ if ((apm_info.bios.flags & APM_BIOS_DISENGAGED)
&& (apm_info.connection_version > 0x0100)) {
error = apm_engage_power_management(APM_DEVICE_ALL, 1);
if (error) {
@@ -1610,17 +1598,19 @@
*/
static int __init apm_init(void)
{
- if (apm_info.bios_info.version == 0) {
+ struct proc_dir_entry *apm_proc;
+
+ if (apm_info.bios.version == 0) {
printk(KERN_INFO "apm: BIOS not found.\n");
return -ENODEV;
}
printk(KERN_INFO
"apm: BIOS version %d.%d Flags 0x%02x (Driver version %s)\n",
- ((apm_info.bios_info.version >> 8) & 0xff),
- (apm_info.bios_info.version & 0xff),
- apm_info.bios_info.flags,
+ ((apm_info.bios.version >> 8) & 0xff),
+ (apm_info.bios.version & 0xff),
+ apm_info.bios.flags,
driver_version);
- if ((apm_info.bios_info.flags & APM_32_BIT_SUPPORT) == 0) {
+ if ((apm_info.bios.flags & APM_32_BIT_SUPPORT) == 0) {
printk(KERN_INFO "apm: no 32 bit BIOS support\n");
return -ENODEV;
}
@@ -1629,23 +1619,23 @@
* Fix for the Compaq Contura 3/25c which reports BIOS version 0.1
* but is reportedly a 1.0 BIOS.
*/
- if (apm_info.bios_info.version == 0x001)
- apm_info.bios_info.version = 0x100;
+ if (apm_info.bios.version == 0x001)
+ apm_info.bios.version = 0x100;

/* BIOS < 1.2 doesn't set cseg_16_len */
- if (apm_info.bios_info.version < 0x102)
- apm_info.bios_info.cseg_16_len = 0; /* 64k */
+ if (apm_info.bios.version < 0x102)
+ apm_info.bios.cseg_16_len = 0; /* 64k */

if (debug) {
printk(KERN_INFO "apm: entry %x:%lx cseg16 %x dseg %x",
- apm_info.bios_info.cseg, apm_info.bios_info.offset,
- apm_info.bios_info.cseg_16, apm_info.bios_info.dseg);
- if (apm_info.bios_info.version > 0x100)
+ apm_info.bios.cseg, apm_info.bios.offset,
+ apm_info.bios.cseg_16, apm_info.bios.dseg);
+ if (apm_info.bios.version > 0x100)
printk(" cseg len %x, dseg len %x",
- apm_info.bios_info.cseg_len,
- apm_info.bios_info.dseg_len);
- if (apm_info.bios_info.version > 0x101)
- printk(" cseg16 len %x", apm_info.bios_info.cseg_16_len);
+ apm_info.bios.cseg_len,
+ apm_info.bios.dseg_len);
+ if (apm_info.bios.version > 0x101)
+ printk(" cseg16 len %x", apm_info.bios.cseg_16_len);
printk("\n");
}

@@ -1673,16 +1663,16 @@
__va((unsigned long)0x40 << 4));
_set_limit((char *)&gdt[APM_40 >> 3], 4095 - (0x40 << 4));

- apm_bios_entry.offset = apm_info.bios_info.offset;
+ apm_bios_entry.offset = apm_info.bios.offset;
apm_bios_entry.segment = APM_CS;
set_base(gdt[APM_CS >> 3],
- __va((unsigned long)apm_info.bios_info.cseg << 4));
+ __va((unsigned long)apm_info.bios.cseg << 4));
set_base(gdt[APM_CS_16 >> 3],
- __va((unsigned long)apm_info.bios_info.cseg_16 << 4));
+ __va((unsigned long)apm_info.bios.cseg_16 << 4));
set_base(gdt[APM_DS >> 3],
- __va((unsigned long)apm_info.bios_info.dseg << 4));
+ __va((unsigned long)apm_info.bios.dseg << 4));
#ifndef APM_RELAX_SEGMENTS
- if (apm_info.bios_info.version == 0x100) {
+ if (apm_info.bios.version == 0x100) {
#endif
/* For ASUS motherboard, Award BIOS rev 110 (and others?) */
_set_limit((char *)&gdt[APM_CS >> 3], 64 * 1024 - 1);
@@ -1693,15 +1683,17 @@
#ifndef APM_RELAX_SEGMENTS
} else {
_set_limit((char *)&gdt[APM_CS >> 3],
- (apm_info.bios_info.cseg_len - 1) & 0xffff);
+ (apm_info.bios.cseg_len - 1) & 0xffff);
_set_limit((char *)&gdt[APM_CS_16 >> 3],
- (apm_info.bios_info.cseg_16_len - 1) & 0xffff);
+ (apm_info.bios.cseg_16_len - 1) & 0xffff);
_set_limit((char *)&gdt[APM_DS >> 3],
- (apm_info.bios_info.dseg_len - 1) & 0xffff);
+ (apm_info.bios.dseg_len - 1) & 0xffff);
}
#endif

- create_proc_info_entry("apm", 0, NULL, apm_get_info);
+ apm_proc = create_proc_info_entry("apm", 0, NULL, apm_get_info);
+ if (apm_proc)
+ apm_proc->owner = THIS_MODULE;

kernel_thread(apm, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND | SIGCHLD);

@@ -1720,7 +1712,7 @@
{
int error;

- if (((apm_info.bios_info.flags & APM_BIOS_DISENGAGED) == 0)
+ if (((apm_info.bios.flags & APM_BIOS_DISENGAGED) == 0)
&& (apm_info.connection_version > 0x0100)) {
error = apm_engage_power_management(APM_DEVICE_ALL, 0);
if (error)
diff -ruN 2.4.0-test11-ac2/arch/i386/kernel/dmi_scan.c 2.4.0-test11-ac2-APM.2/arch/i386/kernel/dmi_scan.c
--- 2.4.0-test11-ac2/arch/i386/kernel/dmi_scan.c Thu Nov 23 10:29:19 2000
+++ 2.4.0-test11-ac2-APM.2/arch/i386/kernel/dmi_scan.c Thu Nov 23 12:49:28 2000
@@ -3,6 +3,7 @@
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/init.h>
+#include <linux/apm_bios.h>
#include <asm/io.h>

struct dmi_header
@@ -127,11 +128,8 @@
strcmp(dmi_string(dm, data[5]), "A04")==0)
// &&strcmp(dmi_string(dm, data[8]), "???")==0)
{
-#ifdef CONFIG_APM
- extern void apm_battery_horked(void);
- apm_battery_horked();
- printk(KERN_WARNING "BIOS strings suggest APM bugs, disabling battery reporting.\n");
-#endif
+ apm_info.get_power_status_broken = 1;
+ printk(KERN_WARNING "BIOS strings suggest APM bugs, disabling power status reporting.\n");
}
break;
case 1:
diff -ruN 2.4.0-test11-ac2/arch/i386/kernel/setup.c 2.4.0-test11-ac2-APM.2/arch/i386/kernel/setup.c
--- 2.4.0-test11-ac2/arch/i386/kernel/setup.c Thu Nov 23 10:29:19 2000
+++ 2.4.0-test11-ac2-APM.2/arch/i386/kernel/setup.c Thu Nov 23 12:06:10 2000
@@ -608,7 +608,7 @@
ROOT_DEV = to_kdev_t(ORIG_ROOT_DEV);
drive_info = DRIVE_INFO;
screen_info = SCREEN_INFO;
- apm_info.bios_info = APM_BIOS_INFO;
+ apm_info.bios = APM_BIOS_INFO;
if( SYS_DESC_TABLE.length != 0 ) {
MCA_bus = SYS_DESC_TABLE.table[3] &0x2;
machine_id = SYS_DESC_TABLE.table[0];
diff -ruN 2.4.0-test11-ac2/include/linux/apm_bios.h 2.4.0-test11-ac2-APM.2/include/linux/apm_bios.h
--- 2.4.0-test11-ac2/include/linux/apm_bios.h Thu Nov 23 10:29:22 2000
+++ 2.4.0-test11-ac2-APM.2/include/linux/apm_bios.h Thu Nov 23 12:47:33 2000
@@ -49,8 +49,9 @@
* Data for APM that is persistant across module unload/load
*/
struct apm_info {
- struct apm_bios_info bios_info;
+ struct apm_bios_info bios;
unsigned short connection_version;
+ int get_power_status_broken;
};

/*

2000-11-23 03:53:25

by Peter Samuelson

[permalink] [raw]
Subject: Re: Linux 2.4.0test11-ac2


[Alan Cox]
> Changes in 2.4.0test11ac2
> o Work arounds for broken Dell laptop APM (me)
> | If you have an Inspiron 5000e please send
> | me the dmesg of this kernel booting. Thanks

Inspiron 5000, is this close enough?

Linux version 2.4.0-test11-ac2 ([email protected]) (gcc version 2.95.2 20000220 (Debian GNU/Linux)) #3 Wed Nov 22 21:09:37 CST 2000
BIOS-provided physical RAM map:
BIOS-e820: 000000000009f800 @ 0000000000000000 (usable)
BIOS-e820: 0000000000000800 @ 000000000009f800 (reserved)
BIOS-e820: 0000000000015000 @ 00000000000eb000 (reserved)
BIOS-e820: 0000000003ef0000 @ 0000000000100000 (usable)
BIOS-e820: 000000000000fc00 @ 0000000003ff0000 (ACPI data)
BIOS-e820: 0000000000000400 @ 0000000003fffc00 (ACPI NVS)
BIOS-e820: 0000000000080000 @ 00000000fff80000 (reserved)
Scan SMP from c0000000 for 1024 bytes.
Scan SMP from c009fc00 for 1024 bytes.
Scan SMP from c00f0000 for 65536 bytes.
Scan SMP from c009f800 for 4096 bytes.
On node 0 totalpages: 16368
zone(0): 4096 pages.
zone(1): 12272 pages.
zone(2): 0 pages.
mapped APIC to ffffe000 (01111000)
Kernel command line: vga=normal noinitrd BOOT_IMAGE=linux root=/dev/hda2 vga=1
Initializing CPU#0
Detected 448.060 MHz processor.
Console: colour VGA+ 80x50
Calibrating delay loop... 894.57 BogoMIPS
Memory: 62436k/65472k available (1056k kernel code, 2648k reserved, 80k data, 192k init, 0k highmem)
Dentry-cache hash table entries: 8192 (order: 4, 65536 bytes)
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 4096 (order: 3, 32768 bytes)
CPU: Before vendor init, caps: 0383f9ff 00000000 00000000, vendor = 0
CPU: L2 cache: 256K
Intel machine check architecture supported.
Intel machine check reporting enabled on CPU#0.
CPU: After vendor init, caps: 0383f9ff 00000000 00000000 00000000
CPU: After generic, caps: 0383f9ff 00000000 00000000 00000000
CPU: Common caps: 0383f9ff 00000000 00000000 00000000
CPU: Intel Pentium III (Coppermine) stepping 01
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Checking 'hlt' instruction... OK.
POSIX conformance testing by UNIFIX
mtrr: v1.37 (20001109) Richard Gooch ([email protected])
mtrr: detected mtrr type: Intel
PCI: PCI BIOS revision 2.10 entry at 0xfd9ae, last bus=1
PCI: Using configuration type 1
PCI: Probing PCI hardware
Unknown bridge resource 2: assuming transparent
PCI: Using IRQ router PIIX [8086/7110] at 00:07.0
PCI: Found IRQ 11 for device 00:04.0
PCI: The same IRQ used for device 00:04.1
PCI: The same IRQ used for device 01:00.0
PCI: Cannot allocate resource region 4 of device 00:07.1
got res[1090:109f] for resource 4 of Intel Corporation 82371AB PIIX4 IDE
Limiting direct PCI/PCI transfers.
isapnp: Scanning for Pnp cards...
isapnp: No Plug & Play device found
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
apm: BIOS version 1.2 Flags 0x03 (Driver version 1.14)
Starting kswapd v1.8
pty: 256 Unix98 ptys configured
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
Uniform Multi-Platform E-IDE driver Revision: 6.31
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
PIIX4: IDE controller on PCI bus 00 dev 39
PIIX4: chipset revision 1
PIIX4: not 100% native mode: will probe irqs later
ide0: BM-DMA at 0x1090-0x1097, BIOS settings: hda:DMA, hdb:pio
ide1: BM-DMA at 0x1098-0x109f, BIOS settings: hdc:DMA, hdd:pio
hda: FUJITSU MHK2120AT, ATA DISK drive
hdc: TOSHIBA CD-ROM XM-7002B, ATAPI CDROM drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
hda: 23579136 sectors (12073 MB) w/512KiB Cache, CHS=1559/240/63, UDMA(33)
Partition check:
hda: hda1 hda2 hda3
Floppy drive(s): fd0 is 1.44M
FDC 0 is a post-1991 82077
LVM version 0.8final by Heinz Mauelshagen (15/02/2000)
lvm -- Driver successfully initialized
Serial driver version 5.02 (2000-08-09) with MANY_PORTS SHARE_IRQ SERIAL_PCI ISAPNP enabled
ttyS00 at 0x03f8 (irq = 4) is a 16550A
Linux PCMCIA Card Services 3.1.22
options: [pci] [cardbus] [pm]
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 4096 bind 4096)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
Yenta IRQ list 0698, PCI irq11
Socket status: 30000068
Yenta IRQ list 0698, PCI irq11
Socket status: 30000006
cs: cb_alloc(bus 6): vendor 0x10b7, device 0x5257
got res[3400:347f] for resource 0 of PCI device 10b7:5257
got res[11000000:1100007f] for resource 1 of PCI device 10b7:5257
got res[11000080:110000ff] for resource 2 of PCI device 10b7:5257
got res[10c00000:10c1ffff] for resource 6 of PCI device 10b7:5257
PCI: Enabling device 06:00.0 (0000 -> 0003)
PCI: Found IRQ 11 for device 06:00.0
PCI: The same IRQ used for device 00:04.0
PCI: The same IRQ used for device 00:04.1
PCI: The same IRQ used for device 01:00.0
call_usermodehelper[/sbin/hotplug]: no root fs
VFS: Mounted root (ext2 filesystem) readonly.
Freeing unused kernel memory: 192k freed
Adding Swap: 204792k swap-space (priority 0)
cs: IO port probe 0x0c00-0x0cff: clean.
cs: IO port probe 0x0800-0x08ff: clean.
cs: IO port probe 0x0100-0x04ff: excluding 0x378-0x37f 0x4d0-0x4d7
cs: IO port probe 0x0a00-0x0aff: clean.