linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Linux 2.4.15-pre4 - merge with Alan
@ 2001-11-12 19:01 Linus Torvalds
  2001-11-12 19:18 ` Trever L. Adams
                   ` (13 more replies)
  0 siblings, 14 replies; 37+ messages in thread
From: Linus Torvalds @ 2001-11-12 19:01 UTC (permalink / raw)
  To: Kernel Mailing List


Ok, this kernel hopefully contains all the high-priority merges with Alan,
which means that as far as that is concerned, I'm done with 2.4.x and
ready to pass it on to Marcelo.

Which means that I'd also like people to double-check that there are no
embarrassing missing pieces due to the merge (or other patches).

Known issue: Al Viro fixed the nasty overflow with /proc/cpuinfo and
multiple CPU's, but only for x86. So other architectures need to convert
from the old "get_cpuinfo()" to the seq-file-based "show_cpuinfo()". The
conversion should be pretty mindless and straightforward.. (ie use
"seq_printf()"  instead of "sprintf()" etc - see arch/i386/kernel/setup.c
for the example code).

Changelog appeded,

		Linus

-----
pre4:
 - Mikael Pettersson: make proc_misc happy without modules
 - Arjan van de Ven: clean up acpitable implementation ("micro-acpi")
 - Anton Altaparmakov: LDM partition code update
 - Alan Cox: final (yeah, sure) small missing pieces
 - Andrey Savochkin/Andrew Morton: eepro100 config space save/restore over suspend
 - Arjan van de Ven: remove power from pcmcia socket on card remove
 - Greg KH: USB updates
 - Neil Brown: multipath updates
 - Martin Dalecki: fix up some "asmlinkage" routine markings

pre3:
 - Alan Cox: more driver merging
 - Al Viro: make ext2 group allocation more readable

pre2:
 - Ivan Kokshaysky: fix alpha dec_and_lock with modules, for alpha config entry
 - Kai Germaschewski: ISDN updates
 - Jeff Garzik: network driver updates, sysv fs update
 - Kai Mäkisara: SCSI tape update
 - Alan Cox: large drivers merge
 - Nikita Danilov: reiserfs procfs information
 - Andrew Morton: ext3 merge
 - Christoph Hellwig: vxfs livelock fix
 - Trond Myklebust: NFS updates
 - Jens Axboe: cpqarray + cciss dequeue fix
 - Tim Waugh: parport_serial base_baud setting
 - Matthew Dharm: usb-storage Freecom driver fixes
 - Dave McCracken: wait4() thread group race fix

pre1:
 - me: fix page flags race condition Andrea found
 - David Miller: sparc and network updates
 - various: fix loop driver that thought it was part of the VM system
 - me: teach DRM about VM_RESERVED
 - Alan Cox: more merging


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-12 19:01 Linux 2.4.15-pre4 - merge with Alan Linus Torvalds
@ 2001-11-12 19:18 ` Trever L. Adams
  2001-11-13 11:14   ` Christoph Rohland
  2001-11-12 19:26 ` Matthew Dharm
                   ` (12 subsequent siblings)
  13 siblings, 1 reply; 37+ messages in thread
From: Trever L. Adams @ 2001-11-12 19:18 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux Kernel Mailing List

Red Hat mounts /dev/shm as tmpfs instead of shmfs.  From what I can tell
this is accurate.  However since the beginning of the new VM, it seems
that shmfs/tmpfs leaks memory.

I am just curious about how I can look into this so that I can ease my
mind as well as anyone else who notices this.

Trever



^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-12 19:01 Linux 2.4.15-pre4 - merge with Alan Linus Torvalds
  2001-11-12 19:18 ` Trever L. Adams
@ 2001-11-12 19:26 ` Matthew Dharm
  2001-11-12 20:09 ` Martin Dalecki
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 37+ messages in thread
From: Matthew Dharm @ 2001-11-12 19:26 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Kernel Mailing List

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

Just as a heads-up for interested people... this kernel does contain the
final fixes for the Freecom adaptor, even tho it's not listed.

Matt

On Mon, Nov 12, 2001 at 11:01:56AM -0800, Linus Torvalds wrote:
> 
> Ok, this kernel hopefully contains all the high-priority merges with Alan,
> which means that as far as that is concerned, I'm done with 2.4.x and
> ready to pass it on to Marcelo.
> 
> Which means that I'd also like people to double-check that there are no
> embarrassing missing pieces due to the merge (or other patches).
> 
> Known issue: Al Viro fixed the nasty overflow with /proc/cpuinfo and
> multiple CPU's, but only for x86. So other architectures need to convert
> from the old "get_cpuinfo()" to the seq-file-based "show_cpuinfo()". The
> conversion should be pretty mindless and straightforward.. (ie use
> "seq_printf()"  instead of "sprintf()" etc - see arch/i386/kernel/setup.c
> for the example code).
> 
> Changelog appeded,
> 
> 		Linus
> 
> -----
> pre4:
>  - Mikael Pettersson: make proc_misc happy without modules
>  - Arjan van de Ven: clean up acpitable implementation ("micro-acpi")
>  - Anton Altaparmakov: LDM partition code update
>  - Alan Cox: final (yeah, sure) small missing pieces
>  - Andrey Savochkin/Andrew Morton: eepro100 config space save/restore over suspend
>  - Arjan van de Ven: remove power from pcmcia socket on card remove
>  - Greg KH: USB updates
>  - Neil Brown: multipath updates
>  - Martin Dalecki: fix up some "asmlinkage" routine markings
> 
> pre3:
>  - Alan Cox: more driver merging
>  - Al Viro: make ext2 group allocation more readable
> 
> pre2:
>  - Ivan Kokshaysky: fix alpha dec_and_lock with modules, for alpha config entry
>  - Kai Germaschewski: ISDN updates
>  - Jeff Garzik: network driver updates, sysv fs update
>  - Kai Mäkisara: SCSI tape update
>  - Alan Cox: large drivers merge
>  - Nikita Danilov: reiserfs procfs information
>  - Andrew Morton: ext3 merge
>  - Christoph Hellwig: vxfs livelock fix
>  - Trond Myklebust: NFS updates
>  - Jens Axboe: cpqarray + cciss dequeue fix
>  - Tim Waugh: parport_serial base_baud setting
>  - Matthew Dharm: usb-storage Freecom driver fixes
>  - Dave McCracken: wait4() thread group race fix
> 
> pre1:
>  - me: fix page flags race condition Andrea found
>  - David Miller: sparc and network updates
>  - various: fix loop driver that thought it was part of the VM system
>  - me: teach DRM about VM_RESERVED
>  - Alan Cox: more merging
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.net 
Maintainer, Linux USB Mass Storage Driver

SP: I sell software for Microsoft.  Can you set me free?
DP: Natural Selection says I shouldn't.
					-- MS Salesman and Dust Puppy
User Friendly, 4/2/1998

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-12 19:01 Linux 2.4.15-pre4 - merge with Alan Linus Torvalds
  2001-11-12 19:18 ` Trever L. Adams
  2001-11-12 19:26 ` Matthew Dharm
@ 2001-11-12 20:09 ` Martin Dalecki
  2001-11-12 20:42 ` Greg KH
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 37+ messages in thread
From: Martin Dalecki @ 2001-11-12 20:09 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Kernel Mailing List

I just scrolled one line firther down and
noticed the same problem for ep7211_ir_init
as for sa1100_irda_init. Citing form the corrover patch
between pre-patches you can easly see:

+++ linux/net/irda/irda_device.c	Fri Nov  9 14:22:17 2001
++++ linux/net/irda/irda_device.c	Sun Nov 11 10:20:21 2001
 @@ -10,6 +10,7 @@
   * Modified by:   Dag Brattli <dagb@cs.uit.no>
   * 
@@ -140040,27 +184071,33 @@
  
  static void __irda_task_delete(struct irda_task *task);
  
-@@ -124,6 +127,9 @@
+@@ -124,6 +127,12 @@
  #ifdef CONFIG_WINBOND_FIR
  	w83977af_init();
  #endif
 +#ifdef CONFIG_SA1100_FIR
 +	sa1100_irda_init();
 +#endif
++#ifdef CONFIG_SA1100_FIR
++	sa1100_irda_init();
++#endif
  #ifdef CONFIG_NSC_FIR
  	nsc_ircc_init();
  #endif
-@@ -151,6 +157,9 @@
+@@ -151,6 +160,12 @@
  #ifdef CONFIG_OLD_BELKIN
   	old_belkin_init();
  #endif
 +#ifdef CONFIG_EP7211_IR
 + 	ep7211_ir_init();
 +#endif
++#ifdef CONFIG_EP7211_IR
++ 	ep7211_ir_init();
++#endif
  	return 0;
  }
  
-@@ -181,7 +190,10 @@

Supposedly there is still room for -pre5 ;-).

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-12 19:01 Linux 2.4.15-pre4 - merge with Alan Linus Torvalds
                   ` (2 preceding siblings ...)
  2001-11-12 20:09 ` Martin Dalecki
@ 2001-11-12 20:42 ` Greg KH
  2001-11-12 23:43 ` J . A . Magallon
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 37+ messages in thread
From: Greg KH @ 2001-11-12 20:42 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Kernel Mailing List

On Mon, Nov 12, 2001 at 11:01:56AM -0800, Linus Torvalds wrote:
> 
> Which means that I'd also like people to double-check that there are no
> embarrassing missing pieces due to the merge (or other patches).

This tiny patch to arch/i386/config.in is needed to be able to select
the PCI Hotplug driver so that it can be used.

thanks,

greg k-h


diff --minimal -Nru a/arch/i386/config.in b/arch/i386/config.in
--- a/arch/i386/config.in	Mon Nov 12 11:34:30 2001
+++ b/arch/i386/config.in	Mon Nov 12 11:34:30 2001
@@ -234,8 +234,10 @@
 
 if [ "$CONFIG_HOTPLUG" = "y" ] ; then
    source drivers/pcmcia/Config.in
+   source drivers/hotplug/Config.in
 else
    define_bool CONFIG_PCMCIA n
+   define_bool CONFIG_HOTPLUG_PCI n
 fi
 
 bool 'System V IPC' CONFIG_SYSVIPC


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-12 19:01 Linux 2.4.15-pre4 - merge with Alan Linus Torvalds
                   ` (3 preceding siblings ...)
  2001-11-12 20:42 ` Greg KH
@ 2001-11-12 23:43 ` J . A . Magallon
  2001-11-13  1:11   ` Alan Cox
  2001-11-12 23:45 ` J . A . Magallon
                   ` (8 subsequent siblings)
  13 siblings, 1 reply; 37+ messages in thread
From: J . A . Magallon @ 2001-11-12 23:43 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Kernel Mailing List


On 20011112 Linus Torvalds wrote:
>
>Ok, this kernel hopefully contains all the high-priority merges with Alan,
>which means that as far as that is concerned, I'm done with 2.4.x and
>ready to pass it on to Marcelo.
>
>Which means that I'd also like people to double-check that there are no
>embarrassing missing pieces due to the merge (or other patches).
>

This bit is in Alan's but not in your tree (also is in original aic-6.2.4):

diff -u -r -N linux-2.4.12.virgin/drivers/scsi/scsi_error.c linux-2.4.12/drivers/scsi/scsi_error.c
--- linux-2.4.12.virgin/drivers/scsi/scsi_error.c	Sun Sep  9 11:52:35 2001
+++ linux-2.4.12/drivers/scsi/scsi_error.c	Thu Oct 11 13:57:36 2001
@@ -1009,13 +1009,7 @@
 			SCpnt->flags &= ~IS_RESETTING;
 			goto maybe_retry;
 		}
-		/*
-		 * Examine the sense data to figure out how to proceed from here.
-		 * If there is no sense data, we will be forced into the error
-		 * handler thread, where we get to examine the thing in a lot more
-		 * detail.
-		 */
-		return scsi_check_sense(SCpnt);
+		return SUCCESS;
 	default:
 		return FAILED;
 	}

Is really needed ?

-- 
J.A. Magallon                           #  Let the source be with you...        
mailto:jamagallon@able.es
Mandrake Linux release 8.2 (Cooker) for i586
Linux werewolf 2.4.15-pre3-beo #1 SMP Mon Nov 12 00:04:41 CET 2001 i686

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-12 19:01 Linux 2.4.15-pre4 - merge with Alan Linus Torvalds
                   ` (4 preceding siblings ...)
  2001-11-12 23:43 ` J . A . Magallon
@ 2001-11-12 23:45 ` J . A . Magallon
  2001-11-12 23:48 ` J . A . Magallon
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 37+ messages in thread
From: J . A . Magallon @ 2001-11-12 23:45 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Kernel Mailing List


On 20011112 Linus Torvalds wrote:
>
>Ok, this kernel hopefully contains all the high-priority merges with Alan,
>which means that as far as that is concerned, I'm done with 2.4.x and
>ready to pass it on to Marcelo.
>
>Which means that I'd also like people to double-check that there are no
>embarrassing missing pieces due to the merge (or other patches).
>

Many time ago, this was posted in the list as a cleanup-dead-code-removal. Is
still valid for 2.4.15 ?

--- linux/drivers/scsi/tmscsim.c	Fri Apr 27 23:07:19 2001
+++ linux/drivers/scsi/tmscsim.c	Wed Jul  4 02:51:48 2001
@@ -1352,84 +1352,7 @@
     return(0);
 }
 
-/* We ignore mapping problems, as we expect everybody to respect 
- * valid partition tables. Waiting for complaints ;-) */
-
 #ifdef CONFIG_SCSI_DC390T_TRADMAP
-/* 
- * The next function, partsize(), is copied from scsicam.c.
- *
- * This is ugly code duplication, but I didn't find another way to solve it:
- * We want to respect the partition table and if it fails, we apply the 
- * DC390 BIOS heuristic. Too bad, just calling scsicam_bios_param() doesn't do
- * the job, because we don't know, whether the values returned are from
- * the part. table or determined by setsize(). Unfortunately the setsize() 
- * values differ from the ones chosen by the DC390 BIOS.
- *
- * Looking forward to seeing suggestions for a better solution! KG, 98/10/14
- */
-#include <asm/unaligned.h>
-
-/*
- * Function : static int partsize(struct buffer_head *bh, unsigned long 
- *     capacity,unsigned int *cyls, unsigned int *hds, unsigned int *secs);
- *
- * Purpose : to determine the BIOS mapping used to create the partition
- *	table, storing the results in *cyls, *hds, and *secs 
- *
- * Returns : -1 on failure, 0 on success.
- *
- */
-
-static int partsize(struct buffer_head *bh, unsigned long capacity,
-    unsigned int  *cyls, unsigned int *hds, unsigned int *secs) {
-    struct partition *p, *largest = NULL;
-    int i, largest_cyl;
-    int cyl, ext_cyl, end_head, end_cyl, end_sector;
-    unsigned int logical_end, physical_end, ext_physical_end;
-    
-
-    if (*(unsigned short *) (bh->b_data+510) == 0xAA55) {
-	for (largest_cyl = -1, p = (struct partition *) 
-    	    (0x1BE + bh->b_data), i = 0; i < 4; ++i, ++p) {
-    	    if (!p->sys_ind)
-    	    	continue;
-    	    cyl = p->cyl + ((p->sector & 0xc0) << 2);
-    	    if (cyl > largest_cyl) {
-    	    	largest_cyl = cyl;
-    	    	largest = p;
-    	    }
-    	}
-    }
-
-    if (largest) {
-    	end_cyl = largest->end_cyl + ((largest->end_sector & 0xc0) << 2);
-    	end_head = largest->end_head;
-    	end_sector = largest->end_sector & 0x3f;
-
-    	physical_end =  end_cyl * (end_head + 1) * end_sector +
-    	    end_head * end_sector + end_sector;
-
-	/* This is the actual _sector_ number at the end */
-	logical_end = get_unaligned(&largest->start_sect)
-			+ get_unaligned(&largest->nr_sects);
-
-	/* This is for >1023 cylinders */
-        ext_cyl= (logical_end-(end_head * end_sector + end_sector))
-                                        /(end_head + 1) / end_sector;
-	ext_physical_end = ext_cyl * (end_head + 1) * end_sector +
-            end_head * end_sector + end_sector;
-
-    	if ((logical_end == physical_end) ||
-	    (end_cyl==1023 && ext_physical_end==logical_end)) {
-    	    *secs = end_sector;
-    	    *hds = end_head + 1;
-    	    *cyls = capacity / ((end_head + 1) * end_sector);
-    	    return 0;
-    	}
-    }
-    return -1;
-}
 
 /***********************************************************************
  * Function:
@@ -1442,46 +1365,38 @@
  * Note:
  *   In contrary to other externally callable funcs (DC390_), we don't lock
  ***********************************************************************/
-int DC390_bios_param (Disk *disk, kdev_t devno, int geom[])
+int DC390_bios_param (Disk *disk, kdev_t dev, int *geom)
 {
     int heads, sectors, cylinders;
-    PACB pACB = (PACB) disk->device->host->hostdata;
-    struct buffer_head *bh;
-    int ret_code = -1;
-    int size = disk->capacity;
-
-    if ((bh = bread(MKDEV(MAJOR(devno), MINOR(devno)&~0xf), 0, 1024)))
-    {
-	/* try to infer mapping from partition table */
-	ret_code = partsize (bh, (unsigned long) size, (unsigned int *) geom + 2,
-			     (unsigned int *) geom + 0, (unsigned int *) geom + 1);
-	brelse (bh);
-    }
-    if (ret_code == -1)
-    {
-	heads = 64;
-	sectors = 32;
-	cylinders = size / (heads * sectors);
-
-	if ( (pACB->Gmode2 & GREATER_1G) && (cylinders > 1024) )
-	{
-		heads = 255;
-		sectors = 63;
-		cylinders = size / (heads * sectors);
-	}
-
-	geom[0] = heads;
-	geom[1] = sectors;
-	geom[2] = cylinders;
+    PACB pACB;
+    unsigned long size = disk->capacity;
+
+    if (scsi_bios_param_from_MBR(dev, size, geom) == 0)
+	    return 0;
+
+    heads = 64;
+    sectors = 32;
+    cylinders = size / (heads * sectors);
+
+    pACB = (PACB) disk->device->host->hostdata;
+
+    if ( (pACB->Gmode2 & GREATER_1G) && (cylinders > 1024) ) {
+	    heads = 255;
+	    sectors = 63;
+	    cylinders = size / (heads * sectors);
     }
 
-    return (0);
+    geom[0] = heads;
+    geom[1] = sectors;
+    geom[2] = cylinders;
+
+    return 0;
 }
 #else
-int DC390_bios_param (Disk *disk, kdev_t devno, int geom[])
+int DC390_bios_param (Disk *disk, kdev_t dev, int *geom)
 {
-    return scsicam_bios_param (disk, devno, geom);
-};
+    return scsicam_bios_param (disk, dev, geom);
+}
 #endif
 
 
--- linux/drivers/scsi/BusLogic.c	Sun Nov 12 04:01:11 2000
+++ linux/drivers/scsi/BusLogic.c	Wed Jul  4 02:51:48 2001
@@ -4131,7 +4131,7 @@
   /*
     Attempt to read the first 1024 bytes from the disk device.
   */
-  BufferHead = bread(MKDEV(MAJOR(Device), MINOR(Device) & ~0x0F), 0, 1024);
+  BufferHead = scsi_get_block_zero(Device);
   if (BufferHead == NULL) return 0;
   /*
     If the boot sector partition table flag is valid, search for a partition
--- linux/drivers/scsi/aic7xxx_old.c	Tue Jul  3 20:41:38 2001
+++ linux/drivers/scsi/aic7xxx_old.c	Wed Jul  4 02:51:48 2001
@@ -11732,29 +11732,21 @@
  *   Return the disk geometry for the given SCSI device.
  *-F*************************************************************************/
 int
-aic7xxx_biosparam(Disk *disk, kdev_t dev, int geom[])
+aic7xxx_biosparam(Disk *disk, kdev_t dev, int *geom)
 {
-  int heads, sectors, cylinders, ret;
+  int heads, sectors, cylinders;
   struct aic7xxx_host *p;
-  struct buffer_head *bh;
 
-  p = (struct aic7xxx_host *) disk->device->host->hostdata;
-  bh = bread(MKDEV(MAJOR(dev), MINOR(dev)&~0xf), 0, 1024);
-
-  if ( bh )
-  {
-    ret = scsi_partsize(bh, disk->capacity, &geom[2], &geom[0], &geom[1]);
-    brelse(bh);
-    if ( ret != -1 )
-      return(ret);
-  }
+  if (scsi_bios_param_from_MBR(dev, disk->capacity, geom) == 0)
+	  return 0;
   
   heads = 64;
   sectors = 32;
   cylinders = disk->capacity / (heads * sectors);
 
-  if ((p->flags & AHC_EXTEND_TRANS_A) && (cylinders > 1024))
-  {
+  p = (struct aic7xxx_host *) disk->device->host->hostdata;
+
+  if ((p->flags & AHC_EXTEND_TRANS_A) && (cylinders > 1024)) {
     heads = 255;
     sectors = 63;
     cylinders = disk->capacity / (heads * sectors);
@@ -11764,7 +11764,7 @@
   geom[1] = sectors;
   geom[2] = cylinders;
 
-  return (0);
+  return 0;
 }
 
 /*+F*************************************************************************
--- linux/drivers/scsi/scsi.h	Sat May 26 03:02:21 2001
+++ linux/drivers/scsi/scsi.h	Wed Jul  4 02:39:42 2001
@@ -443,9 +443,11 @@
 /*
  * Prototypes for functions in scsicam.c
  */
-extern int  scsi_partsize(struct buffer_head *bh, unsigned long capacity,
-                    unsigned int *cyls, unsigned int *hds,
-                    unsigned int *secs);
+extern struct buffer_head *scsi_get_block_zero(kdev_t dev);
+extern int scsi_bios_param_from_MBR(kdev_t dev, unsigned long size, int *ip);
+extern int scsi_partsize(struct buffer_head *bh, unsigned long capacity,
+			 unsigned int *cyls, unsigned int *hds,
+			 unsigned int *secs);
 
 /*
  * Prototypes for functions in scsi_dma.c
--- linux/drivers/scsi/scsicam.c	Fri Nov 19 04:09:14 1999
+++ linux/drivers/scsi/scsicam.c	Wed Jul  4 02:51:48 2001
@@ -23,60 +23,73 @@
 #include "sd.h"
 #include <scsi/scsicam.h>
 
-static int setsize(unsigned long capacity, unsigned int *cyls, unsigned int *hds,
-		   unsigned int *secs);
+static int setsize(unsigned long capacity, unsigned int *cyls,
+		   unsigned int *hds, unsigned int *secs);
 
+struct buffer_head *
+scsi_get_block_zero(kdev_t dev) {
+	int ma, mi, block;
+
+	ma = MAJOR(dev);
+	mi = (MINOR(dev) & ~0xf);
+
+	block = 1024; 
+	if(blksize_size[ma])
+		block = blksize_size[ma][mi];
+		
+	return bread(MKDEV(ma,mi), 0, block);
+}
 
 /*
- * Function : int scsicam_bios_param (Disk *disk, int dev, int *ip)
+ * Return: 0: OK
+ *        -1: cannot determine geometry
+ *        -2: cannot read disk
+ */
+#define DISK_READ_ERROR	(-2)
+
+int
+scsi_bios_param_from_MBR(kdev_t dev, unsigned long size, int *ip) {
+	int rc = DISK_READ_ERROR;
+	struct buffer_head *bh;
+
+	bh = scsi_get_block_zero(dev);
+	if (bh) {
+		rc = scsi_partsize(bh, size, ip + 2, ip + 0, ip + 1);
+		brelse(bh);
+	}
+	return rc;
+}
+
+/*
+ * Function : int scsicam_bios_param (Disk *disk, kdev_t dev, int *ip)
  *
  * Purpose : to determine the BIOS mapping used for a drive in a 
  *      SCSI-CAM system, storing the results in ip as required
  *      by the HDIO_GETGEO ioctl().
  *
- * Returns : -1 on failure, 0 on success.
- *
+ * Returns : -1 on failure (cannot read MBR), 0 on success
  */
 
-int scsicam_bios_param(Disk * disk,	/* SCSI disk */
-		       kdev_t dev,	/* Device major, minor */
-		  int *ip /* Heads, sectors, cylinders in that order */ )
+int scsicam_bios_param(Disk *disk, kdev_t dev,
+		       int *ip /* heads, sectors, cylinders in that order */ )
 {
-	struct buffer_head *bh;
-	int ret_code;
-	int size = disk->capacity;
-	unsigned long temp_cyl;
-
-	int ma = MAJOR(dev);
-	int mi = (MINOR(dev) & ~0xf);
-
-	int block = 1024; 
+	int rc;
+	unsigned long size = disk->capacity;
 
-	if(blksize_size[ma])
-		block = blksize_size[ma][mi];
-		
-	if (!(bh = bread(MKDEV(ma,mi), 0, block)))
+	rc = scsi_bios_param_from_MBR(dev, size, ip);
+	if (rc == DISK_READ_ERROR)
 		return -1;
 
-	/* try to infer mapping from partition table */
-	ret_code = scsi_partsize(bh, (unsigned long) size, (unsigned int *) ip + 2,
-		       (unsigned int *) ip + 0, (unsigned int *) ip + 1);
-	brelse(bh);
-
-	if (ret_code == -1) {
-		/* pick some standard mapping with at most 1024 cylinders,
-		   and at most 62 sectors per track - this works up to
-		   7905 MB */
-		ret_code = setsize((unsigned long) size, (unsigned int *) ip + 2,
-		       (unsigned int *) ip + 0, (unsigned int *) ip + 1);
-	}
+	/* pick some standard mapping with at most 1024 cylinders,
+	   and at most 62 sectors per track - this works up to 7905 MB */
+	rc = setsize(size, ip + 2, ip + 0, ip + 1);
+
 	/* if something went wrong, then apparently we have to return
 	   a geometry with more than 1024 cylinders */
-	if (ret_code || ip[0] > 255 || ip[1] > 63) {
+	if (rc || ip[0] > 255 || ip[1] > 63) {
 		ip[0] = 64;
 		ip[1] = 32;
-		temp_cyl = size / (ip[0] * ip[1]);
-		if (temp_cyl > 65534) {
+		if (size / (64 * 32) > 65534) {
 			ip[0] = 255;
 			ip[1] = 63;
 		}
@@ -110,10 +123,6 @@
 		     (0x1BE + bh->b_data), i = 0; i < 4; ++i, ++p) {
 			if (!p->sys_ind)
 				continue;
-#ifdef DEBUG
-			printk("scsicam_bios_param : partition %d has system \n",
-			       i);
-#endif
 			cyl = p->cyl + ((p->sector & 0xc0) << 2);
 			if (cyl > largest_cyl) {
 				largest_cyl = cyl;
@@ -128,11 +137,6 @@
 
 		if (end_head + 1 == 0 || end_sector == 0)
 			return -1;
-
-#ifdef DEBUG
-		printk("scsicam_bios_param : end at h = %d, c = %d, s = %d\n",
-		       end_head, end_cyl, end_sector);
-#endif
 
 		physical_end = end_cyl * (end_head + 1) * end_sector +
 		    end_head * end_sector + end_sector;

-- 
J.A. Magallon                           #  Let the source be with you...        
mailto:jamagallon@able.es
Mandrake Linux release 8.2 (Cooker) for i586
Linux werewolf 2.4.15-pre3-beo #1 SMP Mon Nov 12 00:04:41 CET 2001 i686

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-12 19:01 Linux 2.4.15-pre4 - merge with Alan Linus Torvalds
                   ` (5 preceding siblings ...)
  2001-11-12 23:45 ` J . A . Magallon
@ 2001-11-12 23:48 ` J . A . Magallon
  2001-11-13  0:14   ` Christoph Hellwig
  2001-11-13  5:17 ` Keith Owens
                   ` (6 subsequent siblings)
  13 siblings, 1 reply; 37+ messages in thread
From: J . A . Magallon @ 2001-11-12 23:48 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Kernel Mailing List


On 20011112 Linus Torvalds wrote:
>
>Ok, this kernel hopefully contains all the high-priority merges with Alan,
>which means that as far as that is concerned, I'm done with 2.4.x and
>ready to pass it on to Marcelo.
>
>Which means that I'd also like people to double-check that there are no
>embarrassing missing pieces due to the merge (or other patches).
>

This is an update-cleanup of the i2c code to the current CVS. In short,
it adds version info printing and some CONFIG_ cleanups (there were
CONFIG_ vars defined in Config.in that had been renamed inside the code).
Please consider for next pre of 2.4.15.

--- linux-old/Documentation/i2c/writing-clients	Tue Nov 13 00:31:34 CET 2001
+++ linux/Documentation/i2c/writing-clients	Tue Nov 13 00:31:34 CET 2001
@@ -366,5 +366,5 @@
 The detect client function is called by i2c_probe or i2c_detect.
 The `kind' parameter contains 0 if this call is due to a `force'
-parameter, and 0 otherwise (for i2c_detect, it contains 0 if
+parameter, and -1 otherwise (for i2c_detect, it contains 0 if
 this call is due to the generic `force' parameter, and the chip type
 number if it is due to a specific `force' parameter).
--- linux-old/drivers/i2c/i2c-algo-bit.c	Tue Nov 13 00:31:36 CET 2001
+++ linux/drivers/i2c/i2c-algo-bit.c	Tue Nov 13 00:31:36 CET 2001
@@ -22,5 +22,5 @@
    Frodo Looijaard <frodol@dds.nl> */
 
-/* $Id: i2c-algo-bit.c,v 1.30 2001/07/29 02:44:25 mds Exp $ */
+/* $Id: i2c-algo-bit.c,v 1.33 2001/10/14 15:04:46 mds Exp $ */
 
 #include <linux/kernel.h>
@@ -610,5 +609,5 @@
 int __init i2c_algo_bit_init (void)
 {
-	printk("i2c-algo-bit.o: i2c bit algorithm module\n");
+	printk("i2c-algo-bit.o: i2c bit algorithm module version %s (%s)\n", I2C_VERSION, I2C_DATE);
 	return 0;
 }
--- linux-old/drivers/i2c/i2c-algo-pcf.c	Tue Nov 13 00:31:37 CET 2001
+++ linux/drivers/i2c/i2c-algo-pcf.c	Tue Nov 13 00:31:37 CET 2001
@@ -151,6 +150,5 @@
 	/* check to see S1 now used as R/W ctrl -
 	   PCF8584 does that when ESO is zero */
-	/* PCF also resets PIN bit */
-	if ((temp = get_pcf(adap, 1)) != (0)) {
+	if (((temp = get_pcf(adap, 1)) & 0x7f) != (0)) {
 		DEB2(printk("i2c-algo-pcf.o: PCF detection failed -- can't select S0 (0x%02x).\n", temp));
 		return -ENXIO; /* definetly not PCF8584 */
@@ -168,5 +166,5 @@
 	set_pcf(adap, 1, I2C_PCF_PIN | I2C_PCF_ES1);
 	/* check to see S2 now selected */
-	if ((temp = get_pcf(adap, 1)) != I2C_PCF_ES1) {
+	if (((temp = get_pcf(adap, 1)) & 0x7f) != I2C_PCF_ES1) {
 		DEB2(printk("i2c-algo-pcf.o: PCF detection failed -- can't select S2 (0x%02x).\n", temp));
 		return -ENXIO;
@@ -525,5 +523,5 @@
 int __init i2c_algo_pcf_init (void)
 {
-	printk("i2c-algo-pcf.o: i2c pcf8584 algorithm module\n");
+	printk("i2c-algo-pcf.o: i2c pcf8584 algorithm module version %s (%s)\n", I2C_VERSION, I2C_DATE);
 	return 0;
 }
--- linux-old/drivers/i2c/i2c-core.c	Tue Nov 13 00:31:40 CET 2001
+++ linux/drivers/i2c/i2c-core.c	Tue Nov 13 00:31:40 CET 2001
@@ -21,5 +21,5 @@
    All SMBus-related things are written by Frodo Looijaard <frodol@dds.nl> */
 
-/* $Id: i2c-core.c,v 1.64 2001/08/13 01:35:56 mds Exp $ */
+/* $Id: i2c-core.c,v 1.69 2001/10/28 20:41:47 mds Exp $ */
 
 #include <linux/module.h>
@@ -37,5 +36,5 @@
 #include <linux/init.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
 #define init_MUTEX(s) do { *(s) = MUTEX; } while(0)
 #endif
@@ -1264,5 +1263,5 @@
 static int __init i2c_init(void)
 {
-	printk("i2c-core.o: i2c core module\n");
+	printk("i2c-core.o: i2c core module version %s (%s)\n", I2C_VERSION, I2C_DATE);
 	memset(adapters,0,sizeof(adapters));
 	memset(drivers,0,sizeof(drivers));
@@ -1285,11 +1284,11 @@
 	extern int i2c_algo_bit_init(void);
 #endif
-#ifdef CONFIG_I2C_PHILIPSPAR
+#ifdef CONFIG_I2C_BITLP
 	extern int i2c_bitlp_init(void);
 #endif
-#ifdef CONFIG_I2C_ELV
+#ifdef CONFIG_I2C_BITELV
 	extern int i2c_bitelv_init(void);
 #endif
-#ifdef CONFIG_I2C_VELLEMAN
+#ifdef CONFIG_I2C_BITVELLE
 	extern int i2c_bitvelle_init(void);
 #endif
@@ -1301,5 +1300,5 @@
 	extern int i2c_algo_pcf_init(void);	
 #endif
-#ifdef CONFIG_I2C_ELEKTOR
+#ifdef CONFIG_I2C_PCFISA
 	extern int i2c_pcfisa_init(void);
 #endif
@@ -1330,11 +1329,11 @@
 	i2c_algo_bit_init();
 #endif
-#ifdef CONFIG_I2C_PHILIPSPAR
+#ifdef CONFIG_I2C_BITLP
 	i2c_bitlp_init();
 #endif
-#ifdef CONFIG_I2C_ELV
+#ifdef CONFIG_I2C_BITELV
 	i2c_bitelv_init();
 #endif
-#ifdef CONFIG_I2C_VELLEMAN
+#ifdef CONFIG_I2C_BITVELLE
 	i2c_bitvelle_init();
 #endif
@@ -1344,5 +1343,5 @@
 	i2c_algo_pcf_init();	
 #endif
-#ifdef CONFIG_I2C_ELEKTOR
+#ifdef CONFIG_I2C_PCFISA
 	i2c_pcfisa_init();
 #endif
--- linux-old/drivers/i2c/i2c-dev.c	Tue Nov 13 00:31:41 CET 2001
+++ linux/drivers/i2c/i2c-dev.c	Tue Nov 13 00:31:41 CET 2001
@@ -29,5 +29,5 @@
    <pmhahn@titan.lahn.de> */
 
-/* $Id: i2c-dev.c,v 1.40 2001/08/25 01:28:01 mds Exp $ */
+/* $Id: i2c-dev.c,v 1.43 2001/10/14 15:04:46 mds Exp $ */
 
 #include <linux/config.h>
@@ -488,5 +487,5 @@
 	int res;
 
-	printk("i2c-dev.o: i2c /dev entries driver module\n");
+	printk("i2c-dev.o: i2c /dev entries driver module version %s (%s)\n", I2C_VERSION, I2C_DATE);
 
 	i2cdev_initialized = 0;
--- linux-old/drivers/i2c/i2c-elektor.c	Tue Nov 13 00:31:42 CET 2001
+++ linux/drivers/i2c/i2c-elektor.c	Tue Nov 13 00:31:42 CET 2001
@@ -75,5 +74,6 @@
 	int address = ctl ? (base + 1) : base;
 
-	if (ctl && irq) {
+	/* enable irq if any specified for serial operation */
+	if (ctl && irq && (val & I2C_PCF_ESO)) {
 		val |= I2C_PCF_ENI;
 	}
@@ -274,5 +274,5 @@
 	}
 
-	printk("i2c-elektor.o: i2c pcf8584-isa adapter module\n");
+	printk("i2c-elektor.o: i2c pcf8584-isa adapter module version %s (%s)\n", I2C_VERSION, I2C_DATE);
 
 	if (base == 0) {
@@ -284,6 +284,8 @@
 #endif
 	if (pcf_isa_init() == 0) {
-		if (i2c_pcf_add_bus(&pcf_isa_ops) < 0)
+		if (i2c_pcf_add_bus(&pcf_isa_ops) < 0) {
+			pcf_isa_exit();
 			return -ENODEV;
+		}
 	} else {
 		return -ENODEV;
--- linux-old/drivers/i2c/i2c-elv.c	Tue Nov 13 00:31:43 CET 2001
+++ linux/drivers/i2c/i2c-elv.c	Tue Nov 13 00:31:43 CET 2001
@@ -22,5 +22,5 @@
    Frodo Looijaard <frodol@dds.nl> */
 
-/* $Id: i2c-elv.c,v 1.17 2001/07/29 02:44:25 mds Exp $ */
+/* $Id: i2c-elv.c,v 1.20 2001/10/14 15:04:46 mds Exp $ */
 
 #include <linux/kernel.h>
@@ -171,5 +169,5 @@
 int __init i2c_bitelv_init(void)
 {
-	printk("i2c-elv.o: i2c ELV parallel port adapter module\n");
+	printk("i2c-elv.o: i2c ELV parallel port adapter module version %s (%s)\n", I2C_VERSION, I2C_DATE);
 	if (base==0) {
 		/* probe some values */
--- linux-old/include/linux/i2c-id.h	Tue Nov 13 00:31:43 CET 2001
+++ linux/include/linux/i2c-id.h	Tue Nov 13 00:31:43 CET 2001
@@ -21,5 +21,5 @@
 /* ------------------------------------------------------------------------- */
 
-/* $Id: i2c-id.h,v 1.35 2001/08/12 17:22:20 mds Exp $ */
+/* $Id: i2c-id.h,v 1.40 2001/11/11 22:16:33 mds Exp $ */
 
 #ifndef I2C_ID_H
@@ -128,4 +128,7 @@
 #define I2C_DRIVERID_IT87 1026
 #define I2C_DRIVERID_CH700X 1027 /* single driver for CH7003-7009 digital pc to tv encoders */
+#define I2C_DRIVERID_FSCPOS 1028
+#define I2C_DRIVERID_FSCSCY 1029
+#define I2C_DRIVERID_PCF8591 1030
 
 /*
@@ -144,5 +147,6 @@
 #define I2C_ALGO_SAA7146 0x060000	/* SAA 7146 video decoder bus	*/
 #define I2C_ALGO_ACB 	0x070000	/* ACCESS.bus algorithm         */
-
+#define I2C_ALGO_IIC    0x080000 	/* ITE IIC bus */
+#define I2C_ALGO_SAA7134 0x090000
 #define I2C_ALGO_EC     0x100000        /* ACPI embedded controller     */
 
@@ -189,4 +193,7 @@
 /* --- MPC8xx PowerPC adapters						*/
 #define I2C_HW_MPC8XX_EPON 0x00	/* Eponymous MPC8xx I2C adapter 	*/
+
+/* --- ITE based algorithms						*/
+#define I2C_HW_I_IIC	0x00	/* controller on the ITE */
 
 /* --- SMBus only adapters						*/
--- linux-old/drivers/i2c/i2c-pcf8584.h	Tue Nov 13 00:31:43 CET 2001
+++ linux/drivers/i2c/i2c-pcf8584.h	Tue Nov 13 00:31:43 CET 2001
@@ -22,5 +22,5 @@
 /* With some changes from Frodo Looijaard <frodol@dds.nl> */
 
-/* $Id: i2c-pcf8584.h,v 1.3 2000/01/18 23:54:07 frodo Exp $ */
+/* $Id: i2c-pcf8584.h,v 1.4 2001/10/02 00:07:37 mds Exp $ */
 
 #ifndef I2C_PCF8584_H
--- linux-old/drivers/i2c/i2c-philips-par.c	Tue Nov 13 00:31:44 CET 2001
+++ linux/drivers/i2c/i2c-philips-par.c	Tue Nov 13 00:31:44 CET 2001
@@ -22,5 +22,5 @@
    Frodo Looijaard <frodol@dds.nl> */
 
-/* $Id: i2c-philips-par.c,v 1.18 2000/07/06 19:21:49 frodo Exp $ */
+/* $Id: i2c-philips-par.c,v 1.21 2001/10/14 15:04:46 mds Exp $ */
 
 #include <linux/kernel.h>
@@ -265,5 +264,5 @@
 	struct parport *port;
 #endif
-	printk("i2c-philips-par.o: i2c Philips parallel port adapter module\n");
+	printk("i2c-philips-par.o: i2c Philips parallel port adapter module version %s (%s)\n", I2C_VERSION, I2C_DATE);
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,4)
--- linux-old/drivers/i2c/i2c-proc.c	Tue Nov 13 00:31:46 CET 2001
+++ linux/drivers/i2c/i2c-proc.c	Tue Nov 13 00:31:46 CET 2001
@@ -39,8 +39,4 @@
 #include <linux/init.h>
 
-/* FIXME need i2c versioning */
-#define LM_DATE "20010825"
-#define LM_VERSION "2.6.1"
-
 #ifndef THIS_MODULE
 #define THIS_MODULE NULL
@@ -859,5 +853,5 @@
 int __init sensors_init(void)
 {
-	printk("i2c-proc.o version %s (%s)\n", LM_VERSION, LM_DATE);
+	printk("i2c-proc.o version %s (%s)\n", I2C_VERSION, I2C_DATE);
 	i2c_initialized = 0;
 	if (!
@@ -904,3 +900,4 @@
 	return i2c_cleanup();
 }
+
 #endif				/* MODULE */
--- linux-old/drivers/i2c/i2c-velleman.c	Tue Nov 13 00:31:47 CET 2001
+++ linux/drivers/i2c/i2c-velleman.c	Tue Nov 13 00:31:47 CET 2001
@@ -19,5 +19,5 @@
 /* ------------------------------------------------------------------------- */
 
-/* $Id: i2c-velleman.c,v 1.19 2000/01/24 02:06:33 mds Exp $ */
+/* $Id: i2c-velleman.c,v 1.22 2001/10/14 15:04:46 mds Exp $ */
 
 #include <linux/kernel.h>
@@ -161,5 +160,5 @@
 int __init  i2c_bitvelle_init(void)
 {
-	printk("i2c-velleman.o: i2c Velleman K8000 adapter module\n");
+	printk("i2c-velleman.o: i2c Velleman K8000 adapter module version %s (%s)\n", I2C_VERSION, I2C_DATE);
 	if (base==0) {
 		/* probe some values */
--- linux-old/drivers/i2c/Config.in	Tue Nov 13 00:31:48 CET 2001
+++ linux/drivers/i2c/Config.in	Tue Nov 13 00:31:48 CET 2001
@@ -11,20 +11,14 @@
    dep_tristate 'I2C bit-banging interfaces'  CONFIG_I2C_ALGOBIT $CONFIG_I2C
    if [ "$CONFIG_I2C_ALGOBIT" != "n" ]; then
-      dep_tristate '  Philips style parallel port adapter' CONFIG_I2C_PHILIPSPAR $CONFIG_I2C_ALGOBIT $CONFIG_PARPORT
-      dep_tristate '  ELV adapter' CONFIG_I2C_ELV $CONFIG_I2C_ALGOBIT
-      dep_tristate '  Velleman K9000 adapter' CONFIG_I2C_VELLEMAN $CONFIG_I2C_ALGOBIT
+      dep_tristate '  Philips style parallel port adapter' CONFIG_I2C_BITLP $CONFIG_I2C_ALGOBIT $CONFIG_PARPORT
+      dep_tristate '  ELV adapter' CONFIG_I2C_BITELV $CONFIG_I2C_ALGOBIT
+      dep_tristate '  Velleman K9000 adapter' CONFIG_I2C_BITVELLE $CONFIG_I2C_ALGOBIT
    fi
 
    dep_tristate 'I2C PCF 8584 interfaces' CONFIG_I2C_ALGOPCF $CONFIG_I2C
    if [ "$CONFIG_I2C_ALGOPCF" != "n" ]; then
-      dep_tristate '  Elektor ISA card' CONFIG_I2C_ELEKTOR $CONFIG_I2C_ALGOPCF
+      dep_tristate '  Elektor ISA card' CONFIG_I2C_PCFISA $CONFIG_I2C_ALGOPCF
    fi
 
-   if [ "$CONFIG_MIPS_ITE8172" = "y" ]; then
-      dep_tristate 'ITE I2C Algorithm' CONFIG_ITE_I2C_ALGO $CONFIG_I2C
-      if [ "$CONFIG_ITE_I2C_ALGO" != "n" ]; then
-         dep_tristate '  ITE I2C Adapter' CONFIG_ITE_I2C_ADAP $CONFIG_ITE_I2C_ALGO
-      fi
-   fi
    if [ "$CONFIG_8xx" = "y" ]; then
       dep_tristate 'MPC8xx CPM I2C interface' CONFIG_I2C_ALGO8XX $CONFIG_I2C
@@ -33,4 +27,5 @@
       fi
    fi
+
    if [ "$CONFIG_405" = "y" ]; then
       dep_tristate 'PPC 405 I2C Algorithm' CONFIG_I2C_PPC405_ALGO $CONFIG_I2C
@@ -44,4 +39,5 @@
 
    dep_tristate 'I2C device interface' CONFIG_I2C_CHARDEV $CONFIG_I2C
+
    dep_tristate 'I2C /proc interface (required for hardware sensors)' CONFIG_I2C_PROC $CONFIG_I2C
 
--- linux-old/drivers/i2c/Makefile	Tue Nov 13 00:31:48 CET 2001
+++ linux/drivers/i2c/Makefile	Tue Nov 13 00:31:48 CET 2001
@@ -5,17 +5,14 @@
 O_TARGET := i2c.o
 
-export-objs	:= i2c-core.o i2c-algo-bit.o i2c-algo-pcf.o \
-		   i2c-algo-ite.o i2c-proc.o
+export-objs	:= i2c-core.o i2c-algo-bit.o i2c-algo-pcf.o i2c-proc.o
 
 obj-$(CONFIG_I2C)		+= i2c-core.o
 obj-$(CONFIG_I2C_CHARDEV)	+= i2c-dev.o
 obj-$(CONFIG_I2C_ALGOBIT)	+= i2c-algo-bit.o
-obj-$(CONFIG_I2C_PHILIPSPAR)	+= i2c-philips-par.o
-obj-$(CONFIG_I2C_ELV)		+= i2c-elv.o
-obj-$(CONFIG_I2C_VELLEMAN)	+= i2c-velleman.o
+obj-$(CONFIG_I2C_BITLP)	+= i2c-philips-par.o
+obj-$(CONFIG_I2C_BITELV)	+= i2c-elv.o
+obj-$(CONFIG_I2C_BITVELLE)	+= i2c-velleman.o
 obj-$(CONFIG_I2C_ALGOPCF)	+= i2c-algo-pcf.o
-obj-$(CONFIG_I2C_ELEKTOR)	+= i2c-elektor.o
-obj-$(CONFIG_ITE_I2C_ALGO)	+= i2c-algo-ite.o
-obj-$(CONFIG_ITE_I2C_ADAP)	+= i2c-adap-ite.o
+obj-$(CONFIG_I2C_PCFISA)	+= i2c-elektor.o
 obj-$(CONFIG_I2C_PROC)		+= i2c-proc.o
 
--- linux-old/Documentation/Configure.help	Tue Nov 13 00:31:49 CET 2001
+++ linux/Documentation/Configure.help	Tue Nov 13 00:31:49 CET 2001
@@ -16041,14 +16041,32 @@
   unless you are absolutely sure.
 
+UltraSPARC-III bootbus i2c controller driver
+CONFIG_BBC_I2C
+  The BBC devices on the UltraSPARC III have two I2C controllers.  The
+  first I2C controller connects mainly to configuration PROMs (NVRAM,
+  CPU configuration, DIMM types, etc.).  The second I2C controller
+  connects to environmental control devices such as fans and
+  temperature sensors.  The second controller also connects to the
+  smartcard reader, if present.  Say Y to enable support for these.
+
+I2C /proc support
+CONFIG_I2C_PROC
+  This provides support for i2c device entries in the /proc filesystem.
+  The entries will be found in /proc/sys/dev/sensors.
+
+  This code is also available as a module. If you want to compile
+  it as a module, say M here and read <file:Documentation/modules.txt>.
+  The module will be called i2c-proc.o.
+
 I2C support
 CONFIG_I2C
   I2C (pronounce: I-square-C) is a slow serial bus protocol used in
-  many micro controller applications and developed by Philips.  SMBus,
-  or System Management Bus is a subset of the I2C protocol.  More
+  many micro controller applications and developed by Philips. SMBus,
+  or System Management Bus is a subset of the I2C protocol. More
   information is contained in the directory <file:Documentation/i2c/>,
   especially in the file called "summary" there.
 
   Both I2C and SMBus are supported here. You will need this for
-  hardware sensors support, and also for Video For Linux support.
+  hardware sensors support, and also for Video for Linux support.
   Specifically, if you want to use a BT848 based frame grabber/overlay
   boards under Linux, say Y here and also to "I2C bit-banging
@@ -16056,41 +16074,29 @@
 
   If you want I2C support, you should say Y here and also to the
-  specific driver for your bus adapter(s) below.  If you say Y to
+  specific driver for your bus adapter(s) below. If you say Y to
   "/proc file system" below, you will then get a /proc interface which
   is documented in <file:Documentation/i2c/proc-interface>.
 
-  This I2C support is also available as a module.  If you want to
+  This I2C support is also available as a module. If you want to
   compile it as a module, say M here and read
-  <file:Documentation/modules.txt>.
-  The module will be called i2c-core.o.
-
-UltraSPARC-III bootbus i2c controller driver
-CONFIG_BBC_I2C
-  The BBC devices on the UltraSPARC III have two I2C controllers.  The
-  first I2C controller connects mainly to configuration PROMs (NVRAM,
-  CPU configuration, DIMM types, etc.).  The second I2C controller
-  connects to environmental control devices such as fans and
-  temperature sensors.  The second controller also connects to the
-  smartcard reader, if present.  Say Y to enable support for these.
+  <file:Documentation/modules.txt>. The module will be called i2c-core.o.
 
 I2C bit-banging interfaces
 CONFIG_I2C_ALGOBIT
   This allows you to use a range of I2C adapters called bit-banging
-  adapters.  Say Y if you own an I2C adapter belonging to this class
+  adapters. Say Y if you own an I2C adapter belonging to this class
   and then say Y to the specific driver for you adapter below.
 
-  This support is also available as a module.  If you want to compile
-  it as a module, say M here and read
-  <file:Documentation/modules.txt>.
+  This support is also available as a module. If you want to compile
+  it as a module, say M here and read <file:Documentation/modules.txt>.
   The module will be called i2c-algo-bit.o.
 
 Philips style parallel port adapter
-CONFIG_I2C_PHILIPSPAR
-  This supports parallel-port I2C adapters made by Philips.  Say Y if
+CONFIG_I2C_BITLP
+  This supports parallel-port I2C adapters made by Philips. Say Y if
   you own such an adapter.
 
-  This driver is also available as a module.  If you want to compile
-  it as a module, say M here and read
-  <file:Documentation/modules.txt>.
+  This driver is also available as a module. If you want to compile
+  it as a module, say M here and read <file:Documentation/modules.txt>.
   The module will be called i2c-philips-par.o.
 
@@ -16099,21 +16105,19 @@
 
 ELV adapter
-CONFIG_I2C_ELV
-  This supports parallel-port I2C adapters called ELV.  Say Y if you
+CONFIG_I2C_BITELV
+  This supports parallel-port I2C adapters called ELV. Say Y if you
   own such an adapter.
 
-  This driver is also available as a module.  If you want to compile
-  it as a module, say M here and read
-  <file:Documentation/modules.txt>.
+  This driver is also available as a module. If you want to compile
+  it as a module, say M here and read <file:Documentation/modules.txt>.
   The module will be called i2c-elv.o.
 
 Velleman K9000 adapter
-CONFIG_I2C_VELLEMAN
-  This supports the Velleman K9000 parallel-port I2C adapter.  Say Y
-  if you own such an adapter.
-
-  This driver is also available as a module.  If you want to compile
-  it as a module, say M here and read
-  <file:Documentation/modules.txt>.
+CONFIG_I2C_BITVELLE
+  This supports the Velleman K9000 parallel-port I2C adapter. Say Y if
+  you own such an adapter.
+
+  This driver is also available as a module. If you want to compile
+  it as a module, say M here and read <file:Documentation/modules.txt>.
   The module will be called i2c-velleman.o.
 
@@ -16124,17 +16128,15 @@
   Y to the specific driver for you adapter below.
 
-  This support is also available as a module.  If you want to compile
-  it as a module, say M here and read
-  <file:Documentation/modules.txt>.
+  This support is also available as a module. If you want to compile
+  it as a module, say M here and read <file:Documentation/modules.txt>.
   The module will be called i2c-algo-pcf.o.
 
 Elektor ISA card
-CONFIG_I2C_ELEKTOR
-  This supports the PCF8584 ISA bus I2C adapter.  Say Y if you own
-  such an adapter.
-
-  This driver is also available as a module.  If you want to compile
-  it as a module, say M here and read
-  <file:Documentation/modules.txt>.
+CONFIG_I2C_PCFISA
+  This supports the PCF8584 ISA bus I2C adapter. Say Y if you own such
+  an adapter.
+
+  This driver is also available as a module. If you want to compile
+  it as a module, say M here and read <file:Documentation/modules.txt>.
   The module will be called i2c-elektor.o.
 
@@ -16142,11 +16144,10 @@
 CONFIG_I2C_CHARDEV
   Say Y here to use i2c-* device files, usually found in the /dev
-  directory on your system.  They make it possible to have user-space
-  programs use the I2C bus.  Information on how to do this is
-  contained in the file <file:Documentation/i2c/dev-interface>.
-
-  This code is also available as a module.  If you want to compile
-  it as a module, say M here and read
-  <file:Documentation/modules.txt>.
+  directory on your system. They make it possible to have user-space
+  programs use the I2C bus. Information on how to do this is contained
+  in the file <file:Documentation/i2c/dev-interface>.
+
+  This code is also available as a module. If you want to compile
+  it as a module, say M here and read <file:Documentation/modules.txt>.
   The module will be called i2c-dev.o.
 


-- 
J.A. Magallon                           #  Let the source be with you...        
mailto:jamagallon@able.es
Mandrake Linux release 8.2 (Cooker) for i586
Linux werewolf 2.4.15-pre3-beo #1 SMP Mon Nov 12 00:04:41 CET 2001 i686

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-12 23:48 ` J . A . Magallon
@ 2001-11-13  0:14   ` Christoph Hellwig
  2001-11-13  0:25     ` J . A . Magallon
  2001-11-13  0:42     ` J . A . Magallon
  0 siblings, 2 replies; 37+ messages in thread
From: Christoph Hellwig @ 2001-11-13  0:14 UTC (permalink / raw)
  To: "J . A . Magallon"; +Cc: Kernel Mailing List, Linus Torvalds

In article <20011113004846.G1531@werewolf.able.es> you wrote:
>
> This is an update-cleanup of the i2c code to the current CVS. In short,
> it adds version info printing and some CONFIG_ cleanups (there were
> CONFIG_ vars defined in Config.in that had been renamed inside the code).
> Please consider for next pre of 2.4.15.

Could you please think before doing a merge next time?
The patch backs out local changes like ite support:

> -obj-$(CONFIG_I2C_ELEKTOR)	+= i2c-elektor.o
> -obj-$(CONFIG_ITE_I2C_ALGO)	+= i2c-algo-ite.o
> -obj-$(CONFIG_ITE_I2C_ADAP)	+= i2c-adap-ite.o
> +obj-$(CONFIG_I2C_PCFISA)	+= i2c-elektor.o
>  obj-$(CONFIG_I2C_PROC)		+= i2c-proc.o

	Christoph

-- 
Of course it doesn't work. We've performed a software upgrade.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-13  0:14   ` Christoph Hellwig
@ 2001-11-13  0:25     ` J . A . Magallon
  2001-11-13  0:42     ` J . A . Magallon
  1 sibling, 0 replies; 37+ messages in thread
From: J . A . Magallon @ 2001-11-13  0:25 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Kernel Mailing List, Linus Torvalds


On 20011113 Christoph Hellwig wrote:
>In article <20011113004846.G1531@werewolf.able.es> you wrote:
>>
>> This is an update-cleanup of the i2c code to the current CVS. In short,
>> it adds version info printing and some CONFIG_ cleanups (there were
>> CONFIG_ vars defined in Config.in that had been renamed inside the code).
>> Please consider for next pre of 2.4.15.
>
>Could you please think before doing a merge next time?
>The patch backs out local changes like ite support:
>
>> -obj-$(CONFIG_I2C_ELEKTOR)	+= i2c-elektor.o
>> -obj-$(CONFIG_ITE_I2C_ALGO)	+= i2c-algo-ite.o
>> -obj-$(CONFIG_ITE_I2C_ADAP)	+= i2c-adap-ite.o
>> +obj-$(CONFIG_I2C_PCFISA)	+= i2c-elektor.o
>>  obj-$(CONFIG_I2C_PROC)		+= i2c-proc.o
>

Sorry, did not know that. I just got the patch i2c auto-generates, and killed
things like '#ifdef MODULE_LICENSE' and so on.
Well, that are the mailing lists for....I make mistakes and someone catches them.

Thanks.

-- 
J.A. Magallon                           #  Let the source be with you...        
mailto:jamagallon@able.es
Mandrake Linux release 8.2 (Cooker) for i586
Linux werewolf 2.4.15-pre3-beo #1 SMP Mon Nov 12 00:04:41 CET 2001 i686

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-13  0:14   ` Christoph Hellwig
  2001-11-13  0:25     ` J . A . Magallon
@ 2001-11-13  0:42     ` J . A . Magallon
  2001-11-13  7:43       ` Christoph Hellwig
  1 sibling, 1 reply; 37+ messages in thread
From: J . A . Magallon @ 2001-11-13  0:42 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Kernel Mailing List, Linus Torvalds


On 20011113 Christoph Hellwig wrote:
>In article <20011113004846.G1531@werewolf.able.es> you wrote:
>>
>> This is an update-cleanup of the i2c code to the current CVS. In short,
>> it adds version info printing and some CONFIG_ cleanups (there were
>> CONFIG_ vars defined in Config.in that had been renamed inside the code).
>> Please consider for next pre of 2.4.15.
>
>Could you please think before doing a merge next time?
>The patch backs out local changes like ite support:
>
>> -obj-$(CONFIG_I2C_ELEKTOR)	+= i2c-elektor.o
>> -obj-$(CONFIG_ITE_I2C_ALGO)	+= i2c-algo-ite.o
>> -obj-$(CONFIG_ITE_I2C_ADAP)	+= i2c-adap-ite.o
>> +obj-$(CONFIG_I2C_PCFISA)	+= i2c-elektor.o
>>  obj-$(CONFIG_I2C_PROC)		+= i2c-proc.o
>
>	Christoph

This should also stay, so ?

-   if [ "$CONFIG_MIPS_ITE8172" = "y" ]; then
-      dep_tristate 'ITE I2C Algorithm' CONFIG_ITE_I2C_ALGO $CONFIG_I2C
-      if [ "$CONFIG_ITE_I2C_ALGO" != "n" ]; then
-         dep_tristate '  ITE I2C Adapter' CONFIG_ITE_I2C_ADAP $CONFIG_ITE_I2C_ALGO
-      fi
-   fi


-- 
J.A. Magallon                           #  Let the source be with you...        
mailto:jamagallon@able.es
Mandrake Linux release 8.2 (Cooker) for i586
Linux werewolf 2.4.15-pre4-beo #2 SMP Tue Nov 13 00:50:12 CET 2001 i686

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-12 23:43 ` J . A . Magallon
@ 2001-11-13  1:11   ` Alan Cox
  0 siblings, 0 replies; 37+ messages in thread
From: Alan Cox @ 2001-11-13  1:11 UTC (permalink / raw)
  To: J . A . Magallon; +Cc: Linus Torvalds, Kernel Mailing List

> -		 */
> -		return scsi_check_sense(SCpnt);
> +		return SUCCESS;
>  	default:
>  		return FAILED;
>  	}
> 
> Is really needed ?

I think so but its only for specific cases like shared busses

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-12 19:01 Linux 2.4.15-pre4 - merge with Alan Linus Torvalds
                   ` (6 preceding siblings ...)
  2001-11-12 23:48 ` J . A . Magallon
@ 2001-11-13  5:17 ` Keith Owens
  2001-11-13 17:27   ` Chad N. Tindel
  2001-11-13 17:58   ` Chad N. Tindel
  2001-11-13  5:54 ` Neil Brown
                   ` (5 subsequent siblings)
  13 siblings, 2 replies; 37+ messages in thread
From: Keith Owens @ 2001-11-13  5:17 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Kernel Mailing List, Janice Girouard, Takao Indoh,
	Chad N. Tindel, Mark Huth

drivers/net/bonding.c has #include <limits.h>, exposing the kernel to
user space dependencies.  It must be removed.

I could not find a maintainer for this beast so cc'ed to seevral users
in the changelog.


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-12 19:01 Linux 2.4.15-pre4 - merge with Alan Linus Torvalds
                   ` (7 preceding siblings ...)
  2001-11-13  5:17 ` Keith Owens
@ 2001-11-13  5:54 ` Neil Brown
  2001-11-13  6:02   ` Jeff Garzik
  2001-11-13  6:03 ` David S. Miller
                   ` (4 subsequent siblings)
  13 siblings, 1 reply; 37+ messages in thread
From: Neil Brown @ 2001-11-13  5:54 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Kernel Mailing List

On Monday November 12, torvalds@transmeta.com wrote:
> 
> Which means that I'd also like people to double-check that there are no
> embarrassing missing pieces due to the merge (or other patches).

I'm still lamenting the loss of the "-Werror" compile switch....

I compiled a fairly vanilla config, filtered the wheat from the chaff
and got:

agpgart_be.c:1533: warning: `intel_820_cleanup' defined but not used
lvm-snap.c: In function `lvm_snapshot_release':
lvm-snap.c:545: warning: unused variable `nbhs'
uhci.c:2986: warning: initialization discards qualifiers from pointer target type
dmi_scan.c:195: warning: `disable_ide_dma' defined but not used

The following patch removes these warnings.  I suspect all parts are
correct, but *please* don't apply unless you (or someone else)
corroborate.

NeilBrown



--- ./drivers/char/agp/agpgart_be.c	2001/11/13 05:38:20	1.1
+++ ./drivers/char/agp/agpgart_be.c	2001/11/13 05:38:31
@@ -1529,6 +1529,7 @@
   return;
 }
 
+#if 0
 static void intel_820_cleanup(void)
 {
 	u8 temp;
@@ -1541,7 +1542,7 @@
 	pci_write_config_byte(agp_bridge.dev, INTEL_APSIZE,
 			      previous_size->size_value);
 }
-
+#endif
 
 static int intel_820_configure(void)
 {
--- ./drivers/usb/uhci.c	2001/11/13 05:41:32	1.1
+++ ./drivers/usb/uhci.c	2001/11/13 05:41:36
@@ -2968,7 +2968,7 @@
 }
 #endif
 
-static const struct pci_device_id __devinitdata uhci_pci_ids[] = { {
+static const struct pci_device_id uhci_pci_ids[] = { {
 
 	/* handle any USB UHCI controller */
 	class: 		((PCI_CLASS_SERIAL_USB << 8) | 0x00),
--- ./drivers/md/lvm-snap.c	2001/11/13 05:35:39	1.1
+++ ./drivers/md/lvm-snap.c	2001/11/13 05:35:41
@@ -542,7 +542,6 @@
 
 void lvm_snapshot_release(lv_t * lv)
 {
-	int 	nbhs = KIO_MAX_SECTORS;
 
 	if (lv->lv_block_exception)
 	{
--- ./arch/i386/kernel/dmi_scan.c	2001/11/13 05:42:55	1.1
+++ ./arch/i386/kernel/dmi_scan.c	2001/11/13 05:43:01
@@ -184,6 +184,7 @@
 #define NO_MATCH	{ NONE, NULL}
 #define MATCH(a,b)	{ a, b }
 
+#if 0
 /*
  *	We have problems with IDE DMA on some platforms. In paticular the
  *	KT7 series. On these it seems the newer BIOS has fixed them. The
@@ -203,6 +204,7 @@
 #endif	
 	return 0;
 }
+#endif
 
 /* 
  * Reboot options and system auto-detection code provided by

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-13  5:54 ` Neil Brown
@ 2001-11-13  6:02   ` Jeff Garzik
  2001-11-13  9:41     ` Alan Cox
  0 siblings, 1 reply; 37+ messages in thread
From: Jeff Garzik @ 2001-11-13  6:02 UTC (permalink / raw)
  To: Neil Brown; +Cc: Linus Torvalds, Kernel Mailing List

Neil Brown wrote:
> I'm still lamenting the loss of the "-Werror" compile switch....

Me too but the kernel won't build basic stuff in fs/*.c code on 64-bit
platforms with it enabled...

-- 
Jeff Garzik      | Only so many songs can be sung
Building 1024    | with two lips, two lungs, and one tongue.
MandrakeSoft     |         - nomeansno


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-12 19:01 Linux 2.4.15-pre4 - merge with Alan Linus Torvalds
                   ` (8 preceding siblings ...)
  2001-11-13  5:54 ` Neil Brown
@ 2001-11-13  6:03 ` David S. Miller
  2001-11-13  6:16   ` Keith Owens
                     ` (2 more replies)
  2001-11-13 10:43 ` David S. Miller
                   ` (3 subsequent siblings)
  13 siblings, 3 replies; 37+ messages in thread
From: David S. Miller @ 2001-11-13  6:03 UTC (permalink / raw)
  To: neilb; +Cc: torvalds, linux-kernel

   From: Neil Brown <neilb@cse.unsw.edu.au>
   Date: Tue, 13 Nov 2001 16:54:00 +1100 (EST)

   uhci.c:2986: warning: initialization discards qualifiers from pointer target type

The correct fix for this one is below and already sent
to Linus:

diff -u --recursive --new-file --exclude=CVS --exclude=.cvsignore vanilla/linux/include/linux/module.h linux/include/linux/module.h
--- vanilla/linux/include/linux/module.h	Mon Nov 12 15:13:12 2001
+++ linux/include/linux/module.h	Mon Nov 12 17:11:04 2001
@@ -317,7 +317,7 @@
  * const, other exit data may be writable.
  */
 #define MODULE_GENERIC_TABLE(gtype,name) \
-static struct gtype##_id * __module_##gtype##_table \
+static const struct gtype##_id * __module_##gtype##_table \
   __attribute__ ((unused, __section__(".data.exit"))) = name
 
 #ifndef __GENKSYMS__

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-13  6:03 ` David S. Miller
@ 2001-11-13  6:16   ` Keith Owens
  2001-11-13  6:18   ` Keith Owens
  2001-11-13  6:23   ` David S. Miller
  2 siblings, 0 replies; 37+ messages in thread
From: Keith Owens @ 2001-11-13  6:16 UTC (permalink / raw)
  To: David S. Miller; +Cc: neilb, torvalds, linux-kernel

On Mon, 12 Nov 2001 22:03:41 -0800 (PST), 
"David S. Miller" <davem@redhat.com> wrote:
>   From: Neil Brown <neilb@cse.unsw.edu.au>
>   Date: Tue, 13 Nov 2001 16:54:00 +1100 (EST)
>
>   uhci.c:2986: warning: initialization discards qualifiers from pointer target type
>
>The correct fix for this one is below and already sent
>to Linus:
>
>diff -u --recursive --new-file --exclude=CVS --exclude=.cvsignore vanilla/linux/include/linux/module.h linux/include/linux/module.h
>--- vanilla/linux/include/linux/module.h	Mon Nov 12 15:13:12 2001
>+++ linux/include/linux/module.h	Mon Nov 12 17:11:04 2001
>@@ -317,7 +317,7 @@
>  * const, other exit data may be writable.
>  */
> #define MODULE_GENERIC_TABLE(gtype,name) \
>-static struct gtype##_id * __module_##gtype##_table \
>+static const struct gtype##_id * __module_##gtype##_table \
>   __attribute__ ((unused, __section__(".data.exit"))) = name
> 
> #ifndef __GENKSYMS__

That breaks objects which have other __section__(".data.exit") info
which is not marked const.  I put a comment just above that change...


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-13  6:03 ` David S. Miller
  2001-11-13  6:16   ` Keith Owens
@ 2001-11-13  6:18   ` Keith Owens
  2001-11-13  6:23   ` David S. Miller
  2 siblings, 0 replies; 37+ messages in thread
From: Keith Owens @ 2001-11-13  6:18 UTC (permalink / raw)
  To: David S. Miller; +Cc: neilb, torvalds, linux-kernel

Ignore previous mail, the pointer cannot be const, the structure it
points to can be.


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-13  6:03 ` David S. Miller
  2001-11-13  6:16   ` Keith Owens
  2001-11-13  6:18   ` Keith Owens
@ 2001-11-13  6:23   ` David S. Miller
  2001-11-13  8:17     ` Jeff Garzik
  2 siblings, 1 reply; 37+ messages in thread
From: David S. Miller @ 2001-11-13  6:23 UTC (permalink / raw)
  To: kaos; +Cc: neilb, torvalds, linux-kernel

   From: Keith Owens <kaos@ocs.com.au>
   Date: Tue, 13 Nov 2001 17:16:26 +1100
   
   That breaks objects which have other __section__(".data.exit") info
   which is not marked const.  I put a comment just above that change...
   
Then change the other definition of that macro to
_NOT_ be const, and then fixup each and every driver
to drop the const directive in their table declaration.

As it stands the two version of that macro are totally
inconsistent.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-13  0:42     ` J . A . Magallon
@ 2001-11-13  7:43       ` Christoph Hellwig
  0 siblings, 0 replies; 37+ messages in thread
From: Christoph Hellwig @ 2001-11-13  7:43 UTC (permalink / raw)
  To: J . A . Magallon; +Cc: Kernel Mailing List, Linus Torvalds

On Tue, Nov 13, 2001 at 01:42:48AM +0100, J . A . Magallon wrote:
> This should also stay, so ?
> 
> -   if [ "$CONFIG_MIPS_ITE8172" = "y" ]; then
> -      dep_tristate 'ITE I2C Algorithm' CONFIG_ITE_I2C_ALGO $CONFIG_I2C
> -      if [ "$CONFIG_ITE_I2C_ALGO" != "n" ]; then
> -         dep_tristate '  ITE I2C Adapter' CONFIG_ITE_I2C_ADAP $CONFIG_ITE_I2C_ALGO
> -      fi
> -   fi

*nod* - maybe someone should merge that driver into CVS..

	Christoph

-- 
Of course it doesn't work. We've performed a software upgrade.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-13  6:23   ` David S. Miller
@ 2001-11-13  8:17     ` Jeff Garzik
  0 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2001-11-13  8:17 UTC (permalink / raw)
  To: David S. Miller; +Cc: kaos, torvalds, linux-kernel

"David S. Miller" wrote:
> 
>    From: Keith Owens <kaos@ocs.com.au>
>    Date: Tue, 13 Nov 2001 17:16:26 +1100
> 
>    That breaks objects which have other __section__(".data.exit") info
>    which is not marked const.  I put a comment just above that change...
> 
> Then change the other definition of that macro to
> _NOT_ be const, and then fixup each and every driver
> to drop the const directive in their table declaration.

...and after all that work is done, change the PCI API in a stable
series. :)

grep const include/linux/pci.h

-- 
Jeff Garzik      | Only so many songs can be sung
Building 1024    | with two lips, two lungs, and one tongue.
MandrakeSoft     |         - nomeansno


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-13  6:02   ` Jeff Garzik
@ 2001-11-13  9:41     ` Alan Cox
  0 siblings, 0 replies; 37+ messages in thread
From: Alan Cox @ 2001-11-13  9:41 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Neil Brown, Linus Torvalds, Kernel Mailing List

> Neil Brown wrote:
> > I'm still lamenting the loss of the "-Werror" compile switch....
> 
> Me too but the kernel won't build basic stuff in fs/*.c code on 64-bit
> platforms with it enabled...

Or some 32bit setups, in part because gcc isnt always very bright about
warnings on non-use of variables. I'd rather have a small number of expected
warnings than a pile of ifdefs and = 0 assignments that later mask a real
bug

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-12 19:01 Linux 2.4.15-pre4 - merge with Alan Linus Torvalds
                   ` (9 preceding siblings ...)
  2001-11-13  6:03 ` David S. Miller
@ 2001-11-13 10:43 ` David S. Miller
  2001-11-13 14:10 ` Horst von Brand
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 37+ messages in thread
From: David S. Miller @ 2001-11-13 10:43 UTC (permalink / raw)
  To: kaos; +Cc: torvalds, linux-kernel, girouard, indou.takao, ctindel, mhuth

   From: Keith Owens <kaos@ocs.com.au>
   Date: Tue, 13 Nov 2001 16:17:18 +1100

   drivers/net/bonding.c has #include <limits.h>, exposing the kernel to
   user space dependencies.  It must be removed.
   
   I could not find a maintainer for this beast so cc'ed to seevral users
   in the changelog.
   
Documentation/networking/bonding.txt says:

Current developement on this driver is posted to:
 - http://www.sourceforge.net/projects/bonding/

But I've made the fix and sent it off to Linus for you :)

Franks a lot,
David S. Miller
davem@redhat.com

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-12 19:18 ` Trever L. Adams
@ 2001-11-13 11:14   ` Christoph Rohland
  0 siblings, 0 replies; 37+ messages in thread
From: Christoph Rohland @ 2001-11-13 11:14 UTC (permalink / raw)
  To: Trever L. Adams; +Cc: Linus Torvalds, Linux Kernel Mailing List

Hi Trever,

On 12 Nov 2001, Trever L. Adams wrote:
> Red Hat mounts /dev/shm as tmpfs instead of shmfs.  From what I can
> tell this is accurate.

That's OK.

> However since the beginning of the new VM, it seems that shmfs/tmpfs
> leaks memory.

??? I did not get _one_ single bug report. 

Greetings
		Christoph



^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-12 19:01 Linux 2.4.15-pre4 - merge with Alan Linus Torvalds
                   ` (10 preceding siblings ...)
  2001-11-13 10:43 ` David S. Miller
@ 2001-11-13 14:10 ` Horst von Brand
  2001-11-13 15:21   ` Thorsten Kukuk
  2001-11-14  4:57   ` David S. Miller
  2001-11-13 15:37 ` [PATCH] " Russell King
  2001-11-15  9:25 ` Problem with Linux 2.4.15-pre4 on an IBM ThinkPad Martin Persson
  13 siblings, 2 replies; 37+ messages in thread
From: Horst von Brand @ 2001-11-13 14:10 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Kernel Mailing List, sparclinux

On CVS as of today for sparc64 I get:

sparc64-linux-gcc -D__KERNEL__ -I/usr/src/linux-2.4/include -Wall -Wstrict-proto
types -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -
m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -f
call-used-g7 -Wno-sign-compare -Wa,--undeclared-regs    -c -o ioctl32.o ioctl32.
c
ioctl32.c: In function `do_lvm_ioctl':
ioctl32.c:2636: warning: assignment makes pointer from integer without a cast
ioctl32.c:2670: structure has no member named `inode'
ioctl32.c:2711: warning: assignment from incompatible pointer type
ioctl32.c:2712: structure has no member named `inode'
ioctl32.c:2719: structure has no member named `inode'
ioctl32.c:2732: structure has no member named `inode'
ioctl32.c:2611: warning: `v' might be used uninitialized in this function
make[1]: *** [ioctl32.o] Error 1
make[1]: Leaving directory `/usr/src/linux-2.4/arch/sparc64/kernel'
make: *** [_dir_arch/sparc64/kernel] Error 2
-- 
Dr. Horst H. von Brand                Usuario #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-13 14:10 ` Horst von Brand
@ 2001-11-13 15:21   ` Thorsten Kukuk
  2001-11-14 12:59     ` Horst von Brand
  2001-11-14  4:57   ` David S. Miller
  1 sibling, 1 reply; 37+ messages in thread
From: Thorsten Kukuk @ 2001-11-13 15:21 UTC (permalink / raw)
  To: Horst von Brand; +Cc: Linus Torvalds, Kernel Mailing List, sparclinux

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

On Tue, Nov 13, Horst von Brand wrote:

> On CVS as of today for sparc64 I get:
> 
> sparc64-linux-gcc -D__KERNEL__ -I/usr/src/linux-2.4/include -Wall -Wstrict-proto
> types -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -
> m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -f
> call-used-g7 -Wno-sign-compare -Wa,--undeclared-regs    -c -o ioctl32.o ioctl32.
> c
> ioctl32.c: In function `do_lvm_ioctl':
> ioctl32.c:2636: warning: assignment makes pointer from integer without a cast
> ioctl32.c:2670: structure has no member named `inode'
> ioctl32.c:2711: warning: assignment from incompatible pointer type
> ioctl32.c:2712: structure has no member named `inode'
> ioctl32.c:2719: structure has no member named `inode'
> ioctl32.c:2732: structure has no member named `inode'
> ioctl32.c:2611: warning: `v' might be used uninitialized in this function
> make[1]: *** [ioctl32.o] Error 1
> make[1]: Leaving directory `/usr/src/linux-2.4/arch/sparc64/kernel'
> make: *** [_dir_arch/sparc64/kernel] Error 2

Please try the both attached patches. I'm using them with 
2.4.15pre1aa1 (which has the same lvm version as now 2.2.15pre4).

  Thorsten

-- 
Thorsten Kukuk       http://www.suse.de/~kukuk/        kukuk@suse.de
SuSE GmbH            Deutschherrenstr. 15-19       D-90429 Nuernberg
--------------------------------------------------------------------    
Key fingerprint = A368 676B 5E1B 3E46 CFCE  2D97 F8FD 4E23 56C6 FB4B

[-- Attachment #2: 61_sparc64.lvm.diff --]
[-- Type: text/plain, Size: 1829 bytes --]

--- linux/arch/sparc64/kernel/ioctl32.c
+++ linux/arch/sparc64/kernel/ioctl32.c	2001/05/22 10:08:13
@@ -2166,14 +2166,6 @@
 } lv_status_bydev_req32_t;
 
 typedef struct {
-	uint8_t lv_name[NAME_LEN];
-	kdev_t old_dev;
-	kdev_t new_dev;
-	u32 old_pe;
-	u32 new_pe;
-} le_remap_req32_t;
-
-typedef struct {
 	char pv_name[NAME_LEN];
 	u32 pv;
 } pv_status_req32_t;
@@ -2211,14 +2203,6 @@
 	char dummy[200];
 } lv32_t;
 
-typedef struct {
-	u32 hash[2];
-	u32 rsector_org;
-	kdev_t rdev_org;
-	u32 rsector_new;
-	kdev_t rdev_new;
-} lv_block_exception32_t;
-
 static void put_lv_t(lv_t *l)
 {
 	if (l->lv_current_pe) vfree(l->lv_current_pe);
@@ -2231,8 +2215,6 @@
 	int err, i;
 	u32 ptr1, ptr2;
 	size_t size;
-	lv_block_exception32_t *lbe32;
-	lv_block_exception_t *lbe;
 	lv32_t *ul = (lv32_t *)A(p);
 	lv_t *l = (lv_t *)kmalloc(sizeof(lv_t), GFP_KERNEL);
 	if (!l) {
@@ -2260,18 +2242,9 @@
 	}
 	if (!err && ptr2) {
 		size = l->lv_remap_end * sizeof(lv_block_exception_t);
-		l->lv_block_exception = lbe = vmalloc(size);
-		if (l->lv_block_exception) {
-			lbe32 = (lv_block_exception32_t *)A(ptr2);
-			memset(lbe, 0, size);
-                       for (i = 0; i < l->lv_remap_end; i++, lbe++, lbe32++) {
-                               err |= get_user(lbe->rsector_org, &lbe32->rsector_org);
-                               err |= __get_user(lbe->rdev_org, &lbe32->rdev_org);
-                               err |= __get_user(lbe->rsector_new, &lbe32->rsector_new);
-                               err |= __get_user(lbe->rdev_new, &lbe32->rdev_new);
-
-			}
-		}
+		l->lv_block_exception = vmalloc(size);
+		if (l->lv_block_exception)
+                        err = copy_from_user(l->lv_block_exception, (void *)A(ptr2), size);
 	}
 	if (err || (ptr1 && !l->lv_current_pe) || (ptr2 && !l->lv_block_exception)) {
 		if (!err)

[-- Attachment #3: 61_sparc64.lvm-1.0.1-rc2.diff --]
[-- Type: text/plain, Size: 1837 bytes --]

--- linux/arch/sparc64/kernel/ioctl32.c
+++ linux/arch/sparc64/kernel/ioctl32.c	2001/09/05 11:44:46
@@ -2188,7 +2188,7 @@
 	uint32_t pe_allocated;
 	uint32_t pe_stale;
 	u32 pe;
-	u32 inode;
+	u32 bd;
 	uint8_t pv_uuid[UUID_LEN+1];
 } pv32_t;
 
@@ -2345,6 +2345,7 @@
 		if (!v) return -ENOMEM;
 		karg = v;
 		break;
+	case VG_CREATE_OLD:
 	case VG_CREATE:
 		v = kmalloc(sizeof(vg_t), GFP_KERNEL);
 		if (!v) return -ENOMEM;
@@ -2383,7 +2384,7 @@
 				}
 
 				
-				v->pv[i]->pe = NULL; v->pv[i]->inode = NULL;
+				v->pv[i]->pe = NULL; v->pv[i]->bd = NULL;
 			}
 		}
 		if (!err) {
@@ -2425,14 +2426,14 @@
 		u.lv_bydev.lv = get_lv_t(ptr, &err);
 		if (err) return err;
 		u.lv_bydev.lv = &p;
-		p.pe = NULL; p.inode = NULL;		
+		p.pe = NULL; p.bd = NULL;		
 		break;		
 	case VG_EXTEND:
 		err = copy_from_user(&p, (void *)arg, sizeof(pv32_t) - 8 - UUID_LEN+1);
 		if (err) return -EFAULT;
 		err = copy_from_user(p.pv_uuid, ((pv32_t *)arg)->pv_uuid, UUID_LEN+1);
 		if (err) return -EFAULT;
-		p.pe = NULL; p.inode = NULL;
+		p.pe = NULL; p.bd = NULL;
 		karg = &p;
 		break;
 	case PV_CHANGE:
@@ -2445,7 +2446,7 @@
 		if (cmd == PV_CHANGE) {
 			err = copy_from_user(&p, (void *)A(ptr), sizeof(pv32_t) - 8 - UUID_LEN+1);
 			if (err) return -EFAULT;
-			p.pe = NULL; p.inode = NULL;
+			p.pe = NULL; p.bd = NULL;
 		}
 		break;
 	}
@@ -2464,6 +2465,7 @@
 		}
 		kfree(v);
 		break;
+	case VG_CREATE_OLD:
 	case VG_CREATE:
 		for (i = 0; i < v->pv_max; i++)
 			if (v->pv[i]) kfree(v->pv[i]);
@@ -4363,6 +4365,7 @@
 HANDLE_IOCTL(SONET_GETFRSENSE, do_atm_ioctl)
 #if defined(CONFIG_BLK_DEV_LVM) || defined(CONFIG_BLK_DEV_LVM_MODULE)
 HANDLE_IOCTL(VG_STATUS, do_lvm_ioctl)
+HANDLE_IOCTL(VG_CREATE_OLD, do_lvm_ioctl)
 HANDLE_IOCTL(VG_CREATE, do_lvm_ioctl)
 HANDLE_IOCTL(VG_EXTEND, do_lvm_ioctl)
 HANDLE_IOCTL(LV_CREATE, do_lvm_ioctl)

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [PATCH] Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-12 19:01 Linux 2.4.15-pre4 - merge with Alan Linus Torvalds
                   ` (11 preceding siblings ...)
  2001-11-13 14:10 ` Horst von Brand
@ 2001-11-13 15:37 ` Russell King
  2001-11-15  9:25 ` Problem with Linux 2.4.15-pre4 on an IBM ThinkPad Martin Persson
  13 siblings, 0 replies; 37+ messages in thread
From: Russell King @ 2001-11-13 15:37 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Kernel Mailing List

The pesky linux/irq.h include found its way back into drivers/char/vt.c
again (maybe Alan didn't merge it).

linux/irq.h is not required by vt.c, and, since it includes asm/hw_irq.h
which architectures many not provide, generic code should not be including
this file in the first place.

Here's a patch to fix this bogosity up:

--- orig/drivers/char/vt.c	Thu Nov  8 17:47:59 2001
+++ linux/drivers/char/vt.c	Tue Nov 13 15:24:21 2001
@@ -24,7 +24,6 @@
 #include <linux/major.h>
 #include <linux/fs.h>
 #include <linux/console.h>
-#include <linux/irq.h>
 
 #include <asm/io.h>
 #include <asm/uaccess.h>

--
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-13  5:17 ` Keith Owens
@ 2001-11-13 17:27   ` Chad N. Tindel
  2001-11-13 17:58   ` Chad N. Tindel
  1 sibling, 0 replies; 37+ messages in thread
From: Chad N. Tindel @ 2001-11-13 17:27 UTC (permalink / raw)
  To: Keith Owens
  Cc: Linus Torvalds, Kernel Mailing List, Janice Girouard,
	Takao Indoh, Chad N. Tindel, Mark Huth

> drivers/net/bonding.c has #include <limits.h>, exposing the kernel to
> user space dependencies.  It must be removed.
> 
> I could not find a maintainer for this beast so cc'ed to seevral users
> in the changelog.

Thanks for the message.  I just noticed that the bonding patch had been
included in 2.4.15-pre3.  I hadn't realized Alan was going to integrate
it yet!  I'm happy he did though.  I have a patch which addresses that
issue and some race conditions which I'll send out immediately.

Chad

-- 
Chad N. Tindel <ctindel@cup.hp.com>
Software Engineer
Hewlett Packard, Cupertino
(408) 447-4230


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-13  5:17 ` Keith Owens
  2001-11-13 17:27   ` Chad N. Tindel
@ 2001-11-13 17:58   ` Chad N. Tindel
  1 sibling, 0 replies; 37+ messages in thread
From: Chad N. Tindel @ 2001-11-13 17:58 UTC (permalink / raw)
  To: Chad N. Tindel; +Cc: Keith Owens, Linus Torvalds, Kernel Mailing List, alan

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

On Tue, 2001-11-13 at 09:27, Chad N. Tindel wrote:
> > drivers/net/bonding.c has #include <limits.h>, exposing the kernel to
> > user space dependencies.  It must be removed.
> > 
> > I could not find a maintainer for this beast so cc'ed to seevral users
> > in the changelog.

Here's a bonding patch against 2.4.15-pre4 which:

1.  removes the limits.h include
2.  fixes the compiler warning about #include <linux/malloc.h>
3.  Fixes several SMP race conditions
4.  Fixes a deadlock when hotswapping an enslaved ethernet device

I wasn't sure whether or not to send it to Linus, Alan, or lk so I sent
it to all 3.

So that everybody on the list knows, there's a lot of changes that just
went into the bonding driver.  These have been accumulating over time as
people from IBM, HP, Fujitsu, Monta Vista, and other companies have been
working on enhancements in the High Availability area.  I suggest any
interested parties read Documentation/networking/bonding.txt.

Also, this bonding driver *SHOULD* be backwards compatible with the old
one--- meaning  you shouldn't need to recompile ifenslave or pass any
module parameters unless you want to use any of the new features. 
However, if anybody has any problems with this, please email
bonding-devel@lists.sourceforge.net.  Patches will also be accepted.  :)
The new ifenslave is also available in
Documentation/networking/ifenslave.c, if you want to use it.

Chad 

-- 
Chad N. Tindel <ctindel@cup.hp.com>
Software Engineer
Hewlett Packard, Cupertino
(408) 447-4230

[-- Attachment #2: bonding-2.4.15-pre4-20011113 --]
[-- Type: text/x-patch, Size: 11867 bytes --]

diff -Naru linux-2.4.15-pre4-original/drivers/net/bonding.c linux/drivers/net/bonding.c
--- linux-2.4.15-pre4-original/drivers/net/bonding.c	Tue Nov 13 09:23:22 2001
+++ linux/drivers/net/bonding.c	Tue Nov 13 09:35:24 2001
@@ -153,6 +153,14 @@
  *
  * 2001/10/23 - Takao Indoh <indou dot takao at jp dot fujitsu dot com>
  *     - Various memory leak fixes
+ *
+ * 2001/11/5 - Mark Huth <mark dot huth at mvista dot com>
+ *     - Don't take rtnl lock in bond_mii_monitor as it deadlocks under 
+ *       certain hotswap conditions.  
+ *       Note:  this same change may be required in bond_arp_monitor ???
+ *     - Remove possibility of calling bond_sethwaddr with NULL slave_dev ptr 
+ *     - Handle hot swap ethernet interface deregistration events to remove
+ *       kernel oops following hot swap of enslaved interface
  */
 
 #include <linux/config.h>
@@ -165,7 +173,7 @@
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/in.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/init.h>
 #include <linux/timer.h>
@@ -185,7 +193,6 @@
 
 #include <linux/if_bonding.h>
 #include <linux/smp.h>
-#include <limits.h>
 #include <linux/if_ether.h>
 #include <linux/if_arp.h>
 
@@ -257,6 +264,7 @@
 static void bond_set_slave_active_flags(slave_t *slave);
 static int bond_enslave(struct net_device *master, struct net_device *slave);
 static int bond_release(struct net_device *master, struct net_device *slave);
+static int bond_release_all(struct net_device *master);
 static int bond_sethwaddr(struct net_device *master, struct net_device *slave);
 
 /*
@@ -372,10 +380,13 @@
 static u16 bond_check_mii_link(bonding_t *bond)
 {
 	int has_active_interface = 0;
+	unsigned long flags;
 
+	read_lock_irqsave(&bond->lock, flags);
 	read_lock(&bond->ptrlock);
 	has_active_interface = (bond->current_slave != NULL);
 	read_unlock(&bond->ptrlock);
+	read_unlock_irqrestore(&bond->lock, flags);
 
 	return (has_active_interface ? MII_LINK_READY : 0);
 }
@@ -407,7 +418,6 @@
 static int bond_close(struct net_device *master)
 {
 	bonding_t *bond = (struct bonding *) master->priv;
-	slave_t *slave;
 	unsigned long flags;
 
 	write_lock_irqsave(&bond->lock, flags);
@@ -418,13 +428,11 @@
 	if (arp_interval> 0) {  /* arp interval, in milliseconds. */
 		del_timer(&bond->arp_timer);
 	}
-	/* We need to unlock this because bond_release will re-lock it */
-	write_unlock_irqrestore(&bond->lock, flags);
 
 	/* Release the bonded slaves */
-	while ((slave = bond->prev) != (slave_t *)bond) {
-		bond_release(master, slave->dev);
-	}
+	bond_release_all(master);
+
+	write_unlock_irqrestore(&bond->lock, flags);
 
 	MOD_DEC_USE_COUNT;
 	return 0;
@@ -866,6 +874,49 @@
 	return -EINVAL;
 }
 
+/* 
+ * This function releases all slaves.
+ * Warning: must put write-locks around the call to this function.
+ */
+static int bond_release_all(struct net_device *master)
+{
+	bonding_t *bond;
+	slave_t *our_slave;
+	struct net_device *slave_dev;
+
+	if (master == NULL)  {
+		return -ENODEV;
+	}
+
+	if (master->flags & IFF_SLAVE) {
+		return -EINVAL;
+	}
+
+	bond = (struct bonding *) master->priv;
+	bond->current_slave = NULL;
+
+	while ((our_slave = bond->prev) != (slave_t *)bond) {
+		slave_dev = our_slave->dev;
+		bond->prev = our_slave->prev;
+
+		kfree(our_slave);
+
+		netdev_set_master(slave_dev, NULL);
+
+		/* only restore its RUNNING flag if monitoring set it down */
+		if (slave_dev->flags & IFF_UP)
+			slave_dev->flags |= IFF_RUNNING;
+
+		if (slave_dev->flags & IFF_NOARP)
+			dev_close(slave_dev);
+	}
+	bond->next = (slave_t *)bond;
+	bond->slave_cnt = 0;
+	printk (KERN_INFO "%s: releases all slaves\n", master->name);
+
+	return 0;
+}
+
 /* this function is called regularly to monitor each slave's link. */
 static void bond_mii_monitor(struct net_device *master)
 {
@@ -876,14 +927,6 @@
 
 	read_lock_irqsave(&bond->lock, flags);
 
-	if (rtnl_shlock_nowait()) {
-		goto monitor_out;
-	}
-
-	if (rtnl_exlock_nowait()) {
-		rtnl_shunlock();
-		goto monitor_out;
-	}
 	/* we will try to read the link status of each of our slaves, and
 	 * set their IFF_RUNNING flag appropriately. For each slave not
 	 * supporting MII status, we won't do anything so that a user-space
@@ -1057,9 +1100,10 @@
 		} /* end of switch */
 	} /* end of while */
 
-	/* if there's no active interface and we discovered that one
-	   of the slaves could be activated earlier, so we do it.
-	*/
+	/* 
+	 * if there's no active interface and we discovered that one
+	 * of the slaves could be activated earlier, so we do it.
+	 */
 	read_lock(&bond->ptrlock);
 	oldcurrent = bond->current_slave;
 	read_unlock(&bond->ptrlock);
@@ -1097,9 +1141,6 @@
 		}
 	}
 
-	rtnl_exunlock();
-	rtnl_shunlock();
-monitor_out:
 	read_unlock_irqrestore(&bond->lock, flags);
 	/* re-arm the timer */
 	mod_timer(&bond->mii_timer, jiffies + (miimon * HZ / 1000));
@@ -1128,17 +1169,17 @@
 
 	if (!IS_UP(master)) {
 		mod_timer(&bond->arp_timer, next_timer);
-		goto monitor_out;
+		goto arp_monitor_out;
 	}
 
 
 	if (rtnl_shlock_nowait()) {
-		goto monitor_out;
+		goto arp_monitor_out;
 	}
 
 	if (rtnl_exlock_nowait()) {
 		rtnl_shunlock();
-		goto monitor_out;
+		goto arp_monitor_out;
 	}
 
 	/* see if any of the previous devices are up now (i.e. they have seen a 
@@ -1243,7 +1284,9 @@
 	 * an arp on all of the interfaces 
 	 */
 
+	read_lock(&bond->ptrlock);
 	if (bond->current_slave == NULL) { 
+		read_unlock(&bond->ptrlock);
 		slave = (slave_t *)bond;
 		while ((slave = slave->prev) != (slave_t *)bond)   {
 			arp_send(ARPOP_REQUEST, ETH_P_ARP, arp_target, 
@@ -1251,11 +1294,14 @@
 				 slave->dev->dev_addr, arp_target_hw_addr); 
 		}
 	}
+	else {
+		read_unlock(&bond->ptrlock);
+	}
 
 	rtnl_exunlock();
 	rtnl_shunlock();
 
-monitor_out:
+arp_monitor_out:
 	read_unlock_irqrestore(&bond->lock, flags);
 
 	/* re-arm the timer */
@@ -1367,16 +1413,17 @@
 {
 	bonding_t *bond = (struct bonding *) master->priv;
 	slave_t *slave;
+	unsigned long flags;
 
 	info->bond_mode = mode;
 	info->num_slaves = 0;
 	info->miimon = miimon;
 
-	read_lock(&bond->ptrlock);
+	read_lock_irqsave(&bond->lock, flags);
 	for (slave = bond->prev; slave!=(slave_t *)bond; slave = slave->prev) {
 		info->num_slaves++;
 	}
-	read_unlock(&bond->ptrlock);
+	read_unlock_irqrestore(&bond->lock, flags);
 
 	return 0;
 }
@@ -1387,27 +1434,28 @@
 	bonding_t *bond = (struct bonding *) master->priv;
 	slave_t *slave;
 	int cur_ndx = 0;
+	unsigned long flags;
 
 	if (info->slave_id < 0) {
 		return -ENODEV;
 	}
 
-	read_lock(&bond->ptrlock);
+	read_lock_irqsave(&bond->lock, flags);
 	for (slave = bond->prev; 
 		 slave != (slave_t *)bond && cur_ndx < info->slave_id; 
 		 slave = slave->prev) {
 		cur_ndx++;
 	}
+	read_unlock_irqrestore(&bond->lock, flags);
+
 	if (cur_ndx == info->slave_id) {
 		strcpy(info->slave_name, slave->dev->name);
 		info->link = slave->link;
 		info->state = slave->state;
 		info->link_failure_count = slave->link_failure_count;
 	} else {
-		read_unlock(&bond->ptrlock);
 		return -ENODEV;
 	}
-	read_unlock(&bond->ptrlock);
 
 	return 0;
 }
@@ -1480,40 +1528,40 @@
 	}
 
 	slave_dev = dev_get_by_name(ifr->ifr_slave);
+
 #ifdef BONDING_DEBUG
 	printk(KERN_INFO "slave_dev=%x: \n", (unsigned int)slave_dev);
 	printk(KERN_INFO "slave_dev->name=%s: \n", slave_dev->name);
 #endif
-	switch (cmd) {
-	case BOND_ENSLAVE_OLD:
-	case SIOCBONDENSLAVE:		
-		ret = bond_enslave(master_dev, slave_dev);
-		break;
-	case BOND_RELEASE_OLD:			
-	case SIOCBONDRELEASE:	
-		ret = bond_release(master_dev, slave_dev); 
-		break;
-	case BOND_SETHWADDR_OLD:
-	case SIOCBONDSETHWADDR:	
-		ret = bond_sethwaddr(master_dev, slave_dev);
-		break;
-	case BOND_CHANGE_ACTIVE_OLD:
-	case SIOCBONDCHANGEACTIVE:
-		if (mode == BOND_MODE_ACTIVEBACKUP) {
-			ret = bond_change_active(master_dev, slave_dev);
-		}
-		else {
-			ret = -EINVAL;
-		}
-		break;
-	default:
-		ret = -EOPNOTSUPP;
-	}
 
-	if (slave_dev) {
-		/*
-		 * Clear the module reference that was added by dev_get_by_name
-		 */
+	if (slave_dev == NULL) {
+		ret = -ENODEV;
+	} else {
+		switch (cmd) {
+		case BOND_ENSLAVE_OLD:
+		case SIOCBONDENSLAVE:		
+			ret = bond_enslave(master_dev, slave_dev);
+			break;
+		case BOND_RELEASE_OLD:			
+		case SIOCBONDRELEASE:	
+			ret = bond_release(master_dev, slave_dev); 
+			break;
+		case BOND_SETHWADDR_OLD:
+		case SIOCBONDSETHWADDR:	
+			ret = bond_sethwaddr(master_dev, slave_dev);
+			break;
+		case BOND_CHANGE_ACTIVE_OLD:
+		case SIOCBONDCHANGEACTIVE:
+			if (mode == BOND_MODE_ACTIVEBACKUP) {
+				ret = bond_change_active(master_dev, slave_dev);
+			}
+			else {
+				ret = -EINVAL;
+			}
+			break;
+		default:
+			ret = -EOPNOTSUPP;
+		}
 		dev_put(slave_dev);
 	}
 	return ret;
@@ -1593,13 +1641,11 @@
 	}
 
 	read_lock_irqsave(&bond->lock, flags);
-	read_lock(&bond->ptrlock);
 	slave = bond->prev;
 
 	/* we're at the root, get the first slave */
 	if ((slave == NULL) || (slave->dev == NULL)) { 
 		/* no suitable interface, frame not sent */
-		read_unlock(&bond->ptrlock);
 		dev_kfree_skb(skb);
 		read_unlock_irqrestore(&bond->lock, flags);
 		return 0;
@@ -1607,8 +1653,6 @@
 
 	slave_no = (data->h_dest[5]^slave->dev->dev_addr[5]) % bond->slave_cnt;
 
-	read_unlock(&bond->ptrlock);
-
 	while ( (slave_no > 0) && (slave != (slave_t *)bond) ) {
 		slave = slave->prev;
 		slave_no--;
@@ -1749,6 +1793,7 @@
 	off_t begin = 0;
 	u16 link;
 	slave_t *slave = NULL;
+	unsigned long flags;
 
 	while (bond != NULL) {
 		/*
@@ -1757,17 +1802,19 @@
 		 */
 		link = bond_check_mii_link(bond);
 
-		read_lock(&bond->ptrlock);
-
 		len += sprintf(buf + len, "Bonding Mode: ");
 		len += sprintf(buf + len, "%s\n", mode ? "active-backup" : "load balancing");
 
 		if (mode == BOND_MODE_ACTIVEBACKUP) {
+			read_lock_irqsave(&bond->lock, flags);
+			read_lock(&bond->ptrlock);
 			if (bond->current_slave != NULL) {
 				len += sprintf(buf + len, 
 					"Currently Active Slave: %s\n", 
 					bond->current_slave->dev->name);
 			}
+			read_unlock(&bond->ptrlock);
+			read_unlock_irqrestore(&bond->lock, flags);
 		}
 
 		len += sprintf(buf + len, "MII Status: ");
@@ -1778,6 +1825,7 @@
 		len += sprintf(buf + len, "Up Delay (ms): %d\n", updelay);
 		len += sprintf(buf + len, "Down Delay (ms): %d\n", downdelay);
 
+		read_lock_irqsave(&bond->lock, flags);
 		for (slave = bond->prev; slave != (slave_t *)bond; 
 		     slave = slave->prev) {
 			len += sprintf(buf + len, "\nSlave Interface: %s\n", slave->dev->name);
@@ -1790,6 +1838,7 @@
 			len += sprintf(buf + len, "Link Failure Count: %d\n", 
 				slave->link_failure_count);
 		}
+		read_unlock_irqrestore(&bond->lock, flags);
 
 		/*
 		 * Figure out the calcs for the /proc/net interface
@@ -1803,7 +1852,6 @@
 			len = 0;
 		}
 
-		read_unlock(&bond->ptrlock);
 
 		bond = bond->next_bond;
 	}
@@ -1844,7 +1892,14 @@
 			default:
 				return NOTIFY_DONE;
 			}
-		} 
+		} else if (this_bond->device == event_dev->master) {
+			switch (event) {
+			case NETDEV_UNREGISTER:
+				bond_release(this_bond->device, event_dev);
+				break;
+			}
+			return NOTIFY_DONE;
+		}
 		this_bond = this_bond->next_bond;
 	}
 	return NOTIFY_DONE;
diff -Naru linux-2.4.15-pre4-original/include/linux/if_bonding.h linux/include/linux/if_bonding.h
--- linux-2.4.15-pre4-original/include/linux/if_bonding.h	Tue Nov 13 09:23:46 2001
+++ linux/include/linux/if_bonding.h	Tue Nov 13 09:31:56 2001
@@ -79,6 +79,15 @@
 	u32 link_failure_count;
 } slave_t;
 
+/*
+ * Here are the locking policies for the two bonding locks:
+ *
+ * 1) Get bond->lock when reading/writing slave list.
+ * 2) Get bond->ptrlock when reading/writing bond->current_slave.
+ *    (It is unnecessary when the write-lock is put with bond->lock.)
+ * 3) When we lock with bond->ptrlock, we must lock with bond->lock
+ *    beforehand.
+ */
 typedef struct bonding {
 	slave_t *next;
 	slave_t *prev;

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-13 14:10 ` Horst von Brand
  2001-11-13 15:21   ` Thorsten Kukuk
@ 2001-11-14  4:57   ` David S. Miller
  2001-11-14  6:28     ` Thorsten Kukuk
  2001-11-14  6:31     ` David S. Miller
  1 sibling, 2 replies; 37+ messages in thread
From: David S. Miller @ 2001-11-14  4:57 UTC (permalink / raw)
  To: kukuk; +Cc: vonbrand, torvalds, linux-kernel, sparclinux


This first patch is wrong.  lv_block_exception needs translating
because the types are of a different size on sparc32 than on sparc64.

Specifically the first member of lv_block_exception_t is
'struct list_head', which are two pointers, which is 8 bytes
on sparc32 and 16 bytes on sparc64.

Please do not apply these patches.

Franks a lot,
David S. Miller
davem@redhat.com

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-14  4:57   ` David S. Miller
@ 2001-11-14  6:28     ` Thorsten Kukuk
  2001-11-14  6:31     ` David S. Miller
  1 sibling, 0 replies; 37+ messages in thread
From: Thorsten Kukuk @ 2001-11-14  6:28 UTC (permalink / raw)
  To: David S. Miller; +Cc: vonbrand, torvalds, linux-kernel, sparclinux

On Tue, Nov 13, David S. Miller wrote:

> 
> This first patch is wrong.  lv_block_exception needs translating
> because the types are of a different size on sparc32 than on sparc64.
> 
> Specifically the first member of lv_block_exception_t is
> 'struct list_head', which are two pointers, which is 8 bytes
> on sparc32 and 16 bytes on sparc64.
> 
> Please do not apply these patches.

If the first one should be wrong, why not apply the second one ?
Or I'm missing something ?
To the first patch: Without it you will always get a kernel oops
in this part of ioctl32.c

  Thorsten

-- 
Thorsten Kukuk       http://www.suse.de/~kukuk/        kukuk@suse.de
SuSE GmbH            Deutschherrenstr. 15-19       D-90429 Nuernberg
--------------------------------------------------------------------    
Key fingerprint = A368 676B 5E1B 3E46 CFCE  2D97 F8FD 4E23 56C6 FB4B

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-14  4:57   ` David S. Miller
  2001-11-14  6:28     ` Thorsten Kukuk
@ 2001-11-14  6:31     ` David S. Miller
  1 sibling, 0 replies; 37+ messages in thread
From: David S. Miller @ 2001-11-14  6:31 UTC (permalink / raw)
  To: kukuk; +Cc: vonbrand, torvalds, linux-kernel, sparclinux

   From: Thorsten Kukuk <kukuk@suse.de>
   Date: Wed, 14 Nov 2001 07:28:52 +0100
   
   If the first one should be wrong, why not apply the second one ?
   Or I'm missing something ?
   To the first patch: Without it you will always get a kernel oops
   in this part of ioctl32.c

Please try this patch instead.  I just cleaned up all of this code.

--- ../vanilla/linux/arch/sparc64/kernel/ioctl32.c	Mon Nov 12 15:13:04 2001
+++ arch/sparc64/kernel/ioctl32.c	Tue Nov 13 22:14:45 2001
@@ -2403,6 +2421,7 @@
 	u32 pv[ABS_MAX_PV + 1];
 	u32 lv[ABS_MAX_LV + 1];
     	uint8_t vg_uuid[UUID_LEN+1];	/* volume group UUID */
+	uint8_t dummy1[200];
 } vg32_t;
 
 typedef struct {
@@ -2444,7 +2463,7 @@
 } lv_status_byindex_req32_t;
 
 typedef struct {
-	dev_t dev;
+	__kernel_dev_t32 dev;
 	u32   lv;
 } lv_status_bydev_req32_t;
 
@@ -2517,7 +2536,8 @@
 	lv_block_exception32_t *lbe32;
 	lv_block_exception_t *lbe;
 	lv32_t *ul = (lv32_t *)A(p);
-	lv_t *l = (lv_t *)kmalloc(sizeof(lv_t), GFP_KERNEL);
+	lv_t *l = (lv_t *) kmalloc(sizeof(lv_t), GFP_KERNEL);
+
 	if (!l) {
 		*errp = -ENOMEM;
 		return NULL;
@@ -2547,12 +2567,11 @@
 		if (l->lv_block_exception) {
 			lbe32 = (lv_block_exception32_t *)A(ptr2);
 			memset(lbe, 0, size);
-                       for (i = 0; i < l->lv_remap_end; i++, lbe++, lbe32++) {
-                               err |= get_user(lbe->rsector_org, &lbe32->rsector_org);
-                               err |= __get_user(lbe->rdev_org, &lbe32->rdev_org);
-                               err |= __get_user(lbe->rsector_new, &lbe32->rsector_new);
-                               err |= __get_user(lbe->rdev_new, &lbe32->rdev_new);
-
+			for (i = 0; i < l->lv_remap_end; i++, lbe++, lbe32++) {
+				err |= get_user(lbe->rsector_org, &lbe32->rsector_org);
+				err |= __get_user(lbe->rdev_org, &lbe32->rdev_org);
+				err |= __get_user(lbe->rsector_new, &lbe32->rsector_new);
+				err |= __get_user(lbe->rdev_new, &lbe32->rdev_new);
 			}
 		}
 	}
@@ -2590,7 +2609,7 @@
 
 static int do_lvm_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
-	vg_t *v;
+	vg_t *v = NULL;
 	union {
 		lv_req_t lv_req;
 		le_remap_req_t le_remap;
@@ -2608,17 +2627,22 @@
 	switch (cmd) {
 	case VG_STATUS:
 		v = kmalloc(sizeof(vg_t), GFP_KERNEL);
-		if (!v) return -ENOMEM;
+		if (!v)
+			return -ENOMEM;
 		karg = v;
 		break;
+
+	case VG_CREATE_OLD:
 	case VG_CREATE:
 		v = kmalloc(sizeof(vg_t), GFP_KERNEL);
-		if (!v) return -ENOMEM;
-		if (copy_from_user(v, (void *)arg, (long)&((vg32_t *)0)->proc) ||
-		    __get_user(v->proc, &((vg32_t *)arg)->proc)) {
+		if (!v)
+			return -ENOMEM;
+		if (copy_from_user(v, (void *)arg, (long)&((vg32_t *)0)->proc)) {
 			kfree(v);
 			return -EFAULT;
 		}
+		/* 'proc' field is unused, just NULL it out. */
+		v->proc = NULL;
 		if (copy_from_user(v->vg_uuid, ((vg32_t *)arg)->vg_uuid, UUID_LEN+1)) {
 			kfree(v);
 			return -EFAULT;
@@ -2630,39 +2654,46 @@
 			return -EPERM;
 		for (i = 0; i < v->pv_max; i++) {
 			err = __get_user(ptr, &((vg32_t *)arg)->pv[i]);
-			if (err) break;
+			if (err)
+				break;
 			if (ptr) {
 				v->pv[i] = kmalloc(sizeof(pv_t), GFP_KERNEL);
 				if (!v->pv[i]) {
 					err = -ENOMEM;
 					break;
 				}
-				err = copy_from_user(v->pv[i], (void *)A(ptr), sizeof(pv32_t) - 8 - UUID_LEN+1);
+				err = copy_from_user(v->pv[i], (void *)A(ptr),
+						     sizeof(pv32_t) - 8 - UUID_LEN+1);
 				if (err) {
 					err = -EFAULT;
 					break;
 				}
-				err = copy_from_user(v->pv[i]->pv_uuid, ((pv32_t *)A(ptr))->pv_uuid, UUID_LEN+1);
+				err = copy_from_user(v->pv[i]->pv_uuid,
+						     ((pv32_t *)A(ptr))->pv_uuid,
+						     UUID_LEN+1);
 				if (err) {
 				        err = -EFAULT;
 					break;
 				}
 
-				
-				v->pv[i]->pe = NULL; v->pv[i]->inode = NULL;
+				v->pv[i]->pe = NULL;
+				v->pv[i]->bd = NULL;
 			}
 		}
 		if (!err) {
 			for (i = 0; i < v->lv_max; i++) {
 				err = __get_user(ptr, &((vg32_t *)arg)->lv[i]);
-				if (err) break;
+				if (err)
+					break;
 				if (ptr) {
 					v->lv[i] = get_lv_t(ptr, &err);
-					if (err) break;
+					if (err)
+						break;
 				}
 			}
 		}
 		break;
+
 	case LV_CREATE:
 	case LV_EXTEND:
 	case LV_REDUCE:
@@ -2670,54 +2701,70 @@
 	case LV_RENAME:
 	case LV_STATUS_BYNAME:
 	        err = copy_from_user(&u.pv_status, arg, sizeof(u.pv_status.pv_name));
-		if (err) return -EFAULT;
+		if (err)
+			return -EFAULT;
 		if (cmd != LV_REMOVE) {
 			err = __get_user(ptr, &((lv_req32_t *)arg)->lv);
-			if (err) return err;
+			if (err)
+				return err;
 			u.lv_req.lv = get_lv_t(ptr, &err);
 		} else
 			u.lv_req.lv = NULL;
 		break;
 
-
 	case LV_STATUS_BYINDEX:
-		err = get_user(u.lv_byindex.lv_index, &((lv_status_byindex_req32_t *)arg)->lv_index);
+		err = get_user(u.lv_byindex.lv_index,
+			       &((lv_status_byindex_req32_t *)arg)->lv_index);
 		err |= __get_user(ptr, &((lv_status_byindex_req32_t *)arg)->lv);
-		if (err) return err;
+		if (err)
+			return err;
 		u.lv_byindex.lv = get_lv_t(ptr, &err);
 		break;
+
 	case LV_STATUS_BYDEV:
 	        err = get_user(u.lv_bydev.dev, &((lv_status_bydev_req32_t *)arg)->dev);
+		err |= __get_user(ptr, &((lv_status_bydev_req32_t *)arg)->lv);
+		if (err)
+			return err;
 		u.lv_bydev.lv = get_lv_t(ptr, &err);
-		if (err) return err;
-		u.lv_bydev.lv = &p;
-		p.pe = NULL; p.inode = NULL;		
-		break;		
+		break;
+
 	case VG_EXTEND:
 		err = copy_from_user(&p, (void *)arg, sizeof(pv32_t) - 8 - UUID_LEN+1);
-		if (err) return -EFAULT;
+		if (err)
+			return -EFAULT;
 		err = copy_from_user(p.pv_uuid, ((pv32_t *)arg)->pv_uuid, UUID_LEN+1);
-		if (err) return -EFAULT;
-		p.pe = NULL; p.inode = NULL;
+		if (err)
+			return -EFAULT;
+		p.pe = NULL;
+		p.bd = NULL;
 		karg = &p;
 		break;
+
 	case PV_CHANGE:
 	case PV_STATUS:
 		err = copy_from_user(&u.pv_status, arg, sizeof(u.lv_req.lv_name));
-		if (err) return -EFAULT;
+		if (err)
+			return -EFAULT;
 		err = __get_user(ptr, &((pv_status_req32_t *)arg)->pv);
-		if (err) return err;
+		if (err)
+			return err;
 		u.pv_status.pv = &p;
 		if (cmd == PV_CHANGE) {
-			err = copy_from_user(&p, (void *)A(ptr), sizeof(pv32_t) - 8 - UUID_LEN+1);
-			if (err) return -EFAULT;
-			p.pe = NULL; p.inode = NULL;
+			err = copy_from_user(&p, (void *)A(ptr),
+					     sizeof(pv32_t) - 8 - UUID_LEN+1);
+			if (err)
+				return -EFAULT;
+			p.pe = NULL;
+			p.bd = NULL;
 		}
 		break;
-	}
+	};
+
         old_fs = get_fs(); set_fs (KERNEL_DS);
         err = sys_ioctl (fd, cmd, (unsigned long)karg);
         set_fs (old_fs);
+
 	switch (cmd) {
 	case VG_STATUS:
 		if (!err) {
@@ -2730,42 +2777,60 @@
 		}
 		kfree(v);
 		break;
+
+	case VG_CREATE_OLD:
 	case VG_CREATE:
-		for (i = 0; i < v->pv_max; i++)
-			if (v->pv[i]) kfree(v->pv[i]);
-		for (i = 0; i < v->lv_max; i++)
-			if (v->lv[i]) put_lv_t(v->lv[i]);
+		for (i = 0; i < v->pv_max; i++) {
+			if (v->pv[i])
+				kfree(v->pv[i]);
+		}
+		for (i = 0; i < v->lv_max; i++) {
+			if (v->lv[i])
+				put_lv_t(v->lv[i]);
+		}
 		kfree(v);
 		break;
+
 	case LV_STATUS_BYNAME:
-		if (!err && u.lv_req.lv) err = copy_lv_t(ptr, u.lv_req.lv);
+		if (!err && u.lv_req.lv)
+			err = copy_lv_t(ptr, u.lv_req.lv);
 		/* Fall through */
+
         case LV_CREATE:
 	case LV_EXTEND:
 	case LV_REDUCE:
-		if (u.lv_req.lv) put_lv_t(u.lv_req.lv);
+		if (u.lv_req.lv)
+			put_lv_t(u.lv_req.lv);
 		break;
+
 	case LV_STATUS_BYINDEX:
 		if (u.lv_byindex.lv) {
-			if (!err) err = copy_lv_t(ptr, u.lv_byindex.lv);
+			if (!err)
+				err = copy_lv_t(ptr, u.lv_byindex.lv);
 			put_lv_t(u.lv_byindex.lv);
 		}
 		break;
+
+	case LV_STATUS_BYDEV:
+	        if (u.lv_bydev.lv) {
+			if (!err)
+				err = copy_lv_t(ptr, u.lv_bydev.lv);
+			put_lv_t(u.lv_byindex.lv);
+	        }
+	        break;
+
 	case PV_STATUS:
 		if (!err) {
 			err = copy_to_user((void *)A(ptr), &p, sizeof(pv32_t) - 8 - UUID_LEN+1);
-			if (err) return -EFAULT;
+			if (err)
+				return -EFAULT;
 			err = copy_to_user(((pv_t *)A(ptr))->pv_uuid, p.pv_uuid, UUID_LEN + 1);
-			if (err) return -EFAULT;
+			if (err)
+				return -EFAULT;
 		}
 		break;
-	case LV_STATUS_BYDEV:
-	        if (!err) {
-			if (!err) err = copy_lv_t(ptr, u.lv_bydev.lv);
-			put_lv_t(u.lv_byindex.lv);
-	        }
-	        break;
-	}
+	};
+
 	return err;
 }
 #endif
@@ -4646,6 +4713,7 @@
 HANDLE_IOCTL(SONET_GETFRSENSE, do_atm_ioctl)
 #if defined(CONFIG_BLK_DEV_LVM) || defined(CONFIG_BLK_DEV_LVM_MODULE)
 HANDLE_IOCTL(VG_STATUS, do_lvm_ioctl)
+HANDLE_IOCTL(VG_CREATE_OLD, do_lvm_ioctl)
 HANDLE_IOCTL(VG_CREATE, do_lvm_ioctl)
 HANDLE_IOCTL(VG_EXTEND, do_lvm_ioctl)
 HANDLE_IOCTL(LV_CREATE, do_lvm_ioctl)
@@ -4655,6 +4723,7 @@
 HANDLE_IOCTL(LV_RENAME, do_lvm_ioctl)
 HANDLE_IOCTL(LV_STATUS_BYNAME, do_lvm_ioctl)
 HANDLE_IOCTL(LV_STATUS_BYINDEX, do_lvm_ioctl)
+HANDLE_IOCTL(LV_STATUS_BYDEV, do_lvm_ioctl)
 HANDLE_IOCTL(PV_CHANGE, do_lvm_ioctl)
 HANDLE_IOCTL(PV_STATUS, do_lvm_ioctl)
 #endif /* LVM */

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-13 15:21   ` Thorsten Kukuk
@ 2001-11-14 12:59     ` Horst von Brand
  0 siblings, 0 replies; 37+ messages in thread
From: Horst von Brand @ 2001-11-14 12:59 UTC (permalink / raw)
  To: Thorsten Kukuk; +Cc: Kernel Mailing List, sparclinux

Thorsten Kukuk <kukuk@suse.de> said:
> On Tue, Nov 13, Horst von Brand wrote:
> 
> > On CVS as of today for sparc64 I get:
> > 
> > sparc64-linux-gcc -D__KERNEL__ -I/usr/src/linux-2.4/include -Wall -Wstrict-pr
> oto
> > types -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-commo
> n -
> > m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 -fcall-used-g5
>  -f
> > call-used-g7 -Wno-sign-compare -Wa,--undeclared-regs    -c -o ioctl32.o ioctl
> 32.
> > c
> > ioctl32.c: In function `do_lvm_ioctl':
> > ioctl32.c:2636: warning: assignment makes pointer from integer without a cast
> > ioctl32.c:2670: structure has no member named `inode'
> > ioctl32.c:2711: warning: assignment from incompatible pointer type
> > ioctl32.c:2712: structure has no member named `inode'
> > ioctl32.c:2719: structure has no member named `inode'
> > ioctl32.c:2732: structure has no member named `inode'
> > ioctl32.c:2611: warning: `v' might be used uninitialized in this function
> > make[1]: *** [ioctl32.o] Error 1
> > make[1]: Leaving directory `/usr/src/linux-2.4/arch/sparc64/kernel'
> > make: *** [_dir_arch/sparc64/kernel] Error 2
> 
> Please try the both attached patches. I'm using them with 
> 2.4.15pre1aa1 (which has the same lvm version as now 2.2.15pre4).

Whatever patches went into CVS since yesterday fixed that one (in a
different way).

Thanks!
-- 
Dr. Horst H. von Brand                Usuario #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Problem with Linux 2.4.15-pre4 on an IBM ThinkPad
  2001-11-12 19:01 Linux 2.4.15-pre4 - merge with Alan Linus Torvalds
                   ` (12 preceding siblings ...)
  2001-11-13 15:37 ` [PATCH] " Russell King
@ 2001-11-15  9:25 ` Martin Persson
  2001-11-15 11:57   ` Keith Owens
  13 siblings, 1 reply; 37+ messages in thread
From: Martin Persson @ 2001-11-15  9:25 UTC (permalink / raw)
  To: linux-kernel

Ok, I've got the thing moving after applying Linus patch. It even
solved the annoying problem I had with having to eject and insert my
Xircom-card to make it work properly with Linux after boot (I just got
the beep-boop-response when the computer tried to initialize pcmcia at
boot). It also solves the problem that the kernel panicked while
trying to mount the root after a warm reboot.

However (there's always a however), now I have other problems with my
laptop. The network comes right up and everything works just fine,
except when I try to scp files on a few Mbytes from the laptop. When I
try that, sometimes the scp just works nicely up to 99% where it
stalls, sometimes it continues after a few seconds, sometimes it
stalls infinitely (or at least for more than 10 minutes, I interrupted
it). Typical like this:

test.foo             100% |*****************************|  4222 KB    00:11    
test.bar              99% |**************************** |  3364 KB  - stalled -

I can reproduce it. Interesting enough, it only seems to appear when I
scp from the sshd on the laptop with a client on my workstation. If I
scp to the laptop from my workstation or run scp on my laptop against
the sshd on the workstation (any direction), things seems to work just
fine. This does not happen under the 2.4.9-kernel I used before (I've
double-checked).

ssh-version on the workstation is openssh-2.2.0p1-2 and on the laptop
it's pure ancient (ssh-1.2.27-5i). It never connects outside firewalls
anyway (bad excuse, I know).

Another problem I have is that the kernel doesn't seem to be able to
power down the laptop at halt. It did it just perfectly under 2.2, has
done it stocastically under 2.4.9, but 2.4.15pre4 doesn't seem able to
do it at all. My Win98 (double boot) is however quite capable to shut
down the machine. APM is set to:

CONFIG_PM=y
# CONFIG_ACPI is not set
CONFIG_APM=y
# CONFIG_APM_IGNORE_USER_SUSPEND is not set
CONFIG_APM_DO_ENABLE=y
CONFIG_APM_CPU_IDLE=y
CONFIG_APM_DISPLAY_BLANK=y
CONFIG_APM_RTC_IS_GMT=y
# CONFIG_APM_ALLOW_INTS is not set
CONFIG_APM_REAL_MODE_POWER_OFF=y

The REAL_MODE_POWER_OFF is set just as an experiment to see if it
improved things. It did not. The same setup (minus the
REAL_MODE_POWER_OFF) works so-so with the 2.4.9.

The machine is an IBM ThinkPad 570 (the one with a PII on 333 MHz),
the PCcard is a Xircom Cardbus Combicard with 10/100 TP and 56 kbit
modem and I'm using the new driver out of curiousity.

Finally, more curiousity: What is kapm-idled? I've never heard about
it before, so I got quite curious when I saw that my laptop suddenly
never were idle.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Problem with Linux 2.4.15-pre4 on an IBM ThinkPad
  2001-11-15  9:25 ` Problem with Linux 2.4.15-pre4 on an IBM ThinkPad Martin Persson
@ 2001-11-15 11:57   ` Keith Owens
  0 siblings, 0 replies; 37+ messages in thread
From: Keith Owens @ 2001-11-15 11:57 UTC (permalink / raw)
  To: Martin Persson; +Cc: linux-kernel

On 15 Nov 2001 10:25:34 +0100, 
Martin Persson <martin@cendio.se> wrote:
>However (there's always a however), now I have other problems with my
>laptop. The network comes right up and everything works just fine,
>except when I try to scp files on a few Mbytes from the laptop. When I
>try that, sometimes the scp just works nicely up to 99% where it
>stalls, sometimes it continues after a few seconds, sometimes it
>stalls infinitely (or at least for more than 10 minutes, I interrupted
>it).

I would suspect the Xircom driver (RBEM56G, right?).  I have similar
symptoms with RBEM56G in a Compaq laptop, ssh hangs during bulk
transfers and is sensitive to which direction the transfer was started.
"ifconfig eth0 -promisc" a few times will usually restart the transfer,
sometimes it takes "/etc/rc.d/init.d/pcmcia restart" to fix the
problem, then wait until TCP retransmission picks up again.

I don't believe ssh is at fault, it just causes the right set of
activity to trip the driver problem.  ifconfig eth0 -promisc reloads
CSR6 on the card and the problem goes away, without me touching the ssh
transfers.

This was on my list of problems to debug (after modutils, kdb, xfs,
kbuild 2.5, ...) but I managed to trip over the Ethernet cable and
completely broke the card.  The Realport cards are more resilient than
most PCMCIA network cards but they have their limits.


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
  2001-11-12 21:10 Linux 2.4.15-pre4 - merge with Alan Robert Cantu
@ 2001-11-13 13:20 ` Andrey Savochkin
  0 siblings, 0 replies; 37+ messages in thread
From: Andrey Savochkin @ 2001-11-13 13:20 UTC (permalink / raw)
  To: Robert Cantu; +Cc: linux-kernel

On Mon, Nov 12, 2001 at 03:10:01PM -0600, Robert Cantu wrote:
> 
>  pre4: 
> 	--snip--
>  - Andrey Savochkin/Andrew Morton: eepro100 config space save/restore over suspend 
> 	--snip--
> 
> My eepro100 mini-pci card on my laptop currently doesn't handle sleep/suspend very well
> for me and needs a reboot to work again. mii-diag output gives wierd data such as
> the MAC address set to ff:ff:ff:ff:ff:ff. Looking at the patch code, it seems that 
> pci_save_state() and pci_restore_state(), among other things, implements this. 
> Will this work with APM's suspend/sleep functions?

It has better chances to work now.

	Andrey

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: Linux 2.4.15-pre4 - merge with Alan
@ 2001-11-12 21:10 Robert Cantu
  2001-11-13 13:20 ` Andrey Savochkin
  0 siblings, 1 reply; 37+ messages in thread
From: Robert Cantu @ 2001-11-12 21:10 UTC (permalink / raw)
  To: linux-kernel


 pre4: 
	--snip--
 - Andrey Savochkin/Andrew Morton: eepro100 config space save/restore over suspend 
	--snip--

My eepro100 mini-pci card on my laptop currently doesn't handle sleep/suspend very well
for me and needs a reboot to work again. mii-diag output gives wierd data such as
the MAC address set to ff:ff:ff:ff:ff:ff. Looking at the patch code, it seems that 
pci_save_state() and pci_restore_state(), among other things, implements this. 
Will this work with APM's suspend/sleep functions?



^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2001-11-15 12:11 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-12 19:01 Linux 2.4.15-pre4 - merge with Alan Linus Torvalds
2001-11-12 19:18 ` Trever L. Adams
2001-11-13 11:14   ` Christoph Rohland
2001-11-12 19:26 ` Matthew Dharm
2001-11-12 20:09 ` Martin Dalecki
2001-11-12 20:42 ` Greg KH
2001-11-12 23:43 ` J . A . Magallon
2001-11-13  1:11   ` Alan Cox
2001-11-12 23:45 ` J . A . Magallon
2001-11-12 23:48 ` J . A . Magallon
2001-11-13  0:14   ` Christoph Hellwig
2001-11-13  0:25     ` J . A . Magallon
2001-11-13  0:42     ` J . A . Magallon
2001-11-13  7:43       ` Christoph Hellwig
2001-11-13  5:17 ` Keith Owens
2001-11-13 17:27   ` Chad N. Tindel
2001-11-13 17:58   ` Chad N. Tindel
2001-11-13  5:54 ` Neil Brown
2001-11-13  6:02   ` Jeff Garzik
2001-11-13  9:41     ` Alan Cox
2001-11-13  6:03 ` David S. Miller
2001-11-13  6:16   ` Keith Owens
2001-11-13  6:18   ` Keith Owens
2001-11-13  6:23   ` David S. Miller
2001-11-13  8:17     ` Jeff Garzik
2001-11-13 10:43 ` David S. Miller
2001-11-13 14:10 ` Horst von Brand
2001-11-13 15:21   ` Thorsten Kukuk
2001-11-14 12:59     ` Horst von Brand
2001-11-14  4:57   ` David S. Miller
2001-11-14  6:28     ` Thorsten Kukuk
2001-11-14  6:31     ` David S. Miller
2001-11-13 15:37 ` [PATCH] " Russell King
2001-11-15  9:25 ` Problem with Linux 2.4.15-pre4 on an IBM ThinkPad Martin Persson
2001-11-15 11:57   ` Keith Owens
2001-11-12 21:10 Linux 2.4.15-pre4 - merge with Alan Robert Cantu
2001-11-13 13:20 ` Andrey Savochkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).