All of lore.kernel.org
 help / color / mirror / Atom feed
* system hangs after reboot
From: Arno Seitzinger @ 2002-12-16  8:53 UTC (permalink / raw)
  To: linux-newbie

Hi NG,

for a couple of days, my Suse Linux 8.1 (2.4.19) on a HP Omnibook XE3 Laptop 
shows a strange behaviour: it hangs after a reboot (shutdown -r now od from 
KDE). First it starts as usual, but freezes after "switching to runlevel 
5", when initializing the random number generator and the network.
I pasted the output of a good and a bad boot.msg below.

My last actions, before I noticed it doesn't reboot anymore, were:
- use the cellphone to access internet
- create a new user because of OpenOffice store failure
- clear tmp directory in single user mode (because of OpenOffice store 
failure - was this stupid?)
- new (workstation) installation of OpenOffice

Nayone around who can give me a clou where to look next?
Arno

***boot.msg when system hangs
=============================
[...]
Master Resource Control: previous runlevel: N, switching to runlevel:
5

done<notice>killproc: kill(30,3)

INIT: Entering runlevel: 5

<notice>/etc/init.d/rc5.d/S01isdn start
<notice>'/etc/init.d/rc5.d/S01isdn start' exits with status 0
<notice>/etc/init.d/rc5.d/S01random start
<notice>'/etc/init.d/rc5.d/S01random start' exits with status 0
<notice>/etc/init.d/rc5.d/S05network start

***boot.msg normally
====================
[...]
Master Resource Control: previous runlevel: N, switching to runlevel:
5


done<notice>killproc: kill(30,3)

INIT: Entering runlevel: 5


<notice>/etc/init.d/rc5.d/S01isdn start
<notice>'/etc/init.d/rc5.d/S01isdn start' exits with status 0
<notice>/etc/init.d/rc5.d/S01random start
<notice>'/etc/init.d/rc5.d/S01random start' exits with status 0
<notice>/etc/init.d/rc5.d/S05network start
<notice>Initializing random number generator
done

Setting up network interfaces:

    lo
done

    eth0      (DHCP) startproc: execve (/sbin/dhcpcd) [ /sbin/dhcpcd -H -D 
-N -Y -t 999999 -h esw44 eth0 ], [ CONSOLE=/dev/console TERM=linux 
SHELL=/bin/sh OLDPWD=/etc/sysconfig/network INIT_VERSION=sysvinit-2.82 
RUN_FROM_RC=yes REDIRECT=/dev/tty1 COLUMNS=106 
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/etc/sysconfig/network/scripts vga=791 
RUNLEVEL=5 PWD=/etc/sysconfig/network PREVLEVEL=N LINES=34 HOME=/ SHLVL=4 
_=/sbin/startproc DAEMON=/sbin/dhcpcd ]
<notice>pidofproc: dhcpcd 347


-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" 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.linux-learn.org/faqs

^ permalink raw reply

* [patch][2.5] idepnp pnp conversion
From: Zwane Mwaikambo @ 2002-12-16  9:01 UTC (permalink / raw)
  To: Linux Kernel; +Cc: Linus Torvalds, Alan Cox

This patch converts idepnp to the new PnP layer and makes the driver
useable. there is only one issue pending, although that affects 2.4 as
well but that requires a bit more thinking in order to be Andre approved.

Patch has been tested with disks and cdroms.

Please apply,

Index: linux-2.5.52/drivers/ide/ide-pnp.c
===================================================================
RCS file: /build/cvsroot/linux-2.5.52/drivers/ide/ide-pnp.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 ide-pnp.c
--- linux-2.5.52/drivers/ide/ide-pnp.c	16 Dec 2002 05:16:23 -0000	1.1.1.1
+++ linux-2.5.52/drivers/ide/ide-pnp.c	16 Dec 2002 08:30:39 -0000
@@ -18,13 +18,11 @@

 #include <linux/ide.h>
 #include <linux/init.h>
-
-#include <linux/isapnp.h>
+#include <linux/pnp.h>

 #define DEV_IO(dev, index) (dev->resource[index].start)
 #define DEV_IRQ(dev, index) (dev->irq_resource[index].start)
-
-#define DEV_NAME(dev) (dev->bus->name ? dev->bus->name : "ISA PnP")
+#define DEV_NAME(dev) (dev->protocol->name ? dev->protocol->name : "ISA PnP")

 #define GENERIC_HD_DATA		0
 #define GENERIC_HD_ERROR	1
@@ -35,125 +33,125 @@
 #define GENERIC_HD_SELECT	6
 #define GENERIC_HD_STATUS	7

-static int generic_ide_offsets[IDE_NR_PORTS] __initdata = {
+static int generic_ide_offsets[IDE_NR_PORTS] = {
 	GENERIC_HD_DATA, GENERIC_HD_ERROR, GENERIC_HD_NSECTOR,
 	GENERIC_HD_SECTOR, GENERIC_HD_LCYL, GENERIC_HD_HCYL,
 	GENERIC_HD_SELECT, GENERIC_HD_STATUS, -1, -1
 };

 /* ISA PnP device table entry */
-struct pnp_dev_t {
-	unsigned short card_vendor, card_device, vendor, device;
-	int (*init_fn)(struct pci_dev *dev, int enable);
+struct idepnp_private {
+	struct pnp_dev *dev;
+	struct pci_dev pci_dev; /* we need this for the upper layers */
+	int (*init_fn)(struct idepnp_private *device, int enable);
 };

-/* Generic initialisation function for ISA PnP IDE interface */
+/* Barf bags at the ready! Enough to satisfy IDE core */
+static void pnp_to_pci(struct pnp_dev *pnp_dev, struct pci_dev *pci_dev)
+{
+	pci_dev->dev = pnp_dev->dev;
+	pci_set_drvdata(pci_dev, pnp_get_drvdata(pnp_dev));
+	pci_dev->irq = DEV_IRQ(pnp_dev, 0);
+	pci_set_dma_mask(pci_dev, 0x00ffffff);
+}

-static int __init pnpide_generic_init(struct pci_dev *dev, int enable)
+/* Generic initialisation function for ISA PnP IDE interface */
+static int pnpide_generic_init(struct idepnp_private *device, int enable)
 {
 	hw_regs_t hw;
 	ide_hwif_t *hwif;
 	int index;
+	struct pnp_dev *dev = device->dev;

-	if (!enable)
+	if (!enable) {
+		/* nothing to do for now */
 		return 0;
+	}

 	if (!(DEV_IO(dev, 0) && DEV_IO(dev, 1) && DEV_IRQ(dev, 0)))
-		return 1;
+		return -EINVAL;

 	ide_setup_ports(&hw, (ide_ioreg_t) DEV_IO(dev, 0),
 			generic_ide_offsets,
 			(ide_ioreg_t) DEV_IO(dev, 1),
 			0, NULL,
-//			generic_pnp_ide_iops,
+			/* generic_pnp_ide_iops, */
 			DEV_IRQ(dev, 0));

 	index = ide_register_hw(&hw, &hwif);

 	if (index != -1) {
 	    	printk(KERN_INFO "ide%d: %s IDE interface\n", index, DEV_NAME(dev));
-		hwif->pci_dev = dev;
+		hwif->pci_dev = &device->pci_dev;
 		return 0;
 	}

-	return 1;
+	return -ENODEV;
 }

 /* Add your devices here :)) */
-struct pnp_dev_t idepnp_devices[] __initdata = {
-  	/* Generic ESDI/IDE/ATA compatible hard disk controller */
-	{	ISAPNP_ANY_ID, ISAPNP_ANY_ID,
-		ISAPNP_VENDOR('P', 'N', 'P'), ISAPNP_DEVICE(0x0600),
-		pnpide_generic_init },
-	{	0 }
+#define IDEPNP_GENERIC_INIT	0
+static const struct pnp_device_id pnp_ide_devs[] = {
+	/* Generic ESDI/IDE/ATA compatible hard disk controller */
+	{"PNP0600", IDEPNP_GENERIC_INIT},
+	{"", 0}
 };

 #define NR_PNP_DEVICES 8
-struct pnp_dev_inst {
-	struct pci_dev *dev;
-	struct pnp_dev_t *dev_type;
-};
-static struct pnp_dev_inst devices[NR_PNP_DEVICES];
-static int pnp_ide_dev_idx = 0;
+/* Nb. pnpide_generic_init is indexed as IDEPNP_GENERIC_INIT */
+static int (*init_functions[])(struct idepnp_private *device, int enable) = {pnpide_generic_init};
+static struct idepnp_private devices[NR_PNP_DEVICES];
+static int pnp_ide_dev_idx;

 /*
  * Probe for ISA PnP IDE interfaces.
  */
-
-void __init pnpide_init(int enable)
+static int pnp_ide_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id)
 {
-	struct pci_dev *dev = NULL;
-	struct pnp_dev_t *dev_type;
+	int ret;
+	struct idepnp_private *p;

-	if (!isapnp_present())
-		return;
+	/*
+	 * Register device in the array to
+	 * deactivate it on a module unload.
+	 */
+	if (pnp_ide_dev_idx >= NR_PNP_DEVICES)
+		return -ENOSPC;
+
+	p = &devices[pnp_ide_dev_idx];
+	p->init_fn = init_functions[dev_id->driver_data];
+	p->dev = pdev;
+	pnp_set_drvdata(pdev, p);
+	pnp_to_pci(p->dev, &p->pci_dev);
+	ret = p->init_fn(p, 1);
+	if (!ret)
+		pnp_ide_dev_idx++;
+
+	return ret;
+}

-	/* Module unload, deactivate all registered devices. */
-	if (!enable) {
-		int i;
-		for (i = 0; i < pnp_ide_dev_idx; i++) {
-			dev = devices[i].dev;
-			devices[i].dev_type->init_fn(dev, 0);
-			if (dev->deactivate)
-				dev->deactivate(dev);
-		}
-		return;
-	}
+static void pnp_ide_remove(struct pnp_dev *dev)
+{
+	struct idepnp_private *p = pnp_get_drvdata(dev);
+
+	/* if p is null you have a bug elsewhere */
+	p->init_fn(p, 0);
+	pnp_ide_dev_idx--;
+	return;
+}

-	for (dev_type = idepnp_devices; dev_type->vendor; dev_type++) {
-		while ((dev = isapnp_find_dev(NULL, dev_type->vendor,
-			dev_type->device, dev))) {
-
-			if (dev->active)
-				continue;
-
-       			if (dev->prepare && dev->prepare(dev) < 0) {
-				printk(KERN_ERR"ide-pnp: %s prepare failed\n", DEV_NAME(dev));
-				continue;
-			}
-
-			if (dev->activate && dev->activate(dev) < 0) {
-				printk(KERN_ERR"ide: %s activate failed\n", DEV_NAME(dev));
-				continue;
-			}
-
-			/* Call device initialization function */
-			if (dev_type->init_fn(dev, 1)) {
-				if (dev->deactivate(dev))
-					dev->deactivate(dev);
-			} else {
-#ifdef MODULE
-				/*
-				 * Register device in the array to
-				 * deactivate it on a module unload.
-				 */
-				if (pnp_ide_dev_idx >= NR_PNP_DEVICES)
-					return;
-				devices[pnp_ide_dev_idx].dev = dev;
-				devices[pnp_ide_dev_idx].dev_type = dev_type;
-				pnp_ide_dev_idx++;
-#endif
-			}
-		}
-	}
+static struct pnp_driver idepnp_driver = {
+	.name		= "ide-pnp",
+	.id_table	= pnp_ide_devs,
+	.probe		= pnp_ide_probe,
+	.remove		= pnp_ide_remove
+};
+
+void pnpide_init(int enable)
+{
+	if (enable)
+		pnp_register_driver(&idepnp_driver);
+	else
+		pnp_unregister_driver(&idepnp_driver);
 }
+
Index: linux-2.5.52/drivers/ide/ide.c
===================================================================
RCS file: /build/cvsroot/linux-2.5.52/drivers/ide/ide.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 ide.c
--- linux-2.5.52/drivers/ide/ide.c	16 Dec 2002 05:16:22 -0000	1.1.1.1
+++ linux-2.5.52/drivers/ide/ide.c	16 Dec 2002 08:52:17 -0000
@@ -2080,7 +2080,7 @@
 		buddha_init();
 	}
 #endif /* CONFIG_BLK_DEV_BUDDHA */
-#if defined(CONFIG_BLK_DEV_ISAPNP) && defined(CONFIG_ISAPNP)
+#if defined(CONFIG_BLK_DEV_ISAPNP) && defined(CONFIG_PNP)
 	{
 		extern void pnpide_init(int enable);
 		pnpide_init(1);
@@ -2256,7 +2256,7 @@
 		spin_unlock_irqrestore(&ide_lock, flags);
 		return 1;
 	}
-#if defined(CONFIG_BLK_DEV_ISAPNP) && defined(CONFIG_ISAPNP) && defined(MODULE)
+#if defined(CONFIG_BLK_DEV_ISAPNP) && defined(CONFIG_PNP) && defined(MODULE)
 	pnpide_init(0);
 #endif /* CONFIG_BLK_DEV_ISAPNP */
 #ifdef CONFIG_PROC_FS
-- 
function.linuxpower.ca

^ permalink raw reply

* Re: Arctic-2 MTD driver
From: Marius Groeger @ 2002-12-16  8:46 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-embedded
In-Reply-To: <20021216020922.GH4981@zax.zax>


Hello David,

On Mon, 16 Dec 2002, David Gibson wrote:

> Having committed the core support code for the Arctic-2, here come
> some drivers for it.  Below is an MTD map for the Arctic-2, derived
> from beech-mtd.c.  Essentially all it does is provide suitable
> hardwired partitions.

Can you also post this to the linux-mtd folks?

Thanks,
Marius

-----------------------------------------------------------------------------
Marius Groeger           SYSGO Real-Time Solutions AG       mgroeger@sysgo.de
Software Engineering     Embedded and Real-Time Software    www.sysgo.de
Voice: +49-6136-9948-0   Am Pfaffenstein 14                 www.osek.de
FAX:   +49-6136-9948-10  55270 Klein-Winternheim, Germany   www.elinos.com


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply

* Re: Intel sez: Synchronous Flash and XIP is the future -- thoughts?
From: David Woodhouse @ 2002-12-16  9:07 UTC (permalink / raw)
  To: Paul Nash; +Cc: Linux-MTD (E-mail)
In-Reply-To: <43CB1396676FD4119F03001083FD299401A1C8CB@neptune.kirkland.local>

paulnash@wildseed.com said:
> so to really get the RAM reduction benefits of XIP, you'd have to not
> use compression, which means you'd probably need twice as much flash.
> Is that a reasonable conclusion? 

Yep. Especially so for those who sell flash chips, by an amazing coincidence
:)

The power saving point is fair -- flash does take less power than RAM. But
if you're _that_ short of power, you're likely to be using expensive (but
low-power) SRAM, and have the rest of the system so tightly specified that
you'll be more likely to be using something like eCos on it, not Linux.

With the chips available today and in the near future, XIP, at least for a
writable flash chip, makes virtually zero sense on Linux. Anyone who tries
to tell you otherwise is either on crack, trying to sell you something, or
both.

--
dwmw2

^ permalink raw reply

* 2.5.52-mm1
From: Andrew Morton @ 2002-12-16  8:36 UTC (permalink / raw)
  To: lkml, linux-mm

url: http://www.zipworld.com.au/~akpm/linux/patches/2.5/2.5.52/2.5.52-mm1/

  -> 2.5.52-mm1-shpte.gz       For Dave
  -> 2.5.52-mm1.gz             Full patch

A bunch of random stuff.  Most notably I now have restored ext2/ext3
dbench throughput on SMP to about the same level as it was before the
introduction of the Orlov allocator.

This was not the fault of the Orlov allocator - it just exposed some
weaknesses in the block allocation algorithms.  These changes should
benefit a range of workloads.


Changes since 2.5.51-mm2:

-PF_MEMALLOC-no-recur.patch
-deprecate-bdflush.patch
-bcrl-printk.patch
-read_zero-speedup.patch
-nommu-rmap-locking.patch
-semtimedop.patch
-writeback-handle-memory-backed.patch
-2-remove-fail_writepage.patch
-wli-show_free_areas.patch
-pmd-allocation-fix.patch
-radix-tree-overflow-fix.patch
-sync_fs.patch
-ext3_sync_fs.patch
-filldir-checks.patch
-vmstats-fixes.patch
-hugetlb-fixes.patch
-writeback-interaction-fix.patch
-scalable-zone-protection.patch
-page-wait-table-min-size.patch
-ext3-transaction-reserved-blocks.patch
-remove-PF_SYNC.patch
-dont-inherit-mlockall.patch
-bootmem-alloc-alignment.patch
-ext23_free_blocks-check.patch
-blkdev-rlimit.patch
-readahead-pinned-memory.patch
-remove-vmscan-check.patch
-max_sane_readahead.patch
-default-super-ops.patch
-mempool-atomic-check.patch
-page-allocator-off-by-one.patch
-cacheline-aligned-pte_chains.patch
-ext2-sync-dir-fix.patch

 Merged

-mmap-rounding-fix.patch

 Dropped.  Was already fixed in 2.5.

+sync_fs-deadlock-fix.patch

 Fix the fix for the fix for the ext3 journal=data umount bug.  Sigh.

+shrink_list-dirty-page-race.patch

 Fix an SMP race in page reclaim which isn't really there.

+slab-poisoning.patch

 Change the memory poisoning in the slab allocator so you can tell
 whether the oops was due to use-of-uninitialised-memory (0x5a5a5a5a)
 of use-of-freed-memory (0x6b6b6b6b)

+nommu-generic_file_readonly_mmap.patch

 Give !CONFIG_NOMMU a generic_file_readonly_mmap()

+misc.patch

 Minor fixes

+ext3-alloc-spread.patch
+ext2-alloc-spread.patch

 Don't start block allocation for new files at the zeroth block of
 the blockgroup all the time.

+spread-find_group_other.patch

 Don't place S_ISREG inodes into blockgroups which don't have any
 free blocks.

+iosched-doc.patch

 deadline IO scheduler docco.

+ext3-use-after-free.patch

 Fix the ext3 use-after-free bug which occurs when the filesystem runs
 out of space or inodes.

+dio-always-kmalloc.patch

 Never allocate `struct dio' on the stack.

+file-nr-doc-fix.patch

 Docco fix.

+set_page_dirty_lock.patch

 Lock pages when running set_page_dirty(), when there is nothing else
 to pin down page->mapping.

+gup-check-valid.patch

 Minor tweaks to the new page walker API.




All 48 patches:

linus.patch
  cset-1.980-to-1.981.txt.gz

kgdb.patch

sync_fs-deadlock-fix.patch
  sync_fs deadlock fix

shrink_list-dirty-page-race.patch
  fix a page dirtying race in vmscan.c

slab-poisoning.patch
  more informative slab poisoning

nommu-generic_file_readonly_mmap.patch
  Add generic_file_readonly_mmap() for nommu

dio-return-partial-result.patch

aio-direct-io-infrastructure.patch
  AIO support for raw/O_DIRECT

deferred-bio-dirtying.patch
  bio dirtying infrastructure

aio-direct-io.patch
  AIO support for raw/O_DIRECT

aio-dio-debug.patch

dio-reduce-context-switch-rate.patch
  Reduced wakeup rate in direct-io code

cputimes_stat.patch
  Retore per-cpu time accounting, with a config option

reduce-random-context-switch-rate.patch
  Reduce context switch rate due to the random driver

inlines-net.patch

rbtree-iosched.patch
  rbtree-based IO scheduler

deadsched-fix.patch
  deadline scheduler fix

quota-smp-locks.patch
  Subject: [PATCH] Quota SMP locks

shpte-ng.patch
  pagetable sharing for ia32

shpte-nonlinear.patch
  shpte: support nonlinear mappings and clean up clear_share_range()

shpte-always-on.patch
  Force CONFIG_SHAREPTE=y for ia32

ptrace-flush.patch
  Subject: [PATCH] ptrace on 2.5.44

buffer-debug.patch
  buffer.c debugging

misc.patch
  misc fixes

warn-null-wakeup.patch

pentium-II.patch
  Pentium-II support bits

rcu-stats.patch
  RCU statistics reporting

auto-unplug.patch
  self-unplugging request queues

less-unplugging.patch
  Remove most of the blk_run_queues() calls

ext3-fsync-speedup.patch
  Clean up ext3_sync_file()

lockless-current_kernel_time.patch
  Lockless current_kernel_timer()

remove-PF_NOWARN.patch
  Remove PF_NOWARN

scheduler-tunables.patch
  scheduler tunables

blocking-kswapd.patch
  Give kswapd writeback higher priority than pdflush

ext3-alloc-spread.patch
  ext3: smarter block allocation startup

ext2-alloc-spread.patch
  ext2: smarter block allocation startup

spread-find_group_other.patch
  ext2/3: better starting group for S_ISREG files

iosched-doc.patch
  iosched tunables documentation

ext3-use-after-free.patch
  ext3 use-after-free bugfix

dio-always-kmalloc.patch
  direct-io: dynamically allocate struct dio

file-nr-doc-fix.patch
  Docs: fix explanation of file-nr

set_page_dirty_lock.patch
  fix set_page_dirty vs truncate&free races

dcache_rcu-2.patch
  dcache_rcu-2-2.5.51.patch

dcache_rcu-3.patch
  dcache_rcu-3-2.5.51.patch

page-walk-api.patch

page-walk-scsi.patch

page-walk-api-update.patch
  pagewalk API update

gup-check-valid.patch
  valid page test in get_user_pages()
--
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/

^ permalink raw reply

* [patch][2.5] ISAPNP helper macros
From: Zwane Mwaikambo @ 2002-12-16  8:25 UTC (permalink / raw)
  To: Linux Kernel; +Cc: Linus Torvalds, Adam Belay

I Don't think there is anything wrong with keeping these in, and they
simplify in the conversion process.

Index: linux-2.5.51/include/linux/pnp.h
===================================================================
RCS file: /build/cvsroot/linux-2.5.51/include/linux/pnp.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 pnp.h
--- linux-2.5.51/include/linux/pnp.h	10 Dec 2002 12:47:35 -0000	1.1.1.1
+++ linux-2.5.51/include/linux/pnp.h	11 Dec 2002 23:12:06 -0000
@@ -23,6 +23,16 @@
 #define DEVICE_COUNT_RESOURCE	12
 #define MAX_DEVICES		8

+#define ISAPNP_ANY_ID		0xffff
+#define ISAPNP_VENDOR(a,b,c)	(((((a)-'A'+1)&0x3f)<<2)|\
+				((((b)-'A'+1)&0x18)>>3)|((((b)-'A'+1)&7)<<13)|\
+				((((c)-'A'+1)&0x1f)<<8))
+#define ISAPNP_DEVICE(x)	((((x)&0xf000)>>8)|\
+				 (((x)&0x0f00)>>8)|\
+				 (((x)&0x00f0)<<8)|\
+				 (((x)&0x000f)<<8))
+#define ISAPNP_FUNCTION(x)	ISAPNP_DEVICE(x)
+
 struct pnp_resource;
 struct pnp_protocol;
 struct pnp_id;

-- 
function.linuxpower.ca

^ permalink raw reply

* 2.5.52-mm1
From: Andrew Morton @ 2002-12-16  8:36 UTC (permalink / raw)
  To: lkml, linux-mm


url: http://www.zipworld.com.au/~akpm/linux/patches/2.5/2.5.52/2.5.52-mm1/

  -> 2.5.52-mm1-shpte.gz       For Dave
  -> 2.5.52-mm1.gz             Full patch

A bunch of random stuff.  Most notably I now have restored ext2/ext3
dbench throughput on SMP to about the same level as it was before the
introduction of the Orlov allocator.

This was not the fault of the Orlov allocator - it just exposed some
weaknesses in the block allocation algorithms.  These changes should
benefit a range of workloads.


Changes since 2.5.51-mm2:

-PF_MEMALLOC-no-recur.patch
-deprecate-bdflush.patch
-bcrl-printk.patch
-read_zero-speedup.patch
-nommu-rmap-locking.patch
-semtimedop.patch
-writeback-handle-memory-backed.patch
-2-remove-fail_writepage.patch
-wli-show_free_areas.patch
-pmd-allocation-fix.patch
-radix-tree-overflow-fix.patch
-sync_fs.patch
-ext3_sync_fs.patch
-filldir-checks.patch
-vmstats-fixes.patch
-hugetlb-fixes.patch
-writeback-interaction-fix.patch
-scalable-zone-protection.patch
-page-wait-table-min-size.patch
-ext3-transaction-reserved-blocks.patch
-remove-PF_SYNC.patch
-dont-inherit-mlockall.patch
-bootmem-alloc-alignment.patch
-ext23_free_blocks-check.patch
-blkdev-rlimit.patch
-readahead-pinned-memory.patch
-remove-vmscan-check.patch
-max_sane_readahead.patch
-default-super-ops.patch
-mempool-atomic-check.patch
-page-allocator-off-by-one.patch
-cacheline-aligned-pte_chains.patch
-ext2-sync-dir-fix.patch

 Merged

-mmap-rounding-fix.patch

 Dropped.  Was already fixed in 2.5.

+sync_fs-deadlock-fix.patch

 Fix the fix for the fix for the ext3 journal=data umount bug.  Sigh.

+shrink_list-dirty-page-race.patch

 Fix an SMP race in page reclaim which isn't really there.

+slab-poisoning.patch

 Change the memory poisoning in the slab allocator so you can tell
 whether the oops was due to use-of-uninitialised-memory (0x5a5a5a5a)
 of use-of-freed-memory (0x6b6b6b6b)

+nommu-generic_file_readonly_mmap.patch

 Give !CONFIG_NOMMU a generic_file_readonly_mmap()

+misc.patch

 Minor fixes

+ext3-alloc-spread.patch
+ext2-alloc-spread.patch

 Don't start block allocation for new files at the zeroth block of
 the blockgroup all the time.

+spread-find_group_other.patch

 Don't place S_ISREG inodes into blockgroups which don't have any
 free blocks.

+iosched-doc.patch

 deadline IO scheduler docco.

+ext3-use-after-free.patch

 Fix the ext3 use-after-free bug which occurs when the filesystem runs
 out of space or inodes.

+dio-always-kmalloc.patch

 Never allocate `struct dio' on the stack.

+file-nr-doc-fix.patch

 Docco fix.

+set_page_dirty_lock.patch

 Lock pages when running set_page_dirty(), when there is nothing else
 to pin down page->mapping.

+gup-check-valid.patch

 Minor tweaks to the new page walker API.




All 48 patches:

linus.patch
  cset-1.980-to-1.981.txt.gz

kgdb.patch

sync_fs-deadlock-fix.patch
  sync_fs deadlock fix

shrink_list-dirty-page-race.patch
  fix a page dirtying race in vmscan.c

slab-poisoning.patch
  more informative slab poisoning

nommu-generic_file_readonly_mmap.patch
  Add generic_file_readonly_mmap() for nommu

dio-return-partial-result.patch

aio-direct-io-infrastructure.patch
  AIO support for raw/O_DIRECT

deferred-bio-dirtying.patch
  bio dirtying infrastructure

aio-direct-io.patch
  AIO support for raw/O_DIRECT

aio-dio-debug.patch

dio-reduce-context-switch-rate.patch
  Reduced wakeup rate in direct-io code

cputimes_stat.patch
  Retore per-cpu time accounting, with a config option

reduce-random-context-switch-rate.patch
  Reduce context switch rate due to the random driver

inlines-net.patch

rbtree-iosched.patch
  rbtree-based IO scheduler

deadsched-fix.patch
  deadline scheduler fix

quota-smp-locks.patch
  Subject: [PATCH] Quota SMP locks

shpte-ng.patch
  pagetable sharing for ia32

shpte-nonlinear.patch
  shpte: support nonlinear mappings and clean up clear_share_range()

shpte-always-on.patch
  Force CONFIG_SHAREPTE=y for ia32

ptrace-flush.patch
  Subject: [PATCH] ptrace on 2.5.44

buffer-debug.patch
  buffer.c debugging

misc.patch
  misc fixes

warn-null-wakeup.patch

pentium-II.patch
  Pentium-II support bits

rcu-stats.patch
  RCU statistics reporting

auto-unplug.patch
  self-unplugging request queues

less-unplugging.patch
  Remove most of the blk_run_queues() calls

ext3-fsync-speedup.patch
  Clean up ext3_sync_file()

lockless-current_kernel_time.patch
  Lockless current_kernel_timer()

remove-PF_NOWARN.patch
  Remove PF_NOWARN

scheduler-tunables.patch
  scheduler tunables

blocking-kswapd.patch
  Give kswapd writeback higher priority than pdflush

ext3-alloc-spread.patch
  ext3: smarter block allocation startup

ext2-alloc-spread.patch
  ext2: smarter block allocation startup

spread-find_group_other.patch
  ext2/3: better starting group for S_ISREG files

iosched-doc.patch
  iosched tunables documentation

ext3-use-after-free.patch
  ext3 use-after-free bugfix

dio-always-kmalloc.patch
  direct-io: dynamically allocate struct dio

file-nr-doc-fix.patch
  Docs: fix explanation of file-nr

set_page_dirty_lock.patch
  fix set_page_dirty vs truncate&free races

dcache_rcu-2.patch
  dcache_rcu-2-2.5.51.patch

dcache_rcu-3.patch
  dcache_rcu-3-2.5.51.patch

page-walk-api.patch

page-walk-scsi.patch

page-walk-api-update.patch
  pagewalk API update

gup-check-valid.patch
  valid page test in get_user_pages()

^ permalink raw reply

* [patch][2.5] OSS opl3sa2 pnp conversion
From: Zwane Mwaikambo @ 2002-12-16  8:23 UTC (permalink / raw)
  To: Linux Kernel; +Cc: Linus Torvalds, Alan Cox

This patch converts OSS opl3sa2 over to the new PnP layer as well as
merging the changes in the 2.4 tree. The driver has been tested on an
opl3sa3. The driver currently doesn't work in pnp mode.

Please apply

Index: linux-2.5.52/sound/oss/opl3sa2.c
===================================================================
RCS file: /build/cvsroot/linux-2.5.52/sound/oss/opl3sa2.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 opl3sa2.c
--- linux-2.5.52/sound/oss/opl3sa2.c	16 Dec 2002 05:17:04 -0000	1.1.1.1
+++ linux-2.5.52/sound/oss/opl3sa2.c	16 Dec 2002 07:38:44 -0000
@@ -56,7 +56,9 @@
  * Scott Murray            Some small cleanups to the init code output.
  *                         (Jan 7, 2001)
  * Zwane Mwaikambo	   Added PM support. (Dec 4 2001)
- *
+ * Zwane Mwaikambo	   Code, data structure cleanups. (Feb 15 2002)
+ * Zwane Mwaikambo	   Free resources during auxiliary device probe
+ * 			   failures (Apr 29 2002)
  * Adam Belay              Converted driver to new PnP Layer (Oct 12, 2002)
  */

@@ -66,11 +68,15 @@
 #include <linux/module.h>
 #include <linux/delay.h>
 #include <linux/pm.h>
+#include <linux/delay.h>
 #include "sound_config.h"

 #include "ad1848.h"
 #include "mpu401.h"

+#define OPL3SA2_MODULE_NAME	"opl3sa2"
+#define PFX			OPL3SA2_MODULE_NAME ": "
+
 /* Useful control port indexes: */
 #define OPL3SA2_PM	     0x01
 #define OPL3SA2_SYS_CTRL     0x02
@@ -91,9 +97,10 @@
 #define DEFAULT_TIMBRE 0

 /* Power saving modes */
-#define OPL3SA2_PM_MODE1	0x05
-#define OPL3SA2_PM_MODE2	0x04
-#define OPL3SA2_PM_MODE3	0x03
+#define OPL3SA2_PM_MODE0	0x00
+#define OPL3SA2_PM_MODE1	0x04	/* PSV */
+#define OPL3SA2_PM_MODE2	0x05	/* PSV | PDX */
+#define OPL3SA2_PM_MODE3	0x27	/* ADOWN | PSV | PDN | PDX */

 /* For checking against what the card returns: */
 #define VERSION_UNKNOWN 0
@@ -107,6 +114,7 @@
 #define CHIPSET_UNKNOWN -1
 #define CHIPSET_OPL3SA2 0
 #define CHIPSET_OPL3SA3 1
+static const char *CHIPSET_TABLE[] = {"OPL3-SA2", "OPL3-SA3"};

 #ifdef CONFIG_PNP
 #define OPL3SA2_CARDS_MAX 4
@@ -117,40 +125,42 @@
 /* This should be pretty obvious */
 static int opl3sa2_cards_num; /* = 0 */

-/* What's my version(s)? */
-static int chipset[OPL3SA2_CARDS_MAX] = { CHIPSET_UNKNOWN };
-
-/* Oh well, let's just cache the name(s) */
-static char chipset_name[OPL3SA2_CARDS_MAX][12];
+typedef struct {
+	/* device resources */
+	unsigned short cfg_port;
+	struct address_info cfg;
+	struct address_info cfg_mss;
+	struct address_info cfg_mpu;

-/* Where's my mixer(s)? */
-static int opl3sa2_mixer[OPL3SA2_CARDS_MAX] = { -1 };
+#ifdef CONFIG_PNP
+	/* PnP Stuff */
+	struct pnp_dev* pdev;
+	int activated;			/* Whether said devices have been activated */
+#endif

-/* Bag o' mixer data */
-typedef struct opl3sa2_mixerdata_tag {
-	unsigned short cfg_port;
-	unsigned short padding;
-	unsigned char  reg;
-	unsigned int   in_suspend;
-	struct pm_dev  *pmdev;
-	unsigned int   card;
-	unsigned int   volume_l;
-	unsigned int   volume_r;
-	unsigned int   mic;
-	unsigned int   bass_l;
-	unsigned int   bass_r;
-	unsigned int   treble_l;
-	unsigned int   treble_r;
-	unsigned int   wide_l;
-	unsigned int   wide_r;
-} opl3sa2_mixerdata;
-static opl3sa2_mixerdata opl3sa2_data[OPL3SA2_CARDS_MAX];
-
-static struct address_info cfg[OPL3SA2_CARDS_MAX];
-static struct address_info cfg_mss[OPL3SA2_CARDS_MAX];
-static struct address_info cfg_mpu[OPL3SA2_CARDS_MAX];
+#ifdef CONFIG_PM
+	unsigned int	in_suspend;
+	struct pm_dev	*pmdev;
+#endif
+	unsigned int	card;
+	int		chipset;	/* What's my version(s)? */
+	char		*chipset_name;
+
+	/* mixer data */
+	int		mixer;
+	unsigned int	volume_l;
+	unsigned int	volume_r;
+	unsigned int	mic;
+	unsigned int	bass_l;
+	unsigned int	bass_r;
+	unsigned int	treble_l;
+	unsigned int	treble_r;
+	unsigned int	wide_l;
+	unsigned int	wide_r;
+} opl3sa2_state_t;
+static opl3sa2_state_t opl3sa2_state[OPL3SA2_CARDS_MAX];

-static spinlock_t	lock=SPIN_LOCK_UNLOCKED;
+static spinlock_t opl3sa2_lock = SPIN_LOCK_UNLOCKED;

 /* Our parameters */
 static int __initdata io	= -1;
@@ -236,12 +246,11 @@
 	*data = inb(port + 1);
 }

-
 /*
  * All of the mixer functions...
  */

-static void opl3sa2_set_volume(opl3sa2_mixerdata* devc, int left, int right)
+static void opl3sa2_set_volume(opl3sa2_state_t* devc, int left, int right)
 {
 	static unsigned char scale[101] = {
 		0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0e, 0x0e, 0x0e,
@@ -276,7 +285,7 @@
 }


-static void opl3sa2_set_mic(opl3sa2_mixerdata* devc, int level)
+static void opl3sa2_set_mic(opl3sa2_state_t* devc, int level)
 {
 	unsigned char vol = 0x1F;

@@ -291,7 +300,7 @@
 }


-static void opl3sa3_set_bass(opl3sa2_mixerdata* devc, int left, int right)
+static void opl3sa3_set_bass(opl3sa2_state_t* devc, int left, int right)
 {
 	unsigned char bass;

@@ -302,7 +311,7 @@
 }


-static void opl3sa3_set_treble(opl3sa2_mixerdata* devc, int left, int right)
+static void opl3sa3_set_treble(opl3sa2_state_t* devc, int left, int right)
 {
 	unsigned char treble;

@@ -313,7 +322,7 @@
 }


-static void opl3sa3_set_wide(opl3sa2_mixerdata* devc, int left, int right)
+static void opl3sa3_set_wide(opl3sa2_state_t* devc, int left, int right)
 {
 	unsigned char wide;

@@ -324,16 +333,16 @@
 }


-static void opl3sa2_mixer_reset(opl3sa2_mixerdata* devc, int card)
+static void opl3sa2_mixer_reset(opl3sa2_state_t* devc)
 {
-	if(devc) {
+	if (devc) {
 		opl3sa2_set_volume(devc, DEFAULT_VOLUME, DEFAULT_VOLUME);
 		devc->volume_l = devc->volume_r = DEFAULT_VOLUME;

 		opl3sa2_set_mic(devc, DEFAULT_MIC);
 		devc->mic = DEFAULT_MIC;

-		if(chipset[card] == CHIPSET_OPL3SA3) {
+		if (devc->chipset == CHIPSET_OPL3SA3) {
 			opl3sa3_set_bass(devc, DEFAULT_TIMBRE, DEFAULT_TIMBRE);
 			devc->bass_l = devc->bass_r = DEFAULT_TIMBRE;
 			opl3sa3_set_treble(devc, DEFAULT_TIMBRE, DEFAULT_TIMBRE);
@@ -343,13 +352,13 @@
 }


-static void opl3sa2_mixer_restore(opl3sa2_mixerdata* devc, int card)
+static void opl3sa2_mixer_restore(opl3sa2_state_t* devc)
 {
 	if (devc) {
 		opl3sa2_set_volume(devc, devc->volume_l, devc->volume_r);
 		opl3sa2_set_mic(devc, devc->mic);

-		if (chipset[card] == CHIPSET_OPL3SA3) {
+		if (devc->chipset == CHIPSET_OPL3SA3) {
 			opl3sa3_set_bass(devc, devc->bass_l, devc->bass_r);
 			opl3sa3_set_treble(devc, devc->treble_l, devc->treble_r);
 		}
@@ -391,7 +400,7 @@
 {
 	int cmdf = cmd & 0xff;

-	opl3sa2_mixerdata* devc = (opl3sa2_mixerdata*) mixer_devs[dev]->devc;
+	opl3sa2_state_t* devc = &opl3sa2_state[dev];

 	switch(cmdf) {
 		case SOUND_MIXER_VOLUME:
@@ -474,7 +483,7 @@
 {
 	int cmdf = cmd & 0xff;

-	opl3sa2_mixerdata* devc = (opl3sa2_mixerdata*) mixer_devs[dev]->devc;
+	opl3sa2_state_t* devc = &opl3sa2_state[dev];

 	switch(cmdf) {
 		case SOUND_MIXER_BASS:
@@ -584,9 +593,9 @@
 }


-static inline void __init attach_opl3sa2_mpu(struct address_info* hw_config)
+static inline int __init attach_opl3sa2_mpu(struct address_info* hw_config)
 {
-	attach_mpu401(hw_config, THIS_MODULE);
+	return attach_mpu401(hw_config, THIS_MODULE);
 }


@@ -617,7 +626,7 @@
 			AD1848_REROUTE(SOUND_MIXER_LINE3, SOUND_MIXER_LINE);
 		}
 		else {
-			printk(KERN_ERR "opl3sa2: MSS mixer not installed?\n");
+			printk(KERN_ERR PFX "MSS mixer not installed?\n");
 		}
 	}
 }
@@ -634,15 +643,14 @@
 	unsigned char misc;
 	unsigned char tmp;
 	unsigned char version;
-	char tag;

 	/*
-	 * Verify that the I/O port range is free.
+	 * Try and allocate our I/O port range.
 	 */
-	if(check_region(hw_config->io_base, 2)) {
-		printk(KERN_ERR "opl3sa2: Control I/O port %#x not free\n",
+	if(!request_region(hw_config->io_base, 2, OPL3SA2_MODULE_NAME)) {
+		printk(KERN_ERR PFX "Control I/O port %#x not free\n",
 		       hw_config->io_base);
-		return 0;
+		goto out_nodev;
 	}

 	/*
@@ -653,9 +661,9 @@
 	opl3sa2_write(hw_config->io_base, OPL3SA2_MISC, misc ^ 0x07);
 	opl3sa2_read(hw_config->io_base, OPL3SA2_MISC, &tmp);
 	if(tmp != misc) {
-		printk(KERN_ERR "opl3sa2: Control I/O port %#x is not a YMF7xx chipset!\n",
+		printk(KERN_ERR PFX "Control I/O port %#x is not a YMF7xx chipset!\n",
 		       hw_config->io_base);
-		return 0;
+		goto out_region;
 	}

 	/*
@@ -666,9 +674,9 @@
 	opl3sa2_read(hw_config->io_base, OPL3SA2_MIC, &tmp);
 	if((tmp & 0x9f) != 0x8a) {
 		printk(KERN_ERR
-		       "opl3sa2: Control I/O port %#x is not a YMF7xx chipset!\n",
+		       PFX "Control I/O port %#x is not a YMF7xx chipset!\n",
 		       hw_config->io_base);
-		return 0;
+		goto out_region;
 	}
 	opl3sa2_write(hw_config->io_base, OPL3SA2_MIC, tmp);

@@ -679,56 +687,54 @@
 	 * of the miscellaneous register.
 	 */
 	version = misc & 0x07;
-	printk(KERN_DEBUG "opl3sa2: chipset version = %#x\n", version);
+	printk(KERN_DEBUG PFX "chipset version = %#x\n", version);
 	switch(version) {
 		case 0:
-			chipset[card] = CHIPSET_UNKNOWN;
-			tag = '?'; /* silence compiler warning */
+			opl3sa2_state[card].chipset = CHIPSET_UNKNOWN;
 			printk(KERN_ERR
-			       "opl3sa2: Unknown Yamaha audio controller version\n");
+			       PFX "Unknown Yamaha audio controller version\n");
 			break;

 		case VERSION_YMF711:
-			chipset[card] = CHIPSET_OPL3SA2;
-			tag = '2';
-			printk(KERN_INFO "opl3sa2: Found OPL3-SA2 (YMF711)\n");
+			opl3sa2_state[card].chipset = CHIPSET_OPL3SA2;
+			printk(KERN_INFO PFX "Found OPL3-SA2 (YMF711)\n");
 			break;

 		case VERSION_YMF715:
-			chipset[card] = CHIPSET_OPL3SA3;
-			tag = '3';
+			opl3sa2_state[card].chipset = CHIPSET_OPL3SA3;
 			printk(KERN_INFO
-			       "opl3sa2: Found OPL3-SA3 (YMF715 or YMF719)\n");
+			       PFX "Found OPL3-SA3 (YMF715 or YMF719)\n");
 			break;

 		case VERSION_YMF715B:
-			chipset[card] = CHIPSET_OPL3SA3;
-			tag = '3';
+			opl3sa2_state[card].chipset = CHIPSET_OPL3SA3;
 			printk(KERN_INFO
-			       "opl3sa2: Found OPL3-SA3 (YMF715B or YMF719B)\n");
+			       PFX "Found OPL3-SA3 (YMF715B or YMF719B)\n");
 			break;

 		case VERSION_YMF715E:
 		default:
-			chipset[card] = CHIPSET_OPL3SA3;
-			tag = '3';
+			opl3sa2_state[card].chipset = CHIPSET_OPL3SA3;
 			printk(KERN_INFO
-			       "opl3sa2: Found OPL3-SA3 (YMF715E or YMF719E)\n");
+			       PFX "Found OPL3-SA3 (YMF715E or YMF719E)\n");
 			break;
 	}

-	if(chipset[card] != CHIPSET_UNKNOWN) {
+	if(opl3sa2_state[card].chipset != CHIPSET_UNKNOWN) {
 		/* Generate a pretty name */
-		sprintf(chipset_name[card], "OPL3-SA%c", tag);
-		return 1;
+		opl3sa2_state[card].chipset_name = (char *)CHIPSET_TABLE[opl3sa2_state[card].chipset];
+		return 0;
 	}
-	return 0;
+
+out_region:
+	release_region(hw_config->io_base, 2);
+out_nodev:
+	return -ENODEV;
 }


 static void __init attach_opl3sa2(struct address_info* hw_config, int card)
 {
-   	request_region(hw_config->io_base, 2, chipset_name[card]);

 	/* Initialize IRQ configuration to IRQ-B: -, IRQ-A: WSS+MPU+OPL3 */
 	opl3sa2_write(hw_config->io_base, OPL3SA2_IRQ_CONFIG, 0x0d);
@@ -748,30 +754,28 @@
 static void __init attach_opl3sa2_mixer(struct address_info *hw_config, int card)
 {
 	struct mixer_operations* mixer_operations;
-	opl3sa2_mixerdata* devc;
+	opl3sa2_state_t* devc = &opl3sa2_state[card];

 	/* Install master mixer */
-	if(chipset[card] == CHIPSET_OPL3SA3) {
+	if(devc->chipset == CHIPSET_OPL3SA3) {
 		mixer_operations = &opl3sa3_mixer_operations;
 	}
 	else {
 		mixer_operations = &opl3sa2_mixer_operations;
 	}

-	if((devc = &opl3sa2_data[card])) {
-		devc->cfg_port = hw_config->io_base;
-
-		opl3sa2_mixer[card] = sound_install_mixer(MIXER_DRIVER_VERSION,
-							  mixer_operations->name,
-							  mixer_operations,
-							  sizeof(struct mixer_operations),
-							  devc);
-		if(opl3sa2_mixer[card] < 0) {
-			printk(KERN_ERR "opl3sa2: Could not install %s master mixer\n",
-				 mixer_operations->name);
-		}
-		else
-			opl3sa2_mixer_reset(devc, card);
+	devc->cfg_port = hw_config->io_base;
+	devc->mixer = sound_install_mixer(MIXER_DRIVER_VERSION,
+					  mixer_operations->name,
+					  mixer_operations,
+					  sizeof(struct mixer_operations),
+					  devc);
+	if(devc->mixer < 0) {
+		printk(KERN_ERR PFX "Could not install %s master mixer\n",
+			 mixer_operations->name);
+	}
+	else {
+			opl3sa2_mixer_reset(devc);
 	}
 }

@@ -799,13 +803,12 @@
 	 */
 	if(ymode >= 0 && ymode <= 3) {
 		unsigned char sys_ctrl;
-
 		opl3sa2_read(hw_config->io_base, OPL3SA2_SYS_CTRL, &sys_ctrl);
 		sys_ctrl = (sys_ctrl & 0xcf) | ((ymode & 3) << 4);
 		opl3sa2_write(hw_config->io_base, OPL3SA2_SYS_CTRL, sys_ctrl);
 	}
 	else {
-		printk(KERN_ERR "opl3sa2: not setting ymode, it must be one of 0,1,2,3\n");
+		printk(KERN_ERR PFX "not setting ymode, it must be one of 0,1,2,3\n");
 	}
 }

@@ -820,7 +823,7 @@
 		opl3sa2_write(hw_config->io_base, OPL3SA2_MISC, misc);
 	}
 	else {
-		printk(KERN_ERR "opl3sa2: not setting loopback, it must be either 0 or 1\n");
+		printk(KERN_ERR PFX "not setting loopback, it must be either 0 or 1\n");
 	}
 }

@@ -831,50 +834,54 @@
 	release_region(hw_config->io_base, 2);

 	/* Unload mixer */
-	if(opl3sa2_mixer[card] >= 0)
-		sound_unload_mixerdev(opl3sa2_mixer[card]);
+	if(opl3sa2_state[card].mixer >= 0)
+		sound_unload_mixerdev(opl3sa2_state[card].mixer);
 }

 #ifdef CONFIG_PNP
-struct pnp_id pnp_opl3sa2_list[] = {
+struct pnp_device_id pnp_opl3sa2_list[] = {
 	{.id = "YMH0021", .driver_data = 0},
 	{.id = ""}
 };

 MODULE_DEVICE_TABLE(pnp, pnp_opl3sa2_list);

-static int opl3sa2_pnp_probe(struct pnp_dev *dev, const struct pnp_id *dev_id)
+static int opl3sa2_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
 {
 	int card = opl3sa2_cards_num;
+
+	/* we don't actually want to return an error as the user may have specified
+	   no multiple card search
+	*/
 	if (opl3sa2_cards_num == OPL3SA2_CARDS_MAX)
 		return 0;
 	opl3sa2_activated[card] = 1;

 	/* Our own config: */
-	cfg[card].io_base = dev->resource[4].start;
-	cfg[card].irq     = dev->irq_resource[0].start;
-	cfg[card].dma     = dev->dma_resource[0].start;
-	cfg[card].dma2    = dev->dma_resource[1].start;
+	opl3sa2_state[card].cfg.io_base = dev->resource[4].start;
+	opl3sa2_state[card].cfg.irq     = dev->irq_resource[0].start;
+	opl3sa2_state[card].cfg.dma     = dev->dma_resource[0].start;
+	opl3sa2_state[card].cfg.dma2    = dev->dma_resource[1].start;

 	/* The MSS config: */
-	cfg_mss[card].io_base      = dev->resource[1].start;
-	cfg_mss[card].irq          = dev->irq_resource[0].start;
-	cfg_mss[card].dma          = dev->dma_resource[0].start;
-	cfg_mss[card].dma2         = dev->dma_resource[1].start;
-	cfg_mss[card].card_subtype = 1; /* No IRQ or DMA setup */
-
-	cfg_mpu[card].io_base       = dev->resource[3].start;
-	cfg_mpu[card].irq           = dev->irq_resource[0].start;
-	cfg_mpu[card].dma           = -1;
-	cfg_mpu[card].dma2          = -1;
-	cfg_mpu[card].always_detect = 1; /* It's there, so use shared IRQs */
+	opl3sa2_state[card].cfg_mss.io_base      = dev->resource[1].start;
+	opl3sa2_state[card].cfg_mss.irq          = dev->irq_resource[0].start;
+	opl3sa2_state[card].cfg_mss.dma          = dev->dma_resource[0].start;
+	opl3sa2_state[card].cfg_mss.dma2         = dev->dma_resource[1].start;
+	opl3sa2_state[card].cfg_mss.card_subtype = 1; /* No IRQ or DMA setup */
+
+	opl3sa2_state[card].cfg_mpu.io_base       = dev->resource[3].start;
+	opl3sa2_state[card].cfg_mpu.irq           = dev->irq_resource[0].start;
+	opl3sa2_state[card].cfg_mpu.dma           = -1;
+	opl3sa2_state[card].cfg_mpu.dma2          = -1;
+	opl3sa2_state[card].cfg_mpu.always_detect = 1; /* It's there, so use shared IRQs */

 	/* Call me paranoid: */
-	opl3sa2_clear_slots(&cfg[card]);
-	opl3sa2_clear_slots(&cfg_mss[card]);
-	opl3sa2_clear_slots(&cfg_mpu[card]);
+	opl3sa2_clear_slots(&opl3sa2_state[card].cfg);
+	opl3sa2_clear_slots(&opl3sa2_state[card].cfg_mss);
+	opl3sa2_clear_slots(&opl3sa2_state[card].cfg_mpu);

-	opl3sa2_dev[card] = dev;
+	opl3sa2_state[card].pdev = dev;
 	opl3sa2_cards_num++;

 	return 0;
@@ -890,19 +897,20 @@

 /* End of component functions */

+#ifdef CONFIG_PM
 /* Power Management support functions */
-static int opl3sa2_suspend(struct pm_dev *pdev, unsigned char pm_mode)
+static int opl3sa2_suspend(struct pm_dev *pdev, unsigned int pm_mode)
 {
 	unsigned long flags;
-	opl3sa2_mixerdata *p;
+	opl3sa2_state_t *p;

 	if (!pdev)
 		return -EINVAL;

-	spin_lock_irqsave(&lock,flags);
+	spin_lock_irqsave(&opl3sa2_lock,flags);
+
+	p = (opl3sa2_state_t *) pdev->data;

-	p = (opl3sa2_mixerdata *) pdev->data;
-	p->in_suspend = 1;
 	switch (pm_mode) {
 	case 1:
 		pm_mode = OPL3SA2_PM_MODE1;
@@ -914,35 +922,38 @@
 		pm_mode = OPL3SA2_PM_MODE3;
 		break;
 	default:
-		pm_mode = OPL3SA2_PM_MODE3;
-		break;
+		/* we don't know howto handle this... */
+		spin_unlock_irqrestore(&opl3sa2_lock, flags);
+		return -EBUSY;
 	}

+	p->in_suspend = 1;
 	/* its supposed to automute before suspending, so we wont bother */
-	opl3sa2_read(p->cfg_port, OPL3SA2_PM, &p->reg);
-	opl3sa2_write(p->cfg_port, OPL3SA2_PM, p->reg | pm_mode);
+	opl3sa2_write(p->cfg_port, OPL3SA2_PM, pm_mode);
+	/* wait a while for the clock oscillator to stabilise */
+	mdelay(10);

-	spin_unlock_irqrestore(&lock,flags);
+	spin_unlock_irqrestore(&opl3sa2_lock,flags);
 	return 0;
 }

 static int opl3sa2_resume(struct pm_dev *pdev)
 {
 	unsigned long flags;
-	opl3sa2_mixerdata *p;
+	opl3sa2_state_t *p;

 	if (!pdev)
 		return -EINVAL;

-	p = (opl3sa2_mixerdata *) pdev->data;
-	spin_lock_irqsave(&lock,flags);
+	p = (opl3sa2_state_t *) pdev->data;
+	spin_lock_irqsave(&opl3sa2_lock,flags);

 	/* I don't think this is necessary */
-	opl3sa2_write(p->cfg_port, OPL3SA2_PM, p->reg);
-	opl3sa2_mixer_restore(p, p->card);
+	opl3sa2_write(p->cfg_port, OPL3SA2_PM, OPL3SA2_PM_MODE0);
+	opl3sa2_mixer_restore(p);
 	p->in_suspend = 0;

-	spin_unlock_irqrestore(&lock,flags);
+	spin_unlock_irqrestore(&opl3sa2_lock,flags);
 	return 0;
 }

@@ -959,6 +970,7 @@
 	}
 	return 0;
 }
+#endif

 /*
  * Install OPL3-SA2 based card(s).
@@ -967,8 +979,7 @@
  */
 static int __init init_opl3sa2(void)
 {
-        int card;
-	int max;
+        int card, max;

 	/* Sanitize isapnp and multiple settings */
 	isapnp = isapnp != 0 ? 1 : 0;
@@ -993,51 +1004,55 @@
 		if(!isapnp) {
 			if(io == -1 || irq == -1 || dma == -1 ||
 			   dma2 == -1 || mss_io == -1) {
-				printk(KERN_ERR
-				       "opl3sa2: io, mss_io, irq, dma, and dma2 must be set\n");
+				printk(KERN_ERR PFX
+					"io, mss_io, irq, dma, and dma2 must be set\n");
 				return -EINVAL;
-				opl3sa2_cards_num++;
 			}
-
+
+			opl3sa2_cards_num++;
 			/*
 			 * Our own config:
 			 * (NOTE: IRQ and DMA aren't used, so they're set to
 			 *  give pretty output from conf_printf. :)
 			 */
-			cfg[card].io_base = io;
-			cfg[card].irq     = irq;
-			cfg[card].dma     = dma;
-			cfg[card].dma2    = dma2;
+			opl3sa2_state[card].cfg.io_base = io;
+			opl3sa2_state[card].cfg.irq     = irq;
+			opl3sa2_state[card].cfg.dma     = dma;
+			opl3sa2_state[card].cfg.dma2    = dma2;

 			/* The MSS config: */
-			cfg_mss[card].io_base      = mss_io;
-			cfg_mss[card].irq          = irq;
-			cfg_mss[card].dma          = dma;
-			cfg_mss[card].dma2         = dma2;
-			cfg_mss[card].card_subtype = 1; /* No IRQ or DMA setup */
-
-			cfg_mpu[card].io_base       = mpu_io;
-			cfg_mpu[card].irq           = irq;
-			cfg_mpu[card].dma           = -1;
-			cfg_mpu[card].always_detect = 1; /* Use shared IRQs */
+			opl3sa2_state[card].cfg_mss.io_base      = mss_io;
+			opl3sa2_state[card].cfg_mss.irq          = irq;
+			opl3sa2_state[card].cfg_mss.dma          = dma;
+			opl3sa2_state[card].cfg_mss.dma2         = dma2;
+			opl3sa2_state[card].cfg_mss.card_subtype = 1; /* No IRQ or DMA setup */
+
+			opl3sa2_state[card].cfg_mpu.io_base       = mpu_io;
+			opl3sa2_state[card].cfg_mpu.irq           = irq;
+			opl3sa2_state[card].cfg_mpu.dma           = -1;
+			opl3sa2_state[card].cfg_mpu.always_detect = 1; /* Use shared IRQs */

 			/* Call me paranoid: */
-			opl3sa2_clear_slots(&cfg[card]);
-			opl3sa2_clear_slots(&cfg_mss[card]);
-			opl3sa2_clear_slots(&cfg_mpu[card]);
+			opl3sa2_clear_slots(&opl3sa2_state[card].cfg);
+			opl3sa2_clear_slots(&opl3sa2_state[card].cfg_mss);
+			opl3sa2_clear_slots(&opl3sa2_state[card].cfg_mpu);
 		}
+
+		if (probe_opl3sa2(&opl3sa2_state[card].cfg, card))
+			return -ENODEV;

-		if(!probe_opl3sa2(&cfg[card], card) ||
-		   !probe_opl3sa2_mss(&cfg_mss[card])) {
+		if(!probe_opl3sa2_mss(&opl3sa2_state[card].cfg_mss)) {
 			/*
 			 * If one or more cards are already registered, don't
 			 * return an error but print a warning.  Note, this
 			 * should never really happen unless the hardware or
 			 * ISA PnP screwed up.
 			 */
+			release_region(opl3sa2_state[card].cfg.io_base, 2);
+
 			if(opl3sa2_cards_num) {
 				printk(KERN_WARNING
-				       "opl3sa2: There was a problem probing one "
+				       PFX "There was a problem probing one "
 				       " of the ISA PNP cards, continuing\n");
 				opl3sa2_cards_num--;
 				continue;
@@ -1045,47 +1060,54 @@
 				return -ENODEV;
 		}

-		attach_opl3sa2(&cfg[card], card);
-		conf_printf(chipset_name[card], &cfg[card]);
-		attach_opl3sa2_mss(&cfg_mss[card]);
-		attach_opl3sa2_mixer(&cfg[card], card);
+		attach_opl3sa2(&opl3sa2_state[card].cfg, card);
+		conf_printf(opl3sa2_state[card].chipset_name, &opl3sa2_state[card].cfg);
+		attach_opl3sa2_mixer(&opl3sa2_state[card].cfg, card);
+		attach_opl3sa2_mss(&opl3sa2_state[card].cfg_mss);
+
+		/* ewww =) */
+		opl3sa2_state[card].card = card;

-		opl3sa2_data[card].card = card;
+#ifdef CONFIG_PM
 		/* register our power management capabilities */
-		opl3sa2_data[card].pmdev = pm_register(PM_ISA_DEV, card, opl3sa2_pm_callback);
-		if (opl3sa2_data[card].pmdev)
-			opl3sa2_data[card].pmdev->data = &opl3sa2_data[card];
+		opl3sa2_state[card].pmdev = pm_register(PM_ISA_DEV, card, opl3sa2_pm_callback);
+		if (opl3sa2_state[card].pmdev)
+			opl3sa2_state[card].pmdev->data = &opl3sa2_state[card];
+#endif

 		/*
 		 * Set the Yamaha 3D enhancement mode (aka Ymersion) if asked to and
 		 * it's supported.
 		 */
 		if(ymode != -1) {
-			if(chipset[card] == CHIPSET_OPL3SA2) {
+			if(opl3sa2_state[card].chipset == CHIPSET_OPL3SA2) {
 				printk(KERN_ERR
-				       "opl3sa2: ymode not supported on OPL3-SA2\n");
+				       PFX "ymode not supported on OPL3-SA2\n");
 			}
 			else {
-				opl3sa2_set_ymode(&cfg[card], ymode);
+				opl3sa2_set_ymode(&opl3sa2_state[card].cfg, ymode);
 			}
 		}


 		/* Set A/D input to Mono loopback if asked to. */
 		if(loopback != -1) {
-			opl3sa2_set_loopback(&cfg[card], loopback);
+			opl3sa2_set_loopback(&opl3sa2_state[card].cfg, loopback);
 		}

-		/* Attach MPU if we've been asked to do so */
-		if(cfg_mpu[card].io_base != -1) {
-			if(probe_opl3sa2_mpu(&cfg_mpu[card])) {
-				attach_opl3sa2_mpu(&cfg_mpu[card]);
+		/* Attach MPU if we've been asked to do so, failure isn't fatal */
+		if(opl3sa2_state[card].cfg_mpu.io_base != -1) {
+			if(probe_opl3sa2_mpu(&opl3sa2_state[card].cfg_mpu)) {
+				if (attach_opl3sa2_mpu(&opl3sa2_state[card].cfg_mpu)) {
+					printk(KERN_ERR PFX "failed to attach MPU401\n");
+					opl3sa2_state[card].cfg_mpu.slots[1] = -1;
+				}
 			}
 		}
 	}

 	if(isapnp) {
-		printk(KERN_NOTICE "opl3sa2: %d PnP card(s) found.\n", opl3sa2_cards_num);
+		printk(KERN_NOTICE PFX "%d PnP card(s) found.\n", opl3sa2_cards_num);
 	}

 	return 0;
@@ -1100,14 +1122,14 @@
 	int card;

 	for(card = 0; card < opl3sa2_cards_num; card++) {
-		if (opl3sa2_data[card].pmdev)
-			pm_unregister(opl3sa2_data[card].pmdev);
+		if (opl3sa2_state[card].pmdev)
+			pm_unregister(opl3sa2_state[card].pmdev);

-	        if(cfg_mpu[card].slots[1] != -1) {
-			unload_opl3sa2_mpu(&cfg_mpu[card]);
+	        if(opl3sa2_state[card].cfg_mpu.slots[1] != -1) {
+			unload_opl3sa2_mpu(&opl3sa2_state[card].cfg_mpu);
 		}
-		unload_opl3sa2_mss(&cfg_mss[card]);
-		unload_opl3sa2(&cfg[card], card);
+		unload_opl3sa2_mss(&opl3sa2_state[card].cfg_mss);
+		unload_opl3sa2(&opl3sa2_state[card].cfg, card);

 #ifdef CONFIG_PNP
 		pnp_unregister_driver(&opl3sa2_driver);

-- 
function.linuxpower.ca

^ permalink raw reply

* Re: two thermal zones
From: Ducrot Bruno @ 2002-12-16  8:14 UTC (permalink / raw)
  To: Giuseppe Ciotta -; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
In-Reply-To: <20021215233842.GA4242-mDuYiFNtgcQ@public.gmane.org>

Hi!

On Mon, Dec 16, 2002 at 12:38:42AM +0100, Giuseppe Ciotta - wrote:
> hi ! i have two thermal zones on my acer 634XVI they are:
> 
> THRC  THRS
> 
> what does they are respectively ?
> 

I have 0 (zero) thermal zone on my laptop!

I guess that it is better to have 2 thermal zones than nothing!

Cheers,

-- 
Ducrot Bruno

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.


-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/

^ permalink raw reply

* Re: [linux-lvm] VFS Locking Patch for 2.4.20?
From: Patrick Caulfield @ 2002-12-16  8:12 UTC (permalink / raw)
  To: linux-lvm
In-Reply-To: <200212161403.gBGE3WLh023355@hni.upb.de>

On Mon, Dec 16, 2002 at 03:03:32PM +0100, Christopher Odenbach wrote:
> 
> Hi,
> 
> is there anywhere a VFS locking patch for kernel version 2.4.20? The 
> latest LVM1-release only includes the one for 2.4.19.
> 
> Please reply also directly to me as I am not subscribed.

The 2.4.19 one should work just fine.

patrick

^ permalink raw reply

* [patch][2.5] ad1848 pnp conversion + fixes
From: Zwane Mwaikambo @ 2002-12-16  8:18 UTC (permalink / raw)
  To: Linux Kernel; +Cc: Linus Torvalds, Alan Cox

This patch converts ad1848 to the new PnP layer and has been tested on an
opl3sa2 here, without it it's non function in pnp mode. I'm willing to
field bug reports, (problems might occur for the modular case later on).

The patch also fixes a number of deadlocks from the cli/sti conversions

Please apply

Index: linux-2.5.52/sound/oss/ad1848.c
===================================================================
RCS file: /build/cvsroot/linux-2.5.52/sound/oss/ad1848.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 ad1848.c
--- linux-2.5.52/sound/oss/ad1848.c	16 Dec 2002 05:17:07 -0000	1.1.1.1
+++ linux-2.5.52/sound/oss/ad1848.c	16 Dec 2002 07:10:16 -0000
@@ -33,6 +33,7 @@
  * Alan Cox		: Added CS4236->4239 identification
  * Daniel T. Cobra	: Alernate config/mixer for later chips
  * Alan Cox		: Merged chip idents and config code
+ * Zwane Mwaikambo	: Converted to 2.5 PnP API
  *
  * TODO
  *		APM save restore assist code on IBM thinkpad
@@ -47,7 +48,6 @@
 #include <linux/module.h>
 #include <linux/stddef.h>
 #include <linux/pm.h>
-#include <linux/isapnp.h>
 #include <linux/pnp.h>
 #include <linux/spinlock.h>

@@ -107,6 +107,9 @@

 	/* Power management */
 	struct		pm_dev *pmdev;
+#ifdef CONFIG_PNP
+	struct pnp_dev	*pnp_dev;
+#endif
 } ad1848_info;

 typedef struct ad1848_port_info
@@ -180,16 +183,11 @@

 #ifdef CONFIG_PNP
 static int isapnp	= 1;
-static int isapnpjump	= 0;
-static int reverse	= 0;
-
 static int audio_activated = 0;
 #else
 static int isapnp	= 0;
 #endif

-
-
 static int      ad1848_open(int dev, int mode);
 static void     ad1848_close(int dev);
 static void     ad1848_output_block(int dev, unsigned long buf, int count, int intrflag);
@@ -207,17 +205,15 @@
 static void ad1848_tmr_reprogram(int dev);
 #endif

+/* has to be called with devc->lock held */
 static int ad_read(ad1848_info * devc, int reg)
 {
-	unsigned long flags;
 	int x;
 	int timeout = 900000;

 	while (timeout > 0 && inb(devc->base) == 0x80)	/*Are we initializing */
 		timeout--;

-	spin_lock_irqsave(&devc->lock,flags);
-
 	if(reg < 32)
 	{
 		outb(((unsigned char) (reg & 0xff) | devc->MCE_bit), io_Index_Addr(devc));
@@ -233,21 +229,18 @@
 		outb(((unsigned char) (xra & 0xff)), io_Indexed_Data(devc));
 		x = inb(io_Indexed_Data(devc));
 	}
-	spin_unlock_irqrestore(&devc->lock,flags);

 	return x;
 }

+/* has to be called with the devc->lock held */
 static void ad_write(ad1848_info * devc, int reg, int data)
 {
-	unsigned long flags;
 	int timeout = 900000;

 	while (timeout > 0 && inb(devc->base) == 0x80)	/* Are we initializing */
 		timeout--;

-	spin_lock_irqsave(&devc->lock,flags);
-
 	if(reg < 32)
 	{
 		outb(((unsigned char) (reg & 0xff) | devc->MCE_bit), io_Index_Addr(devc));
@@ -263,7 +256,6 @@
 		outb(((unsigned char) (xra & 0xff)), io_Indexed_Data(devc));
 		outb((unsigned char) (data & 0xff), io_Indexed_Data(devc));
 	}
-	spin_unlock_irqrestore(&devc->lock,flags);
 }

 static void wait_for_calibration(ad1848_info * devc)
@@ -307,10 +299,7 @@
 	 */

 	for (i = 6; i < 8; i++)
-	{
 		prev = devc->saved_regs[i] = ad_read(devc, i);
-	}
-
 }

 static void ad_unmute(ad1848_info * devc)
@@ -319,37 +308,28 @@

 static void ad_enter_MCE(ad1848_info * devc)
 {
-	unsigned long flags;
 	int timeout = 1000;
 	unsigned short prev;

 	while (timeout > 0 && inb(devc->base) == 0x80)	/*Are we initializing */
 		timeout--;

-	spin_lock_irqsave(&devc->lock,flags);
-
 	devc->MCE_bit = 0x40;
 	prev = inb(io_Index_Addr(devc));
 	if (prev & 0x40)
-	{
-		spin_unlock_irqrestore(&devc->lock,flags);
 		return;
-	}
+
 	outb((devc->MCE_bit), io_Index_Addr(devc));
-	spin_unlock_irqrestore(&devc->lock,flags);
 }

 static void ad_leave_MCE(ad1848_info * devc)
 {
-	unsigned long flags;
 	unsigned char prev, acal;
 	int timeout = 1000;

 	while (timeout > 0 && inb(devc->base) == 0x80)	/*Are we initializing */
 		timeout--;

-	spin_lock_irqsave(&devc->lock,flags);
-
 	acal = ad_read(devc, 9);

 	devc->MCE_bit = 0x00;
@@ -357,14 +337,11 @@
 	outb((0x00), io_Index_Addr(devc));	/* Clear the MCE bit */

 	if ((prev & 0x40) == 0)	/* Not in MCE mode */
-	{
-		spin_unlock_irqrestore(&devc->lock,flags);
 		return;
-	}
+
 	outb((0x00), io_Index_Addr(devc));	/* Clear the MCE bit */
 	if (acal & 0x08)	/* Auto calibration is enabled */
 		wait_for_calibration(devc);
-	spin_unlock_irqrestore(&devc->lock,flags);
 }

 static int ad1848_set_recmask(ad1848_info * devc, int mask)
@@ -375,12 +352,9 @@
 	mask &= devc->supported_rec_devices;

 	/* Rename the mixer bits if necessary */
-	for (i = 0; i < 32; i++)
-	{
-		if (devc->mixer_reroute[i] != i)
-		{
-			if (mask & (1 << i))
-			{
+	for (i = 0; i < 32; i++) {
+		if (devc->mixer_reroute[i] != i) {
+			if (mask & (1 << i)) {
 				mask &= ~(1 << i);
 				mask |= (1 << devc->mixer_reroute[i]);
 			}
@@ -462,12 +436,9 @@
 	}

 	/* Rename the mixer bits back if necessary */
-	for (i = 0; i < 32; i++)
-	{
-		if (devc->mixer_reroute[i] != i)
-		{
-			if (mask & (1 << devc->mixer_reroute[i]))
-			{
+	for (i = 0; i < 32; i++) {
+		if (devc->mixer_reroute[i] != i) {
+			if (mask & (1 << devc->mixer_reroute[i])) {
 				mask &= ~(1 << devc->mixer_reroute[i]);
 				mask |= (1 << i);
 			}
@@ -494,13 +465,11 @@
 	mask = (1 << devc->mix_devices[dev][chn].nbits) - 1;
 	shift = devc->mix_devices[dev][chn].bitpos;

-	if (devc->mix_devices[dev][chn].mutepos == 8)
-	{			/* if there is no mute bit */
+	if (devc->mix_devices[dev][chn].mutepos == 8) {
+		/* if there is no mute bit */
 		mute = 0;	/* No mute bit; do nothing special */
 		mutemask = ~0;	/* No mute bit; do nothing special */
-	}
-	else
-	{
+	} else {
 		mute = (set_mute_bit << devc->mix_devices[dev][chn].mutepos);
 		mutemask = ~(1 << devc->mix_devices[dev][chn].mutepos);
 	}
@@ -600,9 +569,10 @@
 {
 	int i;
 	char name[32];
+	unsigned long flags;

+	spin_lock_irqsave(&devc->lock, flags);
 	devc->mix_devices = &(ad1848_mix_devices[0]);
-
 	sprintf(name, "%s_%d", devc->chip_name, nr_ad1848_devs);

 	for (i = 0; i < 32; i++)
@@ -656,12 +626,11 @@

 	devc->levels = load_mixer_volumes(name, default_mixer_levels, 1);

-	for (i = 0; i < SOUND_MIXER_NRDEVICES; i++)
-	{
+	for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) {
 		if (devc->supported_devices & (1 << i))
 			ad1848_mixer_set(devc, i, devc->levels[i]);
 	}
-
+
 	ad1848_set_recmask(devc, SOUND_MASK_MIC);

 	devc->mixer_output_port = devc->levels[31] | AUDIO_HEADPHONE | AUDIO_LINE_OUT;
@@ -679,13 +648,15 @@
 		/* Enable surround mode and SB16 mixer */
 		ad_write(devc, 16, 0x60);
 	}
+	spin_unlock_irqrestore(&devc->lock, flags);
 }

 static int ad1848_mixer_ioctl(int dev, unsigned int cmd, caddr_t arg)
 {
 	ad1848_info *devc = mixer_devs[dev]->devc;
+	unsigned long flags;
 	int val;
-
+
 	if (cmd == SOUND_MIXER_PRIVATE1)
 	{
 		if (get_user(val, (int *)arg))
@@ -697,10 +668,12 @@
 			devc->mixer_output_port = val;
 			val |= AUDIO_HEADPHONE | AUDIO_LINE_OUT;	/* Always on */
 			devc->mixer_output_port = val;
+			spin_lock_irqsave(&devc->lock, flags);
 			if (val & AUDIO_SPEAKER)
 				ad_write(devc, 26, ad_read(devc, 26) & ~0x40);	/* Unmute mono out */
 			else
 				ad_write(devc, 26, ad_read(devc, 26) | 0x40);		/* Mute mono out */
+			spin_unlock_irqrestore(&devc->lock, flags);
 		}
 		val = devc->mixer_output_port;
 		return put_user(val, (int *)arg);
@@ -720,13 +693,17 @@
 				case SOUND_MIXER_RECSRC:
 					if (get_user(val, (int *)arg))
 						return -EFAULT;
+					spin_lock_irqsave(&devc->lock, flags);
 					val = ad1848_set_recmask(devc, val);
+					spin_unlock_irqrestore(&devc->lock, flags);
 					break;

 				default:
 					if (get_user(val, (int *)arg))
 					return -EFAULT;
+					spin_lock_irqsave(&devc->lock, flags);
 					val = ad1848_mixer_set(devc, cmd & 0xff, val);
+					spin_unlock_irqrestore(&devc->lock, flags);
 					break;
 			}
 			return put_user(val, (int *)arg);
@@ -977,7 +954,7 @@
 {
 	ad1848_info    *devc;
 	ad1848_port_info *portc;
-	unsigned long   flags;
+	unsigned long flags;

 	if (dev < 0 || dev >= num_audiodevs)
 		return -ENXIO;
@@ -985,18 +962,16 @@
 	devc = (ad1848_info *) audio_devs[dev]->devc;
 	portc = (ad1848_port_info *) audio_devs[dev]->portc;

-	spin_lock_irqsave(&devc->lock,flags);
-	if (portc->open_mode || (devc->open_mode & mode))
-	{
-		spin_unlock_irqrestore(&devc->lock,flags);
+	spin_lock_irqsave(&devc->lock, flags);
+	if (portc->open_mode || (devc->open_mode & mode)) {
+		spin_unlock_irqrestore(&devc->lock, flags);
 		return -EBUSY;
 	}
 	devc->dual_dma = 0;

 	if (audio_devs[dev]->flags & DMA_DUPLEX)
-	{
 		devc->dual_dma = 1;
-	}
+
 	devc->intr_active = 0;
 	devc->audio_mode = 0;
 	devc->open_mode |= mode;
@@ -1007,10 +982,10 @@
 		devc->record_dev = dev;
 	if (mode & OPEN_WRITE)
 		devc->playback_dev = dev;
-	spin_unlock_irqrestore(&devc->lock,flags);
 /*
  * Mute output until the playback really starts. This decreases clicking (hope so).
  */
+	spin_unlock_irqrestore(&devc->lock, flags);
 	ad_mute(devc);

 	return 0;
@@ -1018,23 +993,24 @@

 static void ad1848_close(int dev)
 {
-	unsigned long   flags;
 	ad1848_info    *devc = (ad1848_info *) audio_devs[dev]->devc;
 	ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc;
+	unsigned long flags;

 	DEB(printk("ad1848_close(void)\n"));
-
-	spin_lock_irqsave(&devc->lock,flags);
-
+
+	spin_lock_irqsave(&devc->lock, flags);
 	devc->intr_active = 0;
+	spin_unlock_irqrestore(&devc->lock, flags);
+
 	ad1848_halt(dev);

+	spin_lock_irqsave(&devc->lock, flags);
 	devc->audio_mode = 0;
 	devc->open_mode &= ~portc->open_mode;
 	portc->open_mode = 0;
-
+	spin_unlock_irqrestore(&devc->lock, flags);
 	ad_unmute(devc);
-	spin_unlock_irqrestore(&devc->lock,flags);
 }

 static void ad1848_output_block(int dev, unsigned long buf, int count, int intrflag)
@@ -1111,13 +1087,10 @@
 	}
 	spin_lock_irqsave(&devc->lock,flags);

-	if (devc->model == MD_1848)
-	{
+	if (devc->model == MD_1848) {
 		  ad_write(devc, 15, (unsigned char) (cnt & 0xff));
 		  ad_write(devc, 14, (unsigned char) ((cnt >> 8) & 0xff));
-	}
-	else
-	{
+	} else {
 		  ad_write(devc, 31, (unsigned char) (cnt & 0xff));
 		  ad_write(devc, 30, (unsigned char) ((cnt >> 8) & 0xff));
 	}
@@ -1184,15 +1157,13 @@
 	ad_leave_MCE(devc);	/*
 				 * Starts the calibration process.
 				 */
-	spin_unlock_irqrestore(&devc->lock,flags);
 	devc->xfer_count = 0;
+	spin_unlock_irqrestore(&devc->lock,flags);

 #ifndef EXCLUDE_TIMERS
 	if (dev == timer_installed && devc->timer_running)
 		if ((fs & 0x01) != (old_fs & 0x01))
-		{
 			ad1848_tmr_reprogram(dev);
-		}
 #endif
 	ad1848_halt_output(dev);
 	return 0;
@@ -1336,9 +1307,8 @@
 	if (!(ad_read(devc, 9) & 0x02))
 		return;		/* Capture not enabled */

-	spin_lock_irqsave(&devc->lock,flags);
-
 	ad_mute(devc);
+	spin_lock_irqsave(&devc->lock,flags);

 	{
 		int             tmout;
@@ -1372,9 +1342,9 @@
 	if (!(ad_read(devc, 9) & 0x01))
 		return;		/* Playback not enabled */

+	ad_mute(devc);
 	spin_lock_irqsave(&devc->lock,flags);

-	ad_mute(devc);
 	{
 		int             tmout;

@@ -1404,35 +1374,28 @@
 {
 	ad1848_info    *devc = (ad1848_info *) audio_devs[dev]->devc;
 	ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc;
-	unsigned long   flags;
 	unsigned char   tmp, old;

-	spin_lock_irqsave(&devc->lock,flags);
 	state &= devc->audio_mode;
-
 	tmp = old = ad_read(devc, 9);

-	if (portc->open_mode & OPEN_READ)
-	{
+	if (portc->open_mode & OPEN_READ) {
 		  if (state & PCM_ENABLE_INPUT)
 			  tmp |= 0x02;
 		  else
 			  tmp &= ~0x02;
 	}
-	if (portc->open_mode & OPEN_WRITE)
-	{
+	if (portc->open_mode & OPEN_WRITE) {
 		if (state & PCM_ENABLE_OUTPUT)
 			tmp |= 0x01;
 		else
 			tmp &= ~0x01;
 	}
 	/* ad_mute(devc); */
-	if (tmp != old)
-	{
+	if (tmp != old) {
 		  ad_write(devc, 9, tmp);
 		  ad_unmute(devc);
 	}
-	spin_unlock_irqrestore(&devc->lock,flags);
 }

 static void ad1848_init_hw(ad1848_info * devc)
@@ -1580,11 +1543,7 @@
 		printk(KERN_ERR "ad1848 - Too many audio devices\n");
 		return 0;
 	}
-	if (check_region(io_base, 4))
-	{
-		printk(KERN_ERR "ad1848.c: Port %x not free.\n", io_base);
-		return 0;
-	}
+
 	devc->base = io_base;
 	devc->irq_ok = 0;
 	devc->timer_running = 0;
@@ -1736,15 +1695,13 @@
 		*ad_flags = 0;

 	tmp1 = ad_read(devc, 12);
-	if (tmp1 & 0x80)
-	{
+	if (tmp1 & 0x80) {
 		if (ad_flags)
 			*ad_flags |= AD_F_CS4248;

 		devc->chip_name = "CS4248";	/* Our best knowledge just now */
 	}
-	if (optiC930 || (tmp1 & 0xc0) == (0x80 | 0x40))
-	{
+	if (optiC930 || (tmp1 & 0xc0) == (0x80 | 0x40)) {
 		/*
 		 *      CS4231 detected - is it?
 		 *
@@ -1935,8 +1892,7 @@
 	}

 	DDB(printk("ad1848_detect() - step L\n"));
-	if (ad_flags)
-	{
+	if (ad_flags) {
 		  if (devc->model != MD_1848)
 			  *ad_flags |= AD_F_CS4231;
 	}
@@ -1945,7 +1901,6 @@
 	if (devc->model == MD_1848 && ad1847_flag)
 		devc->chip_name = "AD1847";

-
 	if (sscape_flag == 1)
 		devc->model = MD_1845_SSCAPE;

@@ -1969,7 +1924,6 @@

 	ad1848_port_info *portc = NULL;

-	spin_lock_init(&devc->lock);
 	devc->irq = (irq > 0) ? irq : 0;
 	devc->open_mode = 0;
 	devc->timer_ticks = 0;
@@ -2039,17 +1993,14 @@

 	ad1848_init_hw(devc);

-	if (irq > 0)
-	{
+	if (irq > 0) {
 		devc->dev_no = my_dev;
-		if (request_irq(devc->irq, adintr, 0, devc->name, (void *)my_dev) < 0)
-		{
+		if (request_irq(devc->irq, adintr, 0, devc->name, (void *)my_dev) < 0) {
 			printk(KERN_WARNING "ad1848: Unable to allocate IRQ\n");
 			/* Don't free it either then.. */
 			devc->irq = 0;
 		}
-		if (capabilities[devc->model].flags & CAP_F_TIMER)
-		{
+		if (capabilities[devc->model].flags & CAP_F_TIMER) {
 #ifndef CONFIG_SMP
 			int x;
 			unsigned char tmp = ad_read(devc, 16);
@@ -2066,8 +2017,7 @@

 			if (devc->timer_ticks == 0)
 				printk(KERN_WARNING "ad1848: Interrupt test failed (IRQ%d)\n", irq);
-			else
-			{
+			else {
 				DDB(printk("Interrupt test OK\n"));
 				devc->irq_ok = 1;
 			}
@@ -2086,8 +2036,7 @@
 		ad1848_tmr_install(my_dev);
 #endif

-	if (!share_dma)
-	{
+	if (!share_dma) {
 		if (sound_alloc_dma(dma_playback, devc->name))
 			printk(KERN_WARNING "ad1848.c: Can't allocate DMA%d\n", dma_playback);

@@ -2100,8 +2049,7 @@
 				     dev_name,
 				     &ad1848_mixer_operations,
 				     sizeof(struct mixer_operations),
-				     devc)) >= 0)
-	{
+				     devc)) >= 0) {
 		audio_devs[my_dev]->mixer_dev = e;
 		if (owner)
 			mixer_devs[e]->owner = owner;
@@ -2112,6 +2060,7 @@
 int ad1848_control(int cmd, int arg)
 {
 	ad1848_info *devc;
+	unsigned long flags;

 	if (nr_ad1848_devs < 1)
 		return -ENODEV;
@@ -2123,9 +2072,11 @@
 		case AD1848_SET_XTAL:	/* Change clock frequency of AD1845 (only ) */
 			if (devc->model != MD_1845 || devc->model != MD_1845_SSCAPE)
 				return -EINVAL;
+			spin_lock_irqsave(&devc->lock, flags);
 			ad_enter_MCE(devc);
 			ad_write(devc, 29, (ad_read(devc, 29) & 0x1f) | (arg << 5));
 			ad_leave_MCE(devc);
+			spin_unlock_irqrestore(&devc->lock, flags);
 			break;

 		case AD1848_MIXER_REROUTE:
@@ -2140,11 +2091,13 @@
 			    !(devc->supported_rec_devices & (1 << o)))
 				return -EINVAL;

-			if (n == SOUND_MIXER_NONE)
-			{	/* Just hide this control */
+			if (n == SOUND_MIXER_NONE) {
+				/* Just hide this control */
+				spin_lock_irqsave(&devc->lock, flags);
 				ad1848_mixer_set(devc, o, 0);	/* Shut up it */
 				devc->supported_devices &= ~(1 << o);
 				devc->supported_rec_devices &= ~(1 << o);
+				spin_unlock_irqrestore(&devc->lock, flags);
 				break;
 			}

@@ -2171,23 +2124,19 @@
 	int i, mixer, dev = 0;
 	ad1848_info *devc = NULL;

-	for (i = 0; devc == NULL && i < nr_ad1848_devs; i++)
-	{
-		if (adev_info[i].base == io_base)
-		{
+	for (i = 0; devc == NULL && i < nr_ad1848_devs; i++) {
+		if (adev_info[i].base == io_base) {
 			devc = &adev_info[i];
 			dev = devc->dev_no;
 		}
 	}

-	if (devc != NULL)
-	{
+	if (devc != NULL) {
 		if(audio_devs[dev]->portc!=NULL)
 			kfree(audio_devs[dev]->portc);
 		release_region(devc->base, 4);

-		if (!share_dma)
-		{
+		if (!share_dma) {
 			if (devc->irq > 0) /* There is no point in freeing irq, if it wasn't allocated */
 				free_irq(devc->irq, (void *)devc->dev_no);

@@ -2198,12 +2147,14 @@

 		}
 		mixer = audio_devs[devc->dev_no]->mixer_dev;
-		if(mixer>=0)
+		if (mixer>=0)
 			sound_unload_mixerdev(mixer);

 		if (devc->pmdev)
 			pm_unregister(devc->pmdev);
-
+#ifdef CONFIG_PNP
+		put_device(&devc->pnp_dev->dev);
+#endif
 		nr_ad1848_devs--;
 		for ( ; i < nr_ad1848_devs ; i++)
 			adev_info[i] = adev_info[i+1];
@@ -2223,6 +2174,7 @@

 	dev = (int)dev_id;
 	devc = (ad1848_info *) audio_devs[dev]->devc;
+	spin_lock(&devc->lock);

 interrupt_again:		/* Jump back here if int status doesn't reset */

@@ -2237,18 +2189,12 @@
 	{
 		if (devc->model == MD_C930)
 		{		/* 82C930 has interrupt status register in MAD16 register MC11 */
-
-			spin_lock(&devc->lock);
-
 			/* 0xe0e is C930 address port
 			 * 0xe0f is C930 data port
 			 */
 			outb(11, 0xe0e);
 			c930_stat = inb(0xe0f);
 			outb((~c930_stat), 0xe0f);
-
-			spin_unlock(&devc->lock);
-
 			alt_stat = (c930_stat << 2) & 0x30;
 		}
 		else if (devc->model != MD_1848)
@@ -2285,6 +2231,7 @@
 	{
 		  goto interrupt_again;
 	}
+	spin_unlock(&devc->lock);
 }

 /*
@@ -2524,11 +2471,6 @@

 	DDB(printk("Entered probe_ms_sound(%x, %d)\n", hw_config->io_base, hw_config->card_subtype));

-	if (check_region(hw_config->io_base, 8))
-	{
-		printk(KERN_ERR "MSS: I/O port conflict\n");
-		return 0;
-	}
 	if (hw_config->card_subtype == 1)	/* Has no IRQ/DMA registers */
 	{
 		/* check_opl3(0x388, hw_config); */
@@ -2723,8 +2665,6 @@
 	unsigned long   xtal_nsecs;	/* nanoseconds per xtal oscillator tick */
 	unsigned long   divider;

-	spin_lock_irqsave(&devc->lock,flags);
-
 	/*
 	 * Length of the timer interval (in nanoseconds) depends on the
 	 * selected crystal oscillator. Check this from bit 0x01 of I8.
@@ -2751,6 +2691,7 @@
 	if (divider > 65535)	/* Overflow check */
 		divider = 65535;

+	spin_lock_irqsave(&devc->lock,flags);
 	ad_write(devc, 21, (divider >> 8) & 0xff);	/* Set upper bits */
 	ad_write(devc, 20, divider & 0xff);	/* Set lower bits */
 	ad_write(devc, 16, ad_read(devc, 16) | 0x40);	/* Start the timer */
@@ -2819,13 +2760,8 @@

 static int ad1848_suspend(ad1848_info *devc)
 {
-	unsigned long flags;
-
-	spin_lock_irqsave(&devc->lock,flags);
-
 	ad_mute(devc);

-	spin_unlock_irqrestore(&devc->lock,flags);
 	return 0;
 }

@@ -2833,9 +2769,8 @@
 {
 	unsigned long flags;
 	int mixer_levels[32], i;
-
-	spin_lock_irqsave(&devc->lock,flags);

+	local_irq_save(flags);
 	/* Thinkpad is a bit more of PITA than normal. The BIOS tends to
 	   restore it in a different config to the one we use.  Need to
 	   fix this somehow */
@@ -2860,7 +2795,7 @@
 		bits = interrupt_bits[devc->irq];
 		if (bits == -1) {
 			printk(KERN_ERR "MSS: Bad IRQ %d\n", devc->irq);
-			spin_unlock_irqrestore(&devc->lock,flags);
+			local_irq_restore(flags);
 			return -1;
 		}

@@ -2875,7 +2810,7 @@
 		outb((bits | dma_bits[devc->dma1] | dma2_bit), config_port);
 	}

-	spin_unlock_irqrestore(&devc->lock,flags);
+	local_irq_restore(flags);
 	return 0;
 }

@@ -2924,13 +2859,7 @@

 #ifdef CONFIG_PNP
 MODULE_PARM(isapnp,	"i");
-MODULE_PARM(isapnpjump,	"i");
-MODULE_PARM(reverse,	"i");
 MODULE_PARM_DESC(isapnp,	"When set to 0, Plug & Play support will be disabled");
-MODULE_PARM_DESC(isapnpjump,	"Jumps to a specific slot in the driver's PnP table. Use the source, Luke.");
-MODULE_PARM_DESC(reverse,	"When set to 1, will reverse ISAPnP search order");
-
-struct pnp_dev	*ad1848_dev  = NULL;

 /* Please add new entries at the end of the table */
 static struct {
@@ -2952,10 +2881,12 @@
                 ISAPNP_ANY_ID, ISAPNP_ANY_ID,
 		ISAPNP_VENDOR('C','S','C'), ISAPNP_FUNCTION(0x0100),
 		0, 0, 0, 1, 0},
-        {"OPL3-SA2 WSS mode",
+        /* This is handled by the opl3sa2 driver
+	{"OPL3-SA2 WSS mode",
         	ISAPNP_ANY_ID, ISAPNP_ANY_ID,
 		ISAPNP_VENDOR('Y','M','H'), ISAPNP_FUNCTION(0x0021),
                 1, 0, 0, 1, 1},
+	*/
 	{"Advanced Gravis InterWave Audio",
 		ISAPNP_VENDOR('G','R','V'), ISAPNP_DEVICE(0x0001),
 		ISAPNP_VENDOR('G','R','V'), ISAPNP_FUNCTION(0x0000),
@@ -2963,137 +2894,90 @@
 	{0}
 };

-static struct isapnp_device_id id_table[] __devinitdata = {
-	{	ISAPNP_VENDOR('C','M','I'), ISAPNP_DEVICE(0x0001),
-		ISAPNP_VENDOR('@','@','@'), ISAPNP_FUNCTION(0x0001), 0 },
-        {       ISAPNP_ANY_ID, ISAPNP_ANY_ID,
-		ISAPNP_VENDOR('C','S','C'), ISAPNP_FUNCTION(0x0000), 0 },
-        {       ISAPNP_ANY_ID, ISAPNP_ANY_ID,
-		ISAPNP_VENDOR('C','S','C'), ISAPNP_FUNCTION(0x0100), 0 },
-        {       ISAPNP_ANY_ID, ISAPNP_ANY_ID,
-		ISAPNP_VENDOR('Y','M','H'), ISAPNP_FUNCTION(0x0021), 0 },
-	{	ISAPNP_VENDOR('G','R','V'), ISAPNP_DEVICE(0x0001),
-		ISAPNP_VENDOR('G','R','V'), ISAPNP_FUNCTION(0x0000), 0 },
-	{0}
+static const struct pnp_device_id ad1848_id_table[] __devinitdata = {
+	{.id = "CMI0001" },
+	{.id = "@@@0001" },
+	{.id = "CSC0000" },
+	{.id = "CSC0100" },
+	/* {.id = "YMH0021" }, */
+	{.id = "GRV0001" },
+	{.id = "GRV0000" },
+	{.id = ""}
 };

-MODULE_DEVICE_TABLE(isapnp, id_table);
+MODULE_DEVICE_TABLE(pnp, ad1848_id_table);

-static struct pnp_dev *activate_dev(char *devname, char *resname, struct pnp_dev *dev)
+static int ad1848_isapnp_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *dev_id)
 {
-	int err;
+	ad1848_info *priv;
+	int mss_io_index, irq_index, dma_index, dma2_index;

-	/* Device already active? Let's use it */
-	if(dev->active)
-		return(dev);
+	if (nr_ad1848_devs >= MAX_AUDIO_DEV)
+		return -ENOSPC;

-	if((err = pnp_activate_dev(dev)) < 0) {
-		printk(KERN_ERR "ad1848: %s %s config failed (out of resources?)[%d]\n", devname, resname, err);
+	priv = &adev_info[nr_ad1848_devs];
+	priv->pnp_dev = pnp_dev;
+	pnp_set_drvdata(pnp_dev, priv);
+	get_device(&pnp_dev->dev);
+
+	mss_io_index = ad1848_isapnp_list[nr_ad1848_devs].mss_io;
+	irq_index = ad1848_isapnp_list[nr_ad1848_devs].irq;
+	dma_index = ad1848_isapnp_list[nr_ad1848_devs].dma;
+	dma2_index = ad1848_isapnp_list[nr_ad1848_devs].dma2;
+
+	cfg.io_base = pnp_dev->resource[mss_io_index].start;
+	cfg.irq = pnp_dev->irq_resource[irq_index].start;
+	cfg.dma = pnp_dev->dma_resource[dma_index].start;

-		pnp_disable_dev(dev);
+	if (dma2_index != -1)
+		cfg.dma2 = pnp_dev->dma_resource[dma2_index].start;
+	else
+		cfg.dma2 = -1;

-		return(NULL);
-	}
+	printk(KERN_NOTICE "ad1848: ISAPnP reports '%s' at i/o %#x, irq %d, dma %d, %d\n",
+		pnp_dev->name, cfg.io_base, cfg.irq, cfg.dma, cfg.dma2);
 	audio_activated = 1;
-	return(dev);
-}
-
-static struct pnp_dev *ad1848_init_generic(struct pnp_card *bus, struct address_info *hw_config, int slot)
-{
-
-	/* Configure Audio device */
-	if((ad1848_dev = pnp_find_dev(bus, ad1848_isapnp_list[slot].vendor, ad1848_isapnp_list[slot].function, NULL)))
-	{
-		if((ad1848_dev = activate_dev(ad1848_isapnp_list[slot].name, "ad1848", ad1848_dev)))
-		{
-			get_device(&ad1848_dev->dev);
-			hw_config->io_base 	= ad1848_dev->resource[ad1848_isapnp_list[slot].mss_io].start;
-			hw_config->irq 		= ad1848_dev->irq_resource[ad1848_isapnp_list[slot].irq].start;
-			hw_config->dma 		= ad1848_dev->dma_resource[ad1848_isapnp_list[slot].dma].start;
-			if(ad1848_isapnp_list[slot].dma2 != -1)
-				hw_config->dma2 = ad1848_dev->dma_resource[ad1848_isapnp_list[slot].dma2].start;
-			else
-				hw_config->dma2 = -1;
-                        hw_config->card_subtype = ad1848_isapnp_list[slot].type;
-		} else
-			return(NULL);
-	} else
-		return(NULL);
-
-	return(ad1848_dev);
-}

-static int __init ad1848_isapnp_init(struct address_info *hw_config, struct pnp_card *bus, int slot)
-{
-	char *busname = bus->name[0] ? bus->name : ad1848_isapnp_list[slot].name;
-
-	/* Initialize this baby. */
-
-	if(ad1848_init_generic(bus, hw_config, slot)) {
-		/* We got it. */
-
-		printk(KERN_NOTICE "ad1848: ISAPnP reports '%s' at i/o %#x, irq %d, dma %d, %d\n",
-		       busname,
-		       hw_config->io_base, hw_config->irq, hw_config->dma,
-		       hw_config->dma2);
-		return 1;
-	}
 	return 0;
 }

-static int __init ad1848_isapnp_probe(struct address_info *hw_config)
+static void ad1848_isapnp_remove(struct pnp_dev *pnp_dev)
 {
-	static int first = 1;
-	int i;
-
-	/* Count entries in sb_isapnp_list */
-	for (i = 0; ad1848_isapnp_list[i].card_vendor != 0; i++);
-	i--;
-
-	/* Check and adjust isapnpjump */
-	if( isapnpjump < 0 || isapnpjump > i) {
-		isapnpjump = reverse ? i : 0;
-		printk(KERN_ERR "ad1848: Valid range for isapnpjump is 0-%d. Adjusted to %d.\n", i, isapnpjump);
-	}
-
-	if(!first || !reverse)
-		i = isapnpjump;
-	first = 0;
-	while(ad1848_isapnp_list[i].card_vendor != 0) {
-		static struct pnp_card *bus = NULL;
-
-		while ((bus = pnp_find_card(
-				ad1848_isapnp_list[i].card_vendor,
-				ad1848_isapnp_list[i].card_device,
-				bus))) {
-
-			if(ad1848_isapnp_init(hw_config, bus, i)) {
-				isapnpjump = i; /* start next search from here */
-				return 0;
-			}
-		}
-		i += reverse ? -1 : 1;
-	}
-
-	return -ENODEV;
+	put_device(&pnp_dev->dev);
+	/* pnp_disable_dev(pnp_dev); does this belong here? -Zwane */
+	nr_ad1848_devs--;
 }
+
+static struct pnp_driver ad1848_driver = {
+	.name		= "ad1848",
+	.id_table	= ad1848_id_table,
+	.probe		= ad1848_isapnp_probe,
+	.remove		= ad1848_isapnp_remove,
+};
 #endif


 static int __init init_ad1848(void)
 {
+	int i;
 	printk(KERN_INFO "ad1848/cs4248 codec driver Copyright (C) by Hannu Savolainen 1993-1996\n");

+	for (i = 0; i < MAX_AUDIO_DEV; i++)
+		spin_lock_init(&adev_info[i].lock);
+
 #ifdef CONFIG_PNP
-	if(isapnp && (ad1848_isapnp_probe(&cfg) < 0) ) {
-		printk(KERN_NOTICE "ad1848: No ISAPnP cards found, trying standard ones...\n");
-		isapnp = 0;
+	if (isapnp) {	/* FIXME I don't think this override can work anymore... -Zwane */
+		/* On return our settings are in cfg */
+		pnp_register_driver(&ad1848_driver);
+		if (audio_activated == 0) {
+			printk(KERN_NOTICE "ad1848: No ISAPnP cards found, trying standard ones...\n");
+			isapnp = 0;
+		}
 	}
 #endif

-	if(io != -1) {
-	        if( isapnp == 0 )
-	        {
+	if (io != -1) {
+	        if ( isapnp == 0 ) {
 			if(irq == -1 || dma == -1) {
 				printk(KERN_WARNING "ad1848: must give I/O , IRQ and DMA.\n");
 				return -EINVAL;
@@ -3106,7 +2990,7 @@
 			cfg.card_subtype = type;
 	        }

-		if(!probe_ms_sound(&cfg))
+		if (!probe_ms_sound(&cfg))
 			return -ENODEV;
 		attach_ms_sound(&cfg, THIS_MODULE);
 		loaded = 1;
@@ -3116,15 +3000,11 @@

 static void __exit cleanup_ad1848(void)
 {
-	if(loaded)
+	if (loaded)
 		unload_ms_sound(&cfg);

 #ifdef CONFIG_PNP
-	if(ad1848_dev){
-		if(audio_activated)
-			pnp_disable_dev(ad1848_dev);
-		put_device(&ad1848_dev->dev);
-	}
+	pnp_unregister_driver(&ad1848_driver);
 #endif
 }

Index: linux-2.5.52/sound/oss/Makefile
===================================================================
RCS file: /build/cvsroot/linux-2.5.52/sound/oss/Makefile,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 Makefile
--- linux-2.5.52/sound/oss/Makefile	16 Dec 2002 05:17:05 -0000	1.1.1.1
+++ linux-2.5.52/sound/oss/Makefile	16 Dec 2002 05:52:23 -0000
@@ -13,6 +13,7 @@
 # Each configuration option enables a list of files.

 obj-$(CONFIG_SOUND_OSS)		+= sound.o
+obj-$(CONFIG_SOUND_MSS)         += ad1848.o
 obj-$(CONFIG_SOUND_CS4232)	+= cs4232.o ad1848.o

 # Please leave it as is, cause the link order is significant !
@@ -24,7 +25,6 @@
 obj-$(CONFIG_SOUND_SSCAPE)	+= sscape.o ad1848.o mpu401.o
 obj-$(CONFIG_SOUND_MAD16)	+= mad16.o ad1848.o sb_lib.o uart401.o
 obj-$(CONFIG_SOUND_CS4232)	+= cs4232.o uart401.o
-obj-$(CONFIG_SOUND_MSS)		+= ad1848.o
 obj-$(CONFIG_SOUND_OPL3SA2)	+= opl3sa2.o ad1848.o mpu401.o
 obj-$(CONFIG_SOUND_PAS)		+= pas2.o sb.o sb_lib.o uart401.o
 obj-$(CONFIG_SOUND_SB)		+= sb.o sb_lib.o uart401.o

-- 
function.linuxpower.ca

^ permalink raw reply

* Re: performance problems?
From: Malte Thoma @ 2002-12-16  8:06 UTC (permalink / raw)
  To: Markus Gaugusch; +Cc: ACPI-Devel
In-Reply-To: <Pine.LNX.4.44.0211191552030.31104-100000-sxQ525G0OhRQK2oVCIMtW7NldLUNz+W/@public.gmane.org>



Markus Gaugusch wrote:
> On Nov 19, Loic Jaquemet <ljaquemet-BNG0eM9rGRi0IRkH3yUr9EW4647UYGdYQQ4Iyu8u01E@public.gmane.org> wrote:
> 
>>i'am using 2.4.19 + around october patch ( I'll check that this evening )
>>on sony vaio fx502
>>[...]
>>when I fetch the /proc/acpi/<batteriesxxx>/state|info files, I get a 1-2
>>second freeze| lag ..
>>[...]
>>I'm not sure, but i think i didn't have this problem on pre-september
>>patches ..
> 
> No, it has been present before. I have an FX405 and can't use any battery
> monitor applet that reads the info file. Even a 'cat
> /proc/acpi/battery/BAT1/info' causes a noticable peak in my cpu monitor
> (kernel time). At least, it doesn't freeze keyboard anymore, thanks to the
> ACPI people!

You can try my 'heatload'. Because I have an Sony, too, I have made a 
workaround for the 'info'-File.
(I'm using an older ACPI-patch for kernel 2.4.18)


Greetings,

Malte




-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/

^ permalink raw reply

* [linux-lvm] VFS Locking Patch for 2.4.20?
From: Christopher Odenbach @ 2002-12-16  8:03 UTC (permalink / raw)
  To: linux-lvm

Hi,

is there anywhere a VFS locking patch for kernel version 2.4.20? The 
latest LVM1-release only includes the one for 2.4.19.

Please reply also directly to me as I am not subscribed.

Thanks,

Christopher


-- 
======================================================
    Dipl.-Ing. Christopher Odenbach
    HNI Rechnerbetrieb
    odenbach@uni-paderborn.de
    Tel.: +49 5251 60 6215
======================================================

^ permalink raw reply

* [patch][2.5] fix NULL Scsi_Host_Template.name entry + C99 initializers for aic7xxx
From: Zwane Mwaikambo @ 2002-12-16  8:09 UTC (permalink / raw)
  To: Linux Kernel; +Cc: Linus Torvalds

Initializes the ->name member and switches the struct over to C99
initializers whilst i'm there.

Please apply

Index: linux-2.5.52/drivers/scsi/aic7xxx/aic7xxx_linux_host.h
===================================================================
RCS file: /build/cvsroot/linux-2.5.52/drivers/scsi/aic7xxx/aic7xxx_linux_host.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 aic7xxx_linux_host.h
--- linux-2.5.52/drivers/scsi/aic7xxx/aic7xxx_linux_host.h	16 Dec 2002 05:16:13 -0000	1.1.1.1
+++ linux-2.5.52/drivers/scsi/aic7xxx/aic7xxx_linux_host.h	16 Dec 2002 07:57:13 -0000
@@ -64,24 +64,25 @@
  * to do with card config are filled in after the card is detected.
  */
 #define AIC7XXX	{						\
-	proc_info: ahc_linux_proc_info,				\
-	detect: ahc_linux_detect,				\
-	release: ahc_linux_release,				\
-	info: ahc_linux_info,					\
-	queuecommand: ahc_linux_queue,				\
-	eh_abort_handler: ahc_linux_abort,			\
-	eh_device_reset_handler: ahc_linux_dev_reset,		\
-	eh_bus_reset_handler: ahc_linux_bus_reset,		\
-	slave_configure: ahc_linux_slave_configure,		\
-	bios_param: AIC7XXX_BIOSPARAM,				\
-	can_queue: 253,		/* max simultaneous cmds      */\
-	this_id: -1,		/* scsi id of host adapter    */\
-	sg_tablesize: 0,	/* max scatter-gather cmds    */\
-	cmd_per_lun: 2,		/* cmds per lun		      */\
-	present: 0,		/* number of 7xxx's present   */\
-	unchecked_isa_dma: 0,	/* no memory DMA restrictions */\
-	use_clustering: ENABLE_CLUSTERING,			\
-	highmem_io: 1						\
+	.name = "aic7xxx",					\
+	.proc_info = ahc_linux_proc_info,			\
+	.detect = ahc_linux_detect,				\
+	.release = ahc_linux_release,				\
+	.info = ahc_linux_info,					\
+	.queuecommand = ahc_linux_queue,			\
+	.eh_abort_handler = ahc_linux_abort,			\
+	.eh_device_reset_handler = ahc_linux_dev_reset,		\
+	.eh_bus_reset_handler = ahc_linux_bus_reset,		\
+	.slave_configure = ahc_linux_slave_configure,		\
+	.bios_param = AIC7XXX_BIOSPARAM,			\
+	.can_queue = 253,		/* max simultaneous cmds      */\
+	.this_id = -1,		/* scsi id of host adapter    */\
+	.sg_tablesize = 0,	/* max scatter-gather cmds    */\
+	.cmd_per_lun = 2,		/* cmds per lun	      */\
+	.present = 0,		/* number of 7xxx's present   */\
+	.unchecked_isa_dma = 0,	/* no memory DMA restrictions */\
+	.use_clustering = ENABLE_CLUSTERING,			\
+	.highmem_io = 1						\
 }

 #endif /* _AIC7XXX_LINUX_HOST_H_ */
Index: linux-2.5.52/drivers/scsi/aic7xxx_old/aic7xxx.h
===================================================================
RCS file: /build/cvsroot/linux-2.5.52/drivers/scsi/aic7xxx_old/aic7xxx.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 aic7xxx.h
--- linux-2.5.52/drivers/scsi/aic7xxx_old/aic7xxx.h	16 Dec 2002 05:16:13 -0000	1.1.1.1
+++ linux-2.5.52/drivers/scsi/aic7xxx_old/aic7xxx.h	16 Dec 2002 07:52:15 -0000
@@ -30,25 +30,26 @@
  * to do with card config are filled in after the card is detected.
  */
 #define AIC7XXX	{						\
-	proc_info: aic7xxx_proc_info,				\
-	detect: aic7xxx_detect,					\
-	release: aic7xxx_release,				\
-	info: aic7xxx_info,					\
-	queuecommand: aic7xxx_queue,				\
-	slave_alloc: aic7xxx_slave_alloc,			\
-	slave_configure: aic7xxx_slave_configure,		\
-	slave_destroy: aic7xxx_slave_destroy,			\
-	bios_param: aic7xxx_biosparam,				\
-	eh_abort_handler: aic7xxx_abort,			\
-	eh_device_reset_handler: aic7xxx_bus_device_reset,	\
-	eh_host_reset_handler: aic7xxx_reset,			\
-	can_queue: 255,		/* max simultaneous cmds      */\
-	this_id: -1,		/* scsi id of host adapter    */\
-	sg_tablesize: 0,	/* max scatter-gather cmds    */\
-	cmd_per_lun: 3,		/* cmds per lun (linked cmds) */\
-	present: 0,		/* number of 7xxx's present   */\
-	unchecked_isa_dma: 0,	/* no memory DMA restrictions */\
-	use_clustering: ENABLE_CLUSTERING,			\
+	.name = "aic7xxx_old",					\
+	.proc_info = aic7xxx_proc_info,				\
+	.detect = aic7xxx_detect,				\
+	.release = aic7xxx_release,				\
+	.info = aic7xxx_info,					\
+	.queuecommand = aic7xxx_queue,				\
+	.slave_alloc = aic7xxx_slave_alloc,			\
+	.slave_configure = aic7xxx_slave_configure,		\
+	.slave_destroy = aic7xxx_slave_destroy,			\
+	.bios_param = aic7xxx_biosparam,			\
+	.eh_abort_handler = aic7xxx_abort,			\
+	.eh_device_reset_handler = aic7xxx_bus_device_reset,	\
+	.eh_host_reset_handler = aic7xxx_reset,			\
+	.can_queue = 255,		/* max simultaneous cmds      */\
+	.this_id = -1,		/* scsi id of host adapter    */\
+	.sg_tablesize = 0,	/* max scatter-gather cmds    */\
+	.cmd_per_lun = 3,		/* cmds per lun (linked cmds) */\
+	.present = 0,		/* number of 7xxx's present   */\
+	.unchecked_isa_dma = 0,	/* no memory DMA restrictions */\
+	.use_clustering = ENABLE_CLUSTERING,			\
 }

 extern int aic7xxx_queue(Scsi_Cmnd *, void (*)(Scsi_Cmnd *));
-- 
function.linuxpower.ca

^ permalink raw reply

* success with redneck rampage and a few questions
From: Peter Jay Salzman @ 2002-12-16  7:55 UTC (permalink / raw)
  To: linux-msdos

hi all,

redneck rampage runs great under an xdos box.  actually, i can't believe
how fast it is.  the sound is great.  very cool.   i see a lot of
improvements in dosemu since last year.

two questions:

1. i already read in the mailing list archives that there is no full
screen xdosemu.  it sounds like there never will be a fullscreen xdosemu
either.  however, the game runs but no graphics show up on a console.  i
enabled svga in the configure process and made sure that svgalib shows
up in ldd dosemu.bin.

the game gives an error message "vesa driver for 640x480 not supported.
i can hear the game fine; it's obviously running.  just no graphics.

i've attached my config file below.   any advice?


2. playing in an xdos box wouldn't be so bad if it would grab the mouse.
is there a way to get dosemu to grab the mouse exclusively?  everytime i
look too far left or right, the mouse pointer goes beyond the bounds of
the xdos box and the mouse leaves the game.

any way to bind the mouse exclusively to the game?

pete


# $_hdimage = "/root/dosemu/freedos"  
# $_hdimage = "/cdrom/FREEDOS/INSTALL/BOOTDISK/FLOPPY"
# $_hdimage = "/cdrom/FREEDOS/FDOS/BIN"
$_hdimage = "/root/bootdir"  
#			# List of hdimages or boot directories under
#                       # syshdimagedir (/var/lib/dosemu by default) 
#			# assigned in this order such as
#                       # "hdimage_c directory_d hdimage_e"
#			# Absolute pathnames are also allowed.
#                       # If the name begins with '/dev/', then partion
#                       # access is done instead of virtual hdimage such as
#                       # "/dev/hda1" or "/dev/hda1:ro" for readonly
#                       # Currently mounted devices and swap are refused.
#                       # Hdimages and devices may be mixed such as
#                       # "hdimage_c /dev/hda1 /dev/hda3:ro"
#                       # Note: 'wholedisk' is _not_ supported.
#$_hdimage_r = $_hdimage        # hdimages for 'restricted access (if different)
#
#$_debug = "-a+cw"	# same format as -D commandline option, ""="-a+cw".
#			# (but without the -D in front)
#$_features= ""		# list of temporary hacks, see release notes in
$_features= "0:10"		# list of temporary hacks, see release notes in
#			# the file ChangeLog. e.g "0:1 2:0", which means
#			# to set feature_0 to 1 and feature_2 to 0.
#$_mapping= ""		# preferred mapping driver, one of:
#			# auto, mapself, mapfile, mapshm
#$_timint = (on)		# emulate INT08 type timer interrupts
#$_mathco = (on)		# or off
$_cpu = "80586"		# CPU shown to DOS, valid values:  "80[345]86"
#			# or "emulated" for non-native CPU (386 in this case)
#
#$_rdtsc = (off)		# if possible use Pentium cycle counter
#$_cpuspeed = (0)	# 0 = calibrated by dosemu, else given (e.g.166.666)
$_xms = (8192)		# in Kbyte
$_ems = (2048)		# in Kbyte
#$_ems_frame = (0xe000)
$_dpmi = (0x16384)	# in Kbyte (default is 0 if running suid-root)
#$_dosmem = (640)	# in Kbyte, < 640
#$_hardware_ram = ""	# list of segment values/ranges such as
#			# "0xc8000 range 0xcc000,0xcffff"
#
#$_emusys = ""		# empty or 3 char., config.sys   -> config.XXX
#$_emuini = ""		# empty or 3 char., system.ini   -> system.XXX
#
$_hogthreshold = (0)	# 0 == all CPU power to DOSEMU
#$_term_char_set = ""	# Global code page and character set selection.
#			# "" == automatic, else: ibm, latin, latin1, latin2,
#			# koi8r
#
#                       # Character set used externally to dosemu
#$_external_char_set = ""
#                       # "" == use $_term_char_set one of else: 
#                       # "cp437", "cp737", "cp775", "cp850", "cp852", "cp857",
#                       # "cp860", "cp861", "cp862", "cp863", "cp864", "cp865",
#                       # "cp866", "cp869", "cp874",
#                       # "iso8859-1", "iso8859-2", "iso8859-3", "iso8859-4", 
#                       # "iso8859-5", "iso8859-6", "iso8859-7", "iso8859-8",
#                       # "iso8859_9", "iso8859-14", "iso8859-15", "koi8-r"
#
#                       # Character set used by dos programs
#$_internal_char_set = ""
#                       # "" == use $_term_char_set one of else: 
#			# "cp437", "cp737", "cp775", "cp850", "cp852", "cp857",
#                       # "cp860", "cp861", "cp862", "cp863", "cp864", "cp865",
#                       # "cp866", "cp869", "cp874"
#
#$_term_color = (on)	# terminal with color support
#$_term_updfreq = (4)	# time between refreshes (units: 20 == 1 second)
#$_escchar = (30)	# 30 == Ctrl-^, special-sequence prefix
#
$_rawkeyboard = (1)	# bypass normal keyboard input, maybe dangerous
#$_layout = "auto"	# one of: finnish(-latin1), de(-latin1), be, it, us
#			# uk, dk(-latin1), keyb-no, no-latin1, dvorak, po
#			# sg(-latin1), fr(-latin1), sf(-latin1), es(-latin1)
#			# sw, hu(-latin2), hu-cwi, keyb-user
#			# hr-cp852, hr-latin2, cz-qwerty, cz-qwertz, ru, tr.
#			# Or 'auto' (which tries to generate the table from
#			# the current Linux console settings)
#$_toggle = ""		# toggle alternate layout, one of "shift_shift",
#			# "ctrl_shift", "alt_shift". "" == disable toggling
#
#
#$_X_updfreq = (5)	# time between refreshes (units: 20 == 1 second)
#$_X_title = "DOS in a BOX"	# Title in the top bar of the window
#$_X_icon_name = "xdos"	# Text for icon, when minimized
#$_X_keycode = (auto) 	# on == translate keyboard via dosemu keytables
#			# or 'off' or 'auto'
#$_X_blinkrate = (12)	# blink rate for the cursor
#$_X_font = ""		# basename from /usr/X11R6/lib/X11/fonts/misc/*
#			# (without extension) e.g. "vga"
#$_X_mitshm = (on)	# Use shared memory extensions
#$_X_sharecmap = (off)	# share the colormap with other applications
#$_X_fixed_aspect = (on)	# Set fixed aspect for resizing the graphics window
#$_X_aspect_43 = (on)	# Always use an aspect ratio of 4:3 for graphics
#$_X_lin_filt = (off)	# Use linear filtering for >15 bpp interpolation
#$_X_bilin_filt = (off)	# Use bi-linear filtering for >15 bpp interpolation
#$_X_mode13fact = (2)	# initial size factor for video mode 0x13 (320x200)
#$_X_winsize = ""	# "x,y" of initial windows size (defaults to float)
#$_X_gamma = (1.0)	# gamma correction
#$_X_vgaemu_memsize = (1024) # size (in Kbytes) of the frame buffer for emulated vga
#$_X_lfb = (on)		# use linear frame buffer in VESA modes
#$_X_pm_interface = (on)	# use protected mode interface for VESA modes
$_X_mgrab_key = "Home"	# KeySym name to activate mouse grab, empty == off
#$_X_vesamode = ""	# "xres,yres ... xres,yres"
#			# List of vesamodes to add. The list has to contain
#			# SPACE separated "xres,yres" pairs
#
#
#
#$_vbootfloppy = ""	# if you want to boot from a virtual floppy:
#			# file name of the floppy image under DOSEMU_LIB_DIR
#			# e.g. "floppyimage" disables $_hdimage
#			#      "floppyimage +hd" does _not_ disable $_hdimage
#$_floppy_a ="threeinch"	# or "fiveinch" or "atapi" or empty, if non-existant
#			# optionally the device may be appended such as
#			# "threeinch:/dev/fd0"
#$_floppy_b = ""		# ditto for B:
#
#$_aspi = ""		# list of generic SCSI devices to make available
#			# for the builtin aspi driver (format of an entry
#			# is 'device:type:mappedtarget' such as
#			# "sg2:WORM sg3:Sequential-Access:6 sg4:CD-ROM" or
#			# "sg2:4 sg3:1:6 sg4:5" (which are equal)
#
#$_com1 = ""		# e.g. "/dev/mouse" or "/dev/ttyS0"
#$_com2 = ""		# e.g. "/dev/modem" or "/dev/ttyS1"
#$_com3 = ""		# ditto                "/dev/ttyS2"
#$_com4 = ""		# ditto                "/dev/ttyS3"
#			# Note: all "/dev/ttyXX" may be suffixed by the IRQ
#			# used (instead of the default one), such as
#			# "/dev/ttyS2 irq 5" or "/dev/ttyS3 irq 9"
#
#$_ttylocks = "/var/lock"# Lock directory (e.g. "/var/lock")
#
#$_mouse = ""		# one of: microsoft, mousesystems, logitech, mmseries
#			# mouseman, hitachi, busmouse, ps2, imps2
#$_mouse_dev = ""	# one of: com1, com2, com3, com4 or /dev/mouse
#$_mouse_flags = ""	# empty list or one or more of:
#			# "emulate3buttons cleardtr"
#$_mouse_baud = (0)	# baudrate, 0 == don't set
#
#$_printer = "lp"	# list of (/etc/printcap) printer names to appear as
#			# LPT1, LPT2, LPT3 (not all are needed, empty for none)
#$_printer_timeout = (20)# idle time in seconds before spooling out
#
$_sound = (on)		# sound support on/off
$_sb_base = (0x220)
$_sb_irq = (5)
$_sb_dma = (1)
$_sb_dsp = "/dev/dsp"
$_sb_mixer = ""         # or "/dev/mixer" if you allow that dosemu 
#                        # changes the volume
$_mpu_base = (0x330)
#
#$_joy_device = "/dev/js0 /dev/js1"     # 1st and 2nd joystick device 
#                       # e.g. "/dev/js0" or "/dev/js0 /dev/js1"
#                       #      (or "" if you don't want joystick support)
#			# 
#$_joy_dos_min = (1)	# range for joystick axis readings, must be > 0
#$_joy_dos_max = (150)	# avoid setting this to > 250
#$_joy_granularity = (1) 	# the higher, the less sensitive - 
#			# useful if you have a wobbly joystick
#                       #
#$_joy_latency = (0)    # delay between nonblocking linux joystick reads
#                       # increases performance if >0 and processor>=Pentium
#                       # recommended: 1-50ms or 0 if unsure
#  
#
# NOTE: IPX needs root privileges unless you setup /proc/net/ipx_route 
# in advance.
#
#$_ipxsupport = (off)	# or on
#
# NOTE: Network/packet driver support needs root privileges
#
#$_pktdriver = (off)	# 'on' for Packet Driver
#$_novell_hack = (off)
#$_netdev = "eth0"	# network device for Packet Driver
#$_vnet = (off)		# 'on' for packet-multi
#			# (used by dosnet, dsn0 overrides $_netdev)
#
# NOTE: the following settings are only valid in a system-wide dosemu.conf
# and cannot be changed by ~/.dosemurc. For these settings to take effect,
# DOSEMU must be run with root privileges.
#
#$_ports = ""		# list of portnumbers such as "0x1ce 0x1cf 0x238"
#			# or "0x1ce range 0x280,0x29f 310"
#			# or "range 0x1a0,(0x1a0+15)"
#
# MODE 1 (this stuff works in X)
# $_console = (1)	# use 'console' video
# $_graphics = (1)	# use the cards BIOS to set graphics
# ======= 
# MODE 2 (trying to get this working on console)
$_video = "vga"	# one of: plainvga, vga, ega, mda, mga, cga
$_console = (1)	# use 'console' video
$_graphics = (1)	# use the cards BIOS to set graphics
$_videoportaccess = (1)	# allow videoportaccess when 'graphics' enabled
$_vbios_seg = (0)	# set the address of your VBIOS (e.g. 0xc000, 0xe000)
$_vbios_size = (0)	# set the size of your BIOS (e.g. 0x10000, 0x8000).
#			# 0 for $_vbios_seg/$_vbios_size means autodetection
#			# (NOTE: DOSEMU must run in full feature mode for this)
$_vmemsize = (4096)	# size of regen buffer
$_chipset = "svgalib"		# one of: plainvga, trident, et4000, diamond, avance
#			# cirrus, matrox, wdvga, paradise, ati, s3, sis
#$_dualmon = (0)	# if you have one vga _plus_ one hgc (2 monitors)
$_secure ="0"	# secure for: n (normal users), g (guest), d (dexe)
#			# empty string: depending on 'restricted'
#			# "0": always insecure (not recommended)
#$_odd_hosts = ""	# black list such as "lucifer.hell.com billy.the.cat"
#$_diskless_hosts=""	# black list such as "hacker1 newbee gateway1"
#$_irqpassing = ""	# list of IRQ numbers (2-15) to pass to DOS such as
#			# "3 8 10"
#$_speaker = ""		# or "native" or "emulated"
$_pci = (on)          # on: give access to the PCI configuration space




^ permalink raw reply

* Re: aix7xxx_old woes in 2.5
From: Doug Ledford @ 2002-12-16  7:40 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-scsi
In-Reply-To: <3DFC06C9.19AFADE2@digeo.com>

On Sat, Dec 14, 2002 at 08:36:25PM -0800, Andrew Morton wrote:
> 
> ho hum.
> 
> It just doesn't start at all:
> 
> scsi HBA driver <NULL> didn't set max_sectors, please fix the template<6>(scsi0) <Adaptec AIC-7892 Ultra 160/m SCSI host adapter> found at PCI 3/4/0
> (scsi0) Wide Channel, SCSI ID=7, 32/255 SCBs
> (scsi0) Downloading sequencer code... 396 instructions downloaded
> (scsi1) <Adaptec AIC-7880 Ultra SCSI host adapter> found at PCI 0/10/0
> (scsi1) Wide Channel, SCSI ID=7, 16/255 SCBs
> (scsi1) Downloading sequencer code... 436 instructions downloaded
> scsi0 : Adaptec AHA274x/284x/294x (EISA/VLB/PCI-Fast SCSI) 5.2.6/5.2.0
>        <Adaptec AIC-7892 Ultra 160/m SCSI host adapter>
> scsi: Device offlined - not ready or command retry failed after error recovery: host 0 channel 0 id 0 lun 0
> scsi: Device offlined - not ready or command retry failed after error recovery: host 0 channel 0 id 1 lun 0
> scsi: Device offlined - not ready or command retry failed after error recovery: host 0 channel 0 id 2 lun 0
> scsi: Device offlined - not ready or command retry failed after error recovery: host 0 channel 0 id 3 lun 0
> scsi: Device offlined - not ready or command retry failed after error recovery: host 0 channel 0 id 4 lun 0
> scsi: Device offlined - not ready or command retry failed after error recovery: host 0 channel 0 id 5 lun 0
> scsi: Device offlined - not ready or command retry failed after error recovery: host 0 channel 0 id 6 lun 0
> scsi: Device offlined - not ready or command retry failed after error recovery: host 0 channel 0 id 8 lun 0
> 
> (The above took three minutes or more)

Interrupt routing problems is what that looks like to me, not driver 
problems.  Try booting with different interrupt settings or with a 
different kernel (smp vs. up, that sort of thing).

-- 
  Doug Ledford <dledford@redhat.com>     919-754-3700 x44233
         Red Hat, Inc. 
         1801 Varsity Dr.
         Raleigh, NC 27606
  

^ permalink raw reply

* [PATCH] RCU statistics 2.5.52
From: Dipankar Sarma @ 2002-12-16  7:38 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel

Hi Linus,

This is a re-transmit of the patch that adds some basic statistics to
RCU (/proc/rcu). The statistics made available by this patch are very generic
in nature - # of RCU requests and # of actual RCU updates for each
CPU. This will allow us to monitor the health of the RCU
subsystem and such things have been extremely useful for
investigating problems. For example, if a CPU looping in kernel
stops RCU grace period from completing, we would be easily able
to detect it by looking at these counters. Without these, that
becomes very difficult.

dipankar@llm04 dipankar]$ cat /proc/rcu
CPU : 0
RCU requests : 0
RCU updates : 0

CPU : 1
RCU requests : 0
RCU updates : 0

CPU : 2
RCU requests : 0
RCU updates : 0

CPU : 3
RCU requests : 0
RCU updates : 0

This patch has been in akpm's -mm tree for a long time now and would be nice
to have in your tree.

Thanks
Dipankar


 Documentation/filesystems/proc.txt |    4 +++
 fs/proc/proc_misc.c                |   13 ++++++++++
 include/linux/rcupdate.h           |    4 +++
 kernel/rcupdate.c                  |   48 +++++++++++++++++++++++++++++++++++--
 4 files changed, 67 insertions(+), 2 deletions(-)

diff -urN linux-2.5.52-base/Documentation/filesystems/proc.txt linux-2.5.52-rcu_stats/Documentation/filesystems/proc.txt
--- linux-2.5.52-base/Documentation/filesystems/proc.txt	2002-12-16 07:37:51.000000000 +0530
+++ linux-2.5.52-rcu_stats/Documentation/filesystems/proc.txt	2002-12-16 13:02:27.000000000 +0530
@@ -222,6 +222,7 @@
  partitions  Table of partitions known to the system           
  pci	     Depreciated info of PCI bus (new way -> /proc/bus/pci/, 
              decoupled by lspci					(2.4)
+ rcu	     Read-Copy Update information			(2.5)
  rtc         Real time clock                                   
  scsi        SCSI info (see text)                              
  slabinfo    Slab pool info                                    
@@ -346,6 +347,9 @@
 ZONE_DMA, 4 chunks of 2^1*PAGE_SIZE in ZONE_DMA, 101 chunks of 2^4*PAGE_SIZE 
 availble in ZONE_NORMAL, etc... 
 
+The rcu file gives information about Read-Copy Update synchronization
+primitive. It indicates the number for RCU requests and actual
+updates for every CPU.
 
 1.3 IDE devices in /proc/ide
 ----------------------------
diff -urN linux-2.5.52-base/fs/proc/proc_misc.c linux-2.5.52-rcu_stats/fs/proc/proc_misc.c
--- linux-2.5.52-base/fs/proc/proc_misc.c	2002-12-16 07:37:46.000000000 +0530
+++ linux-2.5.52-rcu_stats/fs/proc/proc_misc.c	2002-12-16 13:02:27.000000000 +0530
@@ -243,6 +243,18 @@
 	.release	= seq_release,
 };
 
+extern struct seq_operations rcu_op;
+static int rcu_open(struct inode *inode, struct file *file)
+{
+	return seq_open(file, &rcu_op);
+}
+static struct file_operations proc_rcu_operations = {
+	.open		= rcu_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= seq_release,
+};
+
 extern struct seq_operations vmstat_op;
 static int vmstat_open(struct inode *inode, struct file *file)
 {
@@ -586,6 +598,7 @@
 	if (entry)
 		entry->proc_fops = &proc_kmsg_operations;
 	create_seq_entry("cpuinfo", 0, &proc_cpuinfo_operations);
+	create_seq_entry("rcu", 0, &proc_rcu_operations);
 	create_seq_entry("partitions", 0, &proc_partitions_operations);
 #if !defined(CONFIG_ARCH_S390)
 	create_seq_entry("interrupts", 0, &proc_interrupts_operations);
diff -urN linux-2.5.52-base/include/linux/rcupdate.h linux-2.5.52-rcu_stats/include/linux/rcupdate.h
--- linux-2.5.52-base/include/linux/rcupdate.h	2002-12-16 07:37:50.000000000 +0530
+++ linux-2.5.52-rcu_stats/include/linux/rcupdate.h	2002-12-16 13:02:27.000000000 +0530
@@ -95,6 +95,8 @@
         long  	       	batch;           /* Batch # for current RCU batch */
         struct list_head  nxtlist;
         struct list_head  curlist;
+ 	long		nr_rcureqs;
+ 	long		nr_rcupdates;
 };
 
 DECLARE_PER_CPU(struct rcu_data, rcu_data);
@@ -105,6 +107,8 @@
 #define RCU_batch(cpu) 		(per_cpu(rcu_data, (cpu)).batch)
 #define RCU_nxtlist(cpu) 	(per_cpu(rcu_data, (cpu)).nxtlist)
 #define RCU_curlist(cpu) 	(per_cpu(rcu_data, (cpu)).curlist)
+#define RCU_nr_rcureqs(cpu) 	(per_cpu(rcu_data, (cpu)).nr_rcureqs)
+#define RCU_nr_rcupdates(cpu) 	(per_cpu(rcu_data, (cpu)).nr_rcupdates)
 
 #define RCU_QSCTR_INVALID	0
 
diff -urN linux-2.5.52-base/kernel/rcupdate.c linux-2.5.52-rcu_stats/kernel/rcupdate.c
--- linux-2.5.52-base/kernel/rcupdate.c	2002-12-16 07:37:43.000000000 +0530
+++ linux-2.5.52-rcu_stats/kernel/rcupdate.c	2002-12-16 13:02:27.000000000 +0530
@@ -41,6 +41,7 @@
 #include <linux/module.h>
 #include <linux/completion.h>
 #include <linux/percpu.h>
+#include <linux/seq_file.h>
 #include <linux/notifier.h>
 #include <linux/rcupdate.h>
 
@@ -75,6 +76,7 @@
 	local_irq_save(flags);
 	cpu = smp_processor_id();
 	list_add_tail(&head->list, &RCU_nxtlist(cpu));
+	RCU_nr_rcureqs(cpu)++;
 	local_irq_restore(flags);
 }
 
@@ -82,7 +84,7 @@
  * Invoke the completed RCU callbacks. They are expected to be in
  * a per-cpu list.
  */
-static void rcu_do_batch(struct list_head *list)
+static void rcu_do_batch(int cpu, struct list_head *list)
 {
 	struct list_head *entry;
 	struct rcu_head *head;
@@ -92,6 +94,7 @@
 		list_del(entry);
 		head = list_entry(entry, struct rcu_head, list);
 		head->func(head->arg);
+		RCU_nr_rcupdates(cpu)++;
 	}
 }
 
@@ -187,7 +190,7 @@
 	}
 	rcu_check_quiescent_state();
 	if (!list_empty(&list))
-		rcu_do_batch(&list);
+		rcu_do_batch(cpu, &list);
 }
 
 void rcu_check_callbacks(int cpu, int user)
@@ -266,3 +269,44 @@
 
 EXPORT_SYMBOL(call_rcu);
 EXPORT_SYMBOL(synchronize_kernel);
+
+#ifdef	CONFIG_PROC_FS
+
+static void *rcu_start(struct seq_file *m, loff_t *pos)
+{
+	static int cpu;
+	cpu = *pos;
+	return *pos < NR_CPUS ? &cpu : NULL;
+}
+		
+static void *rcu_next(struct seq_file *m, void *v, loff_t *pos) 
+{
+	++*pos;
+	return rcu_start(m, pos);
+}
+
+static void rcu_stop(struct seq_file *m, void *v)
+{
+}
+
+static int show_rcu(struct seq_file *m, void *v)
+{
+	int cpu = *(int *)v;
+
+	if (!cpu_online(cpu))
+		return 0;
+	seq_printf(m, "CPU : %d\n", cpu);
+	seq_printf(m, "RCU requests : %ld\n", RCU_nr_rcureqs(cpu));
+	seq_printf(m, "RCU updates : %ld\n\n", RCU_nr_rcupdates(cpu));
+	return 0;
+}
+
+struct seq_operations rcu_op = {
+	.start	= rcu_start,
+	.next	= rcu_next,
+	.stop	= rcu_stop,
+	.show	= show_rcu,
+};
+
+#endif
+

^ permalink raw reply

* Re: Intel P6 vs P7 system call performance
From: Albert D. Cahalan @ 2002-12-16  7:33 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Albert D. Cahalan, linux-kernel, hpa, terje.eggestad
In-Reply-To: <20021215220132.GB6347@elf.ucw.cz>

Pavel Machek writes:
> [Albert Cahalan]

>> Have apps enter kernel mode via Intel's purposely undefined
>> instruction, plus a few bytes of padding and identification.
>> Require that this not cross a page boundry. When it faults,
>> write the SYSENTER, INT 0x80, or SYSCALL as needed. Leave
>> the page marked clean so it doesn't need to hit swap; if it
>> gets paged in again it gets patched again.
>
> Thats *very* dirty hack. vsyscalls seem cleaner than that.

Sure it's dirty. It's also fast, with the only overhead being
a few NOPs that could get skipped on syscall return anyway.
Patching overhead is negligible, since it only happens when a
page is brought in fresh from the disk.

The vsyscall stuff costs you on every syscall. It's nice for
when you can avoid entering kernel mode entirely, but in that
case the hack I described above can write out a call to user
code (for time-of-day I imagine) just as well as it can write
out a SYSENTER, INT 0x80, or SYSCALL instruction.

Enter with INT 0x42 if you prefer, or just pick one of the new
instructions.

An alternative would be to hack ld.so to patch the syscalls,
but then you get dirty C-O-W pages in every address space.
Permissions change, swap gets used, etc.


^ permalink raw reply

* Re: gas "ljmp" instruction
From: Frederic Marmond @ 2002-12-16  7:24 UTC (permalink / raw)
  To: ram; +Cc: linux-assembly
In-Reply-To: <3DFD1CAF.6010106@curvesoft.com>

Hi,
ljmp is 'long jump'
A 'short' jump (standard jump) will move your ip pointer to a near area 
(in real mode, in the +/-32768 bytes around => jmp 0x1234, which is the 
offset).
If you need more displasment, you have to specify the segment (jmp 
0x1234:0x5678). This is a far jump (long jump). I don't remember opcodes.

In the bootsect.S, we only copy the code at a different place, and then, 
run into our copy:
# First things first. Move ourself from 0x7C00 -> 0x90000 and jump there.

    movw    $BOOTSEG, %ax
    movw    %ax, %ds        # %ds = BOOTSEG
    movw    $INITSEG, %ax
    movw    %ax, %es        # %ax = %es = INITSEG
    movw    $256, %cx
    subw    %si, %si
    subw    %di, %di
    cld
    rep
    movsw
    ljmp    $INITSEG, $go

We copy the code from BOOTSEG:0 to INITSEG:0, and jump to INITSEG:0.
Do you understant that?
cld: clear direction => auto increment
rep    : will repeat next instruction while cx>0
movsw: move word from ds:si to es:di and
        decrement cx
        increment si (by 2, as we are moving words)
        increment di (by 2 as well)
if the direction bit in the flags was 1, we would have decrement by2 si 
and di (so, the cld).

Is it clearer?


Fred



ram wrote:

> Hi,
>
> I was looking at bootsect.S in the Linux sources to understand how
> the boot process works and noticed the "ljmp" instruction but I can
> find no documentation on it either in the Intel docs or the gas docs.
> Does anyone know what it does, and more generally, is there
> some documentation on the full set of x86 opcode mnemonics supported
> by gas ? I'm a novice at the x86 instruction set ...
>
> Thanks.
>
> Ram
>
> -
> To unsubscribe from this list: send the line "unsubscribe 
> linux-assembly" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>




^ permalink raw reply

* slow NFS performance extracting bits from large files
From: Bruce Allen @ 2002-12-16  7:02 UTC (permalink / raw)
  To: nfs; +Cc: Bruce Allen

I've searched/browsed the mail archive and the online documentation but am
still a bit clueless about where to start.

I am working on a scientific data analysis application which needs to
extract a little bit of data from around 10,000 files.  The files
themselves are each around 1 MB in size. The application does:

for (i=0; i<10000; i++){
  open() ith file
  read() 32 bytes from beginning
  lseek() to somewhere in the middle of the file
  read() 620 bytes from the middle of the file
  close() ith file
}

If I run this with the data set on a local disk, the total run time is
around 1 sec -- very reasonable since I am transferring around 6 MB of
data.

If I run this on an NFS-mounted disk the performance is 100 times worse.
Both client and server are stock RH 7.3.  Note that if I run it a second
time, when the data is presumably cached, it takes just a few seconds to
run.

Is it obvious what needs to be changed/tuned to improve this performance?
Or if not, could someone suggest a tool and a strategy for tracing down
the cause of the poor performance?

Sincerely,
	Bruce Allen




-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply

* [BENCHMARK] no much change in performance of 2.5.52 as tested on LM bench
From: Aniruddha M Marathe @ 2002-12-16  7:08 UTC (permalink / raw)
  To: linux-kernel

Hi,
Here is a brief summary of results of LM bench on kernel 2.5.52

								2.5.52 	2.5.51
==============================================================================
Processor, Processes - times in microseconds - smaller is better

1.single handle						5.22		5.08
2. increase in time for fork proc 			362		403
------------------------------------------------------------------------------
Context switching - times in microseconds - smaller is better

1. 2p/16K ctxsw						4.84		5.01
------------------------------------------------------------------------------
*Local* Communication latencies in microseconds - smaller is better
1. pipe							8.005		8.26
------------------------------------------------------------------------------
File & VM system latencies in microseconds - smaller is better
1. 10K file delete					57		59
2. mmap latency						615		651
------------------------------------------------------------------------------
*Local* Communication bandwidths in MB/s - bigger is better
1. pipe							404		335
==============================================================================

Rest of the results are not much different.
	



                 L M B E N C H  2 . 0   S U M M A R Y
                 ------------------------------------
		 (Alpha software, do not distribute)

Basic system parameters
----------------------------------------------------
Host                 OS Description              Mhz
                                                    
--------- ------------- ----------------------- ----
benchtest  Linux 2.5.52       i686-pc-linux-gnu  790
benchtest  Linux 2.5.52       i686-pc-linux-gnu  790
benchtest  Linux 2.5.52       i686-pc-linux-gnu  790
benchtest  Linux 2.5.52       i686-pc-linux-gnu  790
benchtest  Linux 2.5.52       i686-pc-linux-gnu  790

Processor, Processes - times in microseconds - smaller is better
----------------------------------------------------------------
Host                 OS  Mhz null null      open selct sig  sig  fork exec sh  
                             call  I/O stat clos TCP   inst hndl proc proc proc
--------- ------------- ---- ---- ---- ---- ---- ----- ---- ---- ---- ---- ----
benchtest  Linux 2.5.52  790 0.46 0.83   27   28    37 1.30 5.22  363 1582 7961
benchtest  Linux 2.5.52  790 0.46 0.83   27   28    32 1.28 5.23  389 1575 7967
benchtest  Linux 2.5.52  790 0.44 0.80   27   28    34 1.30 5.21  353 1579 8109
benchtest  Linux 2.5.52  790 0.46 0.83   27   28    36 1.30 5.21  349 1581 7979
benchtest  Linux 2.5.52  790 0.46 0.83   27   28    37 1.30 5.23  403 1563 8033

Context switching - times in microseconds - smaller is better
-------------------------------------------------------------
Host                 OS 2p/0K 2p/16K 2p/64K 8p/16K 8p/64K 16p/16K 16p/64K
                        ctxsw  ctxsw  ctxsw ctxsw  ctxsw   ctxsw   ctxsw
--------- ------------- ----- ------ ------ ------ ------ ------- -------
benchtest  Linux 2.5.52 1.170 4.7900     14 7.2100    175      40     178
benchtest  Linux 2.5.52 1.170 4.8300     14 6.4700    179      39     179
benchtest  Linux 2.5.52 1.190 4.8500     14 5.5800    177      41     178
benchtest  Linux 2.5.52 1.260 4.8800     14 5.5200    182      41     180
benchtest  Linux 2.5.52 1.230 4.9400     14 8.0500    181      39     179

*Local* Communication latencies in microseconds - smaller is better
-------------------------------------------------------------------
Host                 OS 2p/0K  Pipe AF     UDP  RPC/   TCP  RPC/ TCP
                        ctxsw       UNIX         UDP         TCP conn
--------- ------------- ----- ----- ---- ----- ----- ----- ----- ----
benchtest  Linux 2.5.52 1.170 8.075   21    34    59   125   153  161
benchtest  Linux 2.5.52 1.170 8.005   21    34    59   123   154  159
benchtest  Linux 2.5.52 1.190 7.952   21    34    59   123   156  161
benchtest  Linux 2.5.52 1.260 8.093   21    35    59   123   133  159
benchtest  Linux 2.5.52 1.230 8.068   21    34    59   124   154  159

File & VM system latencies in microseconds - smaller is better
--------------------------------------------------------------
Host                 OS   0K File      10K File      Mmap    Prot    Page	
                        Create Delete Create Delete  Latency Fault   Fault 
--------- ------------- ------ ------ ------ ------  ------- -----   ----- 
benchtest  Linux 2.5.52    122     57    382    121      614 0.955 4.00000
benchtest  Linux 2.5.52    121     57    398    127      615 0.950 4.00000
benchtest  Linux 2.5.52    119     57    376    124      610 0.969 4.00000
benchtest  Linux 2.5.52    119     57    399    128      615 0.952 4.00000
benchtest  Linux 2.5.52    122     57    395    128      612 0.920 4.00000

*Local* Communication bandwidths in MB/s - bigger is better
-----------------------------------------------------------
Host                OS  Pipe AF    TCP  File   Mmap  Bcopy  Bcopy  Mem   Mem
                             UNIX      reread reread (libc) (hand) read write
--------- ------------- ---- ---- ---- ------ ------ ------ ------ ---- -----
benchtest  Linux 2.5.52  404  137   23    297    356    124    114  355   171
benchtest  Linux 2.5.52  342  137   23    296    355    124    113  354   170
benchtest  Linux 2.5.52  453  135   22    292    353    123    112  353   170
benchtest  Linux 2.5.52  453  137   23    296    353    123    113  352   169
benchtest  Linux 2.5.52  395  129   23    293    352    123    112  351   169

Memory latencies in nanoseconds - smaller is better
    (WARNING - may not be correct, check graphs)
---------------------------------------------------
Host                 OS   Mhz  L1 $   L2 $    Main mem    Guesses
--------- -------------  ---- ----- ------    --------    -------
benchtest  Linux 2.5.52   790 3.799     65    175
benchtest  Linux 2.5.52   790 3.797 8.8730    175
benchtest  Linux 2.5.52   790 3.801 8.8820    176
benchtest  Linux 2.5.52   790 3.799 8.8760    176
benchtest  Linux 2.5.52   790 3.798 8.9510    177


Regards,
Aniruddha Marathe
WIPRO technologies, India
Aniruddha.marathe@wipro.com			
+91-80-5502001 extn 5092

^ permalink raw reply

* [parisc-linux] quad tulip now not functional in 2.4.20
From: Ed Schaller @ 2002-12-16  6:45 UTC (permalink / raw)
  To: parisc-linux

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

I have a B180 that I have been using as a firewall/router for some time
now. Along with the built in tulip ethernet card, I also have a Adaptec
quad ethernet card that is also tulip based. This has worked fine in
2.4.17-2.4.19 but no longer works in 2.4.20-pa13. Although I can
ifconfig up the interfaces, no traffic goes through and mii-tool reports
that the interfaces do not exist (except for the built in one).

In the following dmesg out takes for 2.4.20-pa13 and 2.4.19-32 (debian),
it seems that the older kernel is finding the transceiver and
successfully auto-negotiating the link while the newer is not.

Any ideas how to solve this? Any help would be greatly appreciated.

Linux version 2.4.20-pa13 (root@landmine) (gcc version 3.0.4) #3 Tue Dec 10 01:35:34 MST 2002
...
Linux Tulip driver version 0.9.15-pre12 (Aug 9, 2002)
tulip0: no phy info, aborting mtable build
tulip0:  MII transceiver #1 config 1000 status 782d advertising 01e1.
eth0: Digital DS21143 Tulip rev 48 at 0xf0fff000, 00:60:B0:C4:5E:7B, IRQ 96.
eth1: Digital DS21140 Tulip rev 34 at 0xf0efc000, 00:00:D1:1B:C8:90, IRQ 98.
eth2: Digital DS21140 Tulip rev 34 at 0xf0efd000, 00:00:D1:1B:C8:B5, IRQ 99.
eth3: Digital DS21140 Tulip rev 34 at 0xf0efe000, 00:00:D1:1B:C8:95, IRQ 96.
eth4: Digital DS21140 Tulip rev 34 at 0xf0eff000, 00:00:D1:1B:70:33, IRQ 97.
...until ifconfig eth0-eth4
eth0: Setting full-duplex based on MII#1 link partner capability of 45e1.

Linux version 2.4.19-32 (root@j5k) (gcc version 3.0.4) #1 Fri Nov 22 23:27:00 MST 2002
...
Linux Tulip driver version 0.9.15-pre11 (May 11, 2002)
tulip0: no phy info, aborting mtable build
tulip0:  MII transceiver #1 config 1000 status 782d advertising 01e1.
eth0: Digital DS21143 Tulip rev 48 at 0xff00, 00:60:B0:C4:5E:7B, IRQ 96.
tulip1:  EEPROM default media type Autosense.
tulip1:  Index #0 - Media MII (#11) described by a 21140 MII PHY (1) block.
tulip1:  MII transceiver #1 config 3100 status 7849 advertising 01e1.
eth1: Digital DS21140 Tulip rev 34 at 0xec00, 00:00:D1:1B:C8:90, IRQ 98.
tulip2:  EEPROM default media type Autosense.
tulip2:  Index #0 - Media MII (#11) described by a 21140 MII PHY (1) block.
tulip2:  MII transceiver #1 config 3100 status 7849 advertising 01e1.
eth2: Digital DS21140 Tulip rev 34 at 0xed00, 00:00:D1:1B:C8:B5, IRQ 99.
tulip3:  EEPROM default media type Autosense.
tulip3:  Index #0 - Media MII (#11) described by a 21140 MII PHY (1) block.
tulip3:  MII transceiver #1 config 3100 status 7849 advertising 01e1.
eth3: Digital DS21140 Tulip rev 34 at 0xee00, 00:00:D1:1B:C8:95, IRQ 96.
tulip4:  EEPROM default media type Autosense.
tulip4:  Index #0 - Media MII (#11) described by a 21140 MII PHY (1) block.
tulip4:  MII transceiver #1 config 3100 status 7849 advertising 01e1.
eth4: Digital DS21140 Tulip rev 34 at 0xef00, 00:00:D1:1B:70:33, IRQ 97.
...until ifconfig eth0-eth4
eth0: Setting full-duplex based on MII#1 link partner capability of 45e1.
eth1: Setting full-duplex based on MII#1 link partner capability of 45e1.
eth2: Setting full-duplex based on MII#1 link partner capability of 45e1.
eth3: Setting full-duplex based on MII#1 link partner capability of 41e1.
eth4: Setting full-duplex based on MII#1 link partner capability of 41e1.

>>>------>

--

+-------------+-----------------------+---------------+
| Ed Schaller | Dark Mist Networking  | psuedoshroom  |
+-------------+-----------------------+---------------+

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

^ permalink raw reply

* [TRIVIAL] warning cleanup for drivers_scsi_qla1280.c
From: Rusty Trivial Russell @ 2002-12-16  6:43 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: linux-scsi

[ Indeed, the only call to qla1280_do_dpc is already inside 
  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,95), so this changes nothing ]

From:  Eric Sandeen <sandeen@sgi.com>


--- trivial-2.4.21-pre1/drivers/scsi/qla1280.c.orig	2002-12-16 17:22:08.000000000 +1100
+++ trivial-2.4.21-pre1/drivers/scsi/qla1280.c	2002-12-16 17:22:08.000000000 +1100
@@ -312,7 +312,9 @@
 STATIC int qla1280_return_status( sts_entry_t *sts, Scsi_Cmnd       *cp);
 STATIC void qla1280_removeq(scsi_lu_t *q, srb_t *sp);
 STATIC void qla1280_mem_free(scsi_qla_host_t *ha);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95)
 static void qla1280_do_dpc(void *p);
+#endif
 #ifdef  QLA1280_UNUSED 
 static void qla1280_set_flags(char * s);
 #endif
@@ -1611,17 +1613,12 @@
  * "host->can_queue". This can cause a panic if we were in our interrupt
  * code .
  **************************************************************************/
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95)
 static void qla1280_do_dpc(void *p)
 {
     scsi_qla_host_t *ha = (scsi_qla_host_t *) p;
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,95)
-    unsigned long cpu_flags = 0;
-#endif
 
     COMTRACE('p')  
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,95)
-    spin_lock_irqsave(&io_request_lock, cpu_flags);
-#endif
     if (ha->flags.isp_abort_needed)
         qla1280_abort_isp(ha);
 
@@ -1631,10 +1628,8 @@
     if (ha->done_q_first)
         qla1280_done(ha, (srb_t **)&ha->done_q_first, (srb_t **)&ha->done_q_last);
     ha->flags.dpc_sched = FALSE;
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,95)
-    spin_unlock_irqrestore(&io_request_lock, cpu_flags);
-#endif
 }
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,95) */
 
 /**************************************************************************
  *   qla1280_device_queue_depth
-- 
  Don't blame me: the Monkey is driving
  File: Eric Sandeen <sandeen@sgi.com>: warning cleanup for drivers_scsi_qla1280.c

^ permalink raw reply

* Re: JDIRTY JWAIT errors in 2.4.19
From: Oleg Drokin @ 2002-12-16  6:46 UTC (permalink / raw)
  To: Tupshin Harper; +Cc: linux-kernel
In-Reply-To: <3DFD74B5.5050206@tupshin.com>

Hello!

On Sun, Dec 15, 2002 at 10:37:41PM -0800, Tupshin Harper wrote:
> >Can you please execute SysRq-T, decode it with ksymoops and send us the 
> >result?
> I have succeeded in reproducing this problem at will (and 
> deterministically) with a SysRq enabled kernel.

Ok.

> I can reproduce the problem consistently by doing a cp -av of a 
> directory(haven't tried other cp permutations, guessing it wouldn't make 
> a difference) containing three mp3 files from one location on a 
> partition to another location on the same reiserfs partition. During the 
> third file, cp hangs(continues to use 80%+ of the CPU), and is 
> unkillable. A few minutes later, it starts generating the same JDIRTY 
> error messages that I reported before.

Can you please produce a metadump data for us?
use debugreiserfs -p /dev/yourdevice | gzip -9c >metadata.gz
then tell us where we can get that file.
Also please use recent reiserfsprogs for that operation
(e.g. version 3.6.4 available from us: ftp://ftp.namesys.com/pub/reiserprogs )

> I have not tried to do any kind of reiserfs check or repair on the 
> filesystem, and I can trigger this problem at any point if you would 
> like me to test further.

Let's see if we can reproduce it locally after you give us the metadata.

Thank you.

Bye,
    Oleg

^ permalink raw reply

* [BENCHMARK] not so good performance of 2.5.52 on TIO bench
From: Aniruddha M Marathe @ 2002-12-16  6:44 UTC (permalink / raw)
  To: linux-kernel

Hi,
Here are the results of comparison of kernel 2.5.51 and 2.5.52 on TIObench.
key findings. 

-------------------------------------------------------------
test					2.5.52 (as compared to
					2.5.51) APPRXIMATE % change
-------------------------------------------------------------
rate (megabytes per second)	5% decrease
CPU % utilization			5% decrease
Average Latency			less than 2% increase
Maximum latency			15 % increase		
CPU efficiency			less than 2% increase
-------------------------------------------------------------

-------------------------------------------------------------
			Linux kernel 2.5.52
			TIO bench results
			Date 16th december 2002
-------------------------------------------------------------
Unit information
================
File size = megabytes
Blk Size  = bytes
Rate      = megabytes per second
CPU%      = percentage of CPU used during the test
Latency   = milliseconds
Lat%      = percent of requests that took longer than X seconds
CPU Eff   = Rate divided by CPU% - throughput per cpu load

Sequential Reads
                              File  Blk   Num                   Avg      Maximum      Lat%     Lat%    CPU
Identifier                    Size  Size  Thr   Rate  (CPU%)  Latency    Latency      >2s      >10s    Eff
---------------------------- ------ ----- ---  ------ ------ --------- -----------  -------- -------- -----
2.5.52                        252   4096   10    8.48 5.251%    12.152     1825.07   0.00000  0.00000   161

Random Reads
                              File  Blk   Num                   Avg      Maximum      Lat%     Lat%    CPU
Identifier                    Size  Size  Thr   Rate  (CPU%)  Latency    Latency      >2s      >10s    Eff
---------------------------- ------ ----- ---  ------ ------ --------- -----------  -------- -------- -----
2.5.52                        252   4096   10    0.50 0.729%   211.130     1079.20   0.00000  0.00000    69

Sequential Writes
                              File  Blk   Num                   Avg      Maximum      Lat%     Lat%    CPU
Identifier                    Size  Size  Thr   Rate  (CPU%)  Latency    Latency      >2s      >10s    Eff
---------------------------- ------ ----- ---  ------ ------ --------- -----------  -------- -------- -----
2.5.52                        252   4096   10   16.17 30.00%     4.525    29226.70   0.06094  0.00625    54

Random Writes
                              File  Blk   Num                   Avg      Maximum      Lat%     Lat%    CPU
Identifier                    Size  Size  Thr   Rate  (CPU%)  Latency    Latency      >2s      >10s    Eff
---------------------------- ------ ----- ---  ------ ------ --------- -----------  -------- -------- -----
2.5.52                        252   4096   10    0.78 1.084%     0.675      992.39   0.00000  0.00000    72

regards,
Aniruddha Marathe
WIPRO Technologies, India
aniruddha.marathe@wipro.com

^ 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.