Re: LILO fatal error after going from 2.6.22 to 2.6.24.2

2008-02-19 Thread Rasmus Andersen
On Tue, Feb 19, 2008 at 09:22:27AM -0800, H. Peter Anvin wrote:
> Rasmus Andersen wrote:
[...]
> You have at least one file on a device mapper device (possibly an LVM 
> module), and LILO doesn't understand it.

Hi Peter, and thanks for your reply. That was indeed the issue, my /boot
was not mounted and my / is on a LVM partition. So this was merely a
user issue, my specialty.

Thanks for your time.

Cheers,
  Rasmus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: LILO fatal error after going from 2.6.22 to 2.6.24.2

2008-02-19 Thread Rasmus Andersen
On Tue, Feb 19, 2008 at 09:22:27AM -0800, H. Peter Anvin wrote:
 Rasmus Andersen wrote:
[...]
 You have at least one file on a device mapper device (possibly an LVM 
 module), and LILO doesn't understand it.

Hi Peter, and thanks for your reply. That was indeed the issue, my /boot
was not mounted and my / is on a LVM partition. So this was merely a
user issue, my specialty.

Thanks for your time.

Cheers,
  Rasmus
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


LILO fatal error after going from 2.6.22 to 2.6.24.2

2008-02-18 Thread Rasmus Andersen
Hello,

I have just upgraded from 2.6.22 to 2.6.24.2 and after booting into the
new kernel and seeing that everything went right, I wanted to make the
new kernel the default boot kernel. But running LILO I got

   Fatal: Linux experimental device 0x04x needs to be defined.
   Check 'man lilo.conf' under 'disk=' and 'max-partitions='

(Full output from lilo -v 5 below). Apart from setting 2.6.24.2 as
default this is the same lilo config as 2.6.22 was able to write fine.
Can anyone tell me what I (or the kernel) am/is doing wrong?

Thanks,
  Rasmus



LILO version 22.7.3, Copyright (C) 1992-1998 Werner Almesberger
Development beyond version 21 Copyright (C) 1999-2006 John Coffman
Released 11-Aug-2006 and compiled at 17:06:40 on Jan 17 2007

raid_setup: dev=000C  rdev=0340
raid_setup returns offset =   ndisk = 0
 BIOS   VolumeID   Device
Reading boot sector from /dev/hdb
geo_get: device 0340, all=1
pf_hard_disk_scan: (7,0) /dev/loop0
pf_hard_disk_scan: (3,64) /dev/hdb
pf_hard_disk_scan: (3,65) /dev/hdb1
lookup_dev:  number=0340
lookup_dev:  number=0340
pf:  dev=0340  id=B661B661  name=/dev/hdb
geo_query_dev: device=0340
lookup_dev:  number=0340
exit geo_query_dev
bios_dev:  device 0340
lookup_dev:  number=0340
bios_dev:  masked device 0340, which is /dev/hdb
bios_dev: geometry check found 0 matches
bios_dev: (0x82)  vol-ID=17FF01F9  *PT=08070AD0
bios_dev: (0x81)  vol-ID=7C4DC2CA  *PT=08070A88
bios_dev: (0x80)  vol-ID=B661B661  *PT=08070A40
bios_dev: PT match found 1 match (0x80)
pf_hard_disk_scan: (3,66) /dev/hdb2
pf_hard_disk_scan: (8,0) /dev/sda
pf_hard_disk_scan: (8,1) /dev/sda1
lookup_dev:  number=0800
lookup_dev:  number=0800
pf:  dev=0800  id=7C4DC2CA  name=/dev/sda
geo_query_dev: device=0800
lookup_dev:  number=0800
lookup_dev:  number=0300
exit geo_query_dev
bios_dev:  device 0800
lookup_dev:  number=0800
bios_dev:  masked device 0800, which is /dev/sda
bios_dev: geometry check found 0 matches
bios_dev: (0x82)  vol-ID=17FF01F9  *PT=08070AD0
bios_dev: (0x81)  vol-ID=7C4DC2CA  *PT=08070A88
bios_dev: (0x80)  vol-ID=B661B661  *PT=08070A40
bios_dev: PT match found 1 match (0x81)
pf_hard_disk_scan: (8,16) /dev/sdb
pf_hard_disk_scan: (8,17) /dev/sdb1
lookup_dev:  number=0810
lookup_dev:  number=0810
pf:  dev=0810  id=17FF01F9  name=/dev/sdb
geo_query_dev: device=0810
lookup_dev:  number=0810
lookup_dev:  number=0300
exit geo_query_dev
bios_dev:  device 0810
lookup_dev:  number=0810
bios_dev:  masked device 0810, which is /dev/sdb
bios_dev: geometry check found 0 matches
bios_dev: (0x82)  vol-ID=17FF01F9  *PT=08070AD0
bios_dev: (0x81)  vol-ID=7C4DC2CA  *PT=08070A88
bios_dev: (0x80)  vol-ID=B661B661  *PT=08070A40
bios_dev: PT match found 1 match (0x81)
pf_hard_disk_scan: (9,0) /dev/md0
pf_hard_disk_scan: (253,0) /dev/dm-0
Caching device /dev/dm-0 (0xFD00)
pf_hard_disk_scan: (253,1) /dev/dm-1
Caching device /dev/dm-1 (0xFD01)
pf_hard_disk_scan: (253,2) /dev/dm-2
Caching device /dev/dm-2 (0xFD02)
pf_hard_disk_scan: (253,3) /dev/dm-3
Caching device /dev/dm-3 (0xFD03)
pf_hard_disk_scan: (253,4) /dev/dm-4
Caching device /dev/dm-4 (0xFD04)
pf_hard_disk_scan: (253,5) /dev/dm-5
Caching device /dev/dm-5 (0xFD05)
pf_hard_disk_scan: (253,6) /dev/dm-6
Caching device /dev/dm-6 (0xFD06)
  0340  B661B661  /dev/hdb
  0800  7C4DC2CA  /dev/sda
  0810  17FF01F9  /dev/sdb
pf_hard_disk_scan: ndevs=3
  0340  B661B661  /dev/hdb
  0800  7C4DC2CA  /dev/sda
  0810  17FF01F9  /dev/sdb
Resolve invalid VolumeIDs
Resolve duplicate VolumeIDs
  0340  B661B661  /dev/hdb
  0800  7C4DC2CA  /dev/sda
  0810  17FF01F9  /dev/sdb
device codes (user assigned pf) = 0
device codes (user assigned) = 0
device codes (BIOS assigned) = 3
Filling in '/dev/sdb' = 0x82
device codes (canonical) = 7
geo_query_dev: device=0340
lookup_dev:  number=0340
exit geo_query_dev
bios_dev:  device 0340
lookup_dev:  number=0340
bios_dev:  masked device 0340, which is /dev/hdb
bios_dev: geometry check found 0 matches
bios_dev: (0x82)  vol-ID=17FF01F9  *PT=08070AD0
bios_dev: (0x81)  vol-ID=7C4DC2CA  *PT=08070A88
bios_dev: (0x80)  vol-ID=B661B661  *PT=08070A40
bios_dev: PT match found 1 match (0x80)
Device 0x0340: BIOS drive 0x80, 255 heads, 9729 cylinders,
   63 sectors. Partition offset: 0 sectors.
registering bios=0x80  device=0x0340
Using Volume ID B661B661 on bios 80
geo_get: device FD06, all=1
geo_query_dev: device=FD06
lookup_dev:  number=FD06
Fatal: Linux experimental device 0x04x needs to be defined.
Check 'man lilo.conf' under 'disk=' and 'max-partitions='
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


LILO fatal error after going from 2.6.22 to 2.6.24.2

2008-02-18 Thread Rasmus Andersen
Hello,

I have just upgraded from 2.6.22 to 2.6.24.2 and after booting into the
new kernel and seeing that everything went right, I wanted to make the
new kernel the default boot kernel. But running LILO I got

   Fatal: Linux experimental device 0x04x needs to be defined.
   Check 'man lilo.conf' under 'disk=' and 'max-partitions='

(Full output from lilo -v 5 below). Apart from setting 2.6.24.2 as
default this is the same lilo config as 2.6.22 was able to write fine.
Can anyone tell me what I (or the kernel) am/is doing wrong?

Thanks,
  Rasmus



LILO version 22.7.3, Copyright (C) 1992-1998 Werner Almesberger
Development beyond version 21 Copyright (C) 1999-2006 John Coffman
Released 11-Aug-2006 and compiled at 17:06:40 on Jan 17 2007

raid_setup: dev=000C  rdev=0340
raid_setup returns offset =   ndisk = 0
 BIOS   VolumeID   Device
Reading boot sector from /dev/hdb
geo_get: device 0340, all=1
pf_hard_disk_scan: (7,0) /dev/loop0
pf_hard_disk_scan: (3,64) /dev/hdb
pf_hard_disk_scan: (3,65) /dev/hdb1
lookup_dev:  number=0340
lookup_dev:  number=0340
pf:  dev=0340  id=B661B661  name=/dev/hdb
geo_query_dev: device=0340
lookup_dev:  number=0340
exit geo_query_dev
bios_dev:  device 0340
lookup_dev:  number=0340
bios_dev:  masked device 0340, which is /dev/hdb
bios_dev: geometry check found 0 matches
bios_dev: (0x82)  vol-ID=17FF01F9  *PT=08070AD0
bios_dev: (0x81)  vol-ID=7C4DC2CA  *PT=08070A88
bios_dev: (0x80)  vol-ID=B661B661  *PT=08070A40
bios_dev: PT match found 1 match (0x80)
pf_hard_disk_scan: (3,66) /dev/hdb2
pf_hard_disk_scan: (8,0) /dev/sda
pf_hard_disk_scan: (8,1) /dev/sda1
lookup_dev:  number=0800
lookup_dev:  number=0800
pf:  dev=0800  id=7C4DC2CA  name=/dev/sda
geo_query_dev: device=0800
lookup_dev:  number=0800
lookup_dev:  number=0300
exit geo_query_dev
bios_dev:  device 0800
lookup_dev:  number=0800
bios_dev:  masked device 0800, which is /dev/sda
bios_dev: geometry check found 0 matches
bios_dev: (0x82)  vol-ID=17FF01F9  *PT=08070AD0
bios_dev: (0x81)  vol-ID=7C4DC2CA  *PT=08070A88
bios_dev: (0x80)  vol-ID=B661B661  *PT=08070A40
bios_dev: PT match found 1 match (0x81)
pf_hard_disk_scan: (8,16) /dev/sdb
pf_hard_disk_scan: (8,17) /dev/sdb1
lookup_dev:  number=0810
lookup_dev:  number=0810
pf:  dev=0810  id=17FF01F9  name=/dev/sdb
geo_query_dev: device=0810
lookup_dev:  number=0810
lookup_dev:  number=0300
exit geo_query_dev
bios_dev:  device 0810
lookup_dev:  number=0810
bios_dev:  masked device 0810, which is /dev/sdb
bios_dev: geometry check found 0 matches
bios_dev: (0x82)  vol-ID=17FF01F9  *PT=08070AD0
bios_dev: (0x81)  vol-ID=7C4DC2CA  *PT=08070A88
bios_dev: (0x80)  vol-ID=B661B661  *PT=08070A40
bios_dev: PT match found 1 match (0x81)
pf_hard_disk_scan: (9,0) /dev/md0
pf_hard_disk_scan: (253,0) /dev/dm-0
Caching device /dev/dm-0 (0xFD00)
pf_hard_disk_scan: (253,1) /dev/dm-1
Caching device /dev/dm-1 (0xFD01)
pf_hard_disk_scan: (253,2) /dev/dm-2
Caching device /dev/dm-2 (0xFD02)
pf_hard_disk_scan: (253,3) /dev/dm-3
Caching device /dev/dm-3 (0xFD03)
pf_hard_disk_scan: (253,4) /dev/dm-4
Caching device /dev/dm-4 (0xFD04)
pf_hard_disk_scan: (253,5) /dev/dm-5
Caching device /dev/dm-5 (0xFD05)
pf_hard_disk_scan: (253,6) /dev/dm-6
Caching device /dev/dm-6 (0xFD06)
  0340  B661B661  /dev/hdb
  0800  7C4DC2CA  /dev/sda
  0810  17FF01F9  /dev/sdb
pf_hard_disk_scan: ndevs=3
  0340  B661B661  /dev/hdb
  0800  7C4DC2CA  /dev/sda
  0810  17FF01F9  /dev/sdb
Resolve invalid VolumeIDs
Resolve duplicate VolumeIDs
  0340  B661B661  /dev/hdb
  0800  7C4DC2CA  /dev/sda
  0810  17FF01F9  /dev/sdb
device codes (user assigned pf) = 0
device codes (user assigned) = 0
device codes (BIOS assigned) = 3
Filling in '/dev/sdb' = 0x82
device codes (canonical) = 7
geo_query_dev: device=0340
lookup_dev:  number=0340
exit geo_query_dev
bios_dev:  device 0340
lookup_dev:  number=0340
bios_dev:  masked device 0340, which is /dev/hdb
bios_dev: geometry check found 0 matches
bios_dev: (0x82)  vol-ID=17FF01F9  *PT=08070AD0
bios_dev: (0x81)  vol-ID=7C4DC2CA  *PT=08070A88
bios_dev: (0x80)  vol-ID=B661B661  *PT=08070A40
bios_dev: PT match found 1 match (0x80)
Device 0x0340: BIOS drive 0x80, 255 heads, 9729 cylinders,
   63 sectors. Partition offset: 0 sectors.
registering bios=0x80  device=0x0340
Using Volume ID B661B661 on bios 80
geo_get: device FD06, all=1
geo_query_dev: device=FD06
lookup_dev:  number=FD06
Fatal: Linux experimental device 0x04x needs to be defined.
Check 'man lilo.conf' under 'disk=' and 'max-partitions='
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Help with intrepeting SATA log messages

2008-01-19 Thread Rasmus Andersen
Hello,

I was hoping that you could help me interpret these SATA errors from my
brand new Western Digital disk (at end). Also, this disk seems to refuse
smart commands:


# smartctl -s on -o on -S on /dev/sda
smartctl version 5.37 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce
Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF ENABLE/DISABLE COMMANDS SECTION ===
SMART Enabled.
Error SMART Status command failed
Please get assistance from http://smartmontools.sourceforge.net/
Values from ATA status return descriptor are:
 00 09 0c 00 00 00 00 00 00  00 00 00 00 00 50
 A mandatory SMART command failed: exiting. To continue, add one or more
 '-T permissive' options.


Whats up with that? :)

Thanks in advance,
  Rasmus



md: recovery of RAID array md0
md: minimum _guaranteed_  speed: 1000 KB/sec/disk.
md: using maximum available idle IO bandwidth (but not more than 20 KB/sec) 
for recovery.
md: using 128k window, over a total of 198306240 blocks.
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:3f:aa:0b/00:03:01:00:00/e0 tag 0 cdb 0x0 data 393216 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:3f:aa:0b/00:03:01:00:00/e0 tag 0 cdb 0x0 data 393216 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:3f:aa:0b/00:03:01:00:00/e0 tag 0 cdb 0x0 data 393216 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:3f:aa:0b/00:03:01:00:00/e0 tag 0 cdb 0x0 data 393216 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:3f:aa:0b/00:03:01:00:00/e0 tag 0 cdb 0x0 data 393216 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:3f:aa:0b/00:03:01:00:00/e0 tag 0 cdb 0x0 data 393216 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08
sd 0:0:0:0: [sda] Sense Key : 0xb [current] [descriptor]
Descriptor sense data with sense descriptors (in hex):
72 0b 00 00 00 00 00 0c 00 0a 80 00 00 00 00 00 
01 00 00 01 
sd 0:0:0:0: [sda] ASC=0x0 ASCQ=0x0
end_request: I/O error, dev sda, sector 17541695
ata1: EH complete
sd 0:0:0:0: [sda] 976773168 512-byte hardware sectors (500108 MB)
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:bf:ad:0b/00:04:01:00:00/e0 tag 0 cdb 0x0 data 524288 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:bf:ad:0b/00:04:01:00:00/e0 tag 0 cdb 0x0 data 524288 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:bf:ad:0b/00:04:01:00:00/e0 tag 0 cdb 0x0 data 524288 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:bf:ad:0b/00:04:01:00:00/e0 tag 0 cdb 0x0 data 524288 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:bf:ad:0b/00:04:01:00:00/e0 tag 0 cdb 0x0 data 524288 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:bf:ad:0b/00:04:01:00:00/e0 tag 0 cdb 0x0 data 524288 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08
sd 0:0:0:0: [sda] Sense Key : 0xb [current] 

Help with intrepeting SATA log messages

2008-01-19 Thread Rasmus Andersen
Hello,

I was hoping that you could help me interpret these SATA errors from my
brand new Western Digital disk (at end). Also, this disk seems to refuse
smart commands:


# smartctl -s on -o on -S on /dev/sda
smartctl version 5.37 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce
Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF ENABLE/DISABLE COMMANDS SECTION ===
SMART Enabled.
Error SMART Status command failed
Please get assistance from http://smartmontools.sourceforge.net/
Values from ATA status return descriptor are:
 00 09 0c 00 00 00 00 00 00  00 00 00 00 00 50
 A mandatory SMART command failed: exiting. To continue, add one or more
 '-T permissive' options.


Whats up with that? :)

Thanks in advance,
  Rasmus



md: recovery of RAID array md0
md: minimum _guaranteed_  speed: 1000 KB/sec/disk.
md: using maximum available idle IO bandwidth (but not more than 20 KB/sec) 
for recovery.
md: using 128k window, over a total of 198306240 blocks.
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:3f:aa:0b/00:03:01:00:00/e0 tag 0 cdb 0x0 data 393216 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:3f:aa:0b/00:03:01:00:00/e0 tag 0 cdb 0x0 data 393216 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:3f:aa:0b/00:03:01:00:00/e0 tag 0 cdb 0x0 data 393216 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:3f:aa:0b/00:03:01:00:00/e0 tag 0 cdb 0x0 data 393216 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:3f:aa:0b/00:03:01:00:00/e0 tag 0 cdb 0x0 data 393216 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:3f:aa:0b/00:03:01:00:00/e0 tag 0 cdb 0x0 data 393216 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08
sd 0:0:0:0: [sda] Sense Key : 0xb [current] [descriptor]
Descriptor sense data with sense descriptors (in hex):
72 0b 00 00 00 00 00 0c 00 0a 80 00 00 00 00 00 
01 00 00 01 
sd 0:0:0:0: [sda] ASC=0x0 ASCQ=0x0
end_request: I/O error, dev sda, sector 17541695
ata1: EH complete
sd 0:0:0:0: [sda] 976773168 512-byte hardware sectors (500108 MB)
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:bf:ad:0b/00:04:01:00:00/e0 tag 0 cdb 0x0 data 524288 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:bf:ad:0b/00:04:01:00:00/e0 tag 0 cdb 0x0 data 524288 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:bf:ad:0b/00:04:01:00:00/e0 tag 0 cdb 0x0 data 524288 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:bf:ad:0b/00:04:01:00:00/e0 tag 0 cdb 0x0 data 524288 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:bf:ad:0b/00:04:01:00:00/e0 tag 0 cdb 0x0 data 524288 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: (BMDMA2 stat 0x181ca109)
ata1.00: cmd 25/00:00:bf:ad:0b/00:04:01:00:00/e0 tag 0 cdb 0x0 data 524288 in
 res 51/00:00:01:00:00/00:00:01:00:00/e0 Emask 0x1 (device error)
ata1.00: configured for UDMA/33
sd 0:0:0:0: [sda] Result: hostbyte=0x00 driverbyte=0x08
sd 0:0:0:0: [sda] Sense Key : 0xb [current] 

Re: RAID1 questions and errors and questions about errors :)

2007-05-28 Thread Rasmus Andersen
On Mon, May 28, 2007 at 11:57:55AM +0200, Rasmus Andersen wrote:
> My main problem is that a check/repair run of my RAID1 device reports
> errors. Not always the same number of errors and not monotonously
> increasing. It has not always been like this but I have not been able to
> link this to any external event.

Meh. I forgot to state that I have seen this with vanilla .20 and .21.1
and also with various gentoo kernels based on .20. But as stated, I am
not able to link this to a kernel upgrade.

Rasmus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RAID1 questions and errors and questions about errors :)

2007-05-28 Thread Rasmus Andersen
Hello,

I have for some time been facing some RAID1 issues which I finally have
been able to take the time to write about. I hope you can help me shed
some light on this.

My main problem is that a check/repair run of my RAID1 device reports
errors. Not always the same number of errors and not monotonously
increasing. It has not always been like this but I have not been able to
link this to any external event.

Secondary problems, probably linked to the main one, is that rtorrent
complains about checksum errors from time to time and that a loop of ten
sha1/md5 sums over a DVD image returns varying numbers, usually only a
single diffent one. The latter is more easily provoked if the system (my
home server) as such is busy (rdiff-backup, compiling, etc). (The
torrents and images reside on the RAID1 device.)

I have tried to run smart tests on the component drives and I have tried
memtest86+ for about 24 hours and doug ledfords memtest script[1] for
~12 hours, all without errors reported. The box is running gentoo so it
also sees a fair amount of gcc action, which also never have had a
SIGSEG or SIGBUS error pop up.

The system dmesg is attached, it a basic oldish athlon system with two
SATA drives on a SIL adapter with a PATA drive as well. The SATA drives
are the ones in the RAID1 setup. Running the md5sums on the PATA drive
has not resulted in any errors so far.

A tangential question to all of this is that if I use mdadm to create a
single-device raid1 setup consisting of my existing PATA partition, the
resulting device is smaller than the existing one, causing fsck to
complain bitterly about the FS being bigger than the device. Is that a
bug? The command I use to create the device is

   mdadm --create /dev/md1 -l 1 -n 2 /dev/hdb2 missing

(from memory but should capture the essence). I have wanted to create a
test RAID1 on the PATA drive to see if this caused errors to occur but
this prevents me from doing so, at least without some pain.


Lastly, I hope I made some sense :) I might well be that this is not
related to RAID1 at all but I have to start somewhere :)


[1] http://people.redhat.com/dledford/memtest.html

Thanks in advance,
  Rasmus
Linux version 2.6.21.1 ([EMAIL PROTECTED]) (gcc version 3.4.6 (Gentoo 3.4.6-r1, 
ssp-3.4.5-1.0, pie-8.7.9)) #2 Mon May 14 20:25:51 CEST 2007
BIOS-provided physical RAM map:
sanitize start
sanitize end
copy_e820_map() start:  size: 0009fc00 end: 
0009fc00 type: 1
copy_e820_map() type is E820_RAM
copy_e820_map() start: 0009fc00 size: 0400 end: 
000a type: 2
copy_e820_map() start: 000f size: 0001 end: 
0010 type: 2
copy_e820_map() start: 0010 size: 1feec000 end: 
1ffec000 type: 1
copy_e820_map() type is E820_RAM
copy_e820_map() start: 1ffec000 size: 3000 end: 
1ffef000 type: 3
copy_e820_map() start: 1ffef000 size: 0001 end: 
1000 type: 2
copy_e820_map() start: 1000 size: 1000 end: 
2000 type: 4
copy_e820_map() start:  size: 0001 end: 
0001 type: 2
 BIOS-e820:  - 0009fc00 (usable)
 BIOS-e820: 0009fc00 - 000a (reserved)
 BIOS-e820: 000f - 0010 (reserved)
 BIOS-e820: 0010 - 1ffec000 (usable)
 BIOS-e820: 1ffec000 - 1ffef000 (ACPI data)
 BIOS-e820: 1ffef000 - 1000 (reserved)
 BIOS-e820: 1000 - 2000 (ACPI NVS)
 BIOS-e820:  - 0001 (reserved)
511MB LOWMEM available.
Entering add_active_range(0, 0, 131052) 0 entries of 256 used
Zone PFN ranges:
  DMA 0 -> 4096
  Normal   4096 ->   131052
early_node_map[1] active PFN ranges
0:0 ->   131052
On node 0 totalpages: 131052
  DMA zone: 32 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 4064 pages, LIFO batch:0
  Normal zone: 991 pages used for memmap
  Normal zone: 125965 pages, LIFO batch:31
DMI 2.3 present.
ACPI: RSDP 000F7930, 0014 (r0 ASUS  )
ACPI: RSDT 1FFEC000, 002C (r1 ASUS   A7A266   42302E31 MSFT 31313031)
ACPI: FACP 1FFEC080, 0074 (r1 ASUS   A7A266   42302E31 MSFT 31313031)
ACPI: DSDT 1FFEC100, 291E (r1   ASUS A7A266   1000 MSFT  10B)
ACPI: FACS 1000, 0040
ACPI: BOOT 1FFEC040, 0028 (r1 ASUS   A7A266   42302E31 MSFT 31313031)
ACPI: PM-Timer IO Port: 0xe408
Allocating PCI resources starting at 3000 (gap: 2000:dfff)
Built 1 zonelists.  Total pages: 130029
Kernel command line: BOOT_IMAGE=2.6.21.1 ro root=902 root=/dev/ram0 
lvm2root=/dev/data1/root elevator=cfq hda=none
ide_setup: hda=none
Local APIC disabled by BIOS -- you can enable it with "lapic"
mapped APIC to d000 (01402000)
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Initializing CPU#0
PID hash table entries: 

RAID1 questions and errors and questions about errors :)

2007-05-28 Thread Rasmus Andersen
Hello,

I have for some time been facing some RAID1 issues which I finally have
been able to take the time to write about. I hope you can help me shed
some light on this.

My main problem is that a check/repair run of my RAID1 device reports
errors. Not always the same number of errors and not monotonously
increasing. It has not always been like this but I have not been able to
link this to any external event.

Secondary problems, probably linked to the main one, is that rtorrent
complains about checksum errors from time to time and that a loop of ten
sha1/md5 sums over a DVD image returns varying numbers, usually only a
single diffent one. The latter is more easily provoked if the system (my
home server) as such is busy (rdiff-backup, compiling, etc). (The
torrents and images reside on the RAID1 device.)

I have tried to run smart tests on the component drives and I have tried
memtest86+ for about 24 hours and doug ledfords memtest script[1] for
~12 hours, all without errors reported. The box is running gentoo so it
also sees a fair amount of gcc action, which also never have had a
SIGSEG or SIGBUS error pop up.

The system dmesg is attached, it a basic oldish athlon system with two
SATA drives on a SIL adapter with a PATA drive as well. The SATA drives
are the ones in the RAID1 setup. Running the md5sums on the PATA drive
has not resulted in any errors so far.

A tangential question to all of this is that if I use mdadm to create a
single-device raid1 setup consisting of my existing PATA partition, the
resulting device is smaller than the existing one, causing fsck to
complain bitterly about the FS being bigger than the device. Is that a
bug? The command I use to create the device is

   mdadm --create /dev/md1 -l 1 -n 2 /dev/hdb2 missing

(from memory but should capture the essence). I have wanted to create a
test RAID1 on the PATA drive to see if this caused errors to occur but
this prevents me from doing so, at least without some pain.


Lastly, I hope I made some sense :) I might well be that this is not
related to RAID1 at all but I have to start somewhere :)


[1] http://people.redhat.com/dledford/memtest.html

Thanks in advance,
  Rasmus
Linux version 2.6.21.1 ([EMAIL PROTECTED]) (gcc version 3.4.6 (Gentoo 3.4.6-r1, 
ssp-3.4.5-1.0, pie-8.7.9)) #2 Mon May 14 20:25:51 CEST 2007
BIOS-provided physical RAM map:
sanitize start
sanitize end
copy_e820_map() start:  size: 0009fc00 end: 
0009fc00 type: 1
copy_e820_map() type is E820_RAM
copy_e820_map() start: 0009fc00 size: 0400 end: 
000a type: 2
copy_e820_map() start: 000f size: 0001 end: 
0010 type: 2
copy_e820_map() start: 0010 size: 1feec000 end: 
1ffec000 type: 1
copy_e820_map() type is E820_RAM
copy_e820_map() start: 1ffec000 size: 3000 end: 
1ffef000 type: 3
copy_e820_map() start: 1ffef000 size: 0001 end: 
1000 type: 2
copy_e820_map() start: 1000 size: 1000 end: 
2000 type: 4
copy_e820_map() start:  size: 0001 end: 
0001 type: 2
 BIOS-e820:  - 0009fc00 (usable)
 BIOS-e820: 0009fc00 - 000a (reserved)
 BIOS-e820: 000f - 0010 (reserved)
 BIOS-e820: 0010 - 1ffec000 (usable)
 BIOS-e820: 1ffec000 - 1ffef000 (ACPI data)
 BIOS-e820: 1ffef000 - 1000 (reserved)
 BIOS-e820: 1000 - 2000 (ACPI NVS)
 BIOS-e820:  - 0001 (reserved)
511MB LOWMEM available.
Entering add_active_range(0, 0, 131052) 0 entries of 256 used
Zone PFN ranges:
  DMA 0 - 4096
  Normal   4096 -   131052
early_node_map[1] active PFN ranges
0:0 -   131052
On node 0 totalpages: 131052
  DMA zone: 32 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 4064 pages, LIFO batch:0
  Normal zone: 991 pages used for memmap
  Normal zone: 125965 pages, LIFO batch:31
DMI 2.3 present.
ACPI: RSDP 000F7930, 0014 (r0 ASUS  )
ACPI: RSDT 1FFEC000, 002C (r1 ASUS   A7A266   42302E31 MSFT 31313031)
ACPI: FACP 1FFEC080, 0074 (r1 ASUS   A7A266   42302E31 MSFT 31313031)
ACPI: DSDT 1FFEC100, 291E (r1   ASUS A7A266   1000 MSFT  10B)
ACPI: FACS 1000, 0040
ACPI: BOOT 1FFEC040, 0028 (r1 ASUS   A7A266   42302E31 MSFT 31313031)
ACPI: PM-Timer IO Port: 0xe408
Allocating PCI resources starting at 3000 (gap: 2000:dfff)
Built 1 zonelists.  Total pages: 130029
Kernel command line: BOOT_IMAGE=2.6.21.1 ro root=902 root=/dev/ram0 
lvm2root=/dev/data1/root elevator=cfq hda=none
ide_setup: hda=none
Local APIC disabled by BIOS -- you can enable it with lapic
mapped APIC to d000 (01402000)
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Initializing CPU#0
PID hash table entries: 2048 

Re: RAID1 questions and errors and questions about errors :)

2007-05-28 Thread Rasmus Andersen
On Mon, May 28, 2007 at 11:57:55AM +0200, Rasmus Andersen wrote:
 My main problem is that a check/repair run of my RAID1 device reports
 errors. Not always the same number of errors and not monotonously
 increasing. It has not always been like this but I have not been able to
 link this to any external event.

Meh. I forgot to state that I have seen this with vanilla .20 and .21.1
and also with various gentoo kernels based on .20. But as stated, I am
not able to link this to a kernel upgrade.

Rasmus
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


raid 1 check and component device mismatches

2007-02-22 Thread Rasmus Andersen
Hello,

Let me first start by saying that if a better place to ask these
quesions is to be found, please let me know.

I have a 2.6.20 kernel running a raid 1 set with two SATA disks.
Recently (on an older (gentoo-specific) kernel) I started getting
entries like this after my weekly 'echo check >
/sys/block/md0/md/sync_action'

mdadm: RebuildFinished event detected on md device /dev/md0, component 
device  mismatches found : 375936

I have tried 'repair' a number of times but to no avail. The disks seem
OK from their smart values and I have yet to discover an actual data
problem. Still, I am a bit unsettled and would like to hear opinions.
I have attached dmesg and smartctl -a output from both disks, if more is
needed I am happy to provide.

Thanks in advance,
  Rasmus
000 end: 1ffef000 type: 3
copy_e820_map() start: 1ffef000 size: 0001 end: 
1000 type: 2
copy_e820_map() start: 1000 size: 1000 end: 
2000 type: 4
copy_e820_map() start:  size: 0001 end: 
0001 type: 2
 BIOS-e820:  - 0009fc00 (usable)
 BIOS-e820: 0009fc00 - 000a (reserved)
 BIOS-e820: 000f - 0010 (reserved)
 BIOS-e820: 0010 - 1ffec000 (usable)
 BIOS-e820: 1ffec000 - 1ffef000 (ACPI data)
 BIOS-e820: 1ffef000 - 1000 (reserved)
 BIOS-e820: 1000 - 2000 (ACPI NVS)
 BIOS-e820:  - 0001 (reserved)
511MB LOWMEM available.
Entering add_active_range(0, 0, 131052) 0 entries of 256 used
Zone PFN ranges:
  DMA 0 -> 4096
  Normal   4096 ->   131052
early_node_map[1] active PFN ranges
0:0 ->   131052
On node 0 totalpages: 131052
  DMA zone: 32 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 4064 pages, LIFO batch:0
  Normal zone: 991 pages used for memmap
  Normal zone: 125965 pages, LIFO batch:31
DMI 2.3 present.
ACPI: RSDP (v000 ASUS  ) @ 0x000f7930
ACPI: RSDT (v001 ASUS   A7A266   0x42302e31 MSFT 0x31313031) @ 0x1ffec000
ACPI: FADT (v001 ASUS   A7A266   0x42302e31 MSFT 0x31313031) @ 0x1ffec080
ACPI: BOOT (v001 ASUS   A7A266   0x42302e31 MSFT 0x31313031) @ 0x1ffec040
ACPI: DSDT (v001   ASUS A7A266   0x1000 MSFT 0x010b) @ 0x
ACPI: PM-Timer IO Port: 0xe408
Allocating PCI resources starting at 3000 (gap: 2000:dfff)
Detected 1410.349 MHz processor.
Built 1 zonelists.  Total pages: 130029
Kernel command line: BOOT_IMAGE=2.6.20 ro root=902 root=/dev/ram0 
lvm2root=/dev/data1/root elevator=cfq hda=none
ide_setup: hda=none
Local APIC disabled by BIOS -- you can enable it with "lapic"
mapped APIC to d000 (01402000)
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Initializing CPU#0
PID hash table entries: 2048 (order: 11, 8192 bytes)
Console: colour VGA+ 80x25
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 513016k/524208k available (2387k kernel code, 10660k reserved, 938k 
data, 188k init, 0k highmem)
virtual kernel memory layout:
fixmap  : 0xfffb7000 - 0xf000   ( 288 kB)
vmalloc : 0xe080 - 0xfffb5000   ( 503 MB)
lowmem  : 0xc000 - 0xdffec000   ( 511 MB)
  .init : 0xc0442000 - 0xc0471000   ( 188 kB)
  .data : 0xc0354fda - 0xc043f8a4   ( 938 kB)
  .text : 0xc010 - 0xc0354fda   (2387 kB)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Calibrating delay using timer specific routine.. 2822.33 BogoMIPS (lpj=5644677)
Mount-cache hash table entries: 512
CPU: After generic identify, caps: 0383f9ff c1cbf9ff    
 
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 256K (64 bytes/line)
CPU: After all inits, caps: 0383f9ff c1cbf9ff  0420  
 
Intel machine check architecture supported.
Intel machine check reporting enabled on CPU#0.
Compat vDSO mapped to e000.
CPU: AMD Athlon(TM) XP1600+ stepping 02
Checking 'hlt' instruction... OK.
ACPI: Core revision 20060707
ACPI: setting ELCR to 0200 (from 1e60)
NET: Registered protocol family 16
ACPI: bus type pci registered
PCI: PCI BIOS revision 2.10 entry at 0xf1170, last bus=1
PCI: Using configuration type 1
Setting up standard PCI resources
ACPI: Interpreter enabled
ACPI: Using PIC for interrupt routing
ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 9 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 9 *10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 7 9 10 11 *12 14 15)
ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 *5 6 7 9 10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 *6 7 9 10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 6 7 9 10 11 12 14 15) *0, disabled.
ACPI: PCI 

raid 1 check and component device mismatches

2007-02-22 Thread Rasmus Andersen
Hello,

Let me first start by saying that if a better place to ask these
quesions is to be found, please let me know.

I have a 2.6.20 kernel running a raid 1 set with two SATA disks.
Recently (on an older (gentoo-specific) kernel) I started getting
entries like this after my weekly 'echo check 
/sys/block/md0/md/sync_action'

mdadm: RebuildFinished event detected on md device /dev/md0, component 
device  mismatches found : 375936

I have tried 'repair' a number of times but to no avail. The disks seem
OK from their smart values and I have yet to discover an actual data
problem. Still, I am a bit unsettled and would like to hear opinions.
I have attached dmesg and smartctl -a output from both disks, if more is
needed I am happy to provide.

Thanks in advance,
  Rasmus
000 end: 1ffef000 type: 3
copy_e820_map() start: 1ffef000 size: 0001 end: 
1000 type: 2
copy_e820_map() start: 1000 size: 1000 end: 
2000 type: 4
copy_e820_map() start:  size: 0001 end: 
0001 type: 2
 BIOS-e820:  - 0009fc00 (usable)
 BIOS-e820: 0009fc00 - 000a (reserved)
 BIOS-e820: 000f - 0010 (reserved)
 BIOS-e820: 0010 - 1ffec000 (usable)
 BIOS-e820: 1ffec000 - 1ffef000 (ACPI data)
 BIOS-e820: 1ffef000 - 1000 (reserved)
 BIOS-e820: 1000 - 2000 (ACPI NVS)
 BIOS-e820:  - 0001 (reserved)
511MB LOWMEM available.
Entering add_active_range(0, 0, 131052) 0 entries of 256 used
Zone PFN ranges:
  DMA 0 - 4096
  Normal   4096 -   131052
early_node_map[1] active PFN ranges
0:0 -   131052
On node 0 totalpages: 131052
  DMA zone: 32 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 4064 pages, LIFO batch:0
  Normal zone: 991 pages used for memmap
  Normal zone: 125965 pages, LIFO batch:31
DMI 2.3 present.
ACPI: RSDP (v000 ASUS  ) @ 0x000f7930
ACPI: RSDT (v001 ASUS   A7A266   0x42302e31 MSFT 0x31313031) @ 0x1ffec000
ACPI: FADT (v001 ASUS   A7A266   0x42302e31 MSFT 0x31313031) @ 0x1ffec080
ACPI: BOOT (v001 ASUS   A7A266   0x42302e31 MSFT 0x31313031) @ 0x1ffec040
ACPI: DSDT (v001   ASUS A7A266   0x1000 MSFT 0x010b) @ 0x
ACPI: PM-Timer IO Port: 0xe408
Allocating PCI resources starting at 3000 (gap: 2000:dfff)
Detected 1410.349 MHz processor.
Built 1 zonelists.  Total pages: 130029
Kernel command line: BOOT_IMAGE=2.6.20 ro root=902 root=/dev/ram0 
lvm2root=/dev/data1/root elevator=cfq hda=none
ide_setup: hda=none
Local APIC disabled by BIOS -- you can enable it with lapic
mapped APIC to d000 (01402000)
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Initializing CPU#0
PID hash table entries: 2048 (order: 11, 8192 bytes)
Console: colour VGA+ 80x25
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 513016k/524208k available (2387k kernel code, 10660k reserved, 938k 
data, 188k init, 0k highmem)
virtual kernel memory layout:
fixmap  : 0xfffb7000 - 0xf000   ( 288 kB)
vmalloc : 0xe080 - 0xfffb5000   ( 503 MB)
lowmem  : 0xc000 - 0xdffec000   ( 511 MB)
  .init : 0xc0442000 - 0xc0471000   ( 188 kB)
  .data : 0xc0354fda - 0xc043f8a4   ( 938 kB)
  .text : 0xc010 - 0xc0354fda   (2387 kB)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Calibrating delay using timer specific routine.. 2822.33 BogoMIPS (lpj=5644677)
Mount-cache hash table entries: 512
CPU: After generic identify, caps: 0383f9ff c1cbf9ff    
 
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 256K (64 bytes/line)
CPU: After all inits, caps: 0383f9ff c1cbf9ff  0420  
 
Intel machine check architecture supported.
Intel machine check reporting enabled on CPU#0.
Compat vDSO mapped to e000.
CPU: AMD Athlon(TM) XP1600+ stepping 02
Checking 'hlt' instruction... OK.
ACPI: Core revision 20060707
ACPI: setting ELCR to 0200 (from 1e60)
NET: Registered protocol family 16
ACPI: bus type pci registered
PCI: PCI BIOS revision 2.10 entry at 0xf1170, last bus=1
PCI: Using configuration type 1
Setting up standard PCI resources
ACPI: Interpreter enabled
ACPI: Using PIC for interrupt routing
ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 9 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 9 *10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 7 9 10 11 *12 14 15)
ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 *5 6 7 9 10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 *6 7 9 10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 6 7 9 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link 

[PATCH] error path deallocation in ibmtr.c (246ac5)

2001-07-19 Thread Rasmus Andersen

Hi.

The following patch makes drivers/net/tokenring/ibmtr.c
call iounmap before it returns on error paths, makes it 
not use check_region(), makes it check the return
of request_region and init_trdev and adds a few comment
strings on #endifs.

It applies against 246ac5 and my writing this patch was
caused by the Stanford team reporting the init_trdev
problem a while back.


--- linux-246-ac5-clean/drivers/net/tokenring/ibmtr.c   Mon Jul 16 20:40:03 2001
+++ linux-246-ac5/drivers/net/tokenring/ibmtr.c Thu Jul 19 23:04:49 2001
@@ -330,7 +330,6 @@
for (i = 0; ibmtr_portlist[i]; i++) {
int ioaddr = ibmtr_portlist[i];
 
-   if (check_region(ioaddr, IBMTR_IO_EXTENT)) continue;
if (!ibmtr_probe1(dev, ioaddr)) return 0;
}
return -ENODEV;
@@ -355,6 +354,8 @@
 #ifndef MODULE
 #ifndef PCMCIA
dev = init_trdev(dev, 0);
+   if (!dev)
+   return -ENOMEM;
 #endif
 #endif
 
@@ -392,6 +393,7 @@
 *what we is there to learn of ISA/MCA or not TR card
 */
 #ifdef PCMCIA
+   iounmap(t_mmio);
ti = dev->priv; /*BMS moved up here */
t_mmio = ti->mmio;  /*BMS to get virtual address */
irq = ti->irq;  /*BMS to display the irq!   */
@@ -424,7 +426,12 @@
if (cardpresent == TR_ISA && (readb(AIPFID + t_mmio) == 0x0e))
cardpresent = TR_ISAPNP;
if (cardpresent == NOTOK) { /* "channel_id" did not match, report */
-   if (!(ibmtr_debug_trace & TRC_INIT)) return -ENODEV;
+   if (!(ibmtr_debug_trace & TRC_INIT)) {
+#ifndef PCMCIA
+   iounmap(t_mmio);
+#endif
+   return -ENODEV;
+   }
DPRINTK( "Channel ID string not found for PIOaddr: %4hx\n",
PIOaddr);
DPRINTK("Expected for ISA: ");
@@ -442,7 +449,10 @@
   waste the memory, just use the existing structure */
 #ifndef PCMCIA
ti = (struct tok_info *) kmalloc(sizeof(struct tok_info), GFP_KERNEL);
-   if (ti == NULL) return -ENOMEM;
+   if (ti == NULL) {
+   iounmap(t_mmio);
+   return -ENOMEM;
+   }
memset(ti, 0, sizeof(struct tok_info));
ti->mmio = t_mmio;
dev->priv = ti; /* this seems like the logical use of the
@@ -459,7 +469,7 @@
ti->turbo=1;
t_irq=turbo_irq[i];
 }
-#endif
+#endif /* !PCMCIA */
ti->readlog_pending = 0;
init_waitqueue_head(>wait_for_reset);
 
@@ -496,6 +506,7 @@
while (!readb(ti->mmio + ACA_OFFSET + ACA_RW + RRR_EVEN)){
if (!time_after(jiffies, timeout)) continue;
DPRINTK( "Hardware timeout during initialization.\n");
+   iounmap(t_mmio);
kfree(ti);
return -ENODEV;
}
@@ -609,6 +620,7 @@
default:
DPRINTK("Unknown shared ram paging info %01X\n",
ti->shared_ram_paging);
+   iounmap(t_mmio); 
kfree(ti);
return -ENODEV;
break;
@@ -638,6 +650,7 @@
DPRINTK("Shared RAM for this adapter (%05x) exceeds "
"driver limit (%05x), adapter not started.\n",
chk_base, ibmtr_mem_base + IBMTR_SHARED_RAM_SIZE);
+   iounmap(t_mmio);
kfree(ti);
return -ENODEV;
} else { /* seems cool, record what we have figured out */
@@ -652,16 +665,24 @@
if (request_irq(dev->irq = irq, _interrupt, 0, "ibmtr", dev) != 0) {
DPRINTK("Could not grab irq %d.  Halting Token Ring driver.\n",
irq);
+   iounmap(t_mmio);
kfree(ti);
return -ENODEV;
}
/*?? Now, allocate some of the PIO PORTs for this driver.. */
/* record PIOaddr range as busy */
-   request_region(PIOaddr, IBMTR_IO_EXTENT, "ibmtr");
+   if (!request_region(PIOaddr, IBMTR_IO_EXTENT, "ibmtr")) {
+   DPRINTK("Could not grab PIO range. Halting driver.\n");
+   free_irq(dev->irq);
+   iounmap(t_mmio);
+   kfree(ti);
+   return -EBUSY;
+   }
+
if (!version_printed++) {
printk(version);
}
-#endif
+#endif /* !PCMCIA */
DPRINTK("%s %s found\n",
channel_def[cardpresent - 1], adapter_def(ti->adapter_type));
DPRINTK("using irq %d, PIOaddr %hx, %dK shared RAM.\n",
-- 
Regards,
Rasmus([EMAIL PROTECTED])

"I begin by taking. I shall find scholars later to demonstrate my 
perfect right." - Frederick (II) the Great
-
To 

[PATCH] error path deallocation in ibmtr.c (246ac5)

2001-07-19 Thread Rasmus Andersen

Hi.

The following patch makes drivers/net/tokenring/ibmtr.c
call iounmap before it returns on error paths, makes it 
not use check_region(), makes it check the return
of request_region and init_trdev and adds a few comment
strings on #endifs.

It applies against 246ac5 and my writing this patch was
caused by the Stanford team reporting the init_trdev
problem a while back.


--- linux-246-ac5-clean/drivers/net/tokenring/ibmtr.c   Mon Jul 16 20:40:03 2001
+++ linux-246-ac5/drivers/net/tokenring/ibmtr.c Thu Jul 19 23:04:49 2001
@@ -330,7 +330,6 @@
for (i = 0; ibmtr_portlist[i]; i++) {
int ioaddr = ibmtr_portlist[i];
 
-   if (check_region(ioaddr, IBMTR_IO_EXTENT)) continue;
if (!ibmtr_probe1(dev, ioaddr)) return 0;
}
return -ENODEV;
@@ -355,6 +354,8 @@
 #ifndef MODULE
 #ifndef PCMCIA
dev = init_trdev(dev, 0);
+   if (!dev)
+   return -ENOMEM;
 #endif
 #endif
 
@@ -392,6 +393,7 @@
 *what we is there to learn of ISA/MCA or not TR card
 */
 #ifdef PCMCIA
+   iounmap(t_mmio);
ti = dev-priv; /*BMS moved up here */
t_mmio = ti-mmio;  /*BMS to get virtual address */
irq = ti-irq;  /*BMS to display the irq!   */
@@ -424,7 +426,12 @@
if (cardpresent == TR_ISA  (readb(AIPFID + t_mmio) == 0x0e))
cardpresent = TR_ISAPNP;
if (cardpresent == NOTOK) { /* channel_id did not match, report */
-   if (!(ibmtr_debug_trace  TRC_INIT)) return -ENODEV;
+   if (!(ibmtr_debug_trace  TRC_INIT)) {
+#ifndef PCMCIA
+   iounmap(t_mmio);
+#endif
+   return -ENODEV;
+   }
DPRINTK( Channel ID string not found for PIOaddr: %4hx\n,
PIOaddr);
DPRINTK(Expected for ISA: );
@@ -442,7 +449,10 @@
   waste the memory, just use the existing structure */
 #ifndef PCMCIA
ti = (struct tok_info *) kmalloc(sizeof(struct tok_info), GFP_KERNEL);
-   if (ti == NULL) return -ENOMEM;
+   if (ti == NULL) {
+   iounmap(t_mmio);
+   return -ENOMEM;
+   }
memset(ti, 0, sizeof(struct tok_info));
ti-mmio = t_mmio;
dev-priv = ti; /* this seems like the logical use of the
@@ -459,7 +469,7 @@
ti-turbo=1;
t_irq=turbo_irq[i];
 }
-#endif
+#endif /* !PCMCIA */
ti-readlog_pending = 0;
init_waitqueue_head(ti-wait_for_reset);
 
@@ -496,6 +506,7 @@
while (!readb(ti-mmio + ACA_OFFSET + ACA_RW + RRR_EVEN)){
if (!time_after(jiffies, timeout)) continue;
DPRINTK( Hardware timeout during initialization.\n);
+   iounmap(t_mmio);
kfree(ti);
return -ENODEV;
}
@@ -609,6 +620,7 @@
default:
DPRINTK(Unknown shared ram paging info %01X\n,
ti-shared_ram_paging);
+   iounmap(t_mmio); 
kfree(ti);
return -ENODEV;
break;
@@ -638,6 +650,7 @@
DPRINTK(Shared RAM for this adapter (%05x) exceeds 
driver limit (%05x), adapter not started.\n,
chk_base, ibmtr_mem_base + IBMTR_SHARED_RAM_SIZE);
+   iounmap(t_mmio);
kfree(ti);
return -ENODEV;
} else { /* seems cool, record what we have figured out */
@@ -652,16 +665,24 @@
if (request_irq(dev-irq = irq, tok_interrupt, 0, ibmtr, dev) != 0) {
DPRINTK(Could not grab irq %d.  Halting Token Ring driver.\n,
irq);
+   iounmap(t_mmio);
kfree(ti);
return -ENODEV;
}
/*?? Now, allocate some of the PIO PORTs for this driver.. */
/* record PIOaddr range as busy */
-   request_region(PIOaddr, IBMTR_IO_EXTENT, ibmtr);
+   if (!request_region(PIOaddr, IBMTR_IO_EXTENT, ibmtr)) {
+   DPRINTK(Could not grab PIO range. Halting driver.\n);
+   free_irq(dev-irq);
+   iounmap(t_mmio);
+   kfree(ti);
+   return -EBUSY;
+   }
+
if (!version_printed++) {
printk(version);
}
-#endif
+#endif /* !PCMCIA */
DPRINTK(%s %s found\n,
channel_def[cardpresent - 1], adapter_def(ti-adapter_type));
DPRINTK(using irq %d, PIOaddr %hx, %dK shared RAM.\n,
-- 
Regards,
Rasmus([EMAIL PROTECTED])

I begin by taking. I shall find scholars later to demonstrate my 
perfect right. - Frederick (II) the Great
-
To unsubscribe from this list: send the line 

Re: [PATCH] catch potential null derefs in drivers/char/ip2main.c (245ac16)

2001-06-25 Thread Rasmus Andersen

On Sun, Jun 24, 2001 at 07:14:00PM -0400, Michael H. Warfield wrote:
[...] 
>   I'm responsible for the kernel / driver integration end of it
> anyways.
> 
>   I'll find out what's up with Doug, but this is my issue to deal
> with anyways.  And yes, I'm looking at it.  I've got a couple of other
> patches on the back burner that are overdue for integration.

The pB deref below kinda bothers me. It is last set way above as
part of looping through stuff comparing it to NULL. It seems
bogus to use is as below but I have no clue what should be used
instead.

[..]
> > -   for ( box = 0; box < ABS_MAX_BOXES; ++box )
> > -   {
> > -   for ( j = 0; j < ABS_BIGGEST_BOX; ++j )
> > -   {
> > -   if ( pB->i2eChannelMap[box] & (1 << j) )
> > +   for ( box = 0; box < ABS_MAX_BOXES; ++box )
> > {

Regards,
  Rasmus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] catch potential null derefs in drivers/char/ip2main.c (245ac16)

2001-06-25 Thread Rasmus Andersen

On Sun, Jun 24, 2001 at 07:14:00PM -0400, Michael H. Warfield wrote:
[...] 
   I'm responsible for the kernel / driver integration end of it
 anyways.
 
   I'll find out what's up with Doug, but this is my issue to deal
 with anyways.  And yes, I'm looking at it.  I've got a couple of other
 patches on the back burner that are overdue for integration.

The pB deref below kinda bothers me. It is last set way above as
part of looping through stuff comparing it to NULL. It seems
bogus to use is as below but I have no clue what should be used
instead.

[..]
  -   for ( box = 0; box  ABS_MAX_BOXES; ++box )
  -   {
  -   for ( j = 0; j  ABS_BIGGEST_BOX; ++j )
  -   {
  -   if ( pB-i2eChannelMap[box]  (1  j) )
  +   for ( box = 0; box  ABS_MAX_BOXES; ++box )
  {

Regards,
  Rasmus
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] catch potential null derefs in drivers/char/ip2main.c (245ac16)

2001-06-24 Thread Rasmus Andersen

On Sun, Jun 24, 2001 at 07:14:00PM -0400, Michael H. Warfield wrote:
> On Sun, Jun 24, 2001 at 11:06:06PM +0200, Rasmus Andersen wrote:
> > Hi.
> 
> > (My last mail to [EMAIL PROTECTED] bounced. Is there another
> > maintainer for drivers/char/ip2main.c somewhere?)
> 
>   I'm still here.  :-)  Just look one more line down below
> Doug's line.  There I am.

Ah. My apoligies. I am not accustomed to the luxury of having
multiple maintainers to bug :) No slight intended.

Regards,
  Rasmus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] add create_proc_entry check to videodev.c (245ac16)

2001-06-24 Thread Rasmus Andersen

Hi.

The patch below adds a check for create_proc_entry return code
in drivers/media/video/videodev.c. It applies against 245-ac16
and 246p6.


--- linux-245-ac16-clean/drivers/media/video/videodev.c Sun May 27 22:15:23 2001
+++ linux-245-ac16/drivers/media/video/videodev.c   Sun Jun 24 23:33:36 2001
@@ -373,6 +373,8 @@
return;
 
p = create_proc_entry(name, S_IFREG|S_IRUGO|S_IWUSR, video_dev_proc_entry);
+   if (!p)
+   return;
p->data = vfd;
p->read_proc = videodev_proc_read;
 
-- 
Regards,
Rasmus([EMAIL PROTECTED])

Genius may have its limitations, but stupidity is not thus handicapped. 
  -- Elbert Hubbard 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] kmalloc check for drivers/media/video/i2c-parport.c (245ac16)

2001-06-24 Thread Rasmus Andersen

Hi.

The following patch tries to avoid a potential null pointer
dereference. It applies against 245-ac16 and 246p6. The
dereference was originally reported by the Stanford team.


--- linux-245-ac16-clean/drivers/media/video/i2c-parport.c  Thu Jul 13 01:24:33 
2000
+++ linux-245-ac16/drivers/media/video/i2c-parport.cSun Jun 24 23:22:19 2001
@@ -74,6 +74,10 @@
 {
   struct parport_i2c_bus *b = kmalloc(sizeof(struct parport_i2c_bus), 
  GFP_KERNEL);
+  if (!b) {
+ printk(KERN_ERR __FUNCTION__ ": Memory allocation failed. Not attaching.\n");
+ return;
+  }
   b->i2c = parport_i2c_bus_template;
   b->i2c.data = parport_get_port (port);
   strncpy(b->i2c.name, port->name, 32);
-- 
Regards,
Rasmus([EMAIL PROTECTED])

"A statesman... is a dead politician. Lord knows, we need more statesmen." 
   -- Bloom County
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] catch potential null derefs in drivers/char/ip2main.c (245ac16)

2001-06-24 Thread Rasmus Andersen

Hi.

(My last mail to [EMAIL PROTECTED] bounced. Is there another
maintainer for drivers/char/ip2main.c somewhere?)

The patch below tries to avoid dereferencing (potential)
NULL pointers. It was reported by the Stanford team way
back and applies against 245ac16 and 246p6. It could
probably be done nicer but that would take someone that
actually understands this code.

--- linux-245-ac16-clean/drivers/char/ip2main.c Sat May 19 20:58:17 2001
+++ linux-245-ac16/drivers/char/ip2main.c   Sun Jun 24 22:37:27 2001
@@ -866,36 +866,38 @@
}
 
 #ifdef CONFIG_DEVFS_FS
-   sprintf( name, "ipl%d", i );
-   i2BoardPtrTable[i]->devfs_ipl_handle =
-   devfs_register (devfs_handle, name,
-   DEVFS_FL_DEFAULT,
-   IP2_IPL_MAJOR, 4 * i,
-   S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR,
-   _ipl, NULL);
+   if (i2BoardPtrTable[i] && pB) {
+   sprintf( name, "ipl%d", i );
+   i2BoardPtrTable[i]->devfs_ipl_handle =
+   devfs_register (devfs_handle, name,
+   DEVFS_FL_DEFAULT,
+   IP2_IPL_MAJOR, 4 * i,
+   S_IRUSR | S_IWUSR | S_IRGRP | 
+S_IFCHR,
+   _ipl, NULL);
 
-   sprintf( name, "stat%d", i );
-   i2BoardPtrTable[i]->devfs_stat_handle =
-   devfs_register (devfs_handle, name,
-   DEVFS_FL_DEFAULT,
-   IP2_IPL_MAJOR, 4 * i + 1,
-   S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR,
-   _ipl, NULL);
+   sprintf( name, "stat%d", i );
+   i2BoardPtrTable[i]->devfs_stat_handle =
+   devfs_register (devfs_handle, name,
+   DEVFS_FL_DEFAULT,
+   IP2_IPL_MAJOR, 4 * i + 1,
+   S_IRUSR | S_IWUSR | S_IRGRP | 
+S_IFCHR,
+   _ipl, NULL);
 
-   for ( box = 0; box < ABS_MAX_BOXES; ++box )
-   {
-   for ( j = 0; j < ABS_BIGGEST_BOX; ++j )
-   {
-   if ( pB->i2eChannelMap[box] & (1 << j) )
+   for ( box = 0; box < ABS_MAX_BOXES; ++box )
{
-   tty_register_devfs(_tty_driver,
-   0, j + ABS_BIGGEST_BOX *
-   (box+i*ABS_MAX_BOXES));
-   tty_register_devfs(_callout_driver,
-   0, j + ABS_BIGGEST_BOX *
-   (box+i*ABS_MAX_BOXES));
+   for ( j = 0; j < ABS_BIGGEST_BOX; ++j )
+   {
+   if ( pB->i2eChannelMap[box] & (1 << j) 
+)
+   {
+   
+tty_register_devfs(_tty_driver,
+  0, j + 
+ABS_BIGGEST_BOX *
+  
+(box+i*ABS_MAX_BOXES));
+   
+tty_register_devfs(_callout_driver,
+  0, j + 
+ABS_BIGGEST_BOX *
+  
+(box+i*ABS_MAX_BOXES));
+   }
+   }
}
-   }
}
 #endif
 
-- 
Regards,
Rasmus([EMAIL PROTECTED])

A chicken and an egg are lying in bed. The chicken is smoking a
cigarette with a satisfied smile on it's face and the egg is frowning
and looking a bit pissed off. The egg mutters, to no-one in particular,
"Well, I guess we answered THAT question..."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] add kmalloc check in drviers/pcmcia/rsrc_mgr.c (245-ac16)

2001-06-24 Thread Rasmus Andersen

On Sun, Jun 24, 2001 at 10:52:31PM +0200, Eric Lammerts wrote:
[...] 
> There are zillions of functions called 'init_module' in the kernel.
> I think my suggestion was better (and it had a \n at the end!)

Agreed. Actually, 'ouch' on point two :) BTW, was it intentional
that you dropped the maintainer from the recipient-list back then?

--- linux-245-ac16-clean/drivers/pcmcia/rsrc_mgr.c  Sat May 19 20:59:21 2001+++ 
linux-245-ac16/drivers/pcmcia/rsrc_mgr.cSat Jun 23 15:06:54 2001
@@ -189,6 +189,11 @@
 
 /* First, what does a floating port look like? */
 b = kmalloc(256, GFP_KERNEL);
+if (!b) {
+   printk(" -- aborting.\n");
+   printk(KERN_ERR "rsrc_mgr: Out of memory.\n");
+   return;
+}
 memset(b, 0, 256);
 for (i = base, most = 0; i < base+num; i += 8) {
if (check_io_resource(i, 8))
-- 
Regards,
Rasmus([EMAIL PROTECTED])

You know how dumb the average guy is?  Well, by  definition, half
of them are even dumber than that.
-- J.R. "Bob" Dobbs 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] add kmalloc check in drviers/pcmcia/rsrc_mgr.c (245-ac16)

2001-06-24 Thread Rasmus Andersen

On Sat, Jun 23, 2001 at 02:30:06PM -0300, Arnaldo Carvalho de Melo wrote:
[...] 
> printk(KERN_ERR __FUNCTION__ "Out of memory.");
> 
> Then if you move the code to other function or if you change the name of
> the function you don't have to go all over the code doing
> s/old_function_name/new_function_name/g

Excellent suggestion. How about this one:

--- linux-245-ac16-clean/drivers/pcmcia/rsrc_mgr.c  Sat May 19 20:59:21 2001+++ 
linux-245-ac16/drivers/pcmcia/rsrc_mgr.cSat Jun 23 15:06:54 2001
@@ -189,6 +189,11 @@

 /* First, what does a floating port look like? */
 b = kmalloc(256, GFP_KERNEL);
+if (!b) {
+   printk(" -- aborting.\n");
+   printk(KERN_ERR __FUNCTION__ ": Out of memory.");
+   return;
+}
 memset(b, 0, 256);
 for (i = base, most = 0; i < base+num; i += 8) {
if (check_io_resource(i, 8))

-- 
Regards,
Rasmus([EMAIL PROTECTED])

You don't become a failure until you're satisfied with being one. 
  -- Anonymous
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] add kmalloc check in drviers/pcmcia/rsrc_mgr.c (245-ac16)

2001-06-24 Thread Rasmus Andersen

On Sat, Jun 23, 2001 at 02:30:06PM -0300, Arnaldo Carvalho de Melo wrote:
[...] 
 printk(KERN_ERR __FUNCTION__ Out of memory.);
 
 Then if you move the code to other function or if you change the name of
 the function you don't have to go all over the code doing
 s/old_function_name/new_function_name/g

Excellent suggestion. How about this one:

--- linux-245-ac16-clean/drivers/pcmcia/rsrc_mgr.c  Sat May 19 20:59:21 2001+++ 
linux-245-ac16/drivers/pcmcia/rsrc_mgr.cSat Jun 23 15:06:54 2001
@@ -189,6 +189,11 @@

 /* First, what does a floating port look like? */
 b = kmalloc(256, GFP_KERNEL);
+if (!b) {
+   printk( -- aborting.\n);
+   printk(KERN_ERR __FUNCTION__ : Out of memory.);
+   return;
+}
 memset(b, 0, 256);
 for (i = base, most = 0; i  base+num; i += 8) {
if (check_io_resource(i, 8))

-- 
Regards,
Rasmus([EMAIL PROTECTED])

You don't become a failure until you're satisfied with being one. 
  -- Anonymous
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] add kmalloc check in drviers/pcmcia/rsrc_mgr.c (245-ac16)

2001-06-24 Thread Rasmus Andersen

On Sun, Jun 24, 2001 at 10:52:31PM +0200, Eric Lammerts wrote:
[...] 
 There are zillions of functions called 'init_module' in the kernel.
 I think my suggestion was better (and it had a \n at the end!)

Agreed. Actually, 'ouch' on point two :) BTW, was it intentional
that you dropped the maintainer from the recipient-list back then?

--- linux-245-ac16-clean/drivers/pcmcia/rsrc_mgr.c  Sat May 19 20:59:21 2001+++ 
linux-245-ac16/drivers/pcmcia/rsrc_mgr.cSat Jun 23 15:06:54 2001
@@ -189,6 +189,11 @@
 
 /* First, what does a floating port look like? */
 b = kmalloc(256, GFP_KERNEL);
+if (!b) {
+   printk( -- aborting.\n);
+   printk(KERN_ERR rsrc_mgr: Out of memory.\n);
+   return;
+}
 memset(b, 0, 256);
 for (i = base, most = 0; i  base+num; i += 8) {
if (check_io_resource(i, 8))
-- 
Regards,
Rasmus([EMAIL PROTECTED])

You know how dumb the average guy is?  Well, by  definition, half
of them are even dumber than that.
-- J.R. Bob Dobbs 
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] catch potential null derefs in drivers/char/ip2main.c (245ac16)

2001-06-24 Thread Rasmus Andersen

Hi.

(My last mail to [EMAIL PROTECTED] bounced. Is there another
maintainer for drivers/char/ip2main.c somewhere?)

The patch below tries to avoid dereferencing (potential)
NULL pointers. It was reported by the Stanford team way
back and applies against 245ac16 and 246p6. It could
probably be done nicer but that would take someone that
actually understands this code.

--- linux-245-ac16-clean/drivers/char/ip2main.c Sat May 19 20:58:17 2001
+++ linux-245-ac16/drivers/char/ip2main.c   Sun Jun 24 22:37:27 2001
@@ -866,36 +866,38 @@
}
 
 #ifdef CONFIG_DEVFS_FS
-   sprintf( name, ipl%d, i );
-   i2BoardPtrTable[i]-devfs_ipl_handle =
-   devfs_register (devfs_handle, name,
-   DEVFS_FL_DEFAULT,
-   IP2_IPL_MAJOR, 4 * i,
-   S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR,
-   ip2_ipl, NULL);
+   if (i2BoardPtrTable[i]  pB) {
+   sprintf( name, ipl%d, i );
+   i2BoardPtrTable[i]-devfs_ipl_handle =
+   devfs_register (devfs_handle, name,
+   DEVFS_FL_DEFAULT,
+   IP2_IPL_MAJOR, 4 * i,
+   S_IRUSR | S_IWUSR | S_IRGRP | 
+S_IFCHR,
+   ip2_ipl, NULL);
 
-   sprintf( name, stat%d, i );
-   i2BoardPtrTable[i]-devfs_stat_handle =
-   devfs_register (devfs_handle, name,
-   DEVFS_FL_DEFAULT,
-   IP2_IPL_MAJOR, 4 * i + 1,
-   S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR,
-   ip2_ipl, NULL);
+   sprintf( name, stat%d, i );
+   i2BoardPtrTable[i]-devfs_stat_handle =
+   devfs_register (devfs_handle, name,
+   DEVFS_FL_DEFAULT,
+   IP2_IPL_MAJOR, 4 * i + 1,
+   S_IRUSR | S_IWUSR | S_IRGRP | 
+S_IFCHR,
+   ip2_ipl, NULL);
 
-   for ( box = 0; box  ABS_MAX_BOXES; ++box )
-   {
-   for ( j = 0; j  ABS_BIGGEST_BOX; ++j )
-   {
-   if ( pB-i2eChannelMap[box]  (1  j) )
+   for ( box = 0; box  ABS_MAX_BOXES; ++box )
{
-   tty_register_devfs(ip2_tty_driver,
-   0, j + ABS_BIGGEST_BOX *
-   (box+i*ABS_MAX_BOXES));
-   tty_register_devfs(ip2_callout_driver,
-   0, j + ABS_BIGGEST_BOX *
-   (box+i*ABS_MAX_BOXES));
+   for ( j = 0; j  ABS_BIGGEST_BOX; ++j )
+   {
+   if ( pB-i2eChannelMap[box]  (1  j) 
+)
+   {
+   
+tty_register_devfs(ip2_tty_driver,
+  0, j + 
+ABS_BIGGEST_BOX *
+  
+(box+i*ABS_MAX_BOXES));
+   
+tty_register_devfs(ip2_callout_driver,
+  0, j + 
+ABS_BIGGEST_BOX *
+  
+(box+i*ABS_MAX_BOXES));
+   }
+   }
}
-   }
}
 #endif
 
-- 
Regards,
Rasmus([EMAIL PROTECTED])

A chicken and an egg are lying in bed. The chicken is smoking a
cigarette with a satisfied smile on it's face and the egg is frowning
and looking a bit pissed off. The egg mutters, to no-one in particular,
Well, I guess we answered THAT question...
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] kmalloc check for drivers/media/video/i2c-parport.c (245ac16)

2001-06-24 Thread Rasmus Andersen

Hi.

The following patch tries to avoid a potential null pointer
dereference. It applies against 245-ac16 and 246p6. The
dereference was originally reported by the Stanford team.


--- linux-245-ac16-clean/drivers/media/video/i2c-parport.c  Thu Jul 13 01:24:33 
2000
+++ linux-245-ac16/drivers/media/video/i2c-parport.cSun Jun 24 23:22:19 2001
@@ -74,6 +74,10 @@
 {
   struct parport_i2c_bus *b = kmalloc(sizeof(struct parport_i2c_bus), 
  GFP_KERNEL);
+  if (!b) {
+ printk(KERN_ERR __FUNCTION__ : Memory allocation failed. Not attaching.\n);
+ return;
+  }
   b-i2c = parport_i2c_bus_template;
   b-i2c.data = parport_get_port (port);
   strncpy(b-i2c.name, port-name, 32);
-- 
Regards,
Rasmus([EMAIL PROTECTED])

A statesman... is a dead politician. Lord knows, we need more statesmen. 
   -- Bloom County
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] catch potential null derefs in drivers/char/ip2main.c (245ac16)

2001-06-24 Thread Rasmus Andersen

On Sun, Jun 24, 2001 at 07:14:00PM -0400, Michael H. Warfield wrote:
 On Sun, Jun 24, 2001 at 11:06:06PM +0200, Rasmus Andersen wrote:
  Hi.
 
  (My last mail to [EMAIL PROTECTED] bounced. Is there another
  maintainer for drivers/char/ip2main.c somewhere?)
 
   I'm still here.  :-)  Just look one more line down below
 Doug's line.  There I am.

Ah. My apoligies. I am not accustomed to the luxury of having
multiple maintainers to bug :) No slight intended.

Regards,
  Rasmus
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] add create_proc_entry check to videodev.c (245ac16)

2001-06-24 Thread Rasmus Andersen

Hi.

The patch below adds a check for create_proc_entry return code
in drivers/media/video/videodev.c. It applies against 245-ac16
and 246p6.


--- linux-245-ac16-clean/drivers/media/video/videodev.c Sun May 27 22:15:23 2001
+++ linux-245-ac16/drivers/media/video/videodev.c   Sun Jun 24 23:33:36 2001
@@ -373,6 +373,8 @@
return;
 
p = create_proc_entry(name, S_IFREG|S_IRUGO|S_IWUSR, video_dev_proc_entry);
+   if (!p)
+   return;
p-data = vfd;
p-read_proc = videodev_proc_read;
 
-- 
Regards,
Rasmus([EMAIL PROTECTED])

Genius may have its limitations, but stupidity is not thus handicapped. 
  -- Elbert Hubbard 
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] add kmalloc checking to fs/jffs/intrep.c (245-ac16)

2001-06-23 Thread Rasmus Andersen

Hi.

The following patch adds some checks for kmalloc returning NULL
to fs/jffs/intrep.c along with some way of getting that propagated
back. Applies against 245ac16 and 246p5. These dereferences were
reported by the Stanford team a way back.


--- linux-245-ac16-clean/fs/jffs/intrep.c   Thu Jun 21 21:26:24 2001
+++ linux-245-ac16/fs/jffs/intrep.c Sat Jun 23 16:25:33 2001
@@ -320,8 +320,8 @@
 }
 
 
-__u32
-jffs_checksum_flash(struct mtd_info *mtd, loff_t start, int size)
+int
+jffs_checksum_flash(struct mtd_info *mtd, loff_t start, int size, __u32* checksum)
 {
__u32 sum = 0;
loff_t ptr = start;
@@ -330,6 +330,10 @@
 
/* Allocate read buffer */
read_buf = (__u8 *) kmalloc (sizeof(__u8) * 4096, GFP_KERNEL);
+   if (!read_buf) {
+   printk(KERN_ERR "(jffs:) Out of memory allocating buffer. Aborting.");
+   return -1;
+   }
 
/* Loop until checksum done */
while (size) {
@@ -357,7 +361,8 @@
 
/* Return result */
D3(printk("checksum result: 0x%08x\n", sum));
-   return sum;
+   *checksum = sum;
+   return 0;
 }
 static __inline__ void jffs_fm_write_lock(struct jffs_fmcontrol *fmc)
 {
@@ -605,6 +610,8 @@
 
/* Allocate read buffer */
read_buf = (__u8 *) kmalloc (sizeof(__u8) * 4096, GFP_KERNEL);
+   if (!read_buf) 
+   return -ENOMEM;
 
/* Start the scan.  */
while (pos < end) {
@@ -859,7 +866,10 @@
if (raw_inode.rename) {
deleted_file = flash_read_u32(fmc->mtd, pos);
}
-   checksum = jffs_checksum_flash(fmc->mtd, pos, raw_inode.dsize);
+   if (jffs_checksum_flash(fmc->mtd, pos, 
+   raw_inode.dsize, ))
+   return -ENOMEM;
+
pos += raw_inode.dsize
   + JFFS_GET_PAD_BYTES(raw_inode.dsize);
 

-- 
Regards,
Rasmus([EMAIL PROTECTED])

Television is called a medium because it is neither rare nor well-done. 
  -- Anonymous
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] add kmalloc check in drviers/pcmcia/rsrc_mgr.c (245-ac16)

2001-06-23 Thread Rasmus Andersen

Hi.

The patch below adds a kmalloc check to drivers/pcmcmia/rsrc_mgr.c.
Against 245-ac16 but aplies to 256p6 also. Reported a while back 
by the stanford team.


--- linux-245-ac16-clean/drivers/pcmcia/rsrc_mgr.c  Sat May 19 20:59:21 2001
+++ linux-245-ac16/drivers/pcmcia/rsrc_mgr.cSat Jun 23 15:06:54 2001
@@ -189,6 +189,11 @@
 
 /* First, what does a floating port look like? */
 b = kmalloc(256, GFP_KERNEL);
+if (!b) {
+   printk(" -- aborting.\n");
+   printk(KERN_ERR "Out of memory.");
+   return;
+}
 memset(b, 0, 256);
 for (i = base, most = 0; i < base+num; i += 8) {
if (check_io_resource(i, 8))
-- 
Regards,
Rasmus([EMAIL PROTECTED])

"The obvious mathematical breakthrough would be development of an easy way
to factor large prime numbers." 
  -- Bill Gates, The Road Ahead, Viking Penguin (1995)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] add kmalloc check in drviers/pcmcia/rsrc_mgr.c (245-ac16)

2001-06-23 Thread Rasmus Andersen

Hi.

The patch below adds a kmalloc check to drivers/pcmcmia/rsrc_mgr.c.
Against 245-ac16 but aplies to 256p6 also. Reported a while back 
by the stanford team.


--- linux-245-ac16-clean/drivers/pcmcia/rsrc_mgr.c  Sat May 19 20:59:21 2001
+++ linux-245-ac16/drivers/pcmcia/rsrc_mgr.cSat Jun 23 15:06:54 2001
@@ -189,6 +189,11 @@
 
 /* First, what does a floating port look like? */
 b = kmalloc(256, GFP_KERNEL);
+if (!b) {
+   printk( -- aborting.\n);
+   printk(KERN_ERR Out of memory.);
+   return;
+}
 memset(b, 0, 256);
 for (i = base, most = 0; i  base+num; i += 8) {
if (check_io_resource(i, 8))
-- 
Regards,
Rasmus([EMAIL PROTECTED])

The obvious mathematical breakthrough would be development of an easy way
to factor large prime numbers. 
  -- Bill Gates, The Road Ahead, Viking Penguin (1995)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] add kmalloc checking to fs/jffs/intrep.c (245-ac16)

2001-06-23 Thread Rasmus Andersen

Hi.

The following patch adds some checks for kmalloc returning NULL
to fs/jffs/intrep.c along with some way of getting that propagated
back. Applies against 245ac16 and 246p5. These dereferences were
reported by the Stanford team a way back.


--- linux-245-ac16-clean/fs/jffs/intrep.c   Thu Jun 21 21:26:24 2001
+++ linux-245-ac16/fs/jffs/intrep.c Sat Jun 23 16:25:33 2001
@@ -320,8 +320,8 @@
 }
 
 
-__u32
-jffs_checksum_flash(struct mtd_info *mtd, loff_t start, int size)
+int
+jffs_checksum_flash(struct mtd_info *mtd, loff_t start, int size, __u32* checksum)
 {
__u32 sum = 0;
loff_t ptr = start;
@@ -330,6 +330,10 @@
 
/* Allocate read buffer */
read_buf = (__u8 *) kmalloc (sizeof(__u8) * 4096, GFP_KERNEL);
+   if (!read_buf) {
+   printk(KERN_ERR (jffs:) Out of memory allocating buffer. Aborting.);
+   return -1;
+   }
 
/* Loop until checksum done */
while (size) {
@@ -357,7 +361,8 @@
 
/* Return result */
D3(printk(checksum result: 0x%08x\n, sum));
-   return sum;
+   *checksum = sum;
+   return 0;
 }
 static __inline__ void jffs_fm_write_lock(struct jffs_fmcontrol *fmc)
 {
@@ -605,6 +610,8 @@
 
/* Allocate read buffer */
read_buf = (__u8 *) kmalloc (sizeof(__u8) * 4096, GFP_KERNEL);
+   if (!read_buf) 
+   return -ENOMEM;
 
/* Start the scan.  */
while (pos  end) {
@@ -859,7 +866,10 @@
if (raw_inode.rename) {
deleted_file = flash_read_u32(fmc-mtd, pos);
}
-   checksum = jffs_checksum_flash(fmc-mtd, pos, raw_inode.dsize);
+   if (jffs_checksum_flash(fmc-mtd, pos, 
+   raw_inode.dsize, checksum))
+   return -ENOMEM;
+
pos += raw_inode.dsize
   + JFFS_GET_PAD_BYTES(raw_inode.dsize);
 

-- 
Regards,
Rasmus([EMAIL PROTECTED])

Television is called a medium because it is neither rare nor well-done. 
  -- Anonymous
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] cleanup in drivers/mtd/ftl.c (245-ac16)

2001-06-22 Thread Rasmus Andersen

On Fri, Jun 22, 2001 at 05:21:06PM -0300, Arnaldo Carvalho de Melo wrote:
> Hi Rasmus,
> 
>   I've fixed this ones and its already in 2.4.6-pre5, please take a
> look and see if something is missing.

These patches are very close so I'll of course retract mine[1].
The only thing I'll recommend is the printk I have in the error
path.

[1] Sorry about the unnecessary mailing. I am not accustomed to
janitor-like patches being in Linus' kernel before Alan's :)
(Arnaldo already offered an explanation for why this one happened
to be.)
-- 
Regards,
Rasmus([EMAIL PROTECTED])

Smoking kills. If you're killed, you've lost a very important part of your
life.  -Brooke Shields, during an interview to become spokesperson for a
federal anti-smoking campaign.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] cleanup in drivers/mtd/ftl.c (245-ac16)

2001-06-22 Thread Rasmus Andersen

Hi.

The patch below adds one instance of vmalloc return code checking
and a number of error path resource release cleanups in build_maps. 
It is against 245-ac16.

(The vmalloc non-check was reported by the Stanford team a
while back.)


--- linux-245-ac16-clean/drivers/mtd/ftl.c  Sun May 27 22:15:23 2001
+++ linux-245-ac16/drivers/mtd/ftl.cFri Jun 22 22:24:09 2001
@@ -313,6 +313,7 @@
 ssize_t retval;
 loff_t offset;
 
+ret = -1;
 /* Set up erase unit maps */
 part->DataUnits = le16_to_cpu(part->header.NumEraseUnits) -
part->header.NumTransferUnits;
@@ -324,7 +325,8 @@
 part->XferInfo =
kmalloc(part->header.NumTransferUnits * sizeof(struct xfer_info_t),
GFP_KERNEL);
-if (!part->XferInfo) return -1;
+if (!part->XferInfo) 
+   goto err_free_EUInfo;
 
 xvalid = xtrans = 0;
 for (i = 0; i < le16_to_cpu(part->header.NumEraseUnits); i++) {
@@ -334,8 +336,9 @@
  (unsigned char *));

if (ret) 
-   return ret;
+   goto err_free_XferInfo;
 
+   ret = -1;
/* Is this a transfer partition? */
hdr_ok = (strcmp(header.DataOrgTuple+3, "FTL100") == 0);
if (hdr_ok && (le16_to_cpu(header.LogicalEUN) < part->DataUnits) &&
@@ -348,7 +351,7 @@
if (xtrans == part->header.NumTransferUnits) {
printk(KERN_NOTICE "ftl_cs: format error: too many "
   "transfer units!\n");
-   return -1;
+   goto err_free_XferInfo;
}
if (hdr_ok && (le16_to_cpu(header.LogicalEUN) == 0x)) {
part->XferInfo[xtrans].state = XFER_PREPARED;
@@ -369,18 +372,21 @@
(xvalid+xtrans != le16_to_cpu(header.NumEraseUnits))) {
printk(KERN_NOTICE "ftl_cs: format error: erase units "
   "don't add up!\n");
-   return -1;
+   goto err_free_XferInfo;
 }
 
 /* Set up virtual page map */
 blocks = le32_to_cpu(header.FormattedSize) >> header.BlockSize;
 part->VirtualBlockMap = vmalloc(blocks * sizeof(u_int32_t));
+if (!part->VirtualBlockMap)
+   goto err_free_XferInfo;
 memset(part->VirtualBlockMap, 0xff, blocks * sizeof(u_int32_t));
 part->BlocksPerUnit = (1 << header.EraseUnitSize) >> header.BlockSize;
 
 part->bam_cache = kmalloc(part->BlocksPerUnit * sizeof(u_int32_t),
  GFP_KERNEL);
-if (!part->bam_cache) return -1;
+if (!part->bam_cache) 
+   goto err_free_VirtualBlockMap;
 
 part->bam_index = 0x;
 part->FreeTotal = 0;
@@ -395,7 +401,7 @@
  (unsigned char *)part->bam_cache);

if (ret) 
-   return ret;
+   goto err_free_bam_cache;
 
for (j = 0; j < part->BlocksPerUnit; j++) {
if (BLOCK_FREE(le32_to_cpu(part->bam_cache[j]))) {
@@ -411,7 +417,17 @@
 }
 
 return 0;
-
+
+err_free_bam_cache:
+kfree(part->bam_cache);
+err_free_VirtualBlockMap:
+vfree(part->VirtualBlockMap);
+err_free_XferInfo:
+kfree(part->XferInfo);
+err_free_EUInfo:
+kfree(part->EUNInfo);
+printk(KERN_ERR "ftl_cs: Out of memory.");
+return ret;
 } /* build_maps */
 
 /*==

-- 
Regards,
Rasmus([EMAIL PROTECTED])

Open Source. Closed Minds. We are Slashdot. 
  --Anonymous Coward
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] cleanup of drivers/char/ip2main.c (245ac16)

2001-06-22 Thread Rasmus Andersen

Hi.

The following patch #ifdefs a function to be in its preprocessor
scope and eliminates the use of check_region, adds '\n' to printk's,
adds checks for kmalloc and does error path resource releasing
in ip2_init_board. All in drivers/char/ip2main.c and against
245ac16.

(The kmalloc part of this was reported by the Stanford team
a while back.)


--- linux-245-ac16-clean/drivers/char/ip2main.c Sat May 19 20:58:17 2001
+++ linux-245-ac16/drivers/char/ip2main.c   Fri Jun 22 21:49:08 2001
@@ -418,6 +418,7 @@
rirqs[iindx++] = irq;
 }
 
+#ifdef MODULE
 static int __init
 clear_requested_irq( char irq )
 {
@@ -430,6 +431,7 @@
}
return 0;
 }
+#endif /* MODULE */
 
 static int __init
 have_requested_irq( char irq )
@@ -953,7 +955,7 @@
 static void __init
 ip2_init_board( int boardnum )
 {
-   int i,rc;
+   int i;
int nports = 0, nboxes = 0;
i2ChanStrPtr pCh;
i2eBordStrPtr pB = i2BoardPtrTable[boardnum];
@@ -961,24 +963,21 @@
if ( !iiInitialize ( pB ) ) {
printk ( KERN_ERR "IP2: Failed to initialize board at 0x%x, error 
%d\n",
 pB->i2eBase, pB->i2eError );
-   kfree ( pB );
-   i2BoardPtrTable[boardnum] = NULL;
-   return;
+   goto err_initialize;
}
-   printk(KERN_INFO "Board %d: addr=0x%x irq=%d ", boardnum + 1,
+   printk(KERN_INFO "Board %d: addr=0x%x irq=%d\n", boardnum + 1,
   ip2config.addr[boardnum], ip2config.irq[boardnum] );
 
-   if (0 != ( rc = check_region( ip2config.addr[boardnum], 8))) {
-   i2BoardPtrTable[boardnum] = NULL;
-   printk(KERN_ERR "bad addr=0x%x rc = %d\n",
-   ip2config.addr[boardnum], rc );
-   return;
+   if (!request_region( ip2config.addr[boardnum], 8, pcName )) {
+   printk(KERN_ERR "bad addr=0x%x\n",
+   ip2config.addr[boardnum] );
+   goto err_initialize;
}
-   request_region( ip2config.addr[boardnum], 8, pcName );
 
if ( iiDownloadAll ( pB, (loadHdrStrPtr)Fip_firmware, 1, Fip_firmware_size )
!= II_DOWN_GOOD ) {
-   printk ( KERN_ERR "IP2:failed to download loadware " );
+   printk ( KERN_ERR "IP2:failed to download loadware\n" );
+   goto err_release_region;
} else {
printk ( KERN_INFO "fv=%d.%d.%d lv=%d.%d.%d\n",
 pB->i2ePom.e.porVersion,
@@ -993,7 +992,7 @@
printk( KERN_ERR "IP2: Unknown board type, ID = %x",
pB->i2ePom.e.porID );
nports = 0;
-   goto ex_exit;
+   goto err_release_region;
break;
 
case POR_ID_II_4: /* IntelliPort-II, ISA-4 (4xRJ45) */
@@ -1028,8 +1027,13 @@
}
DevTableMem[boardnum] = pCh =
kmalloc( sizeof(i2ChanStr) * nports, GFP_KERNEL );
+   if ( !pCh ) {
+   printk ( KERN_ERR "(i2_init_channel:) Out of memory.\n");
+   goto err_release_region;
+   }
if ( !i2InitChannels( pB, nports, pCh ) ) {
printk(KERN_ERR "i2InitChannels failed: %d\n",pB->i2eError);
+   goto err_kmalloc;
}
pB->i2eChannelPtr = [portnum];
pB->i2eChannelCnt = ABS_MOST_PORTS;
@@ -1051,6 +1055,10 @@
}
DevTableMem[boardnum] = pCh =
kmalloc ( sizeof (i2ChanStr) * nports, GFP_KERNEL );
+   if ( !pCh ) {
+   printk ( KERN_ERR "(i2_init_channel:) Out of memory.\n");
+   goto err_kmalloc;
+   }
pB->i2eChannelPtr = pCh;
pB->i2eChannelCnt = nports;
i2InitChannels ( pB, pB->i2eChannelCnt, pCh );
@@ -1062,7 +1070,17 @@
pCh++;
}
 ex_exit:
-   printk ( KERN_INFO "\n" );
+   printk ( "\n" );
+   return;
+
+err_kmalloc:
+   kfree ( pCh );
+err_release_region:
+   release_region(ip2config.addr[boardnum], 8);
+err_initialize:
+   kfree ( pB );
+   i2BoardPtrTable[boardnum] = NULL;
+   return;
 }
 
 /**/
-- 
Regards,
Rasmus([EMAIL PROTECTED])

"The obvious mathematical breakthrough would be development of an easy way
to factor large prime numbers." 
  -- Bill Gates, The Road Ahead, Viking Penguin (1995)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] cleanup of drivers/char/ip2main.c (245ac16)

2001-06-22 Thread Rasmus Andersen

Hi.

The following patch #ifdefs a function to be in its preprocessor
scope and eliminates the use of check_region, adds '\n' to printk's,
adds checks for kmalloc and does error path resource releasing
in ip2_init_board. All in drivers/char/ip2main.c and against
245ac16.

(The kmalloc part of this was reported by the Stanford team
a while back.)


--- linux-245-ac16-clean/drivers/char/ip2main.c Sat May 19 20:58:17 2001
+++ linux-245-ac16/drivers/char/ip2main.c   Fri Jun 22 21:49:08 2001
@@ -418,6 +418,7 @@
rirqs[iindx++] = irq;
 }
 
+#ifdef MODULE
 static int __init
 clear_requested_irq( char irq )
 {
@@ -430,6 +431,7 @@
}
return 0;
 }
+#endif /* MODULE */
 
 static int __init
 have_requested_irq( char irq )
@@ -953,7 +955,7 @@
 static void __init
 ip2_init_board( int boardnum )
 {
-   int i,rc;
+   int i;
int nports = 0, nboxes = 0;
i2ChanStrPtr pCh;
i2eBordStrPtr pB = i2BoardPtrTable[boardnum];
@@ -961,24 +963,21 @@
if ( !iiInitialize ( pB ) ) {
printk ( KERN_ERR IP2: Failed to initialize board at 0x%x, error 
%d\n,
 pB-i2eBase, pB-i2eError );
-   kfree ( pB );
-   i2BoardPtrTable[boardnum] = NULL;
-   return;
+   goto err_initialize;
}
-   printk(KERN_INFO Board %d: addr=0x%x irq=%d , boardnum + 1,
+   printk(KERN_INFO Board %d: addr=0x%x irq=%d\n, boardnum + 1,
   ip2config.addr[boardnum], ip2config.irq[boardnum] );
 
-   if (0 != ( rc = check_region( ip2config.addr[boardnum], 8))) {
-   i2BoardPtrTable[boardnum] = NULL;
-   printk(KERN_ERR bad addr=0x%x rc = %d\n,
-   ip2config.addr[boardnum], rc );
-   return;
+   if (!request_region( ip2config.addr[boardnum], 8, pcName )) {
+   printk(KERN_ERR bad addr=0x%x\n,
+   ip2config.addr[boardnum] );
+   goto err_initialize;
}
-   request_region( ip2config.addr[boardnum], 8, pcName );
 
if ( iiDownloadAll ( pB, (loadHdrStrPtr)Fip_firmware, 1, Fip_firmware_size )
!= II_DOWN_GOOD ) {
-   printk ( KERN_ERR IP2:failed to download loadware  );
+   printk ( KERN_ERR IP2:failed to download loadware\n );
+   goto err_release_region;
} else {
printk ( KERN_INFO fv=%d.%d.%d lv=%d.%d.%d\n,
 pB-i2ePom.e.porVersion,
@@ -993,7 +992,7 @@
printk( KERN_ERR IP2: Unknown board type, ID = %x,
pB-i2ePom.e.porID );
nports = 0;
-   goto ex_exit;
+   goto err_release_region;
break;
 
case POR_ID_II_4: /* IntelliPort-II, ISA-4 (4xRJ45) */
@@ -1028,8 +1027,13 @@
}
DevTableMem[boardnum] = pCh =
kmalloc( sizeof(i2ChanStr) * nports, GFP_KERNEL );
+   if ( !pCh ) {
+   printk ( KERN_ERR (i2_init_channel:) Out of memory.\n);
+   goto err_release_region;
+   }
if ( !i2InitChannels( pB, nports, pCh ) ) {
printk(KERN_ERR i2InitChannels failed: %d\n,pB-i2eError);
+   goto err_kmalloc;
}
pB-i2eChannelPtr = DevTable[portnum];
pB-i2eChannelCnt = ABS_MOST_PORTS;
@@ -1051,6 +1055,10 @@
}
DevTableMem[boardnum] = pCh =
kmalloc ( sizeof (i2ChanStr) * nports, GFP_KERNEL );
+   if ( !pCh ) {
+   printk ( KERN_ERR (i2_init_channel:) Out of memory.\n);
+   goto err_kmalloc;
+   }
pB-i2eChannelPtr = pCh;
pB-i2eChannelCnt = nports;
i2InitChannels ( pB, pB-i2eChannelCnt, pCh );
@@ -1062,7 +1070,17 @@
pCh++;
}
 ex_exit:
-   printk ( KERN_INFO \n );
+   printk ( \n );
+   return;
+
+err_kmalloc:
+   kfree ( pCh );
+err_release_region:
+   release_region(ip2config.addr[boardnum], 8);
+err_initialize:
+   kfree ( pB );
+   i2BoardPtrTable[boardnum] = NULL;
+   return;
 }
 
 /**/
-- 
Regards,
Rasmus([EMAIL PROTECTED])

The obvious mathematical breakthrough would be development of an easy way
to factor large prime numbers. 
  -- Bill Gates, The Road Ahead, Viking Penguin (1995)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] cleanup in drivers/mtd/ftl.c (245-ac16)

2001-06-22 Thread Rasmus Andersen

Hi.

The patch below adds one instance of vmalloc return code checking
and a number of error path resource release cleanups in build_maps. 
It is against 245-ac16.

(The vmalloc non-check was reported by the Stanford team a
while back.)


--- linux-245-ac16-clean/drivers/mtd/ftl.c  Sun May 27 22:15:23 2001
+++ linux-245-ac16/drivers/mtd/ftl.cFri Jun 22 22:24:09 2001
@@ -313,6 +313,7 @@
 ssize_t retval;
 loff_t offset;
 
+ret = -1;
 /* Set up erase unit maps */
 part-DataUnits = le16_to_cpu(part-header.NumEraseUnits) -
part-header.NumTransferUnits;
@@ -324,7 +325,8 @@
 part-XferInfo =
kmalloc(part-header.NumTransferUnits * sizeof(struct xfer_info_t),
GFP_KERNEL);
-if (!part-XferInfo) return -1;
+if (!part-XferInfo) 
+   goto err_free_EUInfo;
 
 xvalid = xtrans = 0;
 for (i = 0; i  le16_to_cpu(part-header.NumEraseUnits); i++) {
@@ -334,8 +336,9 @@
  (unsigned char *)header);

if (ret) 
-   return ret;
+   goto err_free_XferInfo;
 
+   ret = -1;
/* Is this a transfer partition? */
hdr_ok = (strcmp(header.DataOrgTuple+3, FTL100) == 0);
if (hdr_ok  (le16_to_cpu(header.LogicalEUN)  part-DataUnits) 
@@ -348,7 +351,7 @@
if (xtrans == part-header.NumTransferUnits) {
printk(KERN_NOTICE ftl_cs: format error: too many 
   transfer units!\n);
-   return -1;
+   goto err_free_XferInfo;
}
if (hdr_ok  (le16_to_cpu(header.LogicalEUN) == 0x)) {
part-XferInfo[xtrans].state = XFER_PREPARED;
@@ -369,18 +372,21 @@
(xvalid+xtrans != le16_to_cpu(header.NumEraseUnits))) {
printk(KERN_NOTICE ftl_cs: format error: erase units 
   don't add up!\n);
-   return -1;
+   goto err_free_XferInfo;
 }
 
 /* Set up virtual page map */
 blocks = le32_to_cpu(header.FormattedSize)  header.BlockSize;
 part-VirtualBlockMap = vmalloc(blocks * sizeof(u_int32_t));
+if (!part-VirtualBlockMap)
+   goto err_free_XferInfo;
 memset(part-VirtualBlockMap, 0xff, blocks * sizeof(u_int32_t));
 part-BlocksPerUnit = (1  header.EraseUnitSize)  header.BlockSize;
 
 part-bam_cache = kmalloc(part-BlocksPerUnit * sizeof(u_int32_t),
  GFP_KERNEL);
-if (!part-bam_cache) return -1;
+if (!part-bam_cache) 
+   goto err_free_VirtualBlockMap;
 
 part-bam_index = 0x;
 part-FreeTotal = 0;
@@ -395,7 +401,7 @@
  (unsigned char *)part-bam_cache);

if (ret) 
-   return ret;
+   goto err_free_bam_cache;
 
for (j = 0; j  part-BlocksPerUnit; j++) {
if (BLOCK_FREE(le32_to_cpu(part-bam_cache[j]))) {
@@ -411,7 +417,17 @@
 }
 
 return 0;
-
+
+err_free_bam_cache:
+kfree(part-bam_cache);
+err_free_VirtualBlockMap:
+vfree(part-VirtualBlockMap);
+err_free_XferInfo:
+kfree(part-XferInfo);
+err_free_EUInfo:
+kfree(part-EUNInfo);
+printk(KERN_ERR ftl_cs: Out of memory.);
+return ret;
 } /* build_maps */
 
 /*==

-- 
Regards,
Rasmus([EMAIL PROTECTED])

Open Source. Closed Minds. We are Slashdot. 
  --Anonymous Coward
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] cleanup in drivers/mtd/ftl.c (245-ac16)

2001-06-22 Thread Rasmus Andersen

On Fri, Jun 22, 2001 at 05:21:06PM -0300, Arnaldo Carvalho de Melo wrote:
 Hi Rasmus,
 
   I've fixed this ones and its already in 2.4.6-pre5, please take a
 look and see if something is missing.

These patches are very close so I'll of course retract mine[1].
The only thing I'll recommend is the printk I have in the error
path.

[1] Sorry about the unnecessary mailing. I am not accustomed to
janitor-like patches being in Linus' kernel before Alan's :)
(Arnaldo already offered an explanation for why this one happened
to be.)
-- 
Regards,
Rasmus([EMAIL PROTECTED])

Smoking kills. If you're killed, you've lost a very important part of your
life.  -Brooke Shields, during an interview to become spokesperson for a
federal anti-smoking campaign.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: rsync hangs on RedHat 2.4.2 or stock 2.4.4

2001-06-21 Thread Rasmus Andersen

On Tue, Jun 19, 2001 at 10:41:51AM +0100, Jeremy Sanders wrote:
> I've found a patch which fixes the hanging problem, so I guess it's not
> linux-kernel which is at fault. Get it from Wayne Davison at:
 
Works for me too. 


-- 
Rasmus([EMAIL PROTECTED])

"Men kick friendship around like a football, but it doesn't seem to
 crack. Women treat it like glass and it goes to pieces."
  -- Anne Spencer Morrow Lindbergh
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: rsync hangs on RedHat 2.4.2 or stock 2.4.4

2001-06-21 Thread Rasmus Andersen

On Tue, Jun 19, 2001 at 10:41:51AM +0100, Jeremy Sanders wrote:
 I've found a patch which fixes the hanging problem, so I guess it's not
 linux-kernel which is at fault. Get it from Wayne Davison at:
 
Works for me too. 


-- 
Rasmus([EMAIL PROTECTED])

Men kick friendship around like a football, but it doesn't seem to
 crack. Women treat it like glass and it goes to pieces.
  -- Anne Spencer Morrow Lindbergh
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: rsync hangs on RedHat 2.4.2 or stock 2.4.4

2001-06-12 Thread Rasmus Andersen

On Tue, Jun 12, 2001 at 11:23:02AM -0400, Disconnect wrote:
> On Tue, 12 Jun 2001, David S. Miller did have cause to say:
> 
> > Look everyone, it was determined to be a deadlock because of some
> > interaction between how rsync sets up it's communication channels
> > with the ssh subprocess, readas: userland bug.
> 
> we're not using ssh. :(

Neither am/was I. The rsync is within a single FS.

Aside from that, here is the original bug report by Matthias 
Schniedermeyer: 
http://marc.theaimsgroup.com/?l=linux-kernel=98157768131423=2
with no reply.

My report:
http://marc.theaimsgroup.com/?l=linux-kernel=98262067309185=2
with myself replying :) 

Russell King's report: 
http://marc.theaimsgroup.com/?l=linux-kernel=98326853429463=2
which gave a fair amount of discussion.

Note that in my report I state that the problem cannot be seen
with smaller workloads; I have to try with at least drivers/*
before it shows itself. Hmm, just tried with 243-ac12 (yeah,
I'm way behind). I have to try the full tree now, drivers/*
wont do it anymore.
-- 
Regards,
Rasmus([EMAIL PROTECTED])

"An intellectual is someone who has been educated beyond their intelligence."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: rsync hangs on RedHat 2.4.2 or stock 2.4.4

2001-06-12 Thread Rasmus Andersen

On Tue, Jun 12, 2001 at 02:59:12PM +0100, Jeremy Sanders wrote:
> I'm getting numerous rsync (v2.4.6) problems under Linux 2.4.2 (RedHat
> 7.1) or stock 2.4.4 on several machines. rsync often hangs copying files
> from NFS or local disks to local disks. Strangely the problem is fixed by
> stracing one of the three rsync threads!
> 
[...]
> Has anyone else encountered this problem? Is it a kernel problem or an
> rsync problem?

I encountered this exact problem some time ago. Some discussion
but in the end the problem was blamed on rsync and nothing came
of it. I'll post an URL to the thread later on when I have the
time to dig it out.

I could swear that during early 240-testX this was not a problem,
but when I finally made a report about it and tried to go back
through earlier kernels, I could not reproduce. Also, this is
not reproducable under 2.2.X (for me, at least).

Regards,
  Rasmus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: rsync hangs on RedHat 2.4.2 or stock 2.4.4

2001-06-12 Thread Rasmus Andersen

On Tue, Jun 12, 2001 at 02:59:12PM +0100, Jeremy Sanders wrote:
 I'm getting numerous rsync (v2.4.6) problems under Linux 2.4.2 (RedHat
 7.1) or stock 2.4.4 on several machines. rsync often hangs copying files
 from NFS or local disks to local disks. Strangely the problem is fixed by
 stracing one of the three rsync threads!
 
[...]
 Has anyone else encountered this problem? Is it a kernel problem or an
 rsync problem?

I encountered this exact problem some time ago. Some discussion
but in the end the problem was blamed on rsync and nothing came
of it. I'll post an URL to the thread later on when I have the
time to dig it out.

I could swear that during early 240-testX this was not a problem,
but when I finally made a report about it and tried to go back
through earlier kernels, I could not reproduce. Also, this is
not reproducable under 2.2.X (for me, at least).

Regards,
  Rasmus
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: rsync hangs on RedHat 2.4.2 or stock 2.4.4

2001-06-12 Thread Rasmus Andersen

On Tue, Jun 12, 2001 at 11:23:02AM -0400, Disconnect wrote:
 On Tue, 12 Jun 2001, David S. Miller did have cause to say:
 
  Look everyone, it was determined to be a deadlock because of some
  interaction between how rsync sets up it's communication channels
  with the ssh subprocess, readas: userland bug.
 
 we're not using ssh. :(

Neither am/was I. The rsync is within a single FS.

Aside from that, here is the original bug report by Matthias 
Schniedermeyer: 
http://marc.theaimsgroup.com/?l=linux-kernelm=98157768131423w=2
with no reply.

My report:
http://marc.theaimsgroup.com/?l=linux-kernelm=98262067309185w=2
with myself replying :) 

Russell King's report: 
http://marc.theaimsgroup.com/?l=linux-kernelm=98326853429463w=2
which gave a fair amount of discussion.

Note that in my report I state that the problem cannot be seen
with smaller workloads; I have to try with at least drivers/*
before it shows itself. Hmm, just tried with 243-ac12 (yeah,
I'm way behind). I have to try the full tree now, drivers/*
wont do it anymore.
-- 
Regards,
Rasmus([EMAIL PROTECTED])

An intellectual is someone who has been educated beyond their intelligence.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] make kmalloc error return unconditional in hysdn_net.c (245ac1)

2001-05-28 Thread Rasmus Andersen

Hi.

The patch below fixes what I believe is a bug in hysdn_net.c.
I cannot see how we can proceed under _any_ circumstances
after the kmalloc fails. Applies against 245ac1.


--- linux-245-ac1-clean/drivers/isdn/hysdn/hysdn_net.c  Sun May 27 22:15:22 2001
+++ linux-245-ac1/drivers/isdn/hysdn/hysdn_net.cMon May 28 22:44:16 2001
@@ -304,8 +304,7 @@
hysdn_net_release(card);/* release an existing net device */
if ((dev = kmalloc(sizeof(struct net_local), GFP_KERNEL)) == NULL) {
printk(KERN_WARNING "HYSDN: unable to allocate mem\n");
-   if (card->debug_flags & LOG_NET_INIT)
-   return (-ENOMEM);
+   return (-ENOMEM);
}
memset(dev, 0, sizeof(struct net_local));   /* clean the structure */
 
-- 
Regards,
Rasmus([EMAIL PROTECTED])

It has just been discovered that research causes cancer in rats. 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] remove unnecessary zero initializations from aironet4500_proc.c (245ac1)

2001-05-28 Thread Rasmus Andersen

(Forgot l-k again... :<)

- Forwarded message from Rasmus Andersen <[EMAIL PROTECTED]> -

Hi.

The following patch removes two superfluous initializations
from aironet4500_proc.c, making the .o ~12K smaller in
size. It applies against 245ac1 and was discovered by Adam
Ritcher some time ago.
 
--- linux-245-ac1-clean/drivers/net/aironet4500_proc.c  Sat May 19 20:58:24 2001
+++ linux-245-ac1/drivers/net/aironet4500_proc.cMon May 28 22:13:26 2001
@@ -59,7 +59,7 @@
charproc_name[10];
 }; 
 static char awc_drive_info[AWC_STR_SIZE]="Zcom \n\0";
-static char awc_proc_buff[AWC_STR_SIZE]="\0";
+static char awc_proc_buff[AWC_STR_SIZE];
 static int  awc_int_buff;
 static struct awc_proc_private awc_proc_priv[MAX_AWCS]; 
 
@@ -403,7 +403,7 @@
 {0}
 };
 
-struct ctl_table_header * awc_driver_sysctl_header = NULL;
+struct ctl_table_header * awc_driver_sysctl_header;
 
 const char awc_procname[]= "awc5";
-- 
Rasmus([EMAIL PROTECTED])

"If you aim the gun at your foot and pull the trigger, it's UNIX's job to 
ensure reliable delivery of the bullet to where you aimed the gun (in
this case, Mr. Foot)." -- Terry Lambert, FreeBSD-Hackers mailing list.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] remove unnecessary zero initializations from aironet4500_proc.c (245ac1)

2001-05-28 Thread Rasmus Andersen

(Forgot l-k again... :)

- Forwarded message from Rasmus Andersen [EMAIL PROTECTED] -

Hi.

The following patch removes two superfluous initializations
from aironet4500_proc.c, making the .o ~12K smaller in
size. It applies against 245ac1 and was discovered by Adam
Ritcher some time ago.
 
--- linux-245-ac1-clean/drivers/net/aironet4500_proc.c  Sat May 19 20:58:24 2001
+++ linux-245-ac1/drivers/net/aironet4500_proc.cMon May 28 22:13:26 2001
@@ -59,7 +59,7 @@
charproc_name[10];
 }; 
 static char awc_drive_info[AWC_STR_SIZE]=Zcom \n\0;
-static char awc_proc_buff[AWC_STR_SIZE]=\0;
+static char awc_proc_buff[AWC_STR_SIZE];
 static int  awc_int_buff;
 static struct awc_proc_private awc_proc_priv[MAX_AWCS]; 
 
@@ -403,7 +403,7 @@
 {0}
 };
 
-struct ctl_table_header * awc_driver_sysctl_header = NULL;
+struct ctl_table_header * awc_driver_sysctl_header;
 
 const char awc_procname[]= awc5;
-- 
Rasmus([EMAIL PROTECTED])

If you aim the gun at your foot and pull the trigger, it's UNIX's job to 
ensure reliable delivery of the bullet to where you aimed the gun (in
this case, Mr. Foot). -- Terry Lambert, FreeBSD-Hackers mailing list.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] make kmalloc error return unconditional in hysdn_net.c (245ac1)

2001-05-28 Thread Rasmus Andersen

Hi.

The patch below fixes what I believe is a bug in hysdn_net.c.
I cannot see how we can proceed under _any_ circumstances
after the kmalloc fails. Applies against 245ac1.


--- linux-245-ac1-clean/drivers/isdn/hysdn/hysdn_net.c  Sun May 27 22:15:22 2001
+++ linux-245-ac1/drivers/isdn/hysdn/hysdn_net.cMon May 28 22:44:16 2001
@@ -304,8 +304,7 @@
hysdn_net_release(card);/* release an existing net device */
if ((dev = kmalloc(sizeof(struct net_local), GFP_KERNEL)) == NULL) {
printk(KERN_WARNING HYSDN: unable to allocate mem\n);
-   if (card-debug_flags  LOG_NET_INIT)
-   return (-ENOMEM);
+   return (-ENOMEM);
}
memset(dev, 0, sizeof(struct net_local));   /* clean the structure */
 
-- 
Regards,
Rasmus([EMAIL PROTECTED])

It has just been discovered that research causes cancer in rats. 
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] add restore_flags to error path in irttp.c (245ac1)

2001-05-27 Thread Rasmus Andersen

Hi.

The following patch makes irttp_read_proc restore_flags()
in error cases too. Applies against 245ac1.


--- linux-245-ac1-clean/net/irda/irttp.cSun May 27 22:15:34 2001
+++ linux-245-ac1/net/irda/irttp.c  Sun May 27 22:37:59 2001
@@ -1598,7 +1598,7 @@
self = (struct tsap_cb *) hashbin_get_first(irttp->tsaps);
while (self != NULL) {
if (!self || self->magic != TTP_TSAP_MAGIC)
-   return len;
+   break;
 
len += sprintf(buf+len, "TSAP %d, ", i++);
len += sprintf(buf+len, "stsap_sel: %02x, ", 

-- 
Regards,
Rasmus([EMAIL PROTECTED])

Which is worse: Ignorance or Apathy?
Who knows? Who cares?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] Fix interrupt flag bug(s) in irtty.c (244-ac18)

2001-05-27 Thread Rasmus Andersen

Hi.

The following patch fixes an interrupt flag bug in irtty.c
as per the stanford team's report way back. Applies against
224-ac18.


--- linux-244-ac18-clean/drivers/net/irda/irtty.c   Sat May 19 20:59:17 2001
+++ linux-244-ac18/drivers/net/irda/irtty.c Sun May 27 21:56:14 2001
@@ -971,13 +971,17 @@
switch (cmd) {
case SIOCSBANDWIDTH: /* Set bandwidth */
if (!capable(CAP_NET_ADMIN))
-   return -EPERM;
-   irda_task_execute(self, irtty_change_speed, NULL, NULL, 
- (void *) irq->ifr_baudrate);
+   ret = -EPERM;
+   else
+   irda_task_execute(self, irtty_change_speed, NULL, NULL, 
+ (void *) irq->ifr_baudrate);
break;
case SIOCSDONGLE: /* Set dongle */
-   if (!capable(CAP_NET_ADMIN))
-   return -EPERM;
+   if (!capable(CAP_NET_ADMIN)) {
+   ret = -EPERM;
+   break;
+   }
+
/* Initialize dongle */
dongle = irda_device_dongle_init(dev, irq->ifr_dongle);
if (!dongle)
@@ -999,21 +1003,24 @@
break;
case SIOCSMEDIABUSY: /* Set media busy */
if (!capable(CAP_NET_ADMIN))
-   return -EPERM;
-   irda_device_set_media_busy(self->netdev, TRUE);
+   ret = -EPERM;
+   else
+   irda_device_set_media_busy(self->netdev, TRUE);
break;
case SIOCGRECEIVING: /* Check if we are receiving right now */
irq->ifr_receiving = irtty_is_receiving(self);
break;
case SIOCSDTRRTS:
if (!capable(CAP_NET_ADMIN))
-   return -EPERM;
-   irtty_set_dtr_rts(dev, irq->ifr_dtr, irq->ifr_rts);
+   ret = -EPERM;
+   else
+   irtty_set_dtr_rts(dev, irq->ifr_dtr, irq->ifr_rts);
break;
case SIOCSMODE:
if (!capable(CAP_NET_ADMIN))
-   return -EPERM;
-   irtty_set_mode(dev, irq->ifr_mode);
+   ret = -EPERM;
+   else
+   irtty_set_mode(dev, irq->ifr_mode);
break;
default:
ret = -EOPNOTSUPP;
-- 
Regards,
Rasmus([EMAIL PROTECTED])

Things are more like they are now than they ever were before.
-Former U.S. President Dwight D. Eisenhower
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] Add missing restore_flags to sm_wss.c (244-ac18)

2001-05-27 Thread Rasmus Andersen

Hi.

The following patch adds a missing restore_flags as per the
stanford team's report way back. Applies against 244ac18.


--- linux-244-ac18-clean/drivers/net/hamradio/soundmodem/sm_wss.c   Wed Jul 19 
01:55:19 2000
+++ linux-244-ac18/drivers/net/hamradio/soundmodem/sm_wss.c Sun May 27 21:36:25 
+2001
@@ -172,8 +172,10 @@
/* MCE and interface config reg */
write_codec(dev, 0x49, fdx ? 0x8 : 0xc);
outb(0xb, WSS_CODEC_IA(dev->base_addr)); /* leave MCE */
-   if (SCSTATE->crystal && !fullcalib)
+   if (SCSTATE->crystal && !fullcalib) {
+   restore_flags(flags);
return 0;
+   }
/*
 * wait for ACI start
 */
-- 
Regards,
Rasmus([EMAIL PROTECTED])

I've overclocked my keyboard interface.  It's quite messy dipping my
hands into the mineral oil, but *MAN* is my keyboard ever fast now!
 - Anonymous Coward
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] missing rio_spin_unlock_irqrestore in rioroute.c (244ac18)

2001-05-27 Thread Rasmus Andersen

 Forgot l-k when sending this off..

- Forwarded message from Rasmus Andersen <[EMAIL PROTECTED]> -

Hi.

The following patch fixes a missing rio_spin_unlock_irqrestore
in drivers/char/rio/rioroute.c as per the stanford team's
report a way back. It applies against 244ac18.


--- linux-244-ac18-clean/drivers/char/rio/rioroute.cSat May 19 20:58:18 2001
+++ linux-244-ac18/drivers/char/rio/rioroute.c  Sun May 27 20:46:34 2001
@@ -657,6 +657,7 @@
*/
if (PortP->TxStart == 0) {
rio_dprintk (RIO_DEBUG_ROUTE, "Tx pkts not set 
up yet\n");
+   rio_spin_unlock_irqrestore(>portSem, 
+flags);
break;
}
 
-- 
Regards,
Rasmus([EMAIL PROTECTED])

While the Melissa license is a bit unclear, Melissa aggressively
encourages free distribution of its source code.
  -- Kevin Dalley on Melissa being Open Source

- End forwarded message -
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] fix for buggy variable reuse in riotable.c (244ac18)

2001-05-27 Thread Rasmus Andersen

Forgot l-k when sending this off...

- Forwarded message from Rasmus Andersen <[EMAIL PROTECTED]> -

Hi.

The following patch fixes a buggy variable reuse i drivers/char/
rio/riotable.c (244-ac18) as reported by the stanford team way
back.


--- linux-244-ac18-clean/drivers/char/rio/riotable.cSun May 27 20:19:56 2001
+++ linux-244-ac18/drivers/char/rio/riotable.c  Sun May 27 21:12:16 2001
@@ -501,7 +501,7 @@
struct Map *HostMapP;
struct Port *PortP;
int work_done = 0;
-   unsigned long flags;
+   unsigned long lock_flags, sem_flags;
 
rio_dprintk (RIO_DEBUG_TABLE, "Delete entry on host %x, rta %x\n",
MapP->HostUniqueNum, 
MapP->RtaUniqueNum);
@@ -509,10 +509,10 @@
for ( host=0; host < p->RIONumHosts; host++ ) {
HostP = >RIOHosts[host];
 
-   rio_spin_lock_irqsave( >HostLock, flags );
+   rio_spin_lock_irqsave( >HostLock, lock_flags );
 
if ( (HostP->Flags & RUN_STATE) != RC_RUNNING ) {
-   rio_spin_unlock_irqrestore(>HostLock, flags);
+   rio_spin_unlock_irqrestore(>HostLock, lock_flags);
continue;
}
 
@@ -529,7 +529,7 @@
if ( HostMapP->Topology[link].Unit != 
ROUTE_DISCONNECT ) {
rio_dprintk (RIO_DEBUG_TABLE, "Entry 
is in use and cannot be deleted!\n");
p->RIOError.Error = UNIT_IS_IN_USE;
-   rio_spin_unlock_irqrestore( 
>HostLock, flags);
+   rio_spin_unlock_irqrestore( 
+>HostLock, lock_flags);
return EBUSY;
}
}
@@ -544,7 +544,7 @@
PortP = p->RIOPortp[port];
rio_dprintk (RIO_DEBUG_TABLE, "Unmap 
port\n");
 
-   rio_spin_lock_irqsave( 
>portSem, flags );
+   rio_spin_lock_irqsave( 
+>portSem, sem_flags );
 
PortP->Mapped = 0;
 
@@ -602,7 +602,7 @@
WWORD(PortP->PhbP->destination,
 dest_unit + (dest_port << 8));
}
-   
rio_spin_unlock_irqrestore(>portSem, flags);
+   
+rio_spin_unlock_irqrestore(>portSem, sem_flags);
}
}
rio_dprintk (RIO_DEBUG_TABLE, "Entry nulled.\n");
@@ -610,7 +610,7 @@
work_done++;
}
}
-   rio_spin_unlock_irqrestore(>HostLock, flags);
+   rio_spin_unlock_irqrestore(>HostLock, lock_flags);
}
 
/* X lock me up */
-- 
Regards,
Rasmus([EMAIL PROTECTED])

We're going to turn this team around 360 degrees.
-Jason Kidd, upon his drafting to the Dallas Mavericks

- End forwarded message -
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] fix for buggy variable reuse in riotable.c (244ac18)

2001-05-27 Thread Rasmus Andersen

Forgot l-k when sending this off...

- Forwarded message from Rasmus Andersen [EMAIL PROTECTED] -

Hi.

The following patch fixes a buggy variable reuse i drivers/char/
rio/riotable.c (244-ac18) as reported by the stanford team way
back.


--- linux-244-ac18-clean/drivers/char/rio/riotable.cSun May 27 20:19:56 2001
+++ linux-244-ac18/drivers/char/rio/riotable.c  Sun May 27 21:12:16 2001
@@ -501,7 +501,7 @@
struct Map *HostMapP;
struct Port *PortP;
int work_done = 0;
-   unsigned long flags;
+   unsigned long lock_flags, sem_flags;
 
rio_dprintk (RIO_DEBUG_TABLE, Delete entry on host %x, rta %x\n,
MapP-HostUniqueNum, 
MapP-RtaUniqueNum);
@@ -509,10 +509,10 @@
for ( host=0; host  p-RIONumHosts; host++ ) {
HostP = p-RIOHosts[host];
 
-   rio_spin_lock_irqsave( HostP-HostLock, flags );
+   rio_spin_lock_irqsave( HostP-HostLock, lock_flags );
 
if ( (HostP-Flags  RUN_STATE) != RC_RUNNING ) {
-   rio_spin_unlock_irqrestore(HostP-HostLock, flags);
+   rio_spin_unlock_irqrestore(HostP-HostLock, lock_flags);
continue;
}
 
@@ -529,7 +529,7 @@
if ( HostMapP-Topology[link].Unit != 
ROUTE_DISCONNECT ) {
rio_dprintk (RIO_DEBUG_TABLE, Entry 
is in use and cannot be deleted!\n);
p-RIOError.Error = UNIT_IS_IN_USE;
-   rio_spin_unlock_irqrestore( 
HostP-HostLock, flags);
+   rio_spin_unlock_irqrestore( 
+HostP-HostLock, lock_flags);
return EBUSY;
}
}
@@ -544,7 +544,7 @@
PortP = p-RIOPortp[port];
rio_dprintk (RIO_DEBUG_TABLE, Unmap 
port\n);
 
-   rio_spin_lock_irqsave( 
PortP-portSem, flags );
+   rio_spin_lock_irqsave( 
+PortP-portSem, sem_flags );
 
PortP-Mapped = 0;
 
@@ -602,7 +602,7 @@
WWORD(PortP-PhbP-destination,
 dest_unit + (dest_port  8));
}
-   
rio_spin_unlock_irqrestore(PortP-portSem, flags);
+   
+rio_spin_unlock_irqrestore(PortP-portSem, sem_flags);
}
}
rio_dprintk (RIO_DEBUG_TABLE, Entry nulled.\n);
@@ -610,7 +610,7 @@
work_done++;
}
}
-   rio_spin_unlock_irqrestore(HostP-HostLock, flags);
+   rio_spin_unlock_irqrestore(HostP-HostLock, lock_flags);
}
 
/* X lock me up */
-- 
Regards,
Rasmus([EMAIL PROTECTED])

We're going to turn this team around 360 degrees.
-Jason Kidd, upon his drafting to the Dallas Mavericks

- End forwarded message -
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] missing rio_spin_unlock_irqrestore in rioroute.c (244ac18)

2001-05-27 Thread Rasmus Andersen

sigh Forgot l-k when sending this off..

- Forwarded message from Rasmus Andersen [EMAIL PROTECTED] -

Hi.

The following patch fixes a missing rio_spin_unlock_irqrestore
in drivers/char/rio/rioroute.c as per the stanford team's
report a way back. It applies against 244ac18.


--- linux-244-ac18-clean/drivers/char/rio/rioroute.cSat May 19 20:58:18 2001
+++ linux-244-ac18/drivers/char/rio/rioroute.c  Sun May 27 20:46:34 2001
@@ -657,6 +657,7 @@
*/
if (PortP-TxStart == 0) {
rio_dprintk (RIO_DEBUG_ROUTE, Tx pkts not set 
up yet\n);
+   rio_spin_unlock_irqrestore(PortP-portSem, 
+flags);
break;
}
 
-- 
Regards,
Rasmus([EMAIL PROTECTED])

While the Melissa license is a bit unclear, Melissa aggressively
encourages free distribution of its source code.
  -- Kevin Dalley on Melissa being Open Source

- End forwarded message -
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] Add missing restore_flags to sm_wss.c (244-ac18)

2001-05-27 Thread Rasmus Andersen

Hi.

The following patch adds a missing restore_flags as per the
stanford team's report way back. Applies against 244ac18.


--- linux-244-ac18-clean/drivers/net/hamradio/soundmodem/sm_wss.c   Wed Jul 19 
01:55:19 2000
+++ linux-244-ac18/drivers/net/hamradio/soundmodem/sm_wss.c Sun May 27 21:36:25 
+2001
@@ -172,8 +172,10 @@
/* MCE and interface config reg */
write_codec(dev, 0x49, fdx ? 0x8 : 0xc);
outb(0xb, WSS_CODEC_IA(dev-base_addr)); /* leave MCE */
-   if (SCSTATE-crystal  !fullcalib)
+   if (SCSTATE-crystal  !fullcalib) {
+   restore_flags(flags);
return 0;
+   }
/*
 * wait for ACI start
 */
-- 
Regards,
Rasmus([EMAIL PROTECTED])

I've overclocked my keyboard interface.  It's quite messy dipping my
hands into the mineral oil, but *MAN* is my keyboard ever fast now!
 - Anonymous Coward
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] add restore_flags to error path in irttp.c (245ac1)

2001-05-27 Thread Rasmus Andersen

Hi.

The following patch makes irttp_read_proc restore_flags()
in error cases too. Applies against 245ac1.


--- linux-245-ac1-clean/net/irda/irttp.cSun May 27 22:15:34 2001
+++ linux-245-ac1/net/irda/irttp.c  Sun May 27 22:37:59 2001
@@ -1598,7 +1598,7 @@
self = (struct tsap_cb *) hashbin_get_first(irttp-tsaps);
while (self != NULL) {
if (!self || self-magic != TTP_TSAP_MAGIC)
-   return len;
+   break;
 
len += sprintf(buf+len, TSAP %d, , i++);
len += sprintf(buf+len, stsap_sel: %02x, , 

-- 
Regards,
Rasmus([EMAIL PROTECTED])

Which is worse: Ignorance or Apathy?
Who knows? Who cares?
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] Fix interrupt flag bug(s) in irtty.c (244-ac18)

2001-05-27 Thread Rasmus Andersen

Hi.

The following patch fixes an interrupt flag bug in irtty.c
as per the stanford team's report way back. Applies against
224-ac18.


--- linux-244-ac18-clean/drivers/net/irda/irtty.c   Sat May 19 20:59:17 2001
+++ linux-244-ac18/drivers/net/irda/irtty.c Sun May 27 21:56:14 2001
@@ -971,13 +971,17 @@
switch (cmd) {
case SIOCSBANDWIDTH: /* Set bandwidth */
if (!capable(CAP_NET_ADMIN))
-   return -EPERM;
-   irda_task_execute(self, irtty_change_speed, NULL, NULL, 
- (void *) irq-ifr_baudrate);
+   ret = -EPERM;
+   else
+   irda_task_execute(self, irtty_change_speed, NULL, NULL, 
+ (void *) irq-ifr_baudrate);
break;
case SIOCSDONGLE: /* Set dongle */
-   if (!capable(CAP_NET_ADMIN))
-   return -EPERM;
+   if (!capable(CAP_NET_ADMIN)) {
+   ret = -EPERM;
+   break;
+   }
+
/* Initialize dongle */
dongle = irda_device_dongle_init(dev, irq-ifr_dongle);
if (!dongle)
@@ -999,21 +1003,24 @@
break;
case SIOCSMEDIABUSY: /* Set media busy */
if (!capable(CAP_NET_ADMIN))
-   return -EPERM;
-   irda_device_set_media_busy(self-netdev, TRUE);
+   ret = -EPERM;
+   else
+   irda_device_set_media_busy(self-netdev, TRUE);
break;
case SIOCGRECEIVING: /* Check if we are receiving right now */
irq-ifr_receiving = irtty_is_receiving(self);
break;
case SIOCSDTRRTS:
if (!capable(CAP_NET_ADMIN))
-   return -EPERM;
-   irtty_set_dtr_rts(dev, irq-ifr_dtr, irq-ifr_rts);
+   ret = -EPERM;
+   else
+   irtty_set_dtr_rts(dev, irq-ifr_dtr, irq-ifr_rts);
break;
case SIOCSMODE:
if (!capable(CAP_NET_ADMIN))
-   return -EPERM;
-   irtty_set_mode(dev, irq-ifr_mode);
+   ret = -EPERM;
+   else
+   irtty_set_mode(dev, irq-ifr_mode);
break;
default:
ret = -EOPNOTSUPP;
-- 
Regards,
Rasmus([EMAIL PROTECTED])

Things are more like they are now than they ever were before.
-Former U.S. President Dwight D. Eisenhower
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] comx-hw-mixcom.c interrupt flag cleanup (244-ac18)

2001-05-26 Thread Rasmus Andersen

(Forgot l-k when sending this off to [EMAIL PROTECTED] :/)

Hi.

The following patch tries to eliminate the interrupt flag bugs
identified by the stanford team a while back in drivers/net/wan/
comx-hw-mixcom.c. It moves request_region and request_irq outside
the cli()/restore_flags() pair as they can sleep and cleans up
some error paths wrt. resource deallocation. It applies against
244-ac18.

Comments would be nice as this is not my day job :)



--- linux-244-ac18-clean/drivers/net/wan/comx-hw-mixcom.c   Mon Dec 11 22:38:29 
2000
+++ linux-244-ac18/drivers/net/wan/comx-hw-mixcom.c Sat May 26 22:45:44 2001
@@ -487,15 +487,18 @@
struct mixcom_privdata *hw = ch->HW_privdata;
struct proc_dir_entry *procfile = ch->procdir->subdir;
unsigned long flags; 
+   int ret = -ENODEV;
 
-   if (!dev->base_addr || !dev->irq) return -ENODEV;
+   if (!dev->base_addr || !dev->irq)
+   goto err_ret;
 
 
if(hw->channel==1) {
if(!TWIN(dev) || !(COMX_CHANNEL(TWIN(dev))->init_status & 
IRQ_ALLOCATED)) {
printk(KERN_ERR "%s: channel 0 not yet 
initialized\n",dev->name);
-   return -EAGAIN;
+   ret = -EAGAIN;
+   goto err_ret;
}
}
 
@@ -503,28 +506,29 @@
/* Is our hw present at all ? Not checking for channel 0 if it is already 
   open */
if(hw->channel!=0 || !(ch->init_status & IRQ_ALLOCATED)) {
-   if (check_region(dev->base_addr, MIXCOM_IO_EXTENT)) {
-   return -EAGAIN;
+   if (!request_region(dev->base_addr, MIXCOM_IO_EXTENT, dev->name)) {
+   ret = -EAGAIN;
+   goto err_ret;
}
if (mixcom_probe(dev)) {
-   return -ENODEV;
+   ret = -ENODEV;
+   goto err_release_region;
}
}
 
-   save_flags(flags); cli();
-
-   if(hw->channel==1) {
-   request_region(dev->base_addr, MIXCOM_IO_EXTENT, dev->name);
-   } 
-
if(hw->channel==0 && !(ch->init_status & IRQ_ALLOCATED)) {
if (request_irq(dev->irq, MIXCOM_interrupt, 0, 
dev->name, (void *)dev)) {
printk(KERN_ERR "MIXCOM: unable to obtain irq %d\n", dev->irq);
-   return -EAGAIN;
+   ret = -EAGAIN;
+   goto err_restore_flags;
}
+   }
+
+   save_flags(flags); cli();
+
+   if(hw->channel==0 && !(ch->init_status & IRQ_ALLOCATED)) {
ch->init_status|=IRQ_ALLOCATED;
-   request_region(dev->base_addr, MIXCOM_IO_EXTENT, dev->name);
mixcom_board_on(dev);
}
 
@@ -560,6 +564,13 @@
}
 
return 0;
+   
+err_restore_flags:
+   restore_flags(flags);
+err_release_region:
+   release_region(dev->base_addr, MIXCOM_IO_EXTENT);
+err_ret:
+   return ret;
 }
 
 static int MIXCOM_close(struct net_device *dev)

-- 
Rasmus([EMAIL PROTECTED])

"I'm not going to have some reporters pawing through our papers. We are
the president."  -Hillary Clinton commenting on the release of subpoenaed
documents.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] fix interrupt flag bugs in irport.c (2.4.4-ac18)

2001-05-26 Thread Rasmus Andersen

Hi.

The following patch tries to correct the interrupt bugs found
by the stanford team a long time ago in drivers/net/irda/irport.c.
Applies against 2.4.4-ac18.


--- linux-244-ac18-clean/drivers/net/irda/irport.c  Sat May 19 20:59:17 2001
+++ linux-244-ac18/drivers/net/irda/irport.cSat May 26 21:35:59 2001
@@ -951,13 +951,17 @@
switch (cmd) {
case SIOCSBANDWIDTH: /* Set bandwidth */
if (!capable(CAP_NET_ADMIN))
-   return -EPERM;
-   irda_task_execute(self, __irport_change_speed, NULL, NULL, 
- (void *) irq->ifr_baudrate);
+   ret = -EPERM;
+else
+   irda_task_execute(self, __irport_change_speed, NULL, 
+ NULL, (void *) irq->ifr_baudrate);
break;
case SIOCSDONGLE: /* Set dongle */
-   if (!capable(CAP_NET_ADMIN))
-   return -EPERM;
+   if (!capable(CAP_NET_ADMIN)) {
+   ret = -EPERM;
+   break;
+   }
+
/* Initialize dongle */
dongle = irda_device_dongle_init(dev, irq->ifr_dongle);
if (!dongle)
@@ -978,16 +982,22 @@
  NULL);
break;
case SIOCSMEDIABUSY: /* Set media busy */
-   if (!capable(CAP_NET_ADMIN))
-   return -EPERM;
+   if (!capable(CAP_NET_ADMIN)) {
+   ret = -EPERM;
+   break;
+   }
+
irda_device_set_media_busy(self->netdev, TRUE);
break;
case SIOCGRECEIVING: /* Check if we are receiving right now */
irq->ifr_receiving = irport_is_receiving(self);
break;
case SIOCSDTRRTS:
-   if (!capable(CAP_NET_ADMIN))
-   return -EPERM;
+   if (!capable(CAP_NET_ADMIN)) {
+   ret = -EPERM;
+   break;
+   }
+
irport_set_dtr_rts(dev, irq->ifr_dtr, irq->ifr_rts);
break;
default:

-- 
Regards,
Rasmus([EMAIL PROTECTED])

A great many people think they are thinking when they are merely 
rearranging their prejudices. -- William James 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] comx-hw-mixcom.c interrupt flag cleanup (244-ac18)

2001-05-26 Thread Rasmus Andersen

(Forgot l-k when sending this off to [EMAIL PROTECTED] :/)

Hi.

The following patch tries to eliminate the interrupt flag bugs
identified by the stanford team a while back in drivers/net/wan/
comx-hw-mixcom.c. It moves request_region and request_irq outside
the cli()/restore_flags() pair as they can sleep and cleans up
some error paths wrt. resource deallocation. It applies against
244-ac18.

Comments would be nice as this is not my day job :)



--- linux-244-ac18-clean/drivers/net/wan/comx-hw-mixcom.c   Mon Dec 11 22:38:29 
2000
+++ linux-244-ac18/drivers/net/wan/comx-hw-mixcom.c Sat May 26 22:45:44 2001
@@ -487,15 +487,18 @@
struct mixcom_privdata *hw = ch-HW_privdata;
struct proc_dir_entry *procfile = ch-procdir-subdir;
unsigned long flags; 
+   int ret = -ENODEV;
 
-   if (!dev-base_addr || !dev-irq) return -ENODEV;
+   if (!dev-base_addr || !dev-irq)
+   goto err_ret;
 
 
if(hw-channel==1) {
if(!TWIN(dev) || !(COMX_CHANNEL(TWIN(dev))-init_status  
IRQ_ALLOCATED)) {
printk(KERN_ERR %s: channel 0 not yet 
initialized\n,dev-name);
-   return -EAGAIN;
+   ret = -EAGAIN;
+   goto err_ret;
}
}
 
@@ -503,28 +506,29 @@
/* Is our hw present at all ? Not checking for channel 0 if it is already 
   open */
if(hw-channel!=0 || !(ch-init_status  IRQ_ALLOCATED)) {
-   if (check_region(dev-base_addr, MIXCOM_IO_EXTENT)) {
-   return -EAGAIN;
+   if (!request_region(dev-base_addr, MIXCOM_IO_EXTENT, dev-name)) {
+   ret = -EAGAIN;
+   goto err_ret;
}
if (mixcom_probe(dev)) {
-   return -ENODEV;
+   ret = -ENODEV;
+   goto err_release_region;
}
}
 
-   save_flags(flags); cli();
-
-   if(hw-channel==1) {
-   request_region(dev-base_addr, MIXCOM_IO_EXTENT, dev-name);
-   } 
-
if(hw-channel==0  !(ch-init_status  IRQ_ALLOCATED)) {
if (request_irq(dev-irq, MIXCOM_interrupt, 0, 
dev-name, (void *)dev)) {
printk(KERN_ERR MIXCOM: unable to obtain irq %d\n, dev-irq);
-   return -EAGAIN;
+   ret = -EAGAIN;
+   goto err_restore_flags;
}
+   }
+
+   save_flags(flags); cli();
+
+   if(hw-channel==0  !(ch-init_status  IRQ_ALLOCATED)) {
ch-init_status|=IRQ_ALLOCATED;
-   request_region(dev-base_addr, MIXCOM_IO_EXTENT, dev-name);
mixcom_board_on(dev);
}
 
@@ -560,6 +564,13 @@
}
 
return 0;
+   
+err_restore_flags:
+   restore_flags(flags);
+err_release_region:
+   release_region(dev-base_addr, MIXCOM_IO_EXTENT);
+err_ret:
+   return ret;
 }
 
 static int MIXCOM_close(struct net_device *dev)

-- 
Rasmus([EMAIL PROTECTED])

I'm not going to have some reporters pawing through our papers. We are
the president.  -Hillary Clinton commenting on the release of subpoenaed
documents.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] fix interrupt flag bugs in irport.c (2.4.4-ac18)

2001-05-26 Thread Rasmus Andersen

Hi.

The following patch tries to correct the interrupt bugs found
by the stanford team a long time ago in drivers/net/irda/irport.c.
Applies against 2.4.4-ac18.


--- linux-244-ac18-clean/drivers/net/irda/irport.c  Sat May 19 20:59:17 2001
+++ linux-244-ac18/drivers/net/irda/irport.cSat May 26 21:35:59 2001
@@ -951,13 +951,17 @@
switch (cmd) {
case SIOCSBANDWIDTH: /* Set bandwidth */
if (!capable(CAP_NET_ADMIN))
-   return -EPERM;
-   irda_task_execute(self, __irport_change_speed, NULL, NULL, 
- (void *) irq-ifr_baudrate);
+   ret = -EPERM;
+else
+   irda_task_execute(self, __irport_change_speed, NULL, 
+ NULL, (void *) irq-ifr_baudrate);
break;
case SIOCSDONGLE: /* Set dongle */
-   if (!capable(CAP_NET_ADMIN))
-   return -EPERM;
+   if (!capable(CAP_NET_ADMIN)) {
+   ret = -EPERM;
+   break;
+   }
+
/* Initialize dongle */
dongle = irda_device_dongle_init(dev, irq-ifr_dongle);
if (!dongle)
@@ -978,16 +982,22 @@
  NULL);
break;
case SIOCSMEDIABUSY: /* Set media busy */
-   if (!capable(CAP_NET_ADMIN))
-   return -EPERM;
+   if (!capable(CAP_NET_ADMIN)) {
+   ret = -EPERM;
+   break;
+   }
+
irda_device_set_media_busy(self-netdev, TRUE);
break;
case SIOCGRECEIVING: /* Check if we are receiving right now */
irq-ifr_receiving = irport_is_receiving(self);
break;
case SIOCSDTRRTS:
-   if (!capable(CAP_NET_ADMIN))
-   return -EPERM;
+   if (!capable(CAP_NET_ADMIN)) {
+   ret = -EPERM;
+   break;
+   }
+
irport_set_dtr_rts(dev, irq-ifr_dtr, irq-ifr_rts);
break;
default:

-- 
Regards,
Rasmus([EMAIL PROTECTED])

A great many people think they are thinking when they are merely 
rearranging their prejudices. -- William James 
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] Add missing spin_unlock_irq to ide.c (244ac16)

2001-05-25 Thread Rasmus Andersen

On Fri, May 25, 2001 at 11:11:23PM +0200, Jens Axboe wrote:
[...] 
> This isn't right. Granted the locking isn't straight forward here, but
> take a look at ide_write_setting -> ide_spin_wait_hwgroup and the
> latters return value.
 
Yes, Andre set me straight here. My apologies for being lazy and
not checking the call path.

-- 
Rasmus([EMAIL PROTECTED])

You know how dumb the average guy is?  Well, by  definition, half
of them are even dumber than that.
-- J.R. "Bob" Dobbs 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] __init -> __initdata in drivers/video/matrox/matroxfb_base.c (244ac16)

2001-05-25 Thread Rasmus Andersen

Hi.

The following patch changes an __init to __initdata. Applies against
2.4.4-ac11.


--- linux-244-ac11-clean/drivers/video/matrox/matroxfb_base.c   Sat May 19 20:58:43 
2001
+++ linux-244-ac11/drivers/video/matrox/matroxfb_base.c Sun May 20 23:55:24 2001
@@ -2483,7 +2483,7 @@
return 0;
 }
 
-static int __init initialized = 0;
+static int __initdata initialized = 0;
 
 int __init matroxfb_init(void)
 {

-- 
Regards,
Rasmus([EMAIL PROTECTED])
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] Add missing spin_unlock_irq to ide.c (244ac16)

2001-05-25 Thread Rasmus Andersen

(I forgot to cc l-k on this one when it went to andre.)

Hi.

This patch adds a spin_unlock_irqsave to ide_spin_wait_hwgroup as
reported by the Stanford team way back. It applies against 244ac16.


--- linux-244-ac16-clean/drivers/ide/ide.c  Fri May 25 21:11:08 2001
+++ linux-244-ac16/drivers/ide/ide.cFri May 25 22:46:43 2001
@@ -2362,6 +2362,8 @@
__restore_flags(lflags);/* local CPU only */
spin_lock_irq(_request_lock);
}
+
+spin_unlock_irq(_request_lock);
return 0;
 }
 
-- 
Rasmus([EMAIL PROTECTED])

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] kmalloc checks for drivers/ide/ide-probe.c (244ac16)

2001-05-25 Thread Rasmus Andersen

On Fri, May 25, 2001 at 01:47:52PM -0700, Andre Hedrick wrote:
> 
> Not valid because the jump to that part of the code is protected.
> If a polling response for a valid status and no timeout, is detected then
> it attempts to the command for real only after success or a test.
> 
> Otherwise it would be valid.

So the EXABYTE case should return normally, I take (otherwise you
confused me good;))? The patch below drops this change and keeps
the rest.


--- linux-244-ac16-clean/drivers/ide/ide-probe.cFri May 25 21:11:08 2001
+++ linux-244-ac16/drivers/ide/ide-probe.c  Fri May 25 22:54:15 2001
@@ -58,6 +58,11 @@
struct hd_driveid *id;
 
id = drive->id = kmalloc (SECTOR_WORDS*4, GFP_ATOMIC);  /* called with 
interrupts disabled! */
+if (!id) {
+printk(KERN_WARNING "(ide-probe::do_identify) Out of memory.\n");
+goto err_kmalloc;
+}
+
ide_input_data(drive, id, SECTOR_WORDS);/* read 512 bytes of 
id info */
ide__sti(); /* local CPU only */
ide_fix_driveid(id);
@@ -76,8 +81,7 @@
if ((id->model[0] == 'P' && id->model[1] == 'M')
 || (id->model[0] == 'S' && id->model[1] == 'K')) {
printk("%s: EATA SCSI HBA %.10s\n", drive->name, id->model);
-   drive->present = 0;
-   return;
+goto err_misc;
}
 #endif /* CONFIG_SCSI_EATA_DMA || CONFIG_SCSI_EATA_PIO */
 
@@ -111,8 +115,7 @@
 #ifdef CONFIG_BLK_DEV_PDC4030
if (HWIF(drive)->channel == 1 && HWIF(drive)->chipset == ide_pdc4030) {
printk(" -- not supported on 2nd Promise port\n");
-   drive->present = 0;
-   return;
+goto err_misc;
}
 #endif /* CONFIG_BLK_DEV_PDC4030 */
switch (type) {
@@ -174,6 +177,12 @@
printk("ATA DISK drive\n");
QUIRK_LIST(HWIF(drive),drive);
return;
+
+err_misc:
+kfree(id);
+err_kmalloc:
+drive->present = 0;
+return;
 }
 
 /*
@@ -759,11 +768,23 @@
}
minors= units * (1part  = kmalloc (minors * sizeof(struct hd_struct), GFP_KERNEL);
-   bs= kmalloc (minors*sizeof(int), GFP_KERNEL);
-   max_sect  = kmalloc (minors*sizeof(int), GFP_KERNEL);
-   max_ra= kmalloc (minors*sizeof(int), GFP_KERNEL);
+if (!gd)
+goto err_kmalloc_gd;
+gd->sizes = kmalloc (minors * sizeof(int), GFP_KERNEL);
+if (!gd->sizes)
+goto err_kmalloc_gd_sizes;
+gd->part  = kmalloc (minors * sizeof(struct hd_struct), GFP_KERNEL);
+if (!gd->part)
+goto err_kmalloc_gd_part;
+bs= kmalloc (minors*sizeof(int), GFP_KERNEL);
+if (!bs)
+goto err_kmalloc_gs;
+max_sect  = kmalloc (minors*sizeof(int), GFP_KERNEL);
+if (!max_sect)
+goto err_kmalloc_max_sect;
+max_ra= kmalloc (minors*sizeof(int), GFP_KERNEL);
+if (!max_ra)
+goto err_kmalloc_max_ra;
 
memset(gd->part, 0, minors * sizeof(struct hd_struct));
 
@@ -816,6 +837,21 @@
devfs_mk_dir (ide_devfs_handle, name, NULL);
}
}
+return;
+
+err_kmalloc_max_ra:
+kfree(max_sect);
+err_kmalloc_max_sect:
+kfree(bs);
+err_kmalloc_gs:
+kfree(gd->part);
+err_kmalloc_gd_part:
+kfree(gd->sizes);
+err_kmalloc_gd_sizes:
+kfree(gd);
+err_kmalloc_gd:
+printk(KERN_WARNING "(ide::init_gendisk) Out of memory\n");
+return;
 }
 
 static int hwif_init (ide_hwif_t *hwif)

Regards,
   Rasmus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] __idetape_kmalloc_stage return code check in ide-tape.c (244-ac16)

2001-05-25 Thread Rasmus Andersen

Hi.

This trivial patch adds a kmalloc check to ide-tape.c::
idetape_onstream_read_back_buffer as per the Stanford team's report
way back. It applies against 244ac16.

Reading the code I was not sure if it was OK to just return
or more should be done. Please sanity check this.

--- linux-244-ac11-clean/drivers/ide/ide-tape.c Sat May 19 21:06:35 2001
+++ linux-244-ac11/drivers/ide/ide-tape.c   Sun May 20 14:58:44 2001
@@ -3472,6 +3472,11 @@
printk(KERN_INFO "ide-tape: %s: reading back %d frames from the drive's 
internal buffer\n", tape->name, frames);
for (i = 0; i < frames; i++) {
stage = __idetape_kmalloc_stage(tape, 0, 0);
+if(!stage) {
+printk(KERN_WARNING "(idetape:) Failed to allocate memory for 
+buffer\n");
+return;
+}
+
if (!first)
first = stage;
aux = stage->aux;
-- 
Regards,
Rasmus([EMAIL PROTECTED])

'Xenix is the pinnacle of modern UNIX design, and will be used for many
years to come' -Xenix OS API manual 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] kmalloc checks for drivers/ide/ide-probe.c (244ac16)

2001-05-25 Thread Rasmus Andersen

Hi.

The following patch adds a number of checks for kmalloc returns
to drivers/ide/ide-probe.c. It applies against ac16.

One comment: This patch adds 'drive-present = 0' to the
code path for the EXABYTE case. I could not discern if this was a
shortcoming of the original code or not. Please comment.


--- linux-244-ac16-clean/drivers/ide/ide-probe.cFri May 25 21:11:08 2001
+++ linux-244-ac16/drivers/ide/ide-probe.c  Fri May 25 21:51:08 2001
@@ -58,6 +58,11 @@
struct hd_driveid *id;
 
id = drive->id = kmalloc (SECTOR_WORDS*4, GFP_ATOMIC);  /* called with 
interrupts disabled! */
+if (!id) {
+printk(KERN_WARNING "(ide-probe::do_identify) Out of memory.\n");
+goto err_kmalloc;
+}
+
ide_input_data(drive, id, SECTOR_WORDS);/* read 512 bytes of 
id info */
ide__sti(); /* local CPU only */
ide_fix_driveid(id);
@@ -76,8 +81,7 @@
if ((id->model[0] == 'P' && id->model[1] == 'M')
 || (id->model[0] == 'S' && id->model[1] == 'K')) {
printk("%s: EATA SCSI HBA %.10s\n", drive->name, id->model);
-   drive->present = 0;
-   return;
+goto err_misc;
}
 #endif /* CONFIG_SCSI_EATA_DMA || CONFIG_SCSI_EATA_PIO */
 
@@ -96,7 +100,7 @@
ide_fixstring (id->serial_no, sizeof(id->serial_no), bswap);
 
if (strstr(id->model, "E X A B Y T E N E S T"))
-   return;
+goto err_misc;
 
id->model[sizeof(id->model)-1] = '\0';  /* we depend on this a lot! */
printk("%s: %s, ", drive->name, id->model);
@@ -111,8 +115,7 @@
 #ifdef CONFIG_BLK_DEV_PDC4030
if (HWIF(drive)->channel == 1 && HWIF(drive)->chipset == ide_pdc4030) {
printk(" -- not supported on 2nd Promise port\n");
-   drive->present = 0;
-   return;
+goto err_misc;
}
 #endif /* CONFIG_BLK_DEV_PDC4030 */
switch (type) {
@@ -174,6 +177,12 @@
printk("ATA DISK drive\n");
QUIRK_LIST(HWIF(drive),drive);
return;
+
+err_misc:
+kfree(id);
+err_kmalloc:
+drive->present = 0;
+return;
 }
 
 /*
@@ -759,11 +768,23 @@
}
minors= units * (1part  = kmalloc (minors * sizeof(struct hd_struct), GFP_KERNEL);
-   bs= kmalloc (minors*sizeof(int), GFP_KERNEL);
-   max_sect  = kmalloc (minors*sizeof(int), GFP_KERNEL);
-   max_ra= kmalloc (minors*sizeof(int), GFP_KERNEL);
+if (!gd)
+goto err_kmalloc_gd;
+gd->sizes = kmalloc (minors * sizeof(int), GFP_KERNEL);
+if (!gd->sizes)
+goto err_kmalloc_gd_sizes;
+gd->part  = kmalloc (minors * sizeof(struct hd_struct), GFP_KERNEL);
+if (!gd->part)
+goto err_kmalloc_gd_part;
+bs= kmalloc (minors*sizeof(int), GFP_KERNEL);
+if (!bs)
+goto err_kmalloc_gs;
+max_sect  = kmalloc (minors*sizeof(int), GFP_KERNEL);
+if (!max_sect)
+goto err_kmalloc_max_sect;
+max_ra= kmalloc (minors*sizeof(int), GFP_KERNEL);
+if (!max_ra)
+goto err_kmalloc_max_ra;
 
memset(gd->part, 0, minors * sizeof(struct hd_struct));
 
@@ -816,6 +837,21 @@
devfs_mk_dir (ide_devfs_handle, name, NULL);
}
}
+return;
+
+err_kmalloc_max_ra:
+kfree(max_sect);
+err_kmalloc_max_sect:
+kfree(bs);
+err_kmalloc_gs:
+kfree(gd->part);
+err_kmalloc_gd_part:
+kfree(gd->sizes);
+err_kmalloc_gd_sizes:
+kfree(gd);
+err_kmalloc_gd:
+printk(KERN_WARNING "(ide::init_gendisk) Out of memory\n");
+return;
 }
 
 static int hwif_init (ide_hwif_t *hwif)
-- 
regards,
Rasmus([EMAIL PROTECTED])

An Emacs reference mug is what I want. It would hold ten gallons of
coffee. -- Steve VanDevender 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] check kmalloc return in ide-cd.c (244-ac16)

2001-05-25 Thread Rasmus Andersen

Hi.

This patch adds a check for the return value from kmalloc in
ide_cdrom_open. Applies against ac16.


--- linux-244-ac16-clean/drivers/ide/ide-cd.c   Fri May 25 21:11:08 2001
+++ linux-244-ac16/drivers/ide/ide-cd.c Fri May 25 21:30:20 2001
@@ -2869,12 +2869,12 @@
 int ide_cdrom_open (struct inode *ip, struct file *fp, ide_drive_t *drive)
 {
struct cdrom_info *info = drive->driver_data;
-   int rc;
+   int rc = -ENOMEM;
 
MOD_INC_USE_COUNT;
if (info->buffer == NULL)
info->buffer = (char *) kmalloc(SECTOR_BUFFER_SIZE, GFP_KERNEL);
-   if ((rc = cdrom_fops.open(ip, fp))) {
+if ((info->buffer == NULL) || (rc = cdrom_fops.open(ip, fp))) {
drive->usage--;
MOD_DEC_USE_COUNT;
}
-- 
Regards,
Rasmus([EMAIL PROTECTED])

The police are not here to create disorder.  They're here to preserve
disorder." -Former Chicago mayor Daley during the infamous 1968 Democratic
Party convention
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] __init -> __initdata for drivers/ide/feature.c (244-ac16)

2001-05-25 Thread Rasmus Andersen

Hi.

The following patch changes an __init to an __initdata. Applies
against 2.4.4-ac16.


--- linux-244-ac16-clean/arch/ppc/kernel/feature.c  Sat May 19 21:06:18 2001+++ 
linux-244-ac16/arch/ppc/kernel/feature.cMon May 21 00:04:35 2001
@@ -267,7 +267,7 @@
 static struct board_features_t {
char*   compatible;
u32 features;
-} board_features_datas[] __init =
+} board_features_datas[] __initdata =
 {
   {"AAPL,PowerMac G3", 0   }, /* Beige G3 */
   {"iMac,1",   0   }, /* First iMac 
(gossamer) */

-- 
Regards,
Rasmus([EMAIL PROTECTED])

We're going to turn this team around 360 degrees.
-Jason Kidd, upon his drafting to the Dallas Mavericks
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] __init - __initdata for drivers/ide/feature.c (244-ac16)

2001-05-25 Thread Rasmus Andersen

Hi.

The following patch changes an __init to an __initdata. Applies
against 2.4.4-ac16.


--- linux-244-ac16-clean/arch/ppc/kernel/feature.c  Sat May 19 21:06:18 2001+++ 
linux-244-ac16/arch/ppc/kernel/feature.cMon May 21 00:04:35 2001
@@ -267,7 +267,7 @@
 static struct board_features_t {
char*   compatible;
u32 features;
-} board_features_datas[] __init =
+} board_features_datas[] __initdata =
 {
   {AAPL,PowerMac G3, 0   }, /* Beige G3 */
   {iMac,1,   0   }, /* First iMac 
(gossamer) */

-- 
Regards,
Rasmus([EMAIL PROTECTED])

We're going to turn this team around 360 degrees.
-Jason Kidd, upon his drafting to the Dallas Mavericks
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] check kmalloc return in ide-cd.c (244-ac16)

2001-05-25 Thread Rasmus Andersen

Hi.

This patch adds a check for the return value from kmalloc in
ide_cdrom_open. Applies against ac16.


--- linux-244-ac16-clean/drivers/ide/ide-cd.c   Fri May 25 21:11:08 2001
+++ linux-244-ac16/drivers/ide/ide-cd.c Fri May 25 21:30:20 2001
@@ -2869,12 +2869,12 @@
 int ide_cdrom_open (struct inode *ip, struct file *fp, ide_drive_t *drive)
 {
struct cdrom_info *info = drive-driver_data;
-   int rc;
+   int rc = -ENOMEM;
 
MOD_INC_USE_COUNT;
if (info-buffer == NULL)
info-buffer = (char *) kmalloc(SECTOR_BUFFER_SIZE, GFP_KERNEL);
-   if ((rc = cdrom_fops.open(ip, fp))) {
+if ((info-buffer == NULL) || (rc = cdrom_fops.open(ip, fp))) {
drive-usage--;
MOD_DEC_USE_COUNT;
}
-- 
Regards,
Rasmus([EMAIL PROTECTED])

The police are not here to create disorder.  They're here to preserve
disorder. -Former Chicago mayor Daley during the infamous 1968 Democratic
Party convention
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] kmalloc checks for drivers/ide/ide-probe.c (244ac16)

2001-05-25 Thread Rasmus Andersen

Hi.

The following patch adds a number of checks for kmalloc returns
to drivers/ide/ide-probe.c. It applies against ac16.

One comment: This patch adds 'drive-present = 0' to the
code path for the EXABYTE case. I could not discern if this was a
shortcoming of the original code or not. Please comment.


--- linux-244-ac16-clean/drivers/ide/ide-probe.cFri May 25 21:11:08 2001
+++ linux-244-ac16/drivers/ide/ide-probe.c  Fri May 25 21:51:08 2001
@@ -58,6 +58,11 @@
struct hd_driveid *id;
 
id = drive-id = kmalloc (SECTOR_WORDS*4, GFP_ATOMIC);  /* called with 
interrupts disabled! */
+if (!id) {
+printk(KERN_WARNING (ide-probe::do_identify) Out of memory.\n);
+goto err_kmalloc;
+}
+
ide_input_data(drive, id, SECTOR_WORDS);/* read 512 bytes of 
id info */
ide__sti(); /* local CPU only */
ide_fix_driveid(id);
@@ -76,8 +81,7 @@
if ((id-model[0] == 'P'  id-model[1] == 'M')
 || (id-model[0] == 'S'  id-model[1] == 'K')) {
printk(%s: EATA SCSI HBA %.10s\n, drive-name, id-model);
-   drive-present = 0;
-   return;
+goto err_misc;
}
 #endif /* CONFIG_SCSI_EATA_DMA || CONFIG_SCSI_EATA_PIO */
 
@@ -96,7 +100,7 @@
ide_fixstring (id-serial_no, sizeof(id-serial_no), bswap);
 
if (strstr(id-model, E X A B Y T E N E S T))
-   return;
+goto err_misc;
 
id-model[sizeof(id-model)-1] = '\0';  /* we depend on this a lot! */
printk(%s: %s, , drive-name, id-model);
@@ -111,8 +115,7 @@
 #ifdef CONFIG_BLK_DEV_PDC4030
if (HWIF(drive)-channel == 1  HWIF(drive)-chipset == ide_pdc4030) {
printk( -- not supported on 2nd Promise port\n);
-   drive-present = 0;
-   return;
+goto err_misc;
}
 #endif /* CONFIG_BLK_DEV_PDC4030 */
switch (type) {
@@ -174,6 +177,12 @@
printk(ATA DISK drive\n);
QUIRK_LIST(HWIF(drive),drive);
return;
+
+err_misc:
+kfree(id);
+err_kmalloc:
+drive-present = 0;
+return;
 }
 
 /*
@@ -759,11 +768,23 @@
}
minors= units * (1PARTN_BITS);
gd= kmalloc (sizeof(struct gendisk), GFP_KERNEL);
-   gd-sizes = kmalloc (minors * sizeof(int), GFP_KERNEL);
-   gd-part  = kmalloc (minors * sizeof(struct hd_struct), GFP_KERNEL);
-   bs= kmalloc (minors*sizeof(int), GFP_KERNEL);
-   max_sect  = kmalloc (minors*sizeof(int), GFP_KERNEL);
-   max_ra= kmalloc (minors*sizeof(int), GFP_KERNEL);
+if (!gd)
+goto err_kmalloc_gd;
+gd-sizes = kmalloc (minors * sizeof(int), GFP_KERNEL);
+if (!gd-sizes)
+goto err_kmalloc_gd_sizes;
+gd-part  = kmalloc (minors * sizeof(struct hd_struct), GFP_KERNEL);
+if (!gd-part)
+goto err_kmalloc_gd_part;
+bs= kmalloc (minors*sizeof(int), GFP_KERNEL);
+if (!bs)
+goto err_kmalloc_gs;
+max_sect  = kmalloc (minors*sizeof(int), GFP_KERNEL);
+if (!max_sect)
+goto err_kmalloc_max_sect;
+max_ra= kmalloc (minors*sizeof(int), GFP_KERNEL);
+if (!max_ra)
+goto err_kmalloc_max_ra;
 
memset(gd-part, 0, minors * sizeof(struct hd_struct));
 
@@ -816,6 +837,21 @@
devfs_mk_dir (ide_devfs_handle, name, NULL);
}
}
+return;
+
+err_kmalloc_max_ra:
+kfree(max_sect);
+err_kmalloc_max_sect:
+kfree(bs);
+err_kmalloc_gs:
+kfree(gd-part);
+err_kmalloc_gd_part:
+kfree(gd-sizes);
+err_kmalloc_gd_sizes:
+kfree(gd);
+err_kmalloc_gd:
+printk(KERN_WARNING (ide::init_gendisk) Out of memory\n);
+return;
 }
 
 static int hwif_init (ide_hwif_t *hwif)
-- 
regards,
Rasmus([EMAIL PROTECTED])

An Emacs reference mug is what I want. It would hold ten gallons of
coffee. -- Steve VanDevender 
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] __idetape_kmalloc_stage return code check in ide-tape.c (244-ac16)

2001-05-25 Thread Rasmus Andersen

Hi.

This trivial patch adds a kmalloc check to ide-tape.c::
idetape_onstream_read_back_buffer as per the Stanford team's report
way back. It applies against 244ac16.

Reading the code I was not sure if it was OK to just return
or more should be done. Please sanity check this.

--- linux-244-ac11-clean/drivers/ide/ide-tape.c Sat May 19 21:06:35 2001
+++ linux-244-ac11/drivers/ide/ide-tape.c   Sun May 20 14:58:44 2001
@@ -3472,6 +3472,11 @@
printk(KERN_INFO ide-tape: %s: reading back %d frames from the drive's 
internal buffer\n, tape-name, frames);
for (i = 0; i  frames; i++) {
stage = __idetape_kmalloc_stage(tape, 0, 0);
+if(!stage) {
+printk(KERN_WARNING (idetape:) Failed to allocate memory for 
+buffer\n);
+return;
+}
+
if (!first)
first = stage;
aux = stage-aux;
-- 
Regards,
Rasmus([EMAIL PROTECTED])

'Xenix is the pinnacle of modern UNIX design, and will be used for many
years to come' -Xenix OS API manual 
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] kmalloc checks for drivers/ide/ide-probe.c (244ac16)

2001-05-25 Thread Rasmus Andersen

On Fri, May 25, 2001 at 01:47:52PM -0700, Andre Hedrick wrote:
 
 Not valid because the jump to that part of the code is protected.
 If a polling response for a valid status and no timeout, is detected then
 it attempts to the command for real only after success or a test.
 
 Otherwise it would be valid.

So the EXABYTE case should return normally, I take (otherwise you
confused me good;))? The patch below drops this change and keeps
the rest.


--- linux-244-ac16-clean/drivers/ide/ide-probe.cFri May 25 21:11:08 2001
+++ linux-244-ac16/drivers/ide/ide-probe.c  Fri May 25 22:54:15 2001
@@ -58,6 +58,11 @@
struct hd_driveid *id;
 
id = drive-id = kmalloc (SECTOR_WORDS*4, GFP_ATOMIC);  /* called with 
interrupts disabled! */
+if (!id) {
+printk(KERN_WARNING (ide-probe::do_identify) Out of memory.\n);
+goto err_kmalloc;
+}
+
ide_input_data(drive, id, SECTOR_WORDS);/* read 512 bytes of 
id info */
ide__sti(); /* local CPU only */
ide_fix_driveid(id);
@@ -76,8 +81,7 @@
if ((id-model[0] == 'P'  id-model[1] == 'M')
 || (id-model[0] == 'S'  id-model[1] == 'K')) {
printk(%s: EATA SCSI HBA %.10s\n, drive-name, id-model);
-   drive-present = 0;
-   return;
+goto err_misc;
}
 #endif /* CONFIG_SCSI_EATA_DMA || CONFIG_SCSI_EATA_PIO */
 
@@ -111,8 +115,7 @@
 #ifdef CONFIG_BLK_DEV_PDC4030
if (HWIF(drive)-channel == 1  HWIF(drive)-chipset == ide_pdc4030) {
printk( -- not supported on 2nd Promise port\n);
-   drive-present = 0;
-   return;
+goto err_misc;
}
 #endif /* CONFIG_BLK_DEV_PDC4030 */
switch (type) {
@@ -174,6 +177,12 @@
printk(ATA DISK drive\n);
QUIRK_LIST(HWIF(drive),drive);
return;
+
+err_misc:
+kfree(id);
+err_kmalloc:
+drive-present = 0;
+return;
 }
 
 /*
@@ -759,11 +768,23 @@
}
minors= units * (1PARTN_BITS);
gd= kmalloc (sizeof(struct gendisk), GFP_KERNEL);
-   gd-sizes = kmalloc (minors * sizeof(int), GFP_KERNEL);
-   gd-part  = kmalloc (minors * sizeof(struct hd_struct), GFP_KERNEL);
-   bs= kmalloc (minors*sizeof(int), GFP_KERNEL);
-   max_sect  = kmalloc (minors*sizeof(int), GFP_KERNEL);
-   max_ra= kmalloc (minors*sizeof(int), GFP_KERNEL);
+if (!gd)
+goto err_kmalloc_gd;
+gd-sizes = kmalloc (minors * sizeof(int), GFP_KERNEL);
+if (!gd-sizes)
+goto err_kmalloc_gd_sizes;
+gd-part  = kmalloc (minors * sizeof(struct hd_struct), GFP_KERNEL);
+if (!gd-part)
+goto err_kmalloc_gd_part;
+bs= kmalloc (minors*sizeof(int), GFP_KERNEL);
+if (!bs)
+goto err_kmalloc_gs;
+max_sect  = kmalloc (minors*sizeof(int), GFP_KERNEL);
+if (!max_sect)
+goto err_kmalloc_max_sect;
+max_ra= kmalloc (minors*sizeof(int), GFP_KERNEL);
+if (!max_ra)
+goto err_kmalloc_max_ra;
 
memset(gd-part, 0, minors * sizeof(struct hd_struct));
 
@@ -816,6 +837,21 @@
devfs_mk_dir (ide_devfs_handle, name, NULL);
}
}
+return;
+
+err_kmalloc_max_ra:
+kfree(max_sect);
+err_kmalloc_max_sect:
+kfree(bs);
+err_kmalloc_gs:
+kfree(gd-part);
+err_kmalloc_gd_part:
+kfree(gd-sizes);
+err_kmalloc_gd_sizes:
+kfree(gd);
+err_kmalloc_gd:
+printk(KERN_WARNING (ide::init_gendisk) Out of memory\n);
+return;
 }
 
 static int hwif_init (ide_hwif_t *hwif)

Regards,
   Rasmus
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] Add missing spin_unlock_irq to ide.c (244ac16)

2001-05-25 Thread Rasmus Andersen

(I forgot to cc l-k on this one when it went to andre.)

Hi.

This patch adds a spin_unlock_irqsave to ide_spin_wait_hwgroup as
reported by the Stanford team way back. It applies against 244ac16.


--- linux-244-ac16-clean/drivers/ide/ide.c  Fri May 25 21:11:08 2001
+++ linux-244-ac16/drivers/ide/ide.cFri May 25 22:46:43 2001
@@ -2362,6 +2362,8 @@
__restore_flags(lflags);/* local CPU only */
spin_lock_irq(io_request_lock);
}
+
+spin_unlock_irq(io_request_lock);
return 0;
 }
 
-- 
Rasmus([EMAIL PROTECTED])

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] __init - __initdata in drivers/video/matrox/matroxfb_base.c (244ac16)

2001-05-25 Thread Rasmus Andersen

Hi.

The following patch changes an __init to __initdata. Applies against
2.4.4-ac11.


--- linux-244-ac11-clean/drivers/video/matrox/matroxfb_base.c   Sat May 19 20:58:43 
2001
+++ linux-244-ac11/drivers/video/matrox/matroxfb_base.c Sun May 20 23:55:24 2001
@@ -2483,7 +2483,7 @@
return 0;
 }
 
-static int __init initialized = 0;
+static int __initdata initialized = 0;
 
 int __init matroxfb_init(void)
 {

-- 
Regards,
Rasmus([EMAIL PROTECTED])
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] Add missing spin_unlock_irq to ide.c (244ac16)

2001-05-25 Thread Rasmus Andersen

On Fri, May 25, 2001 at 11:11:23PM +0200, Jens Axboe wrote:
[...] 
 This isn't right. Granted the locking isn't straight forward here, but
 take a look at ide_write_setting - ide_spin_wait_hwgroup and the
 latters return value.
 
Yes, Andre set me straight here. My apologies for being lazy and
not checking the call path.

-- 
Rasmus([EMAIL PROTECTED])

You know how dumb the average guy is?  Well, by  definition, half
of them are even dumber than that.
-- J.R. Bob Dobbs 
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] drivers/net/others

2001-05-24 Thread Rasmus Andersen

On Thu, May 24, 2001 at 09:00:20AM -0700, Jonathan Lundell wrote:
[...]
> 
> Fine. But:
> 
> At 3:02 AM +0200 2001-05-24, Andrzej Krzysztofowicz wrote:
> >-printk(version);
> >+#ifdef MODULE
> >+printk("s", version);
> > printed_version = 1;
> >+#endif /* MODULE */
> 
> ...is playing it just a little too safe, wouldn't you say?

With the above snippet of code being remailed a couple of times
somebody surely noticed before me that the printk should have
"%s" as format string, not "s". But then again somebody might
not so there you are.
-- 
Rasmus([EMAIL PROTECTED])

"A statesman... is a dead politician. Lord knows, we need more statesmen." 
   -- Bloom County
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] drivers/net/others

2001-05-24 Thread Rasmus Andersen

On Thu, May 24, 2001 at 09:00:20AM -0700, Jonathan Lundell wrote:
[...]
 
 Fine. But:
 
 At 3:02 AM +0200 2001-05-24, Andrzej Krzysztofowicz wrote:
 -printk(version);
 +#ifdef MODULE
 +printk(s, version);
  printed_version = 1;
 +#endif /* MODULE */
 
 ...is playing it just a little too safe, wouldn't you say?

With the above snippet of code being remailed a couple of times
somebody surely noticed before me that the printk should have
%s as format string, not s. But then again somebody might
not so there you are.
-- 
Rasmus([EMAIL PROTECTED])

A statesman... is a dead politician. Lord knows, we need more statesmen. 
   -- Bloom County
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] make drivers/block/ps2esdi.c compile (2.4.4)

2001-05-20 Thread Rasmus Andersen

Hi.

The following trivial patch against 2.4.4(-ac11) makes ps2esdi compile.

--- linux-244-ac10-clean/drivers/block/ps2esdi.cSat May 19 21:06:29 2001
+++ linux-244-ac10/drivers/block/ps2esdi.c  Sun May 20 14:47:04 2001
@@ -953,10 +953,10 @@
break;
}
if(ending != -1) {
-   spin_lock_irqsave(io_request_lock, flags);
+   spin_lock_irqsave(_request_lock, flags);
end_request(ending);
do_ps2esdi_request(BLK_DEFAULT_QUEUE(MAJOR_NR));
-   spin_unlock_irqrestore(io_request_lock, flags);
+   spin_unlock_irqrestore(_request_lock, flags);
}
 }  /* handle interrupts */
 

-- 
Regards,
Rasmus([EMAIL PROTECTED])

The difference between theory and practice is that, in theory, there is 
no difference between theory and practice. -- Anonymous
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] make drivers/block/ps2esdi.c compile (2.4.4)

2001-05-20 Thread Rasmus Andersen

Hi.

The following trivial patch against 2.4.4(-ac11) makes ps2esdi compile.

--- linux-244-ac10-clean/drivers/block/ps2esdi.cSat May 19 21:06:29 2001
+++ linux-244-ac10/drivers/block/ps2esdi.c  Sun May 20 14:47:04 2001
@@ -953,10 +953,10 @@
break;
}
if(ending != -1) {
-   spin_lock_irqsave(io_request_lock, flags);
+   spin_lock_irqsave(io_request_lock, flags);
end_request(ending);
do_ps2esdi_request(BLK_DEFAULT_QUEUE(MAJOR_NR));
-   spin_unlock_irqrestore(io_request_lock, flags);
+   spin_unlock_irqrestore(io_request_lock, flags);
}
 }  /* handle interrupts */
 

-- 
Regards,
Rasmus([EMAIL PROTECTED])

The difference between theory and practice is that, in theory, there is 
no difference between theory and practice. -- Anonymous
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [NEW SCSI DRIVER] for 53c700 chip and NCR_D700 card against 2.4.4

2001-05-14 Thread Rasmus Andersen

Disclaimer: I know nothing of this device/hw, the scsi protocol or
anything remotely applicable the functioning of this driver. The
stuff below is just nit-picking and PITA-ing :) Pro-active kernel
janitoring, if you like.

On Sat, May 12, 2001 at 11:43:04AM -0500, James Bottomley wrote:
[...]
> +struct Scsi_Host * __init
> +NCR_700_detect(Scsi_Host_Template *tpnt,
> +struct NCR_700_Host_Parameters *hostdata)
> +{
> + __u32 *script = kmalloc(sizeof(SCRIPT), GFP_KERNEL);
> + __u32 pScript;
> + struct Scsi_Host *host;
> + static int banner = 0;
> + int j;
> +
[...]
> +
> + host = scsi_register(tpnt, 4);
> + if(script == NULL) {
> + printk(KERN_ERR "53c700: Failed to allocate script, detatching\n");
> + scsi_unregister(host);
> + return NULL;
> + }

You are not checking if the scsi_register went ok or not.

[...] 
> +STATIC void 
> +free_slot(struct NCR_700_command_slot *slot,
> +   struct NCR_700_Host_Parameters *hostdata)
> +{
> + int hash;
> + struct NCR_700_command_slot **forw, **back;
> +
> +
> + if((slot->state & NCR_700_SLOT_MASK) != NCR_700_SLOT_MAGIC) {
> + printk(" SLOT %p is not MAGIC!!!\n", slot);
> + }
> + if(slot->state == NCR_700_SLOT_FREE) {
> + printk(" SLOT %p is FREE!!!\n", slot);
> + }

Could you be persuaded to add KERN_SOMETHING to the printks above?

[...]
> +STATIC __u32
> +process_extended_message(struct Scsi_Host *host, 
> +  struct NCR_700_Host_Parameters *hostdata,
> +  Scsi_Cmnd *SCp, __u32 dsp, __u32 dsps)
> +{
> + __u32 resume_offset = dsp, temp = dsp + 8;
> + __u8 pun = 0xff, lun = 0xff;
> +
> + if(SCp != NULL) {
> + pun = SCp->target;
> + lun = SCp->lun;
> + }
> +
> + switch(hostdata->msgin[2]) {
[...]
> +
> + default:
> + printk(KERN_INFO "scsi%d (%d:%d): Unexpected message %s: ",
> +host->host_no, pun, lun,
> +NCR_700_phase[(dsps & 0xf00) >> 8]);
> + print_msg(hostdata->msgin);
> + printk("\n");

It would be nice with a KERN_XX before "\n" (yes, I recognize that
print_msg does not do this :( )

[...]
> +STATIC __u32
> +process_script_interrupt(__u32 dsps, __u32 dsp, Scsi_Cmnd *SCp,
> +  struct Scsi_Host *host,
> +  struct NCR_700_Host_Parameters *hostdata)
> +{

[...]
> + } else if((dsps & 0xf0f0) == A_UNEXPECTED_PHASE) {
> + __u8 i = (dsps & 0xf00) >> 8;
> +
> + printk(KERN_ERR "scsi%d: (%d:%d), UNEXPECTED PHASE %s (%s)\n",
> +host->host_no, pun, lun,
> +NCR_700_phase[i],
> +sbcl_to_string(inb(host->base + SBCL_REG)));
> + printk(" len = %d, cmd =", SCp->cmd_len);

A KERN_ERR prefix?

[...]
> + retry:
> + if(slot == NULL) {
> + struct NCR_700_command_slot *s = find_ITL_Nexus(hostdata, 
>reselection_id, lun);
> + printk(KERN_ERR "scsi%d: (%d:%d) RESELECTED but no saved 
>command (MSG = %02x %02x %02x)!!\n",
> +host->host_no, reselection_id, lun,
> +hostdata->msgin[0], hostdata->msgin[1],
> +hostdata->msgin[2]);
> + printk(KERN_ERR " OUTSTANDING TAGS:");
> + while(s != NULL) {
> + if(s->cmnd->target == reselection_id &&
> +s->cmnd->lun == lun) {
> + printk("%d ", s->tag);

KERN_ERR?

> + if(s->tag == hostdata->msgin[2]) {
> + printk(" ***FOUND*** \n");

As above.

> + slot = s;
> + goto retry;
> + }
> + 
> + }
> + s = s->ITL_back;
> + }
> + printk("\n");

KERN_ERR?

[...]
> +void
> +NCR_700_intr(int irq, void *dev_id, struct pt_regs *regs)
> +{
[...]
> + if(dsp == Ent_SendMessage + 8 + hostdata->pScript) {
> + /* It wants to reply to some part of
> +  * our message */
> + __u32 temp = inl(host->base + TEMP_REG);
> +
> + int count = (hostdata->script[Ent_SendMessage/4] & 
>0xff) - ((inl(host->base + DBC_REG) & 0xff) + NCR_700_data_residual(host));
> + printk("scsi%d (%d:%d) PHASE MISMATCH IN SEND MESSAGE 
>%d remain, return %p[%04x], phase %s\n", host->host_no, pun, lun, count, (void 
>*)temp, temp - hostdata->pScript, sbcl_to_string(inb(host->base + SBCL_REG)));

Re: [NEW SCSI DRIVER] for 53c700 chip and NCR_D700 card against 2.4.4

2001-05-14 Thread Rasmus Andersen

Disclaimer: I know nothing of this device/hw, the scsi protocol or
anything remotely applicable the functioning of this driver. The
stuff below is just nit-picking and PITA-ing :) Pro-active kernel
janitoring, if you like.

On Sat, May 12, 2001 at 11:43:04AM -0500, James Bottomley wrote:
[...]
 +struct Scsi_Host * __init
 +NCR_700_detect(Scsi_Host_Template *tpnt,
 +struct NCR_700_Host_Parameters *hostdata)
 +{
 + __u32 *script = kmalloc(sizeof(SCRIPT), GFP_KERNEL);
 + __u32 pScript;
 + struct Scsi_Host *host;
 + static int banner = 0;
 + int j;
 +
[...]
 +
 + host = scsi_register(tpnt, 4);
 + if(script == NULL) {
 + printk(KERN_ERR 53c700: Failed to allocate script, detatching\n);
 + scsi_unregister(host);
 + return NULL;
 + }

You are not checking if the scsi_register went ok or not.

[...] 
 +STATIC void 
 +free_slot(struct NCR_700_command_slot *slot,
 +   struct NCR_700_Host_Parameters *hostdata)
 +{
 + int hash;
 + struct NCR_700_command_slot **forw, **back;
 +
 +
 + if((slot-state  NCR_700_SLOT_MASK) != NCR_700_SLOT_MAGIC) {
 + printk( SLOT %p is not MAGIC!!!\n, slot);
 + }
 + if(slot-state == NCR_700_SLOT_FREE) {
 + printk( SLOT %p is FREE!!!\n, slot);
 + }

Could you be persuaded to add KERN_SOMETHING to the printks above?

[...]
 +STATIC __u32
 +process_extended_message(struct Scsi_Host *host, 
 +  struct NCR_700_Host_Parameters *hostdata,
 +  Scsi_Cmnd *SCp, __u32 dsp, __u32 dsps)
 +{
 + __u32 resume_offset = dsp, temp = dsp + 8;
 + __u8 pun = 0xff, lun = 0xff;
 +
 + if(SCp != NULL) {
 + pun = SCp-target;
 + lun = SCp-lun;
 + }
 +
 + switch(hostdata-msgin[2]) {
[...]
 +
 + default:
 + printk(KERN_INFO scsi%d (%d:%d): Unexpected message %s: ,
 +host-host_no, pun, lun,
 +NCR_700_phase[(dsps  0xf00)  8]);
 + print_msg(hostdata-msgin);
 + printk(\n);

It would be nice with a KERN_XX before \n (yes, I recognize that
print_msg does not do this :( )

[...]
 +STATIC __u32
 +process_script_interrupt(__u32 dsps, __u32 dsp, Scsi_Cmnd *SCp,
 +  struct Scsi_Host *host,
 +  struct NCR_700_Host_Parameters *hostdata)
 +{

[...]
 + } else if((dsps  0xf0f0) == A_UNEXPECTED_PHASE) {
 + __u8 i = (dsps  0xf00)  8;
 +
 + printk(KERN_ERR scsi%d: (%d:%d), UNEXPECTED PHASE %s (%s)\n,
 +host-host_no, pun, lun,
 +NCR_700_phase[i],
 +sbcl_to_string(inb(host-base + SBCL_REG)));
 + printk( len = %d, cmd =, SCp-cmd_len);

A KERN_ERR prefix?

[...]
 + retry:
 + if(slot == NULL) {
 + struct NCR_700_command_slot *s = find_ITL_Nexus(hostdata, 
reselection_id, lun);
 + printk(KERN_ERR scsi%d: (%d:%d) RESELECTED but no saved 
command (MSG = %02x %02x %02x)!!\n,
 +host-host_no, reselection_id, lun,
 +hostdata-msgin[0], hostdata-msgin[1],
 +hostdata-msgin[2]);
 + printk(KERN_ERR  OUTSTANDING TAGS:);
 + while(s != NULL) {
 + if(s-cmnd-target == reselection_id 
 +s-cmnd-lun == lun) {
 + printk(%d , s-tag);

KERN_ERR?

 + if(s-tag == hostdata-msgin[2]) {
 + printk( ***FOUND*** \n);

As above.

 + slot = s;
 + goto retry;
 + }
 + 
 + }
 + s = s-ITL_back;
 + }
 + printk(\n);

KERN_ERR?

[...]
 +void
 +NCR_700_intr(int irq, void *dev_id, struct pt_regs *regs)
 +{
[...]
 + if(dsp == Ent_SendMessage + 8 + hostdata-pScript) {
 + /* It wants to reply to some part of
 +  * our message */
 + __u32 temp = inl(host-base + TEMP_REG);
 +
 + int count = (hostdata-script[Ent_SendMessage/4]  
0xff) - ((inl(host-base + DBC_REG)  0xff) + NCR_700_data_residual(host));
 + printk(scsi%d (%d:%d) PHASE MISMATCH IN SEND MESSAGE 
%d remain, return %p[%04x], phase %s\n, host-host_no, pun, lun, count, (void 
*)temp, temp - hostdata-pScript, sbcl_to_string(inb(host-base + SBCL_REG)));

KERN_ERR?

Also, some places you have KERN_ERR on debug output and some places
not. If you could be persuaded to put KERN_XX on the debug output too,
it would be nice 

Re: rsync over ssh on 2.4.2 to 2.2.18

2001-02-27 Thread Rasmus Andersen

On Tue, Feb 27, 2001 at 10:02:11AM +, Russell King wrote:
> Hi,
> 
> I'm seeing odd behaviour with rsync over ssh between two x86 machines -
> one if the is an UP PIII (Katmai) running 2.4.2 (isdn-gw) and the other
> is an UP Pentium 75-200 (pilt-gw) running 2.2.15pre13 with some custom
> serial driver hacks (for running Amplicon cards with their ISA interrupt-
> sharing scheme).

[...]

I have seen behaviour similar to this (descibed in 
http://marc.theaimsgroup.com/?l=linux-kernel=98262067309185=2)
locally on a 2.4.X machine where the rsync completes but fails to
terminate, apparently because the child does not receive the KILLUSR1
(wild speculation)? Anyways, the parent process waits in wait4 and
the child loops, waiting for the signal. This is not reproducable
in 2.2.X (for me).

I have found that in order to reproduce this problem I need to
make rsync do a certain amount of work. Ie., rsync linux/drivers
new-dir will make rsync hang, but rsync linux/drivers/[a-p]* does
not. Does the same thing apply for you? stracing the rsync does
make it all work if I specify that rsync should trace the child,
too.


Regards,
  Rasmus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: rsync over ssh on 2.4.2 to 2.2.18

2001-02-27 Thread Rasmus Andersen

On Tue, Feb 27, 2001 at 10:02:11AM +, Russell King wrote:
 Hi,
 
 I'm seeing odd behaviour with rsync over ssh between two x86 machines -
 one if the is an UP PIII (Katmai) running 2.4.2 (isdn-gw) and the other
 is an UP Pentium 75-200 (pilt-gw) running 2.2.15pre13 with some custom
 serial driver hacks (for running Amplicon cards with their ISA interrupt-
 sharing scheme).

[...]

I have seen behaviour similar to this (descibed in 
http://marc.theaimsgroup.com/?l=linux-kernelm=98262067309185w=2)
locally on a 2.4.X machine where the rsync completes but fails to
terminate, apparently because the child does not receive the KILLUSR1
(wild speculation)? Anyways, the parent process waits in wait4 and
the child loops, waiting for the signal. This is not reproducable
in 2.2.X (for me).

I have found that in order to reproduce this problem I need to
make rsync do a certain amount of work. Ie., rsync linux/drivers
new-dir will make rsync hang, but rsync linux/drivers/[a-p]* does
not. Does the same thing apply for you? stracing the rsync does
make it all work if I specify that rsync should trace the child,
too.


Regards,
  Rasmus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] s/isa//g in drivers/scsi/g_NCR5380.c and some cleanup (242)

2001-02-25 Thread Rasmus Andersen

On Sun, Feb 25, 2001 at 02:46:15PM +, Alan Cox wrote:
> > I am sorry but have I inverted the arguments to the memcpy_*io calls?
> > Or are you referring to something other than the arguments here?
> 
> You seem to have swapped the source/dest over in memcpy_toio cases and I need
> to convince myself you did that correctly

Yes, that is neither obvious nor nice. My apologies, but I could not
find a better way.

Explanation: The memcpy_toio cases goes like this:

-   isa_memcpy_toio(NCR53C400_host_buffer+NCR5380_map_name,src+start,128);
+   memcpy_toio(isa_remap_ptr+OFFSET_FROM_REMAPPING, src+start, 128);

isa_remap_ptr is the ioremap from NCR5380_map_name + NCR53C400_mem_base.
I would like to memcpy from NCR53C400_host_buffer+NCR5380_map_name thus
needing to add the difference between NCR53C400_host_buffer and the
NCR53C400_mem_base (used in isa_remap_ptr). Thus, in the hope that
this can be done linearly, I add OFFSET_FROM_REMAPPING 
(NCR53C400_host_buffer - NCR53C400_mem_base). (BTW, this is also done
in the memcpy_fromio cases.)

I hope that the above is readable.
-- 
Regards,
Rasmus([EMAIL PROTECTED])
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] s/isa//g in drivers/scsi/g_NCR5380.c and some cleanup (242)

2001-02-25 Thread Rasmus Andersen

> 
> Im running PIO. However while I agree with that one Im dubious about the
> inverts on the memcpy_*io bits
> 

I am sorry but have I inverted the arguments to the memcpy_*io calls?
Or are you referring to something other than the arguments here?
-- 
Rasmus([EMAIL PROTECTED])

"Science is like sex: sometimes something useful comes out, but that 
is not the reason we are doing it" -- Richard Feynman 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] s/isa//g in drivers/scsi/g_NCR5380.c and some cleanup (242)

2001-02-25 Thread Rasmus Andersen

On Sun, Feb 25, 2001 at 02:05:42PM +, Alan Cox wrote:
[...]
> > (An indication of how often this code path is used can be found in
> > the fact that the previous define of NCR5380_write had its payload
> > and address mixed up, probably making for wierd results should
> > the code ever be executed.)
> 
> The driver works for me nicely. Im not convinced by the changes of direction
> either. At least not without a detailed audit on the 2.2 code. Some of the
> naming is very misleading in that driver
> 

Looking at the define of NCR_5380_write

#define NCR5380_write(reg, value) isa_writeb(NCR5380_map_name + +NCR53C400_mem_base + 
(reg), value)

followed by an use of NCR5380_write

NCR5380_write(C400_CONTROL_STATUS_REG, CSR_BASE | CSR_TRANS_DIR);

I doubt that it is not the intention to write CSR_BASE | CSR_TRANS_DIR
at the offset C400_CONTROL_STATUS_REG. But note that this argument
swap only is in the code produced by -DCONFIG_SCSI_G_NCR5380_MEM.
Perhaps you use CONFIG_SCSI_G_NCR5380_PORT? Otherwise I must admit
that I have been had...
-- 
Regards,
Rasmus([EMAIL PROTECTED])

Duct tape is like the force; it has a light side and a dark side, and
it holds the universe together.
  -- Anonymous
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



[PATCH] s/isa//g in drivers/scsi/g_NCR5380.c and some cleanup (242)

2001-02-25 Thread Rasmus Andersen

Hi.

(Does anybody know who the maintainer for this code is?)

The patch below moves drivers/scsi/g_NCR5380.c from using isa_{read,
write, memcpy} to ioremap and the equivalent non-isa functions. It
also fixes an 'unused variable' warning and exchanges check_region for
request_region (and fixes a possible scenario where the checked-for
region was unequal in size to the later requested one).

(An indication of how often this code path is used can be found in
the fact that the previous define of NCR5380_write had its payload
and address mixed up, probably making for wierd results should
the code ever be executed.)

Since I feel a bit wierd after following the #defines around in the
code I would appreciate somebody else eyeballing this.


diff -aur linux-242-ac3-clean/drivers/scsi/g_NCR5380.c 
linux-242-ac3/drivers/scsi/g_NCR5380.c
--- linux-242-ac3-clean/drivers/scsi/g_NCR5380.cSat Feb 24 21:20:21 2001
+++ linux-242-ac3/drivers/scsi/g_NCR5380.c  Sun Feb 25 14:07:57 2001
@@ -144,6 +144,10 @@
 [1] __initdata = {{0,},};
 #endif
 
+#ifdef CONFIG_SCSI_G_NCR5380_MEM
+static void *isa_remap_ptr;
+#endif
+
 #define NO_OVERRIDES (sizeof(overrides) / sizeof(struct override))
 
 /*
@@ -264,7 +268,7 @@
 
 int __init generic_NCR5380_detect(Scsi_Host_Template * tpnt){
 static int current_override = 0;
-int count, i;
+int count;
 u_int *ports;
 u_int ncr_53c400a_ports[] = {0x280, 0x290, 0x300, 0x310, 0x330,
0x340, 0x348, 0x350, 0};
@@ -344,6 +348,7 @@
 
 #ifdef CONFIG_SCSI_G_NCR5380_PORT
if (ports) {
+   int i;
/* wakeup sequence for the NCR53C400A and DTC3181E*/
 
/* Disable the adapter and look for a free io port */
@@ -361,8 +366,8 @@
}
else
for(i=0; ports[i]; i++) {
-   if ((!check_region(ports[i], 16)) && (inb(ports[i]) == 0xff))
-   break;
+   if ((inb(ports[i]) == 0xff) && (request_region(ports[i], 
+NCR5380_region_size, "ncr5380")))
+   break;
}
if (ports[i]) {
outb(0x59, 0x779);
@@ -373,33 +378,25 @@
outb(0x80 | i, 0x379);  /* set io port to be used */
outb(0xc0, ports[i] + 9);
if (inb(ports[i] + 9) != 0x80)
-   continue;
+   goto err_release;
else
overrides[current_override].NCR5380_map_name=ports[i];
} else
-   continue;
+   goto err_release;
}
-
-   request_region(overrides[current_override].NCR5380_map_name,
-   NCR5380_region_size, "ncr5380");
 #else
-   if(check_mem_region(overrides[current_override].NCR5380_map_name,
-   NCR5380_region_size))
+   if(!request_mem_region(overrides[current_override].NCR5380_map_name,
+   NCR5380_region_size,  "ncr5380"))
continue;
-   request_mem_region(overrides[current_override].NCR5380_map_name,
-   NCR5380_region_size, "ncr5380");
+
+   isa_remap_ptr = ioremap(overrides[current_override].NCR5380_map_name +
+   NCR53C400_mem_base, NCR53C400_register_offset);
+   if (!isa_remap_ptr)
+   goto err_release_mem;
 #endif
instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
if(instance == NULL)
-   {
-#ifdef CONFIG_SCSI_G_NCR5380_PORT
-   release_region(overrides[current_override].NCR5380_map_name,
-   NCR5380_region_size);
-#else
-   release_mem_region(overrides[current_override].NCR5380_map_name,
-   NCR5380_region_size);
-#endif
-   }
+   goto err_release;

instance->NCR5380_instance_name = overrides[current_override].NCR5380_map_name;
 
@@ -434,6 +431,19 @@
 
++current_override;
++count;
+   continue;
+
+err_release:
+#ifdef CONFIG_SCSI_G_NCR5380_PORT
+   release_region(overrides[current_override].NCR5380_map_name,
+  NCR5380_region_size);
+#else
+   iounmap(isa_remap_ptr);
+err_release_mem:
+   release_mem_region(overrides[current_override].NCR5380_map_name,
+  NCR5380_region_size);
+#endif
+
 }
 return count;
 }
@@ -453,6 +463,7 @@
 release_region(instance->NCR5380_instance_name, NCR5380_region_size);
 #else
 release_mem_region(instance->NCR5380_instance_name, NCR5380_region_size);
+iounmap(isa_remap_ptr);
 #endif
 
 if (instance->irq != IRQ_NONE)
@@ -550,7 +561,7 @@
dst[start+i] = NCR5380_read(C400_HOST_BUFFER);
 #else
/* implies CONFIG_SCSI_G_NCR5380_MEM */
-   isa_memcpy_fromio(dst+start,NCR53C400_host_buffer+NCR5380_map_name,128);
+   memcpy_fromio(dst+start, 

[PATCH] s/isa//g in drivers/scsi/g_NCR5380.c and some cleanup (242)

2001-02-25 Thread Rasmus Andersen

Hi.

(Does anybody know who the maintainer for this code is?)

The patch below moves drivers/scsi/g_NCR5380.c from using isa_{read,
write, memcpy} to ioremap and the equivalent non-isa functions. It
also fixes an 'unused variable' warning and exchanges check_region for
request_region (and fixes a possible scenario where the checked-for
region was unequal in size to the later requested one).

(An indication of how often this code path is used can be found in
the fact that the previous define of NCR5380_write had its payload
and address mixed up, probably making for wierd results should
the code ever be executed.)

Since I feel a bit wierd after following the #defines around in the
code I would appreciate somebody else eyeballing this.


diff -aur linux-242-ac3-clean/drivers/scsi/g_NCR5380.c 
linux-242-ac3/drivers/scsi/g_NCR5380.c
--- linux-242-ac3-clean/drivers/scsi/g_NCR5380.cSat Feb 24 21:20:21 2001
+++ linux-242-ac3/drivers/scsi/g_NCR5380.c  Sun Feb 25 14:07:57 2001
@@ -144,6 +144,10 @@
 [1] __initdata = {{0,},};
 #endif
 
+#ifdef CONFIG_SCSI_G_NCR5380_MEM
+static void *isa_remap_ptr;
+#endif
+
 #define NO_OVERRIDES (sizeof(overrides) / sizeof(struct override))
 
 /*
@@ -264,7 +268,7 @@
 
 int __init generic_NCR5380_detect(Scsi_Host_Template * tpnt){
 static int current_override = 0;
-int count, i;
+int count;
 u_int *ports;
 u_int ncr_53c400a_ports[] = {0x280, 0x290, 0x300, 0x310, 0x330,
0x340, 0x348, 0x350, 0};
@@ -344,6 +348,7 @@
 
 #ifdef CONFIG_SCSI_G_NCR5380_PORT
if (ports) {
+   int i;
/* wakeup sequence for the NCR53C400A and DTC3181E*/
 
/* Disable the adapter and look for a free io port */
@@ -361,8 +366,8 @@
}
else
for(i=0; ports[i]; i++) {
-   if ((!check_region(ports[i], 16))  (inb(ports[i]) == 0xff))
-   break;
+   if ((inb(ports[i]) == 0xff)  (request_region(ports[i], 
+NCR5380_region_size, "ncr5380")))
+   break;
}
if (ports[i]) {
outb(0x59, 0x779);
@@ -373,33 +378,25 @@
outb(0x80 | i, 0x379);  /* set io port to be used */
outb(0xc0, ports[i] + 9);
if (inb(ports[i] + 9) != 0x80)
-   continue;
+   goto err_release;
else
overrides[current_override].NCR5380_map_name=ports[i];
} else
-   continue;
+   goto err_release;
}
-
-   request_region(overrides[current_override].NCR5380_map_name,
-   NCR5380_region_size, "ncr5380");
 #else
-   if(check_mem_region(overrides[current_override].NCR5380_map_name,
-   NCR5380_region_size))
+   if(!request_mem_region(overrides[current_override].NCR5380_map_name,
+   NCR5380_region_size,  "ncr5380"))
continue;
-   request_mem_region(overrides[current_override].NCR5380_map_name,
-   NCR5380_region_size, "ncr5380");
+
+   isa_remap_ptr = ioremap(overrides[current_override].NCR5380_map_name +
+   NCR53C400_mem_base, NCR53C400_register_offset);
+   if (!isa_remap_ptr)
+   goto err_release_mem;
 #endif
instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
if(instance == NULL)
-   {
-#ifdef CONFIG_SCSI_G_NCR5380_PORT
-   release_region(overrides[current_override].NCR5380_map_name,
-   NCR5380_region_size);
-#else
-   release_mem_region(overrides[current_override].NCR5380_map_name,
-   NCR5380_region_size);
-#endif
-   }
+   goto err_release;

instance-NCR5380_instance_name = overrides[current_override].NCR5380_map_name;
 
@@ -434,6 +431,19 @@
 
++current_override;
++count;
+   continue;
+
+err_release:
+#ifdef CONFIG_SCSI_G_NCR5380_PORT
+   release_region(overrides[current_override].NCR5380_map_name,
+  NCR5380_region_size);
+#else
+   iounmap(isa_remap_ptr);
+err_release_mem:
+   release_mem_region(overrides[current_override].NCR5380_map_name,
+  NCR5380_region_size);
+#endif
+
 }
 return count;
 }
@@ -453,6 +463,7 @@
 release_region(instance-NCR5380_instance_name, NCR5380_region_size);
 #else
 release_mem_region(instance-NCR5380_instance_name, NCR5380_region_size);
+iounmap(isa_remap_ptr);
 #endif
 
 if (instance-irq != IRQ_NONE)
@@ -550,7 +561,7 @@
dst[start+i] = NCR5380_read(C400_HOST_BUFFER);
 #else
/* implies CONFIG_SCSI_G_NCR5380_MEM */
-   isa_memcpy_fromio(dst+start,NCR53C400_host_buffer+NCR5380_map_name,128);
+   memcpy_fromio(dst+start, 

Re: [PATCH] s/isa//g in drivers/scsi/g_NCR5380.c and some cleanup (242)

2001-02-25 Thread Rasmus Andersen

On Sun, Feb 25, 2001 at 02:05:42PM +, Alan Cox wrote:
[...]
  (An indication of how often this code path is used can be found in
  the fact that the previous define of NCR5380_write had its payload
  and address mixed up, probably making for wierd results should
  the code ever be executed.)
 
 The driver works for me nicely. Im not convinced by the changes of direction
 either. At least not without a detailed audit on the 2.2 code. Some of the
 naming is very misleading in that driver
 

Looking at the define of NCR_5380_write

#define NCR5380_write(reg, value) isa_writeb(NCR5380_map_name + +NCR53C400_mem_base + 
(reg), value)

followed by an use of NCR5380_write

NCR5380_write(C400_CONTROL_STATUS_REG, CSR_BASE | CSR_TRANS_DIR);

I doubt that it is not the intention to write CSR_BASE | CSR_TRANS_DIR
at the offset C400_CONTROL_STATUS_REG. But note that this argument
swap only is in the code produced by -DCONFIG_SCSI_G_NCR5380_MEM.
Perhaps you use CONFIG_SCSI_G_NCR5380_PORT? Otherwise I must admit
that I have been had...
-- 
Regards,
Rasmus([EMAIL PROTECTED])

Duct tape is like the force; it has a light side and a dark side, and
it holds the universe together.
  -- Anonymous
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] s/isa//g in drivers/scsi/g_NCR5380.c and some cleanup (242)

2001-02-25 Thread Rasmus Andersen

 
 Im running PIO. However while I agree with that one Im dubious about the
 inverts on the memcpy_*io bits
 

I am sorry but have I inverted the arguments to the memcpy_*io calls?
Or are you referring to something other than the arguments here?
-- 
Rasmus([EMAIL PROTECTED])

"Science is like sex: sometimes something useful comes out, but that 
is not the reason we are doing it" -- Richard Feynman 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: [PATCH] s/isa//g in drivers/scsi/g_NCR5380.c and some cleanup (242)

2001-02-25 Thread Rasmus Andersen

On Sun, Feb 25, 2001 at 02:46:15PM +, Alan Cox wrote:
  I am sorry but have I inverted the arguments to the memcpy_*io calls?
  Or are you referring to something other than the arguments here?
 
 You seem to have swapped the source/dest over in memcpy_toio cases and I need
 to convince myself you did that correctly

Yes, that is neither obvious nor nice. My apologies, but I could not
find a better way.

Explanation: The memcpy_toio cases goes like this:

-   isa_memcpy_toio(NCR53C400_host_buffer+NCR5380_map_name,src+start,128);
+   memcpy_toio(isa_remap_ptr+OFFSET_FROM_REMAPPING, src+start, 128);

isa_remap_ptr is the ioremap from NCR5380_map_name + NCR53C400_mem_base.
I would like to memcpy from NCR53C400_host_buffer+NCR5380_map_name thus
needing to add the difference between NCR53C400_host_buffer and the
NCR53C400_mem_base (used in isa_remap_ptr). Thus, in the hope that
this can be done linearly, I add OFFSET_FROM_REMAPPING 
(NCR53C400_host_buffer - NCR53C400_mem_base). (BTW, this is also done
in the memcpy_fromio cases.)

I hope that the above is readable.
-- 
Regards,
Rasmus([EMAIL PROTECTED])
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



make drivers/scsi/seagate.c use ioremap instead of isa_{read,write} (242p4)

2001-02-20 Thread Rasmus Andersen

Hi.

(I have not been able to find a probable current maintainer for
this code.)

The following patch makes drivers/scsi/seagate.c use ioremap
instead of isa_{read, write} (I have not been able to find
a fitting place to put an iounmap since the driver does not
have a release function). The patch also removes some unneces-
sary zero initialization and fixes some resource leaks in
the init/detection process.

It applies against 241ac19 and 242p4.

Comments?.

--- linux-241ac19-clean/drivers/scsi/seagate.c  Sun Nov 12 04:01:11 2000
+++ linux-241ac19/drivers/scsi/seagate.cTue Feb 20 22:32:10 2001
@@ -230,7 +230,7 @@
 static int incommand;   /* set if arbitration has finished
and we are in some command phase. */
 
-static unsigned int base_address = 0;   /* Where the card ROM starts, used to 
+static unsigned int base_address;   /* Where the card ROM starts, used to 
calculate memory mapped register
location.  */
 
@@ -243,23 +243,26 @@
 static unsigned long st0x_dr;   /* data register, read write 256
bytes in length.  */
 
-static volatile int st0x_aborted = 0;   /* set when we are aborted, ie by a
+static volatile int st0x_aborted;   /* set when we are aborted, ie by a
time out, etc.  */
 
-static unsigned char controller_type = 0;   /* set to SEAGATE for ST0x
-   boards or FD for TMC-8xx
-   boards */
+static unsigned char controller_type;   /* set to SEAGATE for ST0x
+   boards or FD for TMC-8xx
+   boards */
 static int irq = IRQ;
 
+static void *status_remap;
+static void *data_remap;
+
 MODULE_PARM(base_address, "i");
 MODULE_PARM(controller_type, "b");
 MODULE_PARM(irq, "i");
 
 #define retcode(result) (((result) << 16) | (message << 8) | status)
-#define STATUS ((u8) isa_readb(st0x_cr_sr))
-#define DATA ((u8) isa_readb(st0x_dr))
-#define WRITE_CONTROL(d) { isa_writeb((d), st0x_cr_sr); }
-#define WRITE_DATA(d) { isa_writeb((d), st0x_dr); }
+#define STATUS ((u8) readb(status_remap))
+#define DATA ((u8) readb(data_remap))
+#define WRITE_CONTROL(d) { writeb((d), status_remap); }
+#define WRITE_DATA(d) { writeb((d), data_remap); }
 
 void st0x_setup (char *str, int *ints)
 {
@@ -489,13 +492,13 @@
  */
   instance = scsi_register (tpnt, 0);
   if(instance == NULL)
-   return 0;
+goto err_scsi_register;

   hostno = instance->host_no;
   if (request_irq (irq, do_seagate_reconnect_intr, SA_INTERRUPT,
   (controller_type == SEAGATE) ? "seagate" : "tmc-8xx", NULL)) {
 printk ("scsi%d : unable to allocate IRQ%d\n", hostno, irq);
-return 0;
+goto err_request_irq;
   }
   instance->irq = irq;
   instance->io_port = base_address;
@@ -546,7 +549,25 @@
 " SWAPCNTDATA"
 #endif
  "\n", tpnt->name);
+
+  status_remap = ioremap(st0x_cr_sr, sizeof(u8));
+  if (!status_remap)
+goto err_status_remap;
+
+  data_remap = ioremap(st0x_dr, sizeof(u8));
+  if (!data_remap)
+goto err_data_remap;
+  
   return 1;
+
+ err_data_remap:
+  iounmap(status_remap);
+ err_status_remap:
+  free_irq(irq, do_seagate_reconnect_intr);
+ err_request_irq:
+  scsi_unregister(instance);
+ err_scsi_register:
+  return 0;
 }
 
 const char *seagate_st0x_info (struct Scsi_Host *shpnt)


-- 
Rasmus([EMAIL PROTECTED])

It is wonderful to be here in the great state of Chicago.
-Former U.S. Vice-President Dan Quayle
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: rsync on newer kernel does not quite work?

2001-02-20 Thread Rasmus Andersen

On Mon, Feb 19, 2001 at 11:09:33PM +0100, Rasmus Andersen wrote:
[...]

(I'll just continue talking to myself in the hope that somebody
will read this and be inspired.)

In order to clear things up I should clearly state that my rsync
problem manifests itself under local operation. Ie., 'rsync -arv
linux-242p4/ linux' will hang. No network is involved and the
problem does not manifest itself under 2.2.X kernels with the
exact same dataset.

Also, I have played around with strace and discovered that if I
make strace follow the children too the hang goes away. So
'strace rsync -arv linux-242p4/ linux' hangs (in wait4, btw)
while 'strace -f rsync -arv linux-242p4/ linux' does not.
I hope this will mean something to somebody. I can put up
strace output on the net if anybody profess any interest.

-- 
Regards,
Rasmus([EMAIL PROTECTED])

"There are also enough rocks on Earth to kill the world's population several
times over."
-- Lt. General Daniel Graham, DIA, explaining why it's necessary to
   have more than enough nukes
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: rsync on newer kernel does not quite work?

2001-02-20 Thread Rasmus Andersen

On Mon, Feb 19, 2001 at 11:09:33PM +0100, Rasmus Andersen wrote:
[...]

(I'll just continue talking to myself in the hope that somebody
will read this and be inspired.)

In order to clear things up I should clearly state that my rsync
problem manifests itself under local operation. Ie., 'rsync -arv
linux-242p4/ linux' will hang. No network is involved and the
problem does not manifest itself under 2.2.X kernels with the
exact same dataset.

Also, I have played around with strace and discovered that if I
make strace follow the children too the hang goes away. So
'strace rsync -arv linux-242p4/ linux' hangs (in wait4, btw)
while 'strace -f rsync -arv linux-242p4/ linux' does not.
I hope this will mean something to somebody. I can put up
strace output on the net if anybody profess any interest.

-- 
Regards,
Rasmus([EMAIL PROTECTED])

"There are also enough rocks on Earth to kill the world's population several
times over."
-- Lt. General Daniel Graham, DIA, explaining why it's necessary to
   have more than enough nukes
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



make drivers/scsi/seagate.c use ioremap instead of isa_{read,write} (242p4)

2001-02-20 Thread Rasmus Andersen

Hi.

(I have not been able to find a probable current maintainer for
this code.)

The following patch makes drivers/scsi/seagate.c use ioremap
instead of isa_{read, write} (I have not been able to find
a fitting place to put an iounmap since the driver does not
have a release function). The patch also removes some unneces-
sary zero initialization and fixes some resource leaks in
the init/detection process.

It applies against 241ac19 and 242p4.

Comments?.

--- linux-241ac19-clean/drivers/scsi/seagate.c  Sun Nov 12 04:01:11 2000
+++ linux-241ac19/drivers/scsi/seagate.cTue Feb 20 22:32:10 2001
@@ -230,7 +230,7 @@
 static int incommand;   /* set if arbitration has finished
and we are in some command phase. */
 
-static unsigned int base_address = 0;   /* Where the card ROM starts, used to 
+static unsigned int base_address;   /* Where the card ROM starts, used to 
calculate memory mapped register
location.  */
 
@@ -243,23 +243,26 @@
 static unsigned long st0x_dr;   /* data register, read write 256
bytes in length.  */
 
-static volatile int st0x_aborted = 0;   /* set when we are aborted, ie by a
+static volatile int st0x_aborted;   /* set when we are aborted, ie by a
time out, etc.  */
 
-static unsigned char controller_type = 0;   /* set to SEAGATE for ST0x
-   boards or FD for TMC-8xx
-   boards */
+static unsigned char controller_type;   /* set to SEAGATE for ST0x
+   boards or FD for TMC-8xx
+   boards */
 static int irq = IRQ;
 
+static void *status_remap;
+static void *data_remap;
+
 MODULE_PARM(base_address, "i");
 MODULE_PARM(controller_type, "b");
 MODULE_PARM(irq, "i");
 
 #define retcode(result) (((result)  16) | (message  8) | status)
-#define STATUS ((u8) isa_readb(st0x_cr_sr))
-#define DATA ((u8) isa_readb(st0x_dr))
-#define WRITE_CONTROL(d) { isa_writeb((d), st0x_cr_sr); }
-#define WRITE_DATA(d) { isa_writeb((d), st0x_dr); }
+#define STATUS ((u8) readb(status_remap))
+#define DATA ((u8) readb(data_remap))
+#define WRITE_CONTROL(d) { writeb((d), status_remap); }
+#define WRITE_DATA(d) { writeb((d), data_remap); }
 
 void st0x_setup (char *str, int *ints)
 {
@@ -489,13 +492,13 @@
  */
   instance = scsi_register (tpnt, 0);
   if(instance == NULL)
-   return 0;
+goto err_scsi_register;

   hostno = instance-host_no;
   if (request_irq (irq, do_seagate_reconnect_intr, SA_INTERRUPT,
   (controller_type == SEAGATE) ? "seagate" : "tmc-8xx", NULL)) {
 printk ("scsi%d : unable to allocate IRQ%d\n", hostno, irq);
-return 0;
+goto err_request_irq;
   }
   instance-irq = irq;
   instance-io_port = base_address;
@@ -546,7 +549,25 @@
 " SWAPCNTDATA"
 #endif
  "\n", tpnt-name);
+
+  status_remap = ioremap(st0x_cr_sr, sizeof(u8));
+  if (!status_remap)
+goto err_status_remap;
+
+  data_remap = ioremap(st0x_dr, sizeof(u8));
+  if (!data_remap)
+goto err_data_remap;
+  
   return 1;
+
+ err_data_remap:
+  iounmap(status_remap);
+ err_status_remap:
+  free_irq(irq, do_seagate_reconnect_intr);
+ err_request_irq:
+  scsi_unregister(instance);
+ err_scsi_register:
+  return 0;
 }
 
 const char *seagate_st0x_info (struct Scsi_Host *shpnt)


-- 
Rasmus([EMAIL PROTECTED])

It is wonderful to be here in the great state of Chicago.
-Former U.S. Vice-President Dan Quayle
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



rsync on newer kernel does not quite work?

2001-02-19 Thread Rasmus Andersen

Hi.

For some time up through the testX kernels I used rsync to
update my "dirty" tree after applying the latest patches to the
clean tree. At some point this stopped working (more about that
later) but as new kernels were coming fast at that time I did
not think much of it, assuming that cleverer folk than me would
fix it soon. They did not, however, and I got kinda used to
working around the "bug".

The problem manifests itself in that rsync will complete syncing
two directories but will then hang (soft). It can be killed
with ^C and rerun with success. The amount of work that rsync
needs to do seems to be the trigger: rsyncing the drivers
directory (to a non-existent dir) will trigger the hang for
me, but drivers/[a-r]* will not.

Since Matthias Schniedermeyer reported the same problem in
http://marc.theaimsgroup.com/?l=linux-kernel=98157768131423=2
I have tried on and off to locate the kernel version where
the shift in behaviour happened, but after recompiling all
kernels down to test1 I have not gotten a successfull rsync
run yet. And I am sure that it worked once, well after test1.
I have upgraded my build environment from RH6.2 to RH7.0
in the meanwhile, but I even remembered to change 'gcc' to
'kgcc' in the makefile without luck :/ However, rsync behaves as
expected under 2.2.18 (compiled locally) and the 2.2.16-22
that comes with RH7.0. But not under any of the 2.4.X kernels
that I have tried (most of them incl. -acX).

rsyncs tried: 2.4.4-1 (rpm), 2.4.6 (local compile) and 2.4.1 
  (ditto).
kernels tried (not working) (partial list): 241, 241ac9, 
  242p4, 240-testX (1<=X<=12).
gccs tried (rsync and kernel compiles): kgcc (gcc version 
egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)), gcc
(gcc version 2.96 2731 (Red Hat Linux 7.0)) (2.96-69)

If you need further information please let me know.


-- 
Regards,
Rasmus([EMAIL PROTECTED])

First snow, then silence.
This thousand dollar screen dies
so beautifully.   --- Error messages in haiku
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



rsync on newer kernel does not quite work?

2001-02-19 Thread Rasmus Andersen

Hi.

For some time up through the testX kernels I used rsync to
update my "dirty" tree after applying the latest patches to the
clean tree. At some point this stopped working (more about that
later) but as new kernels were coming fast at that time I did
not think much of it, assuming that cleverer folk than me would
fix it soon. They did not, however, and I got kinda used to
working around the "bug".

The problem manifests itself in that rsync will complete syncing
two directories but will then hang (soft). It can be killed
with ^C and rerun with success. The amount of work that rsync
needs to do seems to be the trigger: rsyncing the drivers
directory (to a non-existent dir) will trigger the hang for
me, but drivers/[a-r]* will not.

Since Matthias Schniedermeyer reported the same problem in
http://marc.theaimsgroup.com/?l=linux-kernelm=98157768131423w=2
I have tried on and off to locate the kernel version where
the shift in behaviour happened, but after recompiling all
kernels down to test1 I have not gotten a successfull rsync
run yet. And I am sure that it worked once, well after test1.
I have upgraded my build environment from RH6.2 to RH7.0
in the meanwhile, but I even remembered to change 'gcc' to
'kgcc' in the makefile without luck :/ However, rsync behaves as
expected under 2.2.18 (compiled locally) and the 2.2.16-22
that comes with RH7.0. But not under any of the 2.4.X kernels
that I have tried (most of them incl. -acX).

rsyncs tried: 2.4.4-1 (rpm), 2.4.6 (local compile) and 2.4.1 
  (ditto).
kernels tried (not working) (partial list): 241, 241ac9, 
  242p4, 240-testX (1=X=12).
gccs tried (rsync and kernel compiles): kgcc (gcc version 
egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)), gcc
(gcc version 2.96 2731 (Red Hat Linux 7.0)) (2.96-69)

If you need further information please let me know.


-- 
Regards,
Rasmus([EMAIL PROTECTED])

First snow, then silence.
This thousand dollar screen dies
so beautifully.   --- Error messages in haiku
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



  1   2   3   4   >