All of lore.kernel.org
 help / color / mirror / Atom feed
* [ALSA - driver 0001826]: No line, mic, front-mic
From: bugtrack @ 2006-04-06  1:42 UTC (permalink / raw)
  To: alsa-devel


A NOTE has been added to this issue.
======================================================================
<https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1826> 
======================================================================
Reported By:                andreid1303
Assigned To:                tiwai
======================================================================
Project:                    ALSA - driver
Issue ID:                   1826
Category:                   PCI - hda-intel
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Distribution:               
Kernel Version:             
======================================================================
Date Submitted:             02-06-2006 22:35 CET
Last Modified:              04-06-2006 03:42 CEST
======================================================================
Summary:                    No line, mic, front-mic
Description: 
Line, mic, front-mic sound is dead on build-in Sigmatel 9221.
First I was not able to get it in Windows as well but found there a switch
assigning capture input then rised capture level and it is working now.
I tried to do the same via alsamixer but with no result.
======================================================================

----------------------------------------------------------------------
 mate - 04-06-06 03:42 
----------------------------------------------------------------------
I have same problem too (I tried the latest cvs version from 6. Apr.
2006).
Please fix this issue or if somebody have any idea please send me about
it.
Thanx.

Issue History
Date Modified  Username       Field                    Change              
======================================================================
02-06-06 22:35 andreid1303    New Issue                                    
02-07-06 09:23 hweigel        Issue Monitored: hweigel                     
04-06-06 03:42 mate           Note Added: 0009122                          
======================================================================




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

^ permalink raw reply

* Re: 2.6.17-rc1-mm1
From: Antonino A. Daplas @ 2006-04-06  1:49 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: Luck, Tony, Zou Nan hai, Andrew Morton, LKML, linux-ia64
In-Reply-To: <200604051601.08776.bjorn.helgaas@hp.com>

Bjorn Helgaas wrote:
> On Wednesday 05 April 2006 15:17, Luck, Tony wrote:
>> On Wed, Apr 05, 2006 at 10:15:34AM -0600, Bjorn Helgaas wrote:

> [PATCH] vgacon: make VGA_MAP_MEM take size, remove extra use
> 
> VGA_MAP_MEM translates to ioremap() on some architectures.  It
> makes sense to do this to vga_vram_base, because we're going to
> access memory between vga_vram_base and vga_vram_end.
> 
> But it doesn't really make sense to map starting at vga_vram_end,
> because we aren't going to access memory starting there.  On ia64,
> which always has to be different, ioremapping vga_vram_end gives
> you something completely incompatible with ioremapped vga_vram_start,
> so vga_vram_size ends up being nonsense.
> 
> As a bonus, we often know the size up front, so we can use ioremap()
> correctly, rather than giving it a zero size.

I definitely prefer this patch.

> 
> Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Antonino Daplas <adaplas@pol.net>

Tony

^ permalink raw reply

* Re: 2.6.17-rc1-mm1
From: Antonino A. Daplas @ 2006-04-06  1:49 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: Luck, Tony, Zou Nan hai, Andrew Morton, LKML, linux-ia64
In-Reply-To: <200604051601.08776.bjorn.helgaas@hp.com>

Bjorn Helgaas wrote:
> On Wednesday 05 April 2006 15:17, Luck, Tony wrote:
>> On Wed, Apr 05, 2006 at 10:15:34AM -0600, Bjorn Helgaas wrote:

> [PATCH] vgacon: make VGA_MAP_MEM take size, remove extra use
> 
> VGA_MAP_MEM translates to ioremap() on some architectures.  It
> makes sense to do this to vga_vram_base, because we're going to
> access memory between vga_vram_base and vga_vram_end.
> 
> But it doesn't really make sense to map starting at vga_vram_end,
> because we aren't going to access memory starting there.  On ia64,
> which always has to be different, ioremapping vga_vram_end gives
> you something completely incompatible with ioremapped vga_vram_start,
> so vga_vram_size ends up being nonsense.
> 
> As a bonus, we often know the size up front, so we can use ioremap()
> correctly, rather than giving it a zero size.

I definitely prefer this patch.

> 
> Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-by: Antonino Daplas <adaplas@pol.net>

Tony

^ permalink raw reply

* Re: readers-writers mutex
From: Joshua Hudson @ 2006-04-06  1:59 UTC (permalink / raw)
  To: linux-kernel
In-Reply-To: <1144285616.3023.3.camel@laptopd505.fenrus.org>

On 4/5/06, Arjan van de Ven <arjan@infradead.org> wrote:
> On Wed, 2006-04-05 at 15:21 -0700, Joshua Hudson wrote:
> > Since we are moving from semaphores to mutex, there should be a
> > mutex_rw.
>
> should there really? We discussed this briefly during the mutex work
> the conclusion was that rw_sems
> 1) are rare (thankfully; they're highly expensive)
> 2) do not have mutex semantics
>
> so... can you explain how your rw_mutex is behaving different from an
> rw_sem, and can you explain what the gains are for that conversion?
> (eg for mutex it was better defined semantics, lots better debugging
> (possible due to the semantics) and more performance). What is that for
> rw_mutex ?
>
Just this: it inherits the better debugging from mutex. And if a
rw_sem is more expensive than two mutexes, this is cheaper where
it can be used (no ability to downconvert a lock).

Oh, and if nobody uses it, kernel size changes by 0k.

^ permalink raw reply

* [U-Boot-Users] Problem with SystemACE cmd_ace.c patch of 7 Aug 2005
From: Stephen Williams @ 2006-04-06  2:04 UTC (permalink / raw)
  To: u-boot

I have a problem with some changes you (Jeff) did in u-boot related
to compact flash. Can you help me understand why you put this:

+           /* Reset the configruation controller */
+           val = ace_readw(0x18);
+           val|=0x0080;
+           ace_writew(val, 0x18);
+

into the systemace_read function? This is causing me grief, with
the linux SystemACE indicating an error:

 JTAG controller couldn't read configuration from the CompactFlash

while booting Linux with a ext3 partition on the SystemACE CF.
When I comment those lines out of cmd_ace.c, my boot starts to
work again.

I suspect this "reset" of the config portion of the systemace
is causing the SystemACE to start trying again to configure
when the reset is released at the end of a block read. I would
so like to remove that little snippet of code, but if you had
a positive reason why it should be there, we need to negotiate.

-- 
Steve Williams                "The woods are lovely, dark and deep.
steve at icarus.com           But I have promises to keep,
http://www.icarus.com         and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."

^ permalink raw reply

* Re: libata machine check on Alpha
From: Albert Lee @ 2006-04-06  2:04 UTC (permalink / raw)
  To: Carlos Pardo; +Cc: Tejun Heo, Jonathan Blake Benson, linux-ide, Jeff Garzik
In-Reply-To: <2E9B8131C44AF746B1E06BF9B15A434B045D8198@mail.siliconimage.com>

Carlos Pardo wrote:
> The 3611 bridge does not support the ATAPI DMA direction bit in hardware.(software support only)  
> 
> The 3811 bridge supports ATAPI DMA direction bit in both software and hardware.
> 
> The 646 chip is ancient and he should upgrade.  The behavior of this device is unknown since this part was EOL'd years ago.
> 
> 

Hi Carlos,

Does this mean that only the 3611 bridge needs the DMA_DIR bit set by host software, while 3811
can detect the ATAPI DMA direction by hardware and doesn't need the DMA_DIR bit?
(I guess that 3811 detects the direction by looking into the SCSI CDB. If the SCSI command is
unknown to it, 3811 still needs the DMA_DIR bit set by software.)
Is there anyway that we could detect whether the DMA_DIR needs to be set by host software?
Is there anyway that we could detect whether the bridge is a 3611 or a 3811 chip automatically?

Per Jeff's comment, there is a document on t13 (http://www.t13.org/docs2003/e03131r0.pdf).
The documents reads:
"Eg. – Word 50, bit 13: Set to 1 for devices that support DMAIN bit in Features Register for Packet Command".
However, this looks more for the ATAPI device than for the bridge?
Also it looks not a t13 standard yet?
Can we use this word 50 to identify 3611/3811?

Thanks,

Albert


^ permalink raw reply

* [ALSA 1/2] continue on IS_ERR from platform device registration
From: Rene Herman @ 2006-04-06  2:08 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: ALSA devel, Linux Kernel

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

Rene Herman wrote:

> Yes. I don't see a significantly cleaner solution then than the
> slightly hackish "using drvdata as a private success flag" that I
> posted before. Example patch versus snd_adlib attached again. This
> seems to work well.
> 
> Takashi: do you agree? If the probe() method return is not going to
> be propagated up, there are few other options.
> 
> (Continuing the loop on IS_ERR(device) is then also a bit
> questionable again as the IS_ERR then signifies an eror in the bowels
> of the device model, but I feel it's still the correct thing to do)

If you do agree, here's both patches generated against 2.6.17-rc1-mm1.
First, the continue on IS_ERR one again.

   ad1848/ad1848.c       |   14 ++++----------
   cmi8330.c             |   14 ++++----------
   cs423x/cs4231.c       |   14 ++++----------
   cs423x/cs4236.c       |   14 ++++----------
   es1688/es1688.c       |   14 ++++----------
   es18xx.c              |   14 ++++----------
   gus/gusclassic.c      |   14 ++++----------
   gus/gusextreme.c      |   14 ++++----------
   gus/gusmax.c          |   14 ++++----------
   gus/interwave.c       |   14 ++++----------
   opl3sa2.c             |   14 ++++----------
   sb/sb16.c             |   14 ++++----------
   sb/sb8.c              |   14 ++++----------
   sgalaxy.c             |   14 ++++----------
   sscape.c              |   14 ++++----------
   wavefront/wavefront.c |   14 ++++----------
   16 files changed, 64 insertions(+), 160 deletions(-)

Rene.



[-- Attachment #2: alsa_platform_iserr.diff --]
[-- Type: text/plain, Size: 14844 bytes --]

Index: mm/sound/isa/ad1848/ad1848.c
===================================================================
--- mm.orig/sound/isa/ad1848/ad1848.c	2006-04-06 02:16:26.000000000 +0200
+++ mm/sound/isa/ad1848/ad1848.c	2006-04-06 02:45:56.000000000 +0200
@@ -193,10 +193,8 @@ static int __init alsa_card_ad1848_init(
 			continue;
 		device = platform_device_register_simple(SND_AD1848_DRIVER,
 							 i, NULL, 0);
-		if (IS_ERR(device)) {
-			err = PTR_ERR(device);
-			goto errout;
-		}
+		if (IS_ERR(device))
+			continue;
 		devices[i] = device;
 		cards++;
 	}
@@ -204,14 +202,10 @@ static int __init alsa_card_ad1848_init(
 #ifdef MODULE
 		printk(KERN_ERR "AD1848 soundcard not found or device busy\n");
 #endif
-		err = -ENODEV;
-		goto errout;
+		snd_ad1848_unregister_all();
+		return -ENODEV;
 	}
 	return 0;
-
- errout:
-	snd_ad1848_unregister_all();
-	return err;
 }
 
 static void __exit alsa_card_ad1848_exit(void)
Index: mm/sound/isa/cmi8330.c
===================================================================
--- mm.orig/sound/isa/cmi8330.c	2006-04-06 02:16:26.000000000 +0200
+++ mm/sound/isa/cmi8330.c	2006-04-06 02:45:56.000000000 +0200
@@ -699,10 +699,8 @@ static int __init alsa_card_cmi8330_init
 			continue;
 		device = platform_device_register_simple(CMI8330_DRIVER,
 							 i, NULL, 0);
-		if (IS_ERR(device)) {
-			err = PTR_ERR(device);
-			goto errout;
-		}
+		if (IS_ERR(device))
+			continue;
 		platform_devices[i] = device;
 		cards++;
 	}
@@ -719,14 +717,10 @@ static int __init alsa_card_cmi8330_init
 #ifdef MODULE
 		snd_printk(KERN_ERR "CMI8330 not found or device busy\n");
 #endif
-		err = -ENODEV;
-		goto errout;
+		snd_cmi8330_unregister_all();
+		return -ENODEV;
 	}
 	return 0;
-
- errout:
-	snd_cmi8330_unregister_all();
-	return err;
 }
 
 static void __exit alsa_card_cmi8330_exit(void)
Index: mm/sound/isa/cs423x/cs4231.c
===================================================================
--- mm.orig/sound/isa/cs423x/cs4231.c	2006-04-06 02:16:26.000000000 +0200
+++ mm/sound/isa/cs423x/cs4231.c	2006-04-06 02:45:56.000000000 +0200
@@ -209,10 +209,8 @@ static int __init alsa_card_cs4231_init(
 			continue;
 		device = platform_device_register_simple(SND_CS4231_DRIVER,
 							 i, NULL, 0);
-		if (IS_ERR(device)) {
-			err = PTR_ERR(device);
-			goto errout;
-		}
+		if (IS_ERR(device))
+			continue;
 		devices[i] = device;
 		cards++;
 	}
@@ -220,14 +218,10 @@ static int __init alsa_card_cs4231_init(
 #ifdef MODULE
 		printk(KERN_ERR "CS4231 soundcard not found or device busy\n");
 #endif
-		err = -ENODEV;
-		goto errout;
+		snd_cs4231_unregister_all();
+		return -ENODEV;
 	}
 	return 0;
-
- errout:
-	snd_cs4231_unregister_all();
-	return err;
 }
 
 static void __exit alsa_card_cs4231_exit(void)
Index: mm/sound/isa/cs423x/cs4236.c
===================================================================
--- mm.orig/sound/isa/cs423x/cs4236.c	2006-04-06 02:16:26.000000000 +0200
+++ mm/sound/isa/cs423x/cs4236.c	2006-04-06 02:45:56.000000000 +0200
@@ -780,10 +780,8 @@ static int __init alsa_card_cs423x_init(
 			continue;
 		device = platform_device_register_simple(CS423X_DRIVER,
 							 i, NULL, 0);
-		if (IS_ERR(device)) {
-			err = PTR_ERR(device);
-			goto errout;
-		}
+		if (IS_ERR(device))
+			continue;
 		platform_devices[i] = device;
 		snd_cs423x_devices++;
 	}
@@ -802,14 +800,10 @@ static int __init alsa_card_cs423x_init(
 #ifdef MODULE
 		printk(KERN_ERR IDENT " soundcard not found or device busy\n");
 #endif
-		err = -ENODEV;
-		goto errout;
+		snd_cs423x_unregister_all();
+		return -ENODEV;
 	}
 	return 0;
-
- errout:
-	snd_cs423x_unregister_all();
-	return err;
 }
 
 static void __exit alsa_card_cs423x_exit(void)
Index: mm/sound/isa/es1688/es1688.c
===================================================================
--- mm.orig/sound/isa/es1688/es1688.c	2006-04-06 02:16:26.000000000 +0200
+++ mm/sound/isa/es1688/es1688.c	2006-04-06 02:45:56.000000000 +0200
@@ -213,10 +213,8 @@ static int __init alsa_card_es1688_init(
 			continue;
 		device = platform_device_register_simple(ES1688_DRIVER,
 							 i, NULL, 0);
-		if (IS_ERR(device)) {
-			err = PTR_ERR(device);
-			goto errout;
-		}
+		if (IS_ERR(device))
+			continue;
 		devices[i] = device;
 		cards++;
 	}
@@ -224,14 +222,10 @@ static int __init alsa_card_es1688_init(
 #ifdef MODULE
 		printk(KERN_ERR "ESS AudioDrive ES1688 soundcard not found or device busy\n");
 #endif
-		err = -ENODEV;
-		goto errout;
+		snd_es1688_unregister_all();
+		return -ENODEV;
 	}
 	return 0;
-
- errout:
-	snd_es1688_unregister_all();
-	return err;
 }
 
 static void __exit alsa_card_es1688_exit(void)
Index: mm/sound/isa/gus/gusclassic.c
===================================================================
--- mm.orig/sound/isa/gus/gusclassic.c	2006-04-06 02:16:26.000000000 +0200
+++ mm/sound/isa/gus/gusclassic.c	2006-04-06 02:45:56.000000000 +0200
@@ -253,10 +253,8 @@ static int __init alsa_card_gusclassic_i
 			continue;
 		device = platform_device_register_simple(GUSCLASSIC_DRIVER,
 							 i, NULL, 0);
-		if (IS_ERR(device)) {
-			err = PTR_ERR(device);
-			goto errout;
-		}
+		if (IS_ERR(device))
+			continue;
 		devices[i] = device;
 		cards++;
 	}
@@ -264,14 +262,10 @@ static int __init alsa_card_gusclassic_i
 #ifdef MODULE
 		printk(KERN_ERR "GUS Classic soundcard not found or device busy\n");
 #endif
-		err = -ENODEV;
-		goto errout;
+		snd_gusclassic_unregister_all();
+		return -ENODEV;
 	}
 	return 0;
-
- errout:
-	snd_gusclassic_unregister_all();
-	return err;
 }
 
 static void __exit alsa_card_gusclassic_exit(void)
Index: mm/sound/isa/gus/gusextreme.c
===================================================================
--- mm.orig/sound/isa/gus/gusextreme.c	2006-04-06 02:16:26.000000000 +0200
+++ mm/sound/isa/gus/gusextreme.c	2006-04-06 02:45:56.000000000 +0200
@@ -363,10 +363,8 @@ static int __init alsa_card_gusextreme_i
 			continue;
 		device = platform_device_register_simple(GUSEXTREME_DRIVER,
 							 i, NULL, 0);
-		if (IS_ERR(device)) {
-			err = PTR_ERR(device);
-			goto errout;
-		}
+		if (IS_ERR(device))
+			continue;
 		devices[i] = device;
 		cards++;
 	}
@@ -374,14 +372,10 @@ static int __init alsa_card_gusextreme_i
 #ifdef MODULE
 		printk(KERN_ERR "GUS Extreme soundcard not found or device busy\n");
 #endif
-		err = -ENODEV;
-		goto errout;
+		snd_gusextreme_unregister_all();
+		return -ENODEV;
 	}
 	return 0;
-
- errout:
-	snd_gusextreme_unregister_all();
-	return err;
 }
 
 static void __exit alsa_card_gusextreme_exit(void)
Index: mm/sound/isa/gus/gusmax.c
===================================================================
--- mm.orig/sound/isa/gus/gusmax.c	2006-04-06 02:16:26.000000000 +0200
+++ mm/sound/isa/gus/gusmax.c	2006-04-06 02:45:56.000000000 +0200
@@ -390,10 +390,8 @@ static int __init alsa_card_gusmax_init(
 			continue;
 		device = platform_device_register_simple(GUSMAX_DRIVER,
 							 i, NULL, 0);
-		if (IS_ERR(device)) {
-			err = PTR_ERR(device);
-			goto errout;
-		}
+		if (IS_ERR(device))
+			continue;
 		devices[i] = device;
 		cards++;
 	}
@@ -401,14 +399,10 @@ static int __init alsa_card_gusmax_init(
 #ifdef MODULE
 		printk(KERN_ERR "GUS MAX soundcard not found or device busy\n");
 #endif
-		err = -ENODEV;
-		goto errout;
+		snd_gusmax_unregister_all();
+		return -ENODEV;
 	}
 	return 0;
-
- errout:
-	snd_gusmax_unregister_all();
-	return err;
 }
 
 static void __exit alsa_card_gusmax_exit(void)
Index: mm/sound/isa/gus/interwave.c
===================================================================
--- mm.orig/sound/isa/gus/interwave.c	2006-04-06 02:16:26.000000000 +0200
+++ mm/sound/isa/gus/interwave.c	2006-04-06 02:45:56.000000000 +0200
@@ -947,10 +947,8 @@ static int __init alsa_card_interwave_in
 #endif
 		device = platform_device_register_simple(INTERWAVE_DRIVER,
 							 i, NULL, 0);
-		if (IS_ERR(device)) {
-			err = PTR_ERR(device);
-			goto errout;
-		}
+		if (IS_ERR(device))
+			continue;
 		platform_devices[i] = device;
 		cards++;
 	}
@@ -966,14 +964,10 @@ static int __init alsa_card_interwave_in
 #ifdef MODULE
 		printk(KERN_ERR "InterWave soundcard not found or device busy\n");
 #endif
-		err = -ENODEV;
-		goto errout;
+		snd_interwave_unregister_all();
+		return -ENODEV;
 	}
 	return 0;
-
- errout:
-	snd_interwave_unregister_all();
-	return err;
 }
 
 static void __exit alsa_card_interwave_exit(void)
Index: mm/sound/isa/opl3sa2.c
===================================================================
--- mm.orig/sound/isa/opl3sa2.c	2006-04-06 02:16:26.000000000 +0200
+++ mm/sound/isa/opl3sa2.c	2006-04-06 02:45:56.000000000 +0200
@@ -962,10 +962,8 @@ static int __init alsa_card_opl3sa2_init
 #endif
 		device = platform_device_register_simple(OPL3SA2_DRIVER,
 							 i, NULL, 0);
-		if (IS_ERR(device)) {
-			err = PTR_ERR(device);
-			goto errout;
-		}
+		if (IS_ERR(device))
+			continue;
 		platform_devices[i] = device;
 		snd_opl3sa2_devices++;
 	}
@@ -983,14 +981,10 @@ static int __init alsa_card_opl3sa2_init
 #ifdef MODULE
 		snd_printk(KERN_ERR "Yamaha OPL3-SA soundcard not found or device busy\n");
 #endif
-		err = -ENODEV;
-		goto errout;
+		snd_opl3sa2_unregister_all();
+		return -ENODEV;
 	}
 	return 0;
-
- errout:
-	snd_opl3sa2_unregister_all();
-	return err;
 }
 
 static void __exit alsa_card_opl3sa2_exit(void)
Index: mm/sound/isa/sb/sb16.c
===================================================================
--- mm.orig/sound/isa/sb/sb16.c	2006-04-06 02:16:26.000000000 +0200
+++ mm/sound/isa/sb/sb16.c	2006-04-06 02:45:56.000000000 +0200
@@ -721,10 +721,8 @@ static int __init alsa_card_sb16_init(vo
 			continue;
 		device = platform_device_register_simple(SND_SB16_DRIVER,
 							 i, NULL, 0);
-		if (IS_ERR(device)) {
-			err = PTR_ERR(device);
-			goto errout;
-		}
+		if (IS_ERR(device))
+			continue;
 		platform_devices[i] = device;
 		cards++;
 	}
@@ -746,14 +744,10 @@ static int __init alsa_card_sb16_init(vo
 		snd_printk(KERN_ERR "In case, if you have AWE card, try snd-sbawe module\n");
 #endif
 #endif
-		err = -ENODEV;
-		goto errout;
+		snd_sb16_unregister_all();
+		return -ENODEV;
 	}
 	return 0;
-
- errout:
-	snd_sb16_unregister_all();
-	return err;
 }
 
 static void __exit alsa_card_sb16_exit(void)
Index: mm/sound/isa/sb/sb8.c
===================================================================
--- mm.orig/sound/isa/sb/sb8.c	2006-04-06 02:16:26.000000000 +0200
+++ mm/sound/isa/sb/sb8.c	2006-04-06 02:45:56.000000000 +0200
@@ -264,10 +264,8 @@ static int __init alsa_card_sb8_init(voi
 			continue;
 		device = platform_device_register_simple(SND_SB8_DRIVER,
 							 i, NULL, 0);
-		if (IS_ERR(device)) {
-			err = PTR_ERR(device);
-			goto errout;
-		}
+		if (IS_ERR(device))
+			continue;
 		devices[i] = device;
 		cards++;
 	}
@@ -275,14 +273,10 @@ static int __init alsa_card_sb8_init(voi
 #ifdef MODULE
 		snd_printk(KERN_ERR "Sound Blaster soundcard not found or device busy\n");
 #endif
-		err = -ENODEV;
-		goto errout;
+		snd_sb8_unregister_all();
+		return -ENODEV;
 	}
 	return 0;
-
- errout:
-	snd_sb8_unregister_all();
-	return err;
 }
 
 static void __exit alsa_card_sb8_exit(void)
Index: mm/sound/isa/sgalaxy.c
===================================================================
--- mm.orig/sound/isa/sgalaxy.c	2006-04-06 02:16:26.000000000 +0200
+++ mm/sound/isa/sgalaxy.c	2006-04-06 02:45:56.000000000 +0200
@@ -366,10 +366,8 @@ static int __init alsa_card_sgalaxy_init
 			continue;
 		device = platform_device_register_simple(SND_SGALAXY_DRIVER,
 							 i, NULL, 0);
-		if (IS_ERR(device)) {
-			err = PTR_ERR(device);
-			goto errout;
-		}
+		if (IS_ERR(device))
+			continue;
 		devices[i] = device;
 		cards++;
 	}
@@ -377,14 +375,10 @@ static int __init alsa_card_sgalaxy_init
 #ifdef MODULE
 		snd_printk(KERN_ERR "Sound Galaxy soundcard not found or device busy\n");
 #endif
-		err = -ENODEV;
-		goto errout;
+		snd_sgalaxy_unregister_all();
+		return -ENODEV;
 	}
 	return 0;
-
- errout:
-	snd_sgalaxy_unregister_all();
-	return err;
 }
 
 static void __exit alsa_card_sgalaxy_exit(void)
Index: mm/sound/isa/wavefront/wavefront.c
===================================================================
--- mm.orig/sound/isa/wavefront/wavefront.c	2006-04-06 02:16:26.000000000 +0200
+++ mm/sound/isa/wavefront/wavefront.c	2006-04-06 02:45:56.000000000 +0200
@@ -722,10 +722,8 @@ static int __init alsa_card_wavefront_in
 #endif
 		device = platform_device_register_simple(WAVEFRONT_DRIVER,
 							 i, NULL, 0);
-		if (IS_ERR(device)) {
-			err = PTR_ERR(device);
-			goto errout;
-		}
+		if (IS_ERR(device))
+			continue;
 		platform_devices[i] = device;
 		cards++;
 	}
@@ -742,14 +740,10 @@ static int __init alsa_card_wavefront_in
 #ifdef MODULE
 		printk (KERN_ERR "No WaveFront cards found or devices busy\n");
 #endif
-		err = -ENODEV;
-		goto errout;
+		snd_wavefront_unregister_all();
+		return -ENODEV;
 	}
 	return 0;
-
- errout:
-	snd_wavefront_unregister_all();
-	return err;
 }
 
 static void __exit alsa_card_wavefront_exit(void)
Index: mm/sound/isa/es18xx.c
===================================================================
--- mm.orig/sound/isa/es18xx.c	2006-04-06 02:28:33.000000000 +0200
+++ mm/sound/isa/es18xx.c	2006-04-06 02:45:56.000000000 +0200
@@ -2392,10 +2392,8 @@ static int __init alsa_card_es18xx_init(
 			continue;
 		device = platform_device_register_simple(ES18XX_DRIVER,
 							 i, NULL, 0);
-		if (IS_ERR(device)) {
-			err = PTR_ERR(device);
-			goto errout;
-		}
+		if (IS_ERR(device))
+	       		continue;
 		platform_devices[i] = device;
 		cards++;
 	}
@@ -2412,14 +2410,10 @@ static int __init alsa_card_es18xx_init(
 #ifdef MODULE
 		snd_printk(KERN_ERR "ESS AudioDrive ES18xx soundcard not found or device busy\n");
 #endif
-		err = -ENODEV;
-		goto errout;
+		snd_es18xx_unregister_all();
+		return -ENODEV;
 	}
 	return 0;
-
- errout:
-	snd_es18xx_unregister_all();
-	return err;
 }
 
 static void __exit alsa_card_es18xx_exit(void)
Index: mm/sound/isa/sscape.c
===================================================================
--- mm.orig/sound/isa/sscape.c	2006-04-06 02:08:30.000000000 +0200
+++ mm/sound/isa/sscape.c	2006-04-06 02:52:33.000000000 +0200
@@ -1427,8 +1427,8 @@ static int __init sscape_manual_probe(vo
 		    dma[i] == SNDRV_AUTO_DMA) {
 			printk(KERN_INFO
 			       "sscape: insufficient parameters, need IO, IRQ, MPU-IRQ and DMA\n");
-			ret = -ENXIO;
-			goto errout;
+			sscape_unregister_all();
+			return -ENXIO;
 		}
 
 		/*
@@ -1436,17 +1436,11 @@ static int __init sscape_manual_probe(vo
 		 */
 		device = platform_device_register_simple(SSCAPE_DRIVER,
 							 i, NULL, 0);
-		if (IS_ERR(device)) {
-			ret = PTR_ERR(device);
-			goto errout;
-		}
+		if (IS_ERR(device))
+			continue;
 		platform_devices[i] = device;
 	}
 	return 0;
-
- errout:
-	sscape_unregister_all();
-	return ret;
 }
 
 static void sscape_exit(void)


^ permalink raw reply

* [ALSA 2/2] unregister platform device again if probe was unsuccessful
From: Rene Herman @ 2006-04-06  2:08 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: ALSA devel, Linux Kernel

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

Rene Herman wrote:

> Yes. I don't see a significantly cleaner solution then than the 
> slightly hackish "using drvdata as a private success flag" that I 
> posted before. Example patch versus snd_adlib attached again. This 
> seems to work well.
> 
> Takashi: do you agree? If the probe() method return is not going to 
> be propagated up, there are few other options.
> 
> (Continuing the loop on IS_ERR(device) is then also a bit 
> questionable again as the IS_ERR then signifies an eror in the bowels
>  of the device model, but I feel it's still the correct thing to do)

And here's the one doing the unregisters. This one could also go to
stable, if you agree with the method...

I've been testing with snd_adlib, and everything seems to be working as
planned, also with the bus_add_device() patch reverted. Ie, not having
the hardware present (at the supplied adress) makes it fail to load, and

echo -n snd_adlib.0 >/sys/bus/platform/drivers/snd_adlib/{un,}bind

makes the driver unbind and bind correctly.

     ad1848/ad1848.c          |    4 ++++
     adlib.c                  |   11 +++++++----
     cmi8330.c                |    4 ++++
     cs423x/cs4231.c          |    4 ++++
     cs423x/cs4236.c          |    4 ++++
     es1688/es1688.c          |    4 ++++
     es18xx.c                 |    4 ++++
     gus/gusclassic.c         |    4 ++++
     gus/gusextreme.c         |    4 ++++
     gus/gusmax.c             |    4 ++++
     gus/interwave.c          |    4 ++++
     opl3sa2.c                |    4 ++++
     opti9xx/miro.c           |    7 +++++--
     opti9xx/opti92x-ad1848.c |    7 +++++--
     sb/sb16.c                |    4 ++++
     sb/sb8.c                 |    4 ++++
     sgalaxy.c                |    4 ++++
     sscape.c                 |    4 ++++
     wavefront/wavefront.c    |    4 ++++
     19 files changed, 81 insertions(+), 8 deletions(-)

Rene





[-- Attachment #2: alsa_platform_unregister.diff --]
[-- Type: text/plain, Size: 10531 bytes --]

Index: mm/sound/isa/ad1848/ad1848.c
===================================================================
--- mm.orig/sound/isa/ad1848/ad1848.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/ad1848/ad1848.c	2006-04-06 02:55:05.000000000 +0200
@@ -195,6 +195,10 @@ static int __init alsa_card_ad1848_init(
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/cmi8330.c
===================================================================
--- mm.orig/sound/isa/cmi8330.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/cmi8330.c	2006-04-06 02:55:05.000000000 +0200
@@ -701,6 +701,10 @@ static int __init alsa_card_cmi8330_init
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		platform_devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/cs423x/cs4231.c
===================================================================
--- mm.orig/sound/isa/cs423x/cs4231.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/cs423x/cs4231.c	2006-04-06 02:55:05.000000000 +0200
@@ -211,6 +211,10 @@ static int __init alsa_card_cs4231_init(
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/cs423x/cs4236.c
===================================================================
--- mm.orig/sound/isa/cs423x/cs4236.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/cs423x/cs4236.c	2006-04-06 02:55:05.000000000 +0200
@@ -782,6 +782,10 @@ static int __init alsa_card_cs423x_init(
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		platform_devices[i] = device;
 		snd_cs423x_devices++;
 	}
Index: mm/sound/isa/es1688/es1688.c
===================================================================
--- mm.orig/sound/isa/es1688/es1688.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/es1688/es1688.c	2006-04-06 02:55:05.000000000 +0200
@@ -215,6 +215,10 @@ static int __init alsa_card_es1688_init(
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/gus/gusclassic.c
===================================================================
--- mm.orig/sound/isa/gus/gusclassic.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/gus/gusclassic.c	2006-04-06 02:55:05.000000000 +0200
@@ -255,6 +255,10 @@ static int __init alsa_card_gusclassic_i
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/gus/gusextreme.c
===================================================================
--- mm.orig/sound/isa/gus/gusextreme.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/gus/gusextreme.c	2006-04-06 02:55:05.000000000 +0200
@@ -365,6 +365,10 @@ static int __init alsa_card_gusextreme_i
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/gus/gusmax.c
===================================================================
--- mm.orig/sound/isa/gus/gusmax.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/gus/gusmax.c	2006-04-06 02:55:05.000000000 +0200
@@ -392,6 +392,10 @@ static int __init alsa_card_gusmax_init(
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/gus/interwave.c
===================================================================
--- mm.orig/sound/isa/gus/interwave.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/gus/interwave.c	2006-04-06 02:55:05.000000000 +0200
@@ -949,6 +949,10 @@ static int __init alsa_card_interwave_in
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		platform_devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/opl3sa2.c
===================================================================
--- mm.orig/sound/isa/opl3sa2.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/opl3sa2.c	2006-04-06 02:55:05.000000000 +0200
@@ -964,6 +964,10 @@ static int __init alsa_card_opl3sa2_init
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		platform_devices[i] = device;
 		snd_opl3sa2_devices++;
 	}
Index: mm/sound/isa/sb/sb16.c
===================================================================
--- mm.orig/sound/isa/sb/sb16.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/sb/sb16.c	2006-04-06 02:55:05.000000000 +0200
@@ -723,6 +723,10 @@ static int __init alsa_card_sb16_init(vo
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		platform_devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/sb/sb8.c
===================================================================
--- mm.orig/sound/isa/sb/sb8.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/sb/sb8.c	2006-04-06 02:55:05.000000000 +0200
@@ -266,6 +266,10 @@ static int __init alsa_card_sb8_init(voi
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/sgalaxy.c
===================================================================
--- mm.orig/sound/isa/sgalaxy.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/sgalaxy.c	2006-04-06 02:55:05.000000000 +0200
@@ -368,6 +368,10 @@ static int __init alsa_card_sgalaxy_init
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/wavefront/wavefront.c
===================================================================
--- mm.orig/sound/isa/wavefront/wavefront.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/wavefront/wavefront.c	2006-04-06 02:55:05.000000000 +0200
@@ -724,6 +724,10 @@ static int __init alsa_card_wavefront_in
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		platform_devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/adlib.c
===================================================================
--- mm.orig/sound/isa/adlib.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/adlib.c	2006-04-06 02:55:05.000000000 +0200
@@ -43,8 +43,7 @@ static int __devinit snd_adlib_probe(str
 	struct snd_card *card;
 	struct snd_opl3 *opl3;
 
-	int error;
-	int i = device->id;
+	int error, i = device->id;
 
 	if (port[i] == SNDRV_AUTO_PORT) {
 		snd_printk(KERN_ERR DRV_NAME ": please specify port\n");
@@ -95,8 +94,7 @@ static int __devinit snd_adlib_probe(str
 	return 0;
 
 out1:	snd_card_free(card);
- out0:	error = -EINVAL; /* FIXME: should be the original error code */
-	return error;
+out0:	return error;
 }
 
 static int __devexit snd_adlib_remove(struct platform_device *device)
@@ -134,6 +132,11 @@ static int __init alsa_card_adlib_init(v
 		if (IS_ERR(device))
 			continue;
 
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
+
 		devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/es18xx.c
===================================================================
--- mm.orig/sound/isa/es18xx.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/es18xx.c	2006-04-06 02:55:05.000000000 +0200
@@ -2394,6 +2394,10 @@ static int __init alsa_card_es18xx_init(
 							 i, NULL, 0);
 		if (IS_ERR(device))
 	       		continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		platform_devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/opti9xx/miro.c
===================================================================
--- mm.orig/sound/isa/opti9xx/miro.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/opti9xx/miro.c	2006-04-06 02:55:05.000000000 +0200
@@ -1436,8 +1436,11 @@ static int __init alsa_card_miro_init(vo
 	if ((error = platform_driver_register(&snd_miro_driver)) < 0)
 		return error;
 	device = platform_device_register_simple(DRIVER_NAME, -1, NULL, 0);
-	if (! IS_ERR(device))
-		return 0;
+	if (! IS_ERR(device)) {
+		if (platform_get_drvdata(device))
+			return 0;
+		platform_device_unregister(device);
+	}
 #ifdef MODULE
 	printk(KERN_ERR "no miro soundcard found\n");
 #endif
Index: mm/sound/isa/opti9xx/opti92x-ad1848.c
===================================================================
--- mm.orig/sound/isa/opti9xx/opti92x-ad1848.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/opti9xx/opti92x-ad1848.c	2006-04-06 02:55:05.000000000 +0200
@@ -2099,8 +2099,11 @@ static int __init alsa_card_opti9xx_init
 			return error;
 		device = platform_device_register_simple(DRIVER_NAME, -1, NULL, 0);
 		if (!IS_ERR(device)) {
-			snd_opti9xx_platform_device = device;
-			return 0;
+			if (platform_get_drvdata(device)) {
+				snd_opti9xx_platform_device = device;
+				return 0;
+			}
+			platform_device_unregister(device);
 		}
 		platform_driver_unregister(&snd_opti9xx_driver);
 	}
Index: mm/sound/isa/sscape.c
===================================================================
--- mm.orig/sound/isa/sscape.c	2006-04-06 02:52:33.000000000 +0200
+++ mm/sound/isa/sscape.c	2006-04-06 02:56:48.000000000 +0200
@@ -1438,6 +1438,10 @@ static int __init sscape_manual_probe(vo
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		platform_devices[i] = device;
 	}
 	return 0;





^ permalink raw reply

* [ALSA 2/2] unregister platform device again if probe was unsuccessful
From: Rene Herman @ 2006-04-06  2:08 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: ALSA devel, Linux Kernel

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

Rene Herman wrote:

> Yes. I don't see a significantly cleaner solution then than the 
> slightly hackish "using drvdata as a private success flag" that I 
> posted before. Example patch versus snd_adlib attached again. This 
> seems to work well.
> 
> Takashi: do you agree? If the probe() method return is not going to 
> be propagated up, there are few other options.
> 
> (Continuing the loop on IS_ERR(device) is then also a bit 
> questionable again as the IS_ERR then signifies an eror in the bowels
>  of the device model, but I feel it's still the correct thing to do)

And here's the one doing the unregisters. This one could also go to
stable, if you agree with the method...

I've been testing with snd_adlib, and everything seems to be working as
planned, also with the bus_add_device() patch reverted. Ie, not having
the hardware present (at the supplied adress) makes it fail to load, and

echo -n snd_adlib.0 >/sys/bus/platform/drivers/snd_adlib/{un,}bind

makes the driver unbind and bind correctly.

     ad1848/ad1848.c          |    4 ++++
     adlib.c                  |   11 +++++++----
     cmi8330.c                |    4 ++++
     cs423x/cs4231.c          |    4 ++++
     cs423x/cs4236.c          |    4 ++++
     es1688/es1688.c          |    4 ++++
     es18xx.c                 |    4 ++++
     gus/gusclassic.c         |    4 ++++
     gus/gusextreme.c         |    4 ++++
     gus/gusmax.c             |    4 ++++
     gus/interwave.c          |    4 ++++
     opl3sa2.c                |    4 ++++
     opti9xx/miro.c           |    7 +++++--
     opti9xx/opti92x-ad1848.c |    7 +++++--
     sb/sb16.c                |    4 ++++
     sb/sb8.c                 |    4 ++++
     sgalaxy.c                |    4 ++++
     sscape.c                 |    4 ++++
     wavefront/wavefront.c    |    4 ++++
     19 files changed, 81 insertions(+), 8 deletions(-)

Rene





[-- Attachment #2: alsa_platform_unregister.diff --]
[-- Type: text/plain, Size: 10531 bytes --]

Index: mm/sound/isa/ad1848/ad1848.c
===================================================================
--- mm.orig/sound/isa/ad1848/ad1848.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/ad1848/ad1848.c	2006-04-06 02:55:05.000000000 +0200
@@ -195,6 +195,10 @@ static int __init alsa_card_ad1848_init(
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/cmi8330.c
===================================================================
--- mm.orig/sound/isa/cmi8330.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/cmi8330.c	2006-04-06 02:55:05.000000000 +0200
@@ -701,6 +701,10 @@ static int __init alsa_card_cmi8330_init
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		platform_devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/cs423x/cs4231.c
===================================================================
--- mm.orig/sound/isa/cs423x/cs4231.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/cs423x/cs4231.c	2006-04-06 02:55:05.000000000 +0200
@@ -211,6 +211,10 @@ static int __init alsa_card_cs4231_init(
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/cs423x/cs4236.c
===================================================================
--- mm.orig/sound/isa/cs423x/cs4236.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/cs423x/cs4236.c	2006-04-06 02:55:05.000000000 +0200
@@ -782,6 +782,10 @@ static int __init alsa_card_cs423x_init(
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		platform_devices[i] = device;
 		snd_cs423x_devices++;
 	}
Index: mm/sound/isa/es1688/es1688.c
===================================================================
--- mm.orig/sound/isa/es1688/es1688.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/es1688/es1688.c	2006-04-06 02:55:05.000000000 +0200
@@ -215,6 +215,10 @@ static int __init alsa_card_es1688_init(
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/gus/gusclassic.c
===================================================================
--- mm.orig/sound/isa/gus/gusclassic.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/gus/gusclassic.c	2006-04-06 02:55:05.000000000 +0200
@@ -255,6 +255,10 @@ static int __init alsa_card_gusclassic_i
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/gus/gusextreme.c
===================================================================
--- mm.orig/sound/isa/gus/gusextreme.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/gus/gusextreme.c	2006-04-06 02:55:05.000000000 +0200
@@ -365,6 +365,10 @@ static int __init alsa_card_gusextreme_i
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/gus/gusmax.c
===================================================================
--- mm.orig/sound/isa/gus/gusmax.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/gus/gusmax.c	2006-04-06 02:55:05.000000000 +0200
@@ -392,6 +392,10 @@ static int __init alsa_card_gusmax_init(
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/gus/interwave.c
===================================================================
--- mm.orig/sound/isa/gus/interwave.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/gus/interwave.c	2006-04-06 02:55:05.000000000 +0200
@@ -949,6 +949,10 @@ static int __init alsa_card_interwave_in
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		platform_devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/opl3sa2.c
===================================================================
--- mm.orig/sound/isa/opl3sa2.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/opl3sa2.c	2006-04-06 02:55:05.000000000 +0200
@@ -964,6 +964,10 @@ static int __init alsa_card_opl3sa2_init
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		platform_devices[i] = device;
 		snd_opl3sa2_devices++;
 	}
Index: mm/sound/isa/sb/sb16.c
===================================================================
--- mm.orig/sound/isa/sb/sb16.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/sb/sb16.c	2006-04-06 02:55:05.000000000 +0200
@@ -723,6 +723,10 @@ static int __init alsa_card_sb16_init(vo
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		platform_devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/sb/sb8.c
===================================================================
--- mm.orig/sound/isa/sb/sb8.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/sb/sb8.c	2006-04-06 02:55:05.000000000 +0200
@@ -266,6 +266,10 @@ static int __init alsa_card_sb8_init(voi
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/sgalaxy.c
===================================================================
--- mm.orig/sound/isa/sgalaxy.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/sgalaxy.c	2006-04-06 02:55:05.000000000 +0200
@@ -368,6 +368,10 @@ static int __init alsa_card_sgalaxy_init
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/wavefront/wavefront.c
===================================================================
--- mm.orig/sound/isa/wavefront/wavefront.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/wavefront/wavefront.c	2006-04-06 02:55:05.000000000 +0200
@@ -724,6 +724,10 @@ static int __init alsa_card_wavefront_in
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		platform_devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/adlib.c
===================================================================
--- mm.orig/sound/isa/adlib.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/adlib.c	2006-04-06 02:55:05.000000000 +0200
@@ -43,8 +43,7 @@ static int __devinit snd_adlib_probe(str
 	struct snd_card *card;
 	struct snd_opl3 *opl3;
 
-	int error;
-	int i = device->id;
+	int error, i = device->id;
 
 	if (port[i] == SNDRV_AUTO_PORT) {
 		snd_printk(KERN_ERR DRV_NAME ": please specify port\n");
@@ -95,8 +94,7 @@ static int __devinit snd_adlib_probe(str
 	return 0;
 
 out1:	snd_card_free(card);
- out0:	error = -EINVAL; /* FIXME: should be the original error code */
-	return error;
+out0:	return error;
 }
 
 static int __devexit snd_adlib_remove(struct platform_device *device)
@@ -134,6 +132,11 @@ static int __init alsa_card_adlib_init(v
 		if (IS_ERR(device))
 			continue;
 
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
+
 		devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/es18xx.c
===================================================================
--- mm.orig/sound/isa/es18xx.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/es18xx.c	2006-04-06 02:55:05.000000000 +0200
@@ -2394,6 +2394,10 @@ static int __init alsa_card_es18xx_init(
 							 i, NULL, 0);
 		if (IS_ERR(device))
 	       		continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		platform_devices[i] = device;
 		cards++;
 	}
Index: mm/sound/isa/opti9xx/miro.c
===================================================================
--- mm.orig/sound/isa/opti9xx/miro.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/opti9xx/miro.c	2006-04-06 02:55:05.000000000 +0200
@@ -1436,8 +1436,11 @@ static int __init alsa_card_miro_init(vo
 	if ((error = platform_driver_register(&snd_miro_driver)) < 0)
 		return error;
 	device = platform_device_register_simple(DRIVER_NAME, -1, NULL, 0);
-	if (! IS_ERR(device))
-		return 0;
+	if (! IS_ERR(device)) {
+		if (platform_get_drvdata(device))
+			return 0;
+		platform_device_unregister(device);
+	}
 #ifdef MODULE
 	printk(KERN_ERR "no miro soundcard found\n");
 #endif
Index: mm/sound/isa/opti9xx/opti92x-ad1848.c
===================================================================
--- mm.orig/sound/isa/opti9xx/opti92x-ad1848.c	2006-04-06 02:45:56.000000000 +0200
+++ mm/sound/isa/opti9xx/opti92x-ad1848.c	2006-04-06 02:55:05.000000000 +0200
@@ -2099,8 +2099,11 @@ static int __init alsa_card_opti9xx_init
 			return error;
 		device = platform_device_register_simple(DRIVER_NAME, -1, NULL, 0);
 		if (!IS_ERR(device)) {
-			snd_opti9xx_platform_device = device;
-			return 0;
+			if (platform_get_drvdata(device)) {
+				snd_opti9xx_platform_device = device;
+				return 0;
+			}
+			platform_device_unregister(device);
 		}
 		platform_driver_unregister(&snd_opti9xx_driver);
 	}
Index: mm/sound/isa/sscape.c
===================================================================
--- mm.orig/sound/isa/sscape.c	2006-04-06 02:52:33.000000000 +0200
+++ mm/sound/isa/sscape.c	2006-04-06 02:56:48.000000000 +0200
@@ -1438,6 +1438,10 @@ static int __init sscape_manual_probe(vo
 							 i, NULL, 0);
 		if (IS_ERR(device))
 			continue;
+		if (!platform_get_drvdata(device)) {
+			platform_device_unregister(device);
+			continue;
+		}
 		platform_devices[i] = device;
 	}
 	return 0;





^ permalink raw reply

* Re: udev 085 warnings
From: Kay Sievers @ 2006-04-06  2:09 UTC (permalink / raw)
  To: linux-hotplug
In-Reply-To: <Pine.LNX.4.61.0604051110170.11179@yvahk01.tjqt.qr>

On Thu, Apr 06, 2006 at 02:30:41AM +0200, Michael Buesch wrote:
> On Wednesday 05 April 2006 21:03, Kay Sievers wrote:
> > On Wed, Apr 05, 2006 at 11:10:40AM +0200, Jan Engelhardt wrote:
> > > I am currently compiling udev-085-14.src.rpm from the opensuse
> > > OSS-factory tree on a 64-bit arch and get a lot of these warnings:
> > >
> > > fat.c:325: warning: cast increases required alignment of target type
> > > 325:
> > >                 next = le32_to_cpu(*((uint32_t *) buf) & 0x0fffffff);
> 
> Hm, I don't know what this code is about, but is it actually correct?
> I mean, it masks the value of buf, which is appearently a little-endian
> 32bit value with 0x0fffffff (which is CPU order). Is that intentional?
> Or should it be something like that instead:
> 	next = le32_to_cpu(*((uint32_t *) buf)) & 0x0fffffff;

I fixed it already while looking for the warning. :)

Thanks,
Kay


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x110944&bid$1720&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply

* Re: smpnice loadbalancing with high priority tasks
From: Peter Williams @ 2006-04-06  2:14 UTC (permalink / raw)
  To: Siddha, Suresh B
  Cc: Andrew Morton, Mike Galbraith, Nick Piggin, Ingo Molnar,
	Con Kolivas, Chen, Kenneth W, Linux Kernel Mailing List
In-Reply-To: <4431E6D7.2060604@bigpond.net.au>

Peter Williams wrote:
> Siddha, Suresh B wrote:
>> do we then really need smpnice complexity?
> 
> Most people who express unhappiness with SMP and nice are looking at the 
> other end of the problem i.e. they nice 19 a process to make it run in 
> the background but it gets a CPU to itself while a couple nice 0 tasks 
> have to share the other CPU.  The high priority case has to be 
> considered as well (e.g. one high priority task and one normal priority 
> task running on a 2 CPU machine with a CPU each when another task wakes 
> -- you'd like that to end up on the CPU of the normal priority task not 
> the one with the high priority task, etc.) but its effects are more 
> likely to be transitory and high priority tasks would not be expected to 
> have a long term effect on balancing.

Another advantage of smpnice load balancing that I failed to point out 
is that it increases the chances that the tasks at the head of the 
queues within a HT package are approximately the same priority.  This, 
in turn, reduces the probability that it will be necessary to force one 
of the channels to idle and this will tend to increase the overall 
system throughput.

Peter
-- 
Peter Williams                                   pwil3058@bigpond.net.au

"Learning, n. The kind of ignorance distinguishing the studious."
  -- Ambrose Bierce

^ permalink raw reply

* Re: libata machine check on Alpha
From: Jeff Garzik @ 2006-04-06  2:17 UTC (permalink / raw)
  To: albertl; +Cc: Carlos Pardo, Tejun Heo, Jonathan Blake Benson, linux-ide
In-Reply-To: <44347713.9000408@tw.ibm.com>

Albert Lee wrote:
> Per Jeff's comment, there is a document on t13 (http://www.t13.org/docs2003/e03131r0.pdf).
> The documents reads:
> "Eg. – Word 50, bit 13: Set to 1 for devices that support DMAIN bit in Features Register for Packet Command".
> However, this looks more for the ATAPI device than for the bridge?
> Also it looks not a t13 standard yet?
> Can we use this word 50 to identify 3611/3811?


DMADIR is in my copy of ATA-7...

	Jeff



^ permalink raw reply

* Re: about the function register_profile_notifier
From: Jiri Slaby @ 2006-04-06  2:17 UTC (permalink / raw)
  To: HuaFeijun; +Cc: linux-kernel
In-Reply-To: <3fe1d240604051841k353c5ed0u37358578c1ffb7a2@mail.gmail.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

HuaFeijun napsal(a):
> who can tell me .which  function has the same function as the
> register_profile_notifier function in linux 2.6.12 kernel.Thanks.
There was no register_profile_notifier in 2.6.12.
http://sosdg.org/~coywolf/lxr/ident?v=2.6.12;i=register_profile_notifier

regards,
- --
Jiri Slaby         www.fi.muni.cz/~xslaby
~\-/~      jirislaby@gmail.com      ~\-/~
B67499670407CE62ACC8 22A032CC55C339D47A7E
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFENHo2MsxVwznUen4RAg5EAKCuqeXSXFDbv3y6Vj0dwW7TZZZ5eQCglZcB
lyKpxOpBtBXa5X4bGdSVV4s=
=5zoe
-----END PGP SIGNATURE-----

^ permalink raw reply

* Re: [RHEL 4 U2] Recommended blacklist for Sun X4200, V40z
From: Brian Long @ 2006-04-06  2:25 UTC (permalink / raw)
  To: dm-devel
In-Reply-To: <1c59d60b0603290740p7831d874h840add20cc5abab3@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 980 bytes --]

On 3/29/06, Brian Long <briandlong@gmail.com> wrote:
>
> I'm running RHEL 4 U2 (device-mapper-multipath-0.4.5-6.0.RHEL4).  I have a
> multipath.conf which uses the compiled-in blacklist.  I also have
> specified device entries specific to certain EMC arrays in use (see attached
> multipath.conf ).  The majority of our hosts are HP Proliant with cciss
> local disks and they are blacklisted appropriately.  When I use the same
> multipath.conf on a Sun V40z or X4200, multipathing is not working and I
> believe it's because the internal disk (LSI Logic / MPT Fusion RAID) is not
> blacklisted (see attached multipath-v3.out for details).
>
> Is there a recommended blacklist entry for these hosts?  Can I blacklist
> by vendor ID instead of device?
>

I could not get multipath working properly on these hosts until I set up a
vendor-based blacklist in /etc/scis_id.conf.  I blacklisted vendor=LSILOGIC
and multipath works well for the SAN devices.

/Brian/

[-- Attachment #1.2: Type: text/html, Size: 1316 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply

* [ALSA - driver 0002006]: High frequency noise in output from SI7012 (intel8x0)
From: bugtrack @ 2006-04-06  2:27 UTC (permalink / raw)
  To: alsa-devel


The following issue has been SUBMITTED.
======================================================================
<https://bugtrack.alsa-project.org/alsa-bug/view.php?id=2006> 
======================================================================
Reported By:                jaime
Assigned To:                
======================================================================
Project:                    ALSA - driver
Issue ID:                   2006
Category:                   PCI - intel8x0
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
Distribution:               Slax 5.1.0, Debian Etch, Ubuntu Dapper
Kernel Version:             2.6.16 / 2.6.15
======================================================================
Date Submitted:             04-06-2006 04:27 CEST
Last Modified:              04-06-2006 04:27 CEST
======================================================================
Summary:                    High frequency noise in output from SI7012
(intel8x0)
Description: 
Sound chip is SI7012 built into Asrock K7S8X. To demonstrate the noise,
I've played "orig.wav" throught the SI7012 and recorded the (analog)
output on
another computer. When I boot the PC into Windows 2000, the output is
clean: the recording is "win2k.wav". Then I reboot into Linux and use
"aplay -Dhw:0,0 orig.wav" and record the output again: the recording is
"alsa.wav". Ignoring the  clicks in the last half of "win2k.wav" (the
click are the hard-drive reads), I can hear a high frequency intermittent
"buzz" in the last half of "alsa.wav" that isn't present in "win2k.wav".
To hear this, I think you will need headphones, but the buzzing is
definitely there.

As the three wave files are too big to attach, I've put them on the web
here:
orig.wav:   http://www.carbon.eclipse.co.uk/orig.wav
win2k.wav:  http://www.carbon.eclipse.co.uk/win2k.wav
alsa.wav:   http://www.carbon.eclipse.co.uk/alsa.wav

The version used is 1.0.11rc2, but the same problem occurs in the older
1.0.10.

======================================================================

Issue History
Date Modified  Username       Field                    Change              
======================================================================
04-06-06 04:27 jaime          New Issue                                    
04-06-06 04:27 jaime          Distribution              => Slax 5.1.0, Debian
Etch, Ubuntu Dapper
04-06-06 04:27 jaime          Kernel Version            => 2.6.16 / 2.6.15 
======================================================================




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

^ permalink raw reply

* Re: libata machine check on Alpha
From: Tejun Heo @ 2006-04-06  2:31 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: albertl, Carlos Pardo, Jonathan Blake Benson, linux-ide
In-Reply-To: <44347A3D.1000609@garzik.org>

Jeff Garzik wrote:
> Albert Lee wrote:
>> Per Jeff's comment, there is a document on t13 
>> (http://www.t13.org/docs2003/e03131r0.pdf).
>> The documents reads:
>> "Eg. – Word 50, bit 13: Set to 1 for devices that support DMAIN bit in 
>> Features Register for Packet Command".
>> However, this looks more for the ATAPI device than for the bridge?
>> Also it looks not a t13 standard yet?
>> Can we use this word 50 to identify 3611/3811?
> 
> 
> DMADIR is in my copy of ATA-7...
> 

Here's the relavant part from ATA8 draft.  It seems that the bridge is 
supposed to mangle the IDENTIFY PACKET DEVICE result.  It's supposed to 
nuke all DMA transfer mode information reported from the original device 
and report supported modes from the view point of the bridge in bits 
10:1 (which, BTW, should be all 1's).

The question is whether or not bridges implement this properly. I think 
we can add a printk to word 62 and ask Jonathan to test it.

----

7.18.6.17 Word 62: DMADIR

ATAPI devices that use a serial ATA bridge chip for connection to a 
serial ATA host may require use of the DMADIR bit to indicate transfer 
direction for Packet DMA commands. Word 62 is used to indicate if such
support is required.

If bit 15 of word 62 is set to one, then DMADIR bit in the Packet 
Command is required by the device for Packet DMA and Bits 2:0 of word 
63, bits 15 and 8 in word 49, and bits 6:0 of word 88 shall be cleared 
to 0,.

If bit 15 of word 62 is cleared to 0, DMADIR bit in the PACKET command 
is not required. If bit 15 of word 62 is cleared to zero, then all bits 
of word 62 shall be cleared to zero.

Bits (14:11) are reserved.

Bits (10:1) indicate DMA mode support. Since the DMADIR bit is only used 
for a Serial ATAPI device, all of these bits are set to 1.

-- 
tejun

^ permalink raw reply

* Bonnie++ Burps on XFS
From: Kurt Wall @ 2006-04-06  2:34 UTC (permalink / raw)
  To: LKML

I've been using bonnie++ off and on for a long time. Suddenly, it has
started failing when run against an XFS filesystem situated on a SATA
drive. Here's the output of a run:

$ bench/sbin/bonnie++ -m "Luther 2.6.17-rc1 XFS SATA" \
> -d /archive/bench \
> -s 3008 \
> -n 1024 >> bonnie.out 2>> bonnie.err
Version: 1.03
Writing with putc()...done
Writing intelligently...done
Rewriting...done
Reading with getc()...done
Reading intelligently...done
start 'em...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
Delete files in sequential order...Bonnie: drastic I/O error (rmdir):
Directory not empty
Cleaning up test directory after error.

This is on a 2.6.17-rc1 Linux kernel. The interesting thing
is that not even root cannot delete the directory in which
bonnie++ is working:

[~]$ ls -ld /archive/bench/Bonnie.8426/
drwx------  2 kwall users 4096 2006-04-05 09:06 /archive/bench/Bonnie.8426/
[~]$ ls -al /archive/bench/Bonnie.8426/
total 24
drwx------  2 kwall users 4096 2006-04-05 09:06 ./
drwxr-xr-x  4 kwall users   42 2006-04-05 06:24 ../
[~]$ sudo rm -rf /archive/bench/Bonnie.8426
rm: cannot remove directory `/archive/bench/Bonnie.8426': Directory not
empty

As you can see, the directory is empty, but a "rm" fails (as does
"rmdir"). I'm retesting with a 2.6.16 kernel as I type. It isn't
clear if the problems is XFS, some other piece of the kernel, or
bonnie++. Neither dmesg nor syslog shows anything amiss. I suppose 
I could strace the run, but I'm not especially eager to deal with 
a multi-gigabyte output file if there is a more focused method to
isolate the problem.

I've also written to bonnie++'s author.

Thanks for the help.

Best regards,

Kurt
-- 
The full impact of parenthood doesn't hit you until you multiply the
number of your kids by 32 teeth.

^ permalink raw reply

* Re: [PATCH] crypto: add alignment handling to digest layer
From: Atsushi Nemoto @ 2006-04-06  2:37 UTC (permalink / raw)
  To: herbert; +Cc: linux-kernel, linux-crypto, akpm
In-Reply-To: <20060405180520.GA15151@gondor.apana.org.au>

On Thu, 6 Apr 2006 04:05:20 +1000, Herbert Xu <herbert@gondor.apana.org.au> wrote:
> Don't we need to copy this to an aligned buffer?

We don't.  I think update functions do not need an aligned buffer for
data which is smaller then the alignment size.

---
Atsushi Nemoto

^ permalink raw reply

* Re: [uml-devel] system call accessing the host os
From: Jeff Dike @ 2006-04-06  1:43 UTC (permalink / raw)
  To: olivier.crameri; +Cc: user-mode-linux-devel
In-Reply-To: <b54af0b00604051320l54bab57ag311746325c887d7f@mail.gmail.com>

On Wed, Apr 05, 2006 at 10:20:44PM +0200, Olivier Crameri wrote:
> Thanks for the answer. I bumped CONFIG_KERNEL_STACK_ORDER to 3, but it
> doesn't help.

I didn't think so, since the symptoms were wrong.  However, keep that
in the back of your mind since you're dealing with some piggy parts of
libc.

> When I said that using malloc didn't work, I meant the following: I'm
> using malloc to allocate a buffer in the UML kernel. I'm not passing a
> user level buffer to the system call. 

38K isn't big enough for it to fall back to vmalloc, so the pages not
being present probably isn't an issue.

> Then, when I use fread to read
> my file into this buffer, if I read a small number of bytes, it works.
> However when I try to fread the entire file (38k), fread returns 0.

What's the break point between working and non-working?

> Later on, I use sscanf to parse my buffer. No matter what happens,
> sscanf returns 0, which is wrong even if there is no error. The exact
> same code compiled in the host works perfectly.

This, I don't understand.

What version of UML are you using?

				Jeff


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply

* Re: Respin: [PATCH] mm: limit lowmem_reserve
From: Andrew Morton @ 2006-04-06  2:43 UTC (permalink / raw)
  To: Con Kolivas; +Cc: linux-kernel, ck, nickpiggin, linux-mm
In-Reply-To: <200604061129.41658.kernel@kolivas.org>

Con Kolivas <kernel@kolivas.org> wrote:
>
> It is possible with a low enough lowmem_reserve ratio to make
>  zone_watermark_ok fail repeatedly if the lower_zone is small enough.

Is that actually a problem?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply

* Re: Respin: [PATCH] mm: limit lowmem_reserve
From: Andrew Morton @ 2006-04-06  2:43 UTC (permalink / raw)
  To: Con Kolivas; +Cc: linux-kernel, ck, nickpiggin, linux-mm
In-Reply-To: <200604061129.41658.kernel@kolivas.org>

Con Kolivas <kernel@kolivas.org> wrote:
>
> It is possible with a low enough lowmem_reserve ratio to make
>  zone_watermark_ok fail repeatedly if the lower_zone is small enough.

Is that actually a problem?

^ permalink raw reply

* Re: [uml-devel] Re: [PATCH 12/16] UML - Memory hotplug
From: Jeff Dike @ 2006-04-06  1:56 UTC (permalink / raw)
  To: Daniel Phillips; +Cc: Andrew Morton, linux-kernel, user-mode-linux-devel
In-Reply-To: <44343E86.30301@google.com>

On Wed, Apr 05, 2006 at 03:02:46PM -0700, Daniel Phillips wrote:
> > page = alloc_page(GFP_ATOMIC);
> 
> A slightly different objection than Andrew's: this will rapidly eat up
> all the pages available for, e.g., receiving network packets, probably
> not what you want.  How about flags=0?  This will dip a little way into
> reserves but not as far as interrupts or realtime tasks, and will not
> attempt any reclaim.  (Maybe we should have a GFP define for that.)

Yeah, it's a bit non-obvious what 0 means in the twisty little maze of
GFP_ flags.

However, I do want to push the system into reclaim later.  It looks
like the only difference between 0 and GFP_ATOMIC is the use of
emergency pools, which I don't really want to exercise anyway.

> > INIT_LIST_HEAD(&unplugged->list);
> > list_add(&unplugged->list, &unplugged_pages);
> 
> You don't need to initialize the list element you are adding.

This look OK to you?

Index: linux-2.6.16/arch/um/drivers/mconsole_kern.c
===================================================================
--- linux-2.6.16.orig/arch/um/drivers/mconsole_kern.c	2006-04-03 18:05:29.000000000 -0400
+++ linux-2.6.16/arch/um/drivers/mconsole_kern.c	2006-04-05 22:54:17.000000000 -0400
@@ -87,7 +87,11 @@ static irqreturn_t mconsole_interrupt(in
 		if(req.cmd->context == MCONSOLE_INTR)
 			(*req.cmd->handler)(&req);
 		else {
-			new = kmalloc(sizeof(*new), GFP_ATOMIC);
+			/* 0 means don't wait (like GFP_ATOMIC) and
+			 * don't dip into emergency pools (unlike
+			 * GFP_ATOMIC).
+			 */
+			new = kmalloc(sizeof(*new), 0);
 			if(new == NULL)
 				mconsole_reply(&req, "Out of memory", 1, 0);
 			else {
@@ -415,7 +419,6 @@ static int mem_config(char *str)
 
 			unplugged = page_address(page);
 			if(unplug_index == UNPLUGGED_PER_PAGE){
-				INIT_LIST_HEAD(&unplugged->list);
 				list_add(&unplugged->list, &unplugged_pages);
 				unplug_index = 0;
 			}
@@ -655,7 +658,6 @@ static void with_console(struct mc_reque
 	struct mconsole_entry entry;
 	unsigned long flags;
 
-	INIT_LIST_HEAD(&entry.list);
 	entry.request = *req;
 	list_add(&entry.list, &clients);
 	spin_lock_irqsave(&console_lock, flags);

				Jeff


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply

* Re: [uml-devel] Re: [PATCH 12/16] UML - Memory hotplug
From: Jeff Dike @ 2006-04-06  1:56 UTC (permalink / raw)
  To: Daniel Phillips; +Cc: Andrew Morton, linux-kernel, user-mode-linux-devel
In-Reply-To: <44343E86.30301@google.com>

On Wed, Apr 05, 2006 at 03:02:46PM -0700, Daniel Phillips wrote:
> > page = alloc_page(GFP_ATOMIC);
> 
> A slightly different objection than Andrew's: this will rapidly eat up
> all the pages available for, e.g., receiving network packets, probably
> not what you want.  How about flags=0?  This will dip a little way into
> reserves but not as far as interrupts or realtime tasks, and will not
> attempt any reclaim.  (Maybe we should have a GFP define for that.)

Yeah, it's a bit non-obvious what 0 means in the twisty little maze of
GFP_ flags.

However, I do want to push the system into reclaim later.  It looks
like the only difference between 0 and GFP_ATOMIC is the use of
emergency pools, which I don't really want to exercise anyway.

> > INIT_LIST_HEAD(&unplugged->list);
> > list_add(&unplugged->list, &unplugged_pages);
> 
> You don't need to initialize the list element you are adding.

This look OK to you?

Index: linux-2.6.16/arch/um/drivers/mconsole_kern.c
===================================================================
--- linux-2.6.16.orig/arch/um/drivers/mconsole_kern.c	2006-04-03 18:05:29.000000000 -0400
+++ linux-2.6.16/arch/um/drivers/mconsole_kern.c	2006-04-05 22:54:17.000000000 -0400
@@ -87,7 +87,11 @@ static irqreturn_t mconsole_interrupt(in
 		if(req.cmd->context == MCONSOLE_INTR)
 			(*req.cmd->handler)(&req);
 		else {
-			new = kmalloc(sizeof(*new), GFP_ATOMIC);
+			/* 0 means don't wait (like GFP_ATOMIC) and
+			 * don't dip into emergency pools (unlike
+			 * GFP_ATOMIC).
+			 */
+			new = kmalloc(sizeof(*new), 0);
 			if(new == NULL)
 				mconsole_reply(&req, "Out of memory", 1, 0);
 			else {
@@ -415,7 +419,6 @@ static int mem_config(char *str)
 
 			unplugged = page_address(page);
 			if(unplug_index == UNPLUGGED_PER_PAGE){
-				INIT_LIST_HEAD(&unplugged->list);
 				list_add(&unplugged->list, &unplugged_pages);
 				unplug_index = 0;
 			}
@@ -655,7 +658,6 @@ static void with_console(struct mc_reque
 	struct mconsole_entry entry;
 	unsigned long flags;
 
-	INIT_LIST_HEAD(&entry.list);
 	entry.request = *req;
 	list_add(&entry.list, &clients);
 	spin_lock_irqsave(&console_lock, flags);

				Jeff

^ permalink raw reply

* Re: Respin: [PATCH] mm: limit lowmem_reserve
From: Con Kolivas @ 2006-04-06  2:55 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, ck, nickpiggin, linux-mm
In-Reply-To: <20060405194344.1915b57a.akpm@osdl.org>

On Thursday 06 April 2006 12:43, Andrew Morton wrote:
> Con Kolivas <kernel@kolivas.org> wrote:
> > It is possible with a low enough lowmem_reserve ratio to make
> >  zone_watermark_ok fail repeatedly if the lower_zone is small enough.
>
> Is that actually a problem?

Every single call to get_page_from_freelist will call on zone reclaim. It 
seems a problem to me if every call to __alloc_pages will do that?

Cheers,
Con

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply

* Re: Respin: [PATCH] mm: limit lowmem_reserve
From: Con Kolivas @ 2006-04-06  2:55 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, ck, nickpiggin, linux-mm
In-Reply-To: <20060405194344.1915b57a.akpm@osdl.org>

On Thursday 06 April 2006 12:43, Andrew Morton wrote:
> Con Kolivas <kernel@kolivas.org> wrote:
> > It is possible with a low enough lowmem_reserve ratio to make
> >  zone_watermark_ok fail repeatedly if the lower_zone is small enough.
>
> Is that actually a problem?

Every single call to get_page_from_freelist will call on zone reclaim. It 
seems a problem to me if every call to __alloc_pages will do that?

Cheers,
Con

^ permalink raw reply


This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.