2004-06-14 00:31:51

by William Lee Irwin III

[permalink] [raw]
Subject: [0/12] Debian bugfixes

The following series of patches are strict bugfix patches taken from the
debian kernel. Among the various Debian patches, these were deemed
critical enough by me (e.g. not compilefixes or comment fixes) to merit
consideration for 2.6.7.

Each patch is accompanied with a hyperlink to the Debian BTS entry for
the bug it fixes and an except from the bugreport it addresses.

These patches were all written by others, in most of the cases, Herbert Xu.
hch did the work of splitting these out from Debian cvs.


-- wli


2004-06-14 00:35:49

by William Lee Irwin III

[permalink] [raw]
Subject: [1/12] don't dereference netdev->name before register_netdev()

* Removed dev->name lookups before register_netdev
This fixes Debian BTS #234817.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=234817

From: Shaul Karl <[email protected]>
To: [email protected]
Subject: Reports about eth%%d at boot
Message-ID: <20040225225611.GA3532@rakefet>

The problem is that most reports at boot time about the eth modules
use %%d instead of the interface number. For example,

eth%%d: NE2000 found at 0x280, using IRQ 5.
NE*000 ethercard probe at 0x240: 00 c0 f0 10 eb 56


Index: linux-2.5/drivers/net/3c501.c
===================================================================
--- linux-2.5.orig/drivers/net/3c501.c 2004-06-13 11:57:14.000000000 -0700
+++ linux-2.5/drivers/net/3c501.c 2004-06-13 12:08:54.000000000 -0700
@@ -182,20 +182,12 @@
} else if (io != 0) {
err = -ENXIO; /* Don't probe at all. */
} else {
- for (port = ports; *port && el1_probe1(dev, *port); port++)
- ;
- if (!*port)
- err = -ENODEV;
+ for (port = ports; *port; port++)
+ if (!(err = el1_probe1(dev, *port)))
+ break;
}
- if (err)
- goto out;
- err = register_netdev(dev);
- if (err)
- goto out1;
- return dev;
-out1:
- release_region(dev->base_addr, EL1_IO_EXTENT);
-out:
+ if (err == 0)
+ return dev;
free_netdev(dev);
return ERR_PTR(err);
}
@@ -220,12 +212,13 @@
unsigned char station_addr[6];
int autoirq = 0;
int i;
+ int err;

/*
* Reserve I/O resource for exclusive use by this driver
*/

- if (!request_region(ioaddr, EL1_IO_EXTENT, dev->name))
+ if (!request_region(ioaddr, EL1_IO_EXTENT, "3c501"))
return -ENODEV;

/*
@@ -295,16 +288,6 @@
if (autoirq)
dev->irq = autoirq;

- printk(KERN_INFO "%s: %s EtherLink at %#lx, using %sIRQ %d.\n", dev->name, mname, dev->base_addr,
- autoirq ? "auto":"assigned ", dev->irq);
-
-#ifdef CONFIG_IP_MULTICAST
- printk(KERN_WARNING "WARNING: Use of the 3c501 in a multicast kernel is NOT recommended.\n");
-#endif
-
- if (el_debug)
- printk(KERN_DEBUG "%s", version);
-
memset(dev->priv, 0, sizeof(struct net_local));
lp = netdev_priv(dev);
spin_lock_init(&lp->lock);
@@ -321,6 +304,23 @@
dev->get_stats = &el1_get_stats;
dev->set_multicast_list = &set_multicast_list;
dev->ethtool_ops = &netdev_ethtool_ops;
+
+ err = register_netdev(dev);
+ if (err) {
+ release_region(ioaddr, EL1_IO_EXTENT);
+ return err;
+ }
+
+ printk(KERN_INFO "%s: %s EtherLink at %#lx, using %sIRQ %d.\n", dev->name, mname, dev->base_addr,
+ autoirq ? "auto":"assigned ", dev->irq);
+
+#ifdef CONFIG_IP_MULTICAST
+ printk(KERN_WARNING "WARNING: Use of the 3c501 in a multicast kernel is NOT recommended.\n");
+#endif
+
+ if (el_debug)
+ printk(KERN_DEBUG "%s", version);
+
return 0;
}

Index: linux-2.5/drivers/net/3c503.c
===================================================================
--- linux-2.5.orig/drivers/net/3c503.c 2004-06-13 11:57:14.000000000 -0700
+++ linux-2.5/drivers/net/3c503.c 2004-06-13 12:08:54.000000000 -0700
@@ -147,6 +147,7 @@
release_region(dev->base_addr, EL2_IO_EXTENT);
}

+#ifndef MODULE
struct net_device * __init el2_probe(int unit)
{
struct net_device *dev = alloc_ei_netdev();
@@ -161,7 +162,7 @@
err = do_el2_probe(dev);
if (err)
goto out;
- err = register_netdev(dev);
+ err = register_ei_netdev(dev);
if (err)
goto out1;
return dev;
@@ -171,6 +172,7 @@
free_netdev(dev);
return ERR_PTR(err);
}
+#endif

/* Probe for the Etherlink II card at I/O port base IOADDR,
returning non-zero on success. If found, set the station
@@ -182,10 +184,10 @@
static unsigned version_printed;
unsigned long vendor_id;

- if (!request_region(ioaddr, EL2_IO_EXTENT, dev->name))
+ if (!request_region(ioaddr, EL2_IO_EXTENT, "3c503"))
return -EBUSY;

- if (!request_region(ioaddr + 0x400, 8, dev->name)) {
+ if (!request_region(ioaddr + 0x400, 8, "3c503")) {
retval = -EBUSY;
goto out;
}
@@ -226,11 +228,11 @@

dev->base_addr = ioaddr;

- printk("%s: 3c503 at i/o base %#3x, node ", dev->name, ioaddr);
+ printk("3c503 at i/o base %#3x", ioaddr);

- /* Retrieve and print the ethernet address. */
+ /* Retrieve the ethernet address. */
for (i = 0; i < 6; i++)
- printk(" %2.2x", dev->dev_addr[i] = inb(ioaddr + i));
+ dev->dev_addr[i] = inb(ioaddr + i);

/* Map the 8390 back into the window. */
outb(ECNTRL_THIN, ioaddr + 0x406);
@@ -342,16 +344,16 @@
#endif

if (dev->mem_start)
- printk("%s: %s - %dkB RAM, 8kB shared mem window at %#6lx-%#6lx.\n",
- dev->name, ei_status.name, (wordlength+1)<<3,
+ printk("3c503: %s - %dkB RAM, 8kB shared mem window at %#6lx-%#6lx.\n",
+ ei_status.name, (wordlength+1)<<3,
dev->mem_start, dev->mem_end-1);

else
{
ei_status.tx_start_page = EL2_MB1_START_PG;
ei_status.rx_start_page = EL2_MB1_START_PG + TX_PAGES;
- printk("\n%s: %s, %dkB RAM, using programmed I/O (REJUMPER for SHARED MEMORY).\n",
- dev->name, ei_status.name, (wordlength+1)<<3);
+ printk("3c503: %s, %dkB RAM, using programmed I/O (REJUMPER for SHARED MEMORY).\n",
+ ei_status.name, (wordlength+1)<<3);
}
release_region(ioaddr + 0x400, 8);
return 0;
@@ -700,7 +702,7 @@
dev->base_addr = io[this_dev];
dev->mem_end = xcvr[this_dev]; /* low 4bits = xcvr sel. */
if (do_el2_probe(dev) == 0) {
- if (register_netdev(dev) == 0) {
+ if (register_ei_netdev(dev) == 0) {
dev_el2[found++] = dev;
continue;
}
Index: linux-2.5/drivers/net/8390.c
===================================================================
--- linux-2.5.orig/drivers/net/8390.c 2004-06-13 11:57:14.000000000 -0700
+++ linux-2.5/drivers/net/8390.c 2004-06-13 12:08:54.000000000 -0700
@@ -1033,6 +1033,27 @@
ethdev_setup);
}

+/**
+ * register_ei_netdev - register_netdev counterpart for 8390
+ *
+ * Register 8390-specific net_device.
+ */
+int register_ei_netdev(struct net_device *dev)
+{
+ int err;
+ int i;
+
+ err = register_netdev(dev);
+ if (err)
+ return err;
+
+ printk(KERN_INFO "%s: %s found at %#lx, IRQ %d,",
+ dev->name, ei_status.name, dev->base_addr, dev->irq);
+ for (i = 0; i < ETHER_ADDR_LEN; i++)
+ printk("%2.2X%s", dev->dev_addr[i], i == 5 ? ".\n" : ":");
+ return 0;
+}
+



@@ -1139,6 +1160,7 @@
EXPORT_SYMBOL(ei_tx_timeout);
EXPORT_SYMBOL(NS8390_init);
EXPORT_SYMBOL(__alloc_ei_netdev);
+EXPORT_SYMBOL(register_ei_netdev);

#if defined(MODULE)

Index: linux-2.5/drivers/net/8390.h
===================================================================
--- linux-2.5.orig/drivers/net/8390.h 2004-06-13 11:57:14.000000000 -0700
+++ linux-2.5/drivers/net/8390.h 2004-06-13 12:08:54.000000000 -0700
@@ -52,6 +52,7 @@
{
return __alloc_ei_netdev(0);
}
+extern int register_ei_netdev(struct net_device *dev);

/* You have one of these per-board */
struct ei_device {
Index: linux-2.5/drivers/net/ac3200.c
===================================================================
--- linux-2.5.orig/drivers/net/ac3200.c 2004-06-13 11:57:14.000000000 -0700
+++ linux-2.5/drivers/net/ac3200.c 2004-06-13 12:08:54.000000000 -0700
@@ -130,6 +130,7 @@
iounmap((void *)dev->mem_start);
}

+#ifndef MODULE
struct net_device * __init ac3200_probe(int unit)
{
struct net_device *dev = alloc_ei_netdev();
@@ -144,7 +145,7 @@
err = do_ac3200_probe(dev);
if (err)
goto out;
- err = register_netdev(dev);
+ err = register_ei_netdev(dev);
if (err)
goto out1;
return dev;
@@ -154,12 +155,13 @@
free_netdev(dev);
return ERR_PTR(err);
}
+#endif

static int __init ac_probe1(int ioaddr, struct net_device *dev)
{
int i, retval;

- if (!request_region(ioaddr, AC_IO_EXTENT, dev->name))
+ if (!request_region(ioaddr, AC_IO_EXTENT, "ac3200"))
return -EBUSY;

if (inb_p(ioaddr + AC_ID_PORT) == 0xff) {
@@ -179,9 +181,9 @@
inb(ioaddr + AC_ID_PORT + 2), inb(ioaddr + AC_ID_PORT + 3));
#endif

- printk("AC3200 in EISA slot %d, node", ioaddr/0x1000);
+ printk("AC3200 in EISA slot %d", ioaddr/0x1000);
for(i = 0; i < 6; i++)
- printk(" %02x", dev->dev_addr[i] = inb(ioaddr + AC_SA_PROM + i));
+ dev->dev_addr[i] = inb(ioaddr + AC_SA_PROM + i);

#if 0
/* Check the vendor ID/prefix. Redundant after checking the EISA ID */
@@ -203,7 +205,7 @@
printk(", assigning");
}

- retval = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev);
+ retval = request_irq(dev->irq, ei_interrupt, 0, "ac3200", dev);
if (retval) {
printk (" nothing! Unable to get IRQ %d.\n", dev->irq);
goto out1;
@@ -227,8 +229,8 @@
dev->if_port = inb(ioaddr + AC_CONFIG) >> 6;
dev->mem_start = config2mem(inb(ioaddr + AC_CONFIG));

- printk("%s: AC3200 at %#3x with %dkB memory at physical address %#lx.\n",
- dev->name, ioaddr, AC_STOP_PG/4, dev->mem_start);
+ printk("ac3200: AC3200 at %#3x with %dkB memory at physical address %#lx.\n",
+ ioaddr, AC_STOP_PG/4, dev->mem_start);

/*
* BEWARE!! Some dain-bramaged EISA SCUs will allow you to put
@@ -398,7 +400,7 @@
dev->base_addr = io[this_dev];
dev->mem_start = mem[this_dev]; /* Currently ignored by driver */
if (do_ac3200_probe(dev) == 0) {
- if (register_netdev(dev) == 0) {
+ if (register_ei_netdev(dev) == 0) {
dev_ac32[found++] = dev;
continue;
}
Index: linux-2.5/drivers/net/apne.c
===================================================================
--- linux-2.5.orig/drivers/net/apne.c 2004-06-13 11:57:14.000000000 -0700
+++ linux-2.5/drivers/net/apne.c 2004-06-13 12:08:54.000000000 -0700
@@ -168,7 +168,7 @@
return ERR_PTR(-ENODEV);
}

- if (!request_region(IOBASE, 0x20, dev->name)) {
+ if (!request_region(IOBASE, 0x20, "apne")) {
free_netdev(dev);
return ERR_PTR(-EBUSY);
}
@@ -179,7 +179,7 @@
free_netdev(dev);
return ERR_PTR(err);
}
- err = register_netdev(dev);
+ err = register_ei_netdev(dev);
if (!err)
return dev;

@@ -310,15 +310,12 @@
dev->base_addr = ioaddr;

/* Install the Interrupt handler */
- i = request_irq(IRQ_AMIGA_PORTS, apne_interrupt, SA_SHIRQ, dev->name, dev);
+ i = request_irq(IRQ_AMIGA_PORTS, apne_interrupt, SA_SHIRQ, "apne", dev);
if (i) return i;

- for(i = 0; i < ETHER_ADDR_LEN; i++) {
- printk(" %2.2x", SA_prom[i]);
- dev->dev_addr[i] = SA_prom[i];
- }
+ memcpy(dev_addr, SA_prom, ETHER_ADDR_LEN);

- printk("\n%s: %s found.\n", dev->name, name);
+ printk("\n");

ei_status.name = name;
ei_status.tx_start_page = start_page;
Index: linux-2.5/drivers/net/e2100.c
===================================================================
--- linux-2.5.orig/drivers/net/e2100.c 2004-06-13 11:57:14.000000000 -0700
+++ linux-2.5/drivers/net/e2100.c 2004-06-13 12:08:54.000000000 -0700
@@ -144,6 +144,7 @@
release_region(dev->base_addr, E21_IO_EXTENT);
}

+#ifndef MODULE
struct net_device * __init e2100_probe(int unit)
{
struct net_device *dev = alloc_ei_netdev();
@@ -158,7 +159,7 @@
err = do_e2100_probe(dev);
if (err)
goto out;
- err = register_netdev(dev);
+ err = register_ei_netdev(dev);
if (err)
goto out1;
return dev;
@@ -168,6 +169,7 @@
free_netdev(dev);
return ERR_PTR(err);
}
+#endif

static int __init e21_probe1(struct net_device *dev, int ioaddr)
{
@@ -175,7 +177,7 @@
unsigned char *station_addr = dev->dev_addr;
static unsigned version_printed;

- if (!request_region(ioaddr, E21_IO_EXTENT, dev->name))
+ if (!request_region(ioaddr, E21_IO_EXTENT, "e2100"))
return -EBUSY;

/* First check the station address for the Ctron prefix. */
@@ -205,8 +207,7 @@
if (ei_debug && version_printed++ == 0)
printk(version);

- for (i = 0; i < 6; i++)
- printk(" %02X", station_addr[i]);
+ printk("e2100: E2100 at %#3x", ioaddr);

if (dev->irq < 2) {
int irqlist[] = {15,11,10,12,5,9,3,4}, i;
@@ -441,7 +442,7 @@
dev->mem_start = mem[this_dev];
dev->mem_end = xcvr[this_dev]; /* low 4bits = xcvr sel. */
if (do_e2100_probe(dev) == 0) {
- if (register_netdev(dev) == 0) {
+ if (register_ei_netdev(dev) == 0) {
dev_e21[found++] = dev;
continue;
}
Index: linux-2.5/drivers/net/es3210.c
===================================================================
--- linux-2.5.orig/drivers/net/es3210.c 2004-06-13 11:57:14.000000000 -0700
+++ linux-2.5/drivers/net/es3210.c 2004-06-13 12:08:54.000000000 -0700
@@ -161,6 +161,7 @@
release_region(dev->base_addr, ES_IO_EXTENT);
}

+#ifndef MODULE
struct net_device * __init es_probe(int unit)
{
struct net_device *dev = alloc_ei_netdev();
@@ -175,7 +176,7 @@
err = do_es_probe(dev);
if (err)
goto out;
- err = register_netdev(dev);
+ err = register_ei_netdev(dev);
if (err)
goto out1;
return dev;
@@ -185,6 +186,7 @@
free_netdev(dev);
return ERR_PTR(err);
}
+#endif

static int __init es_probe1(struct net_device *dev, int ioaddr)
{
@@ -221,9 +223,9 @@
goto out;
}

- printk("es3210.c: ES3210 rev. %ld at %#x, node", eisa_id>>24, ioaddr);
+ printk("es3210.c: ES3210 rev. %ld at %#x", eisa_id>>24, ioaddr);
for(i = 0; i < ETHER_ADDR_LEN; i++)
- printk(" %02x", (dev->dev_addr[i] = inb(ioaddr + ES_SA_PROM + i)));
+ dev->dev_addr[i] = inb(ioaddr + ES_SA_PROM + i);

/* Snarf the interrupt now. */
if (dev->irq == 0) {
@@ -437,7 +439,7 @@
dev->base_addr = io[this_dev];
dev->mem_start = mem[this_dev];
if (do_es_probe(dev) == 0) {
- if (register_netdev(dev) == 0) {
+ if (register_ei_netdev(dev) == 0) {
dev_es3210[found++] = dev;
continue;
}
Index: linux-2.5/drivers/net/hp-plus.c
===================================================================
--- linux-2.5.orig/drivers/net/hp-plus.c 2004-06-13 11:57:15.000000000 -0700
+++ linux-2.5/drivers/net/hp-plus.c 2004-06-13 12:08:54.000000000 -0700
@@ -142,6 +142,7 @@
release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
}

+#ifndef MODULE
struct net_device * __init hp_plus_probe(int unit)
{
struct net_device *dev = alloc_ei_netdev();
@@ -156,7 +157,7 @@
err = do_hpp_probe(dev);
if (err)
goto out;
- err = register_netdev(dev);
+ err = register_ei_netdev(dev);
if (err)
goto out1;
return dev;
@@ -166,6 +167,7 @@
free_netdev(dev);
return ERR_PTR(err);
}
+#endif

/* Do the interesting part of the probe at a single address. */
static int __init hpp_probe1(struct net_device *dev, int ioaddr)
@@ -176,7 +178,7 @@
int mem_start;
static unsigned version_printed;

- if (!request_region(ioaddr, HP_IO_EXTENT, dev->name))
+ if (!request_region(ioaddr, HP_IO_EXTENT, "hp-plus"))
return -EBUSY;

/* Check for the HP+ signature, 50 48 0x 53. */
@@ -189,7 +191,7 @@
if (ei_debug && version_printed++ == 0)
printk(version);

- printk("%s: %s at %#3x,", dev->name, name, ioaddr);
+ printk("hp-plus: %s at %#3x,", name, ioaddr);

/* Retrieve and checksum the station address. */
outw(MAC_Page, ioaddr + HP_PAGING);
@@ -459,7 +461,7 @@
dev->irq = irq[this_dev];
dev->base_addr = io[this_dev];
if (do_hpp_probe(dev) == 0) {
- if (register_netdev(dev) == 0) {
+ if (register_ei_netdev(dev) == 0) {
dev_hpp[found++] = dev;
continue;
}
Index: linux-2.5/drivers/net/hp.c
===================================================================
--- linux-2.5.orig/drivers/net/hp.c 2004-06-13 11:57:15.000000000 -0700
+++ linux-2.5/drivers/net/hp.c 2004-06-13 12:08:54.000000000 -0700
@@ -106,6 +106,7 @@
release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
}

+#ifndef MODULE
struct net_device * __init hp_probe(int unit)
{
struct net_device *dev = alloc_ei_netdev();
@@ -120,7 +121,7 @@
err = do_hp_probe(dev);
if (err)
goto out;
- err = register_netdev(dev);
+ err = register_ei_netdev(dev);
if (err)
goto out1;
return dev;
@@ -130,6 +131,7 @@
free_netdev(dev);
return ERR_PTR(err);
}
+#endif

static int __init hp_probe1(struct net_device *dev, int ioaddr)
{
@@ -137,7 +139,7 @@
const char *name;
static unsigned version_printed;

- if (!request_region(ioaddr, HP_IO_EXTENT, dev->name))
+ if (!request_region(ioaddr, HP_IO_EXTENT, "hp"))
return -EBUSY;

/* Check for the HP physical address, 08 00 09 xx xx xx. */
@@ -164,10 +166,10 @@
if (ei_debug && version_printed++ == 0)
printk(version);

- printk("%s: %s (ID %02x) at %#3x,", dev->name, name, board_id, ioaddr);
+ printk("hp: %s (ID %02x) at %#3x", name, board_id, ioaddr);

for(i = 0; i < ETHER_ADDR_LEN; i++)
- printk(" %2.2x", dev->dev_addr[i] = inb(ioaddr + i));
+ dev->dev_addr[i] = inb(ioaddr + i);

/* Snarf the interrupt now. Someday this could be moved to open(). */
if (dev->irq < 2) {
@@ -182,7 +184,7 @@
outb_p(irqmap[irq] | HP_RUN, ioaddr + HP_CONFIGURE);
outb_p( 0x00 | HP_RUN, ioaddr + HP_CONFIGURE);
if (irq == probe_irq_off(cookie) /* It's a good IRQ line! */
- && request_irq (irq, ei_interrupt, 0, dev->name, dev) == 0) {
+ && request_irq (irq, ei_interrupt, 0, "hp", dev) == 0) {
printk(" selecting IRQ %d.\n", irq);
dev->irq = *irqp;
break;
@@ -197,12 +199,14 @@
} else {
if (dev->irq == 2)
dev->irq = 9;
- if ((retval = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev))) {
+ if ((retval = request_irq(dev->irq, ei_interrupt, 0, "hp", dev))) {
printk (" unable to get IRQ %d.\n", dev->irq);
goto out;
}
}

+ printk("\n");
+
/* Set the base address to point to the NIC, not the "real" base! */
dev->base_addr = ioaddr + NIC_OFFSET;
dev->open = &hp_open;
@@ -428,7 +432,7 @@
dev->irq = irq[this_dev];
dev->base_addr = io[this_dev];
if (do_hp_probe(dev) == 0) {
- if (register_netdev(dev) == 0) {
+ if (register_ei_netdev(dev) == 0) {
dev_hp[found++] = dev;
continue;
}
Index: linux-2.5/drivers/net/hydra.c
===================================================================
--- linux-2.5.orig/drivers/net/hydra.c 2004-06-13 11:57:15.000000000 -0700
+++ linux-2.5/drivers/net/hydra.c 2004-06-13 12:08:54.000000000 -0700
@@ -144,7 +144,7 @@

NS8390_init(dev, 0);

- err = register_netdev(dev);
+ err = register_ei_netdev(dev);
if (err) {
free_irq(IRQ_AMIGA_PORTS, dev);
free_netdev(dev);
@@ -242,6 +242,7 @@

static int __init hydra_init_module(void)
{
+ printk("hydra.c " HYDRA_VERSION "\n");
return zorro_module_init(&hydra_driver);
}

Index: linux-2.5/drivers/net/lne390.c
===================================================================
--- linux-2.5.orig/drivers/net/lne390.c 2004-06-13 11:57:15.000000000 -0700
+++ linux-2.5/drivers/net/lne390.c 2004-06-13 12:08:54.000000000 -0700
@@ -112,7 +112,7 @@
SET_MODULE_OWNER(dev);

if (ioaddr > 0x1ff) { /* Check a single specified location. */
- if (!request_region(ioaddr, LNE390_IO_EXTENT, dev->name))
+ if (!request_region(ioaddr, LNE390_IO_EXTENT, "lne390"))
return -EBUSY;
ret = lne390_probe1(dev, ioaddr);
if (ret)
@@ -131,7 +131,7 @@

/* EISA spec allows for up to 16 slots, but 8 is typical. */
for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) {
- if (!request_region(ioaddr, LNE390_IO_EXTENT, dev->name))
+ if (!request_region(ioaddr, LNE390_IO_EXTENT, "lne390"))
continue;
if (lne390_probe1(dev, ioaddr) == 0)
return 0;
@@ -151,6 +151,7 @@
iounmap((void *)dev->mem_start);
}

+#ifndef MODULE
struct net_device * __init lne390_probe(int unit)
{
struct net_device *dev = alloc_ei_netdev();
@@ -165,7 +166,7 @@
err = do_lne390_probe(dev);
if (err)
goto out;
- err = register_netdev(dev);
+ err = register_ei_netdev(dev);
if (err)
goto out1;
return dev;
@@ -175,6 +176,7 @@
free_netdev(dev);
return ERR_PTR(err);
}
+#endif

static int __init lne390_probe1(struct net_device *dev, int ioaddr)
{
@@ -211,10 +213,9 @@
}
#endif

- printk("lne390.c: LNE390%X in EISA slot %d, address", 0xa+revision, ioaddr/0x1000);
+ printk("lne390.c: LNE390%X in EISA slot %d.\nlne3900.c: ", 0xa+revision, ioaddr/0x1000);
for(i = 0; i < ETHER_ADDR_LEN; i++)
- printk(" %02x", (dev->dev_addr[i] = inb(ioaddr + LNE390_SA_PROM + i)));
- printk(".\nlne390.c: ");
+ dev->dev_addr[i] = inb(ioaddr + LNE390_SA_PROM + i);

/* Snarf the interrupt now. CFG file has them all listed as `edge' with share=NO */
if (dev->irq == 0) {
@@ -228,7 +229,7 @@
}
printk(" IRQ %d,", dev->irq);

- if ((ret = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev))) {
+ if ((ret = request_irq(dev->irq, ei_interrupt, 0, "lne390", dev))) {
printk (" unable to get IRQ %d.\n", dev->irq);
return ret;
}
@@ -432,7 +433,7 @@
dev->base_addr = io[this_dev];
dev->mem_start = mem[this_dev];
if (do_lne390_probe(dev) == 0) {
- if (register_netdev(dev) == 0) {
+ if (register_ei_netdev(dev) == 0) {
dev_lne[found++] = dev;
continue;
}
Index: linux-2.5/drivers/net/mac8390.c
===================================================================
--- linux-2.5.orig/drivers/net/mac8390.c 2004-06-13 11:57:15.000000000 -0700
+++ linux-2.5/drivers/net/mac8390.c 2004-06-13 12:08:54.000000000 -0700
@@ -273,16 +273,15 @@
of where its memory and registers are. */

if (nubus_get_func_dir(ndev, &dir) == -1) {
- printk(KERN_ERR "%s: Unable to get Nubus functional"
+ printk(KERN_ERR "mac8390: Unable to get Nubus functional"
" directory for slot %X!\n",
- dev->name, ndev->board->slot);
+ ndev->board->slot);
continue;
}

/* Get the MAC address */
if ((nubus_find_rsrc(&dir, NUBUS_RESID_MAC_ADDRESS, &ent)) == -1) {
- printk(KERN_INFO "%s: Couldn't get MAC address!\n",
- dev->name);
+ printk(KERN_INFO "mac8390: Couldn't get MAC address!\n");
continue;
} else {
nubus_get_rsrc_mem(dev->dev_addr, &ent, 6);
@@ -299,9 +298,9 @@
if (useresources[cardtype] == 1) {
nubus_rewinddir(&dir);
if (nubus_find_rsrc(&dir, NUBUS_RESID_MINOR_BASEOS, &ent) == -1) {
- printk(KERN_ERR "%s: Memory offset resource"
+ printk(KERN_ERR "mac8390: Memory offset resource"
" for slot %X not found!\n",
- dev->name, ndev->board->slot);
+ ndev->board->slot);
continue;
}
nubus_get_rsrc_mem(&offset, &ent, 4);
@@ -310,10 +309,10 @@
dev->base_addr = dev->mem_start + 0x10000;
nubus_rewinddir(&dir);
if (nubus_find_rsrc(&dir, NUBUS_RESID_MINOR_LENGTH, &ent) == -1) {
- printk(KERN_INFO "%s: Memory length resource"
+ printk(KERN_INFO "mac8390: Memory length resource"
" for slot %X not found"
", probing\n",
- dev->name, ndev->board->slot);
+ ndev->board->slot);
offset = mac8390_memsize(dev->mem_start);
} else {
nubus_get_rsrc_mem(&offset, &ent, 4);
@@ -368,7 +367,7 @@

if (!ndev)
goto out;
- err = register_netdev(dev);
+ err = register_ei_netdev(dev);
if (err)
goto out;
return dev;
@@ -518,18 +517,9 @@
NS8390_init(dev, 0);

/* Good, done, now spit out some messages */
- printk(KERN_INFO "%s: %s in slot %X (type %s)\n",
- dev->name, ndev->board->name, ndev->board->slot, cardname[type]);
- printk(KERN_INFO "MAC ");
- {
- int i;
- for (i = 0; i < 6; i++) {
- printk("%2.2x", dev->dev_addr[i]);
- if (i < 5)
- printk(":");
- }
- }
- printk(" IRQ %d, shared memory at %#lx-%#lx, %d-bit access.\n",
+ printk(KERN_INFO "%s in slot %X (type %s)\n",
+ ndev->board->name, ndev->board->slot, cardname[type]);
+ printk(KERN_INFO "IRQ %d, shared memory at %#lx-%#lx, %d-bit access.\n",
dev->irq, dev->mem_start, dev->mem_end-1,
access_bitmode?32:16);
return 0;
Index: linux-2.5/drivers/net/ne.c
===================================================================
--- linux-2.5.orig/drivers/net/ne.c 2004-06-13 11:57:15.000000000 -0700
+++ linux-2.5/drivers/net/ne.c 2004-06-13 12:08:54.000000000 -0700
@@ -203,6 +203,7 @@
release_region(dev->base_addr, NE_IO_EXTENT);
}

+#ifndef MODULE
struct net_device * __init ne_probe(int unit)
{
struct net_device *dev = alloc_ei_netdev();
@@ -217,7 +218,7 @@
err = do_ne_probe(dev);
if (err)
goto out;
- err = register_netdev(dev);
+ err = register_ei_netdev(dev);
if (err)
goto out1;
return dev;
@@ -227,6 +228,7 @@
free_netdev(dev);
return ERR_PTR(err);
}
+#endif

static int __init ne_probe_isapnp(struct net_device *dev)
{
@@ -284,7 +286,7 @@
int reg0, ret;
static unsigned version_printed;

- if (!request_region(ioaddr, NE_IO_EXTENT, dev->name))
+ if (!request_region(ioaddr, NE_IO_EXTENT, "ne"))
return -EBUSY;

reg0 = inb_p(ioaddr);
@@ -472,13 +474,9 @@

dev->base_addr = ioaddr;

- for(i = 0; i < ETHER_ADDR_LEN; i++) {
- printk(" %2.2x", SA_prom[i]);
- dev->dev_addr[i] = SA_prom[i];
- }
+ memcpy(dev->dev_addr, SA_prom, ETHER_ADDR_LEN);

- printk("\n%s: %s found at %#x, using IRQ %d.\n",
- dev->name, name, ioaddr, dev->irq);
+ printk("\n");

ei_status.name = name;
ei_status.tx_start_page = start_page;
@@ -794,7 +792,7 @@
dev->mem_end = bad[this_dev];
dev->base_addr = io[this_dev];
if (do_ne_probe(dev) == 0) {
- if (register_netdev(dev) == 0) {
+ if (register_ei_netdev(dev) == 0) {
dev_ne[found++] = dev;
continue;
}
Index: linux-2.5/drivers/net/ne2.c
===================================================================
--- linux-2.5.orig/drivers/net/ne2.c 2004-06-13 11:57:15.000000000 -0700
+++ linux-2.5/drivers/net/ne2.c 2004-06-13 12:08:54.000000000 -0700
@@ -284,6 +284,7 @@
release_region(dev->base_addr, NE_IO_EXTENT);
}

+#ifndef MODULE
struct net_device * __init ne2_probe(int unit)
{
struct net_device *dev = alloc_ei_netdev();
@@ -298,7 +299,7 @@
err = do_ne2_probe(dev);
if (err)
goto out;
- err = register_netdev(dev);
+ err = register_ei_netdev(dev);
if (err)
goto out1;
return dev;
@@ -308,6 +309,7 @@
free_netdev(dev);
return ERR_PTR(err);
}
+#endif

static int ne2_procinfo(char *buf, int slot, struct net_device *dev)
{
@@ -368,7 +370,7 @@
irq = irqs[(POS & 0x60)>>5];
}

- if (!request_region(base_addr, NE_IO_EXTENT, dev->name))
+ if (!request_region(base_addr, NE_IO_EXTENT, "ne2"))
return -EBUSY;

#ifdef DEBUG
@@ -470,7 +472,7 @@

/* Snarf the interrupt now. There's no point in waiting since we cannot
share and the board will usually be enabled. */
- retval = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev);
+ retval = request_irq(dev->irq, ei_interrupt, 0, "ne2", dev);
if (retval) {
printk (" unable to get IRQ %d (irqval=%d).\n",
dev->irq, retval);
@@ -479,13 +481,9 @@

dev->base_addr = base_addr;

- for(i = 0; i < ETHER_ADDR_LEN; i++) {
- printk(" %2.2x", SA_prom[i]);
- dev->dev_addr[i] = SA_prom[i];
- }
+ memcpy(dev->dev_addr, SA_prom, ETHER_ADDR_LEN);

- printk("\n%s: %s found at %#x, using IRQ %d.\n",
- dev->name, name, base_addr, dev->irq);
+ printk("\n");

mca_set_adapter_procfn(slot, (MCA_ProcFn) ne2_procinfo, dev);

@@ -796,7 +794,7 @@
dev->mem_end = bad[this_dev];
dev->base_addr = io[this_dev];
if (do_ne2_probe(dev) == 0) {
- if (register_netdev(dev) == 0) {
+ if (register_ei_netdev(dev) == 0) {
dev_ne[found++] = dev;
continue;
}
Index: linux-2.5/drivers/net/ne2k-pci.c
===================================================================
--- linux-2.5.orig/drivers/net/ne2k-pci.c 2004-06-13 11:57:15.000000000 -0700
+++ linux-2.5/drivers/net/ne2k-pci.c 2004-06-13 12:08:54.000000000 -0700
@@ -362,17 +362,12 @@
#endif
NS8390_init(dev, 0);

- i = register_netdev(dev);
+ memcpy(dev->dev_addr, SA_prom, 6);
+
+ i = register_ei_netdev(dev);
if (i)
goto err_out_free_netdev;

- printk("%s: %s found at %#lx, IRQ %d, ",
- dev->name, pci_clone_list[chip_idx].name, ioaddr, dev->irq);
- for(i = 0; i < 6; i++) {
- printk("%2.2X%s", SA_prom[i], i == 5 ? ".\n": ":");
- dev->dev_addr[i] = SA_prom[i];
- }
-
return 0;

err_out_free_netdev:
Index: linux-2.5/drivers/net/ne2k_cbus.c
===================================================================
--- linux-2.5.orig/drivers/net/ne2k_cbus.c 2004-06-13 11:57:15.000000000 -0700
+++ linux-2.5/drivers/net/ne2k_cbus.c 2004-06-13 12:08:54.000000000 -0700
@@ -187,6 +187,7 @@
ne2k_cbus_destroy(dev);
}

+#ifndef MODULE
struct net_device * __init ne_probe(int unit)
{
struct net_device *dev = alloc_ei_netdev();
@@ -201,7 +202,7 @@
err = do_ne_probe(dev);
if (err)
goto out;
- err = register_netdev(dev);
+ err = register_ei_netdev(dev);
if (err)
goto out1;
return dev;
@@ -211,6 +212,7 @@
free_netdev(dev);
return ERR_PTR(err);
}
+#endif

static int __init ne_probe_cbus(struct net_device *dev, const struct ne2k_cbus_hwinfo *hw, int ioaddr, int irq)
{
@@ -263,7 +265,7 @@

for (rlist = hw->regionlist; rlist->range; rlist++)
if (!request_region(ioaddr + rlist->start,
- rlist->range, dev->name)) {
+ rlist->range, "ne2k_cbus")) {
ret = -EBUSY;
goto err_out;
}
@@ -508,13 +510,10 @@

dev->base_addr = ioaddr;

- for(i = 0; i < ETHER_ADDR_LEN; i++) {
- printk(" %2.2x", SA_prom[i]);
- dev->dev_addr[i] = SA_prom[i];
- }
+ memcpy(dev->dev_addr, SA_prom, ETHER_ADDR_LEN);

- printk("\n%s: %s found at %#x, hardware type %d(%s), using IRQ %d.\n",
- dev->name, name, ioaddr, hw->hwtype, hw->hwident, dev->irq);
+ printk("\nne2k_cbus: %s found at %#x, hardware type %d(%s), using IRQ %d.\n",
+ name, ioaddr, hw->hwtype, hw->hwident, dev->irq);

ei_status.name = name;
ei_status.tx_start_page = start_page;
@@ -850,7 +849,7 @@
dev->base_addr = io[this_dev];
dev->mem_start = hwtype[this_dev];
if (do_ne_probe(dev) == 0) {
- if (register_netdev(dev) == 0) {
+ if (register_ei_netdev(dev) == 0) {
dev_ne[found++] = dev;
continue;
}
Index: linux-2.5/drivers/net/ne3210.c
===================================================================
--- linux-2.5.orig/drivers/net/ne3210.c 2004-06-13 11:57:15.000000000 -0700
+++ linux-2.5/drivers/net/ne3210.c 2004-06-13 12:08:54.000000000 -0700
@@ -111,13 +111,13 @@
device->driver_data = dev;
ioaddr = edev->base_addr;

- if (!request_region(ioaddr, NE3210_IO_EXTENT, dev->name)) {
+ if (!request_region(ioaddr, NE3210_IO_EXTENT, "ne3210")) {
retval = -EBUSY;
goto out;
}

if (!request_region(ioaddr + NE3210_CFG1,
- NE3210_CFG_EXTENT, dev->name)) {
+ NE3210_CFG_EXTENT, "ne3210")) {
retval = -EBUSY;
goto out1;
}
@@ -133,14 +133,14 @@
printk("ne3210.c: NE3210 in EISA slot %d, media: %s, addr:",
edev->slot, ifmap[port_index]);
for(i = 0; i < ETHER_ADDR_LEN; i++)
- printk(" %02x", (dev->dev_addr[i] = inb(ioaddr + NE3210_SA_PROM + i)));
+ dev->dev_addr[i] = inb(ioaddr + NE3210_SA_PROM + i);


/* Snarf the interrupt now. CFG file has them all listed as `edge' with share=NO */
dev->irq = irq_map[(inb(ioaddr + NE3210_CFG2) >> 3) & 0x07];
printk(".\nne3210.c: using IRQ %d, ", dev->irq);

- retval = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev);
+ retval = request_irq(dev->irq, ei_interrupt, 0, "ne3210", dev);
if (retval) {
printk (" unable to get IRQ %d.\n", dev->irq);
goto out2;
@@ -163,7 +163,7 @@
}
}

- if (!request_mem_region (phys_mem, NE3210_STOP_PG*0x100, dev->name)) {
+ if (!request_mem_region (phys_mem, NE3210_STOP_PG*0x100, "ne3210")) {
printk ("ne3210.c: Unable to request shared memory at physical address %#lx\n",
phys_mem);
goto out3;
@@ -210,7 +210,7 @@
#endif
dev->if_port = ifmap_val[port_index];

- if ((retval = register_netdev (dev)))
+ if ((retval = register_ei_netdev (dev)))
goto out5;

NS8390_init(dev, 0);
Index: linux-2.5/drivers/net/oaknet.c
===================================================================
--- linux-2.5.orig/drivers/net/oaknet.c 2004-06-13 11:57:15.000000000 -0700
+++ linux-2.5/drivers/net/oaknet.c 2004-06-13 12:08:54.000000000 -0700
@@ -164,18 +164,13 @@
ret = -EAGAIN;
if (request_irq(dev->irq, ei_interrupt, 0, name, dev)) {
printk("%s: unable to request interrupt %d.\n",
- dev->name, dev->irq);
+ name, dev->irq);
goto out_region;
}

/* Tell the world about what and where we've found. */

- printk("%s: %s at", dev->name, name);
- for (i = 0; i < ETHER_ADDR_LEN; ++i) {
- dev->dev_addr[i] = bip->bi_enetaddr[i];
- printk("%c%.2x", (i ? ':' : ' '), dev->dev_addr[i]);
- }
- printk(", found at %#lx, using IRQ %d.\n", dev->base_addr, dev->irq);
+ memcpy(dev->dev_addr, bip->bi_enetaddr, ETHER_ADDR_LEN);

/* Set up some required driver fields and then we're done. */

@@ -197,7 +192,7 @@
#endif

NS8390_init(dev, FALSE);
- ret = register_netdev(dev);
+ ret = register_ei_netdev(dev);
if (ret)
goto out_irq;

Index: linux-2.5/drivers/net/smc-mca.c
===================================================================
--- linux-2.5.orig/drivers/net/smc-mca.c 2004-06-13 11:57:15.000000000 -0700
+++ linux-2.5/drivers/net/smc-mca.c 2004-06-13 12:08:54.000000000 -0700
@@ -265,7 +265,7 @@
goto err_unclaim;
}

- if (!request_region(ioaddr, ULTRA_IO_EXTENT, dev->name)) {
+ if (!request_region(ioaddr, ULTRA_IO_EXTENT, "smc-mca")) {
rc = -ENODEV;
goto err_unclaim;
}
@@ -276,7 +276,7 @@
printk(KERN_INFO "smc_mca[%d]: Parameters: %#3x,", slot + 1, ioaddr);

for (i = 0; i < 6; i++)
- printk(" %2.2X", dev->dev_addr[i] = inb(ioaddr + 8 + i));
+ dev->dev_addr[i] = inb(ioaddr + 8 + i);

/* Switch from the station address to the alternate register set
* and read the useful registers there.
@@ -330,7 +330,7 @@

NS8390_init(dev, 0);

- rc = register_netdev(dev);
+ rc = register_ei_netdev(dev);
if (rc)
goto err_release_region;

Index: linux-2.5/drivers/net/smc-ultra.c
===================================================================
--- linux-2.5.orig/drivers/net/smc-ultra.c 2004-06-13 11:57:15.000000000 -0700
+++ linux-2.5/drivers/net/smc-ultra.c 2004-06-13 12:08:54.000000000 -0700
@@ -178,6 +178,7 @@
release_region(dev->base_addr - ULTRA_NIC_OFFSET, ULTRA_IO_EXTENT);
}

+#ifndef MODULE
struct net_device * __init ultra_probe(int unit)
{
struct net_device *dev = alloc_ei_netdev();
@@ -192,7 +193,7 @@
err = do_ultra_probe(dev);
if (err)
goto out;
- err = register_netdev(dev);
+ err = register_ei_netdev(dev);
if (err)
goto out1;
return dev;
@@ -202,6 +203,7 @@
free_netdev(dev);
return ERR_PTR(err);
}
+#endif

static int __init ultra_probe1(struct net_device *dev, int ioaddr)
{
@@ -215,7 +217,7 @@
unsigned char idreg = inb(ioaddr + 7);
unsigned char reg4 = inb(ioaddr + 4) & 0x7f;

- if (!request_region(ioaddr, ULTRA_IO_EXTENT, dev->name))
+ if (!request_region(ioaddr, ULTRA_IO_EXTENT, "smc-ultra"))
return -EBUSY;

/* Check the ID nibble. */
@@ -240,10 +242,10 @@

model_name = (idreg & 0xF0) == 0x20 ? "SMC Ultra" : "SMC EtherEZ";

- printk("%s: %s at %#3x,", dev->name, model_name, ioaddr);
+ printk("smc-ultra: %s at %#3x", model_name, ioaddr);

for (i = 0; i < 6; i++)
- printk(" %2.2X", dev->dev_addr[i] = inb(ioaddr + 8 + i));
+ dev->dev_addr[i] = inb(ioaddr + 8 + i);

/* Switch from the station address to the alternate register set and
read the useful registers there. */
@@ -575,7 +577,7 @@
dev->irq = irq[this_dev];
dev->base_addr = io[this_dev];
if (do_ultra_probe(dev) == 0) {
- if (register_netdev(dev) == 0) {
+ if (register_ei_netdev(dev) == 0) {
dev_ultra[found++] = dev;
continue;
}
Index: linux-2.5/drivers/net/smc-ultra32.c
===================================================================
--- linux-2.5.orig/drivers/net/smc-ultra32.c 2004-06-13 11:57:15.000000000 -0700
+++ linux-2.5/drivers/net/smc-ultra32.c 2004-06-13 12:08:54.000000000 -0700
@@ -141,7 +141,7 @@
}
if (base >= 0x9000)
goto out;
- err = register_netdev(dev);
+ err = register_ei_netdev(dev);
if (err)
goto out1;
return dev;
@@ -163,7 +163,7 @@
unsigned char reg4;
const char *ifmap[] = {"UTP No Link", "", "UTP/AUI", "UTP/BNC"};

- if (!request_region(ioaddr, ULTRA32_IO_EXTENT, dev->name))
+ if (!request_region(ioaddr, ULTRA32_IO_EXTENT, "smc-ultra32"))
return -EBUSY;

if (inb(ioaddr + ULTRA32_IDPORT) == 0xff ||
@@ -202,10 +202,10 @@

model_name = "SMC Ultra32";

- printk("%s: %s at 0x%X,", dev->name, model_name, ioaddr);
+ printk("smc-ultra32: %s at 0x%X,", model_name, ioaddr);

for (i = 0; i < 6; i++)
- printk(" %2.2X", dev->dev_addr[i] = inb(ioaddr + 8 + i));
+ dev->dev_addr[i] = inb(ioaddr + 8 + i);

/* Switch from the station address to the alternate register set and
read the useful registers there. */
Index: linux-2.5/drivers/net/stnic.c
===================================================================
--- linux-2.5.orig/drivers/net/stnic.c 2004-06-13 11:57:15.000000000 -0700
+++ linux-2.5/drivers/net/stnic.c 2004-06-13 12:08:54.000000000 -0700
@@ -130,14 +130,14 @@

/* Snarf the interrupt now. There's no point in waiting since we cannot
share and the board will usually be enabled. */
- err = request_irq (dev->irq, ei_interrupt, 0, dev->name, dev);
+ err = request_irq (dev->irq, ei_interrupt, 0, "stnic", dev);
if (err) {
printk (KERN_EMERG " unable to get IRQ %d.\n", dev->irq);
free_netdev(dev);
return err;
}

- ei_status.name = dev->name;
+ ei_status.name = "stnic";
ei_status.word16 = 1;
#ifdef __LITTLE_ENDIAN__
ei_status.bigendian = 0;
@@ -155,7 +155,7 @@

stnic_init (dev);

- err = register_netdev(dev);
+ err = register_ei_netdev(dev);
if (err) {
free_irq(dev->irq, dev);
free_netdev(dev);
Index: linux-2.5/drivers/net/tokenring/ibmtr.c
===================================================================
--- linux-2.5.orig/drivers/net/tokenring/ibmtr.c 2004-06-13 11:57:21.000000000 -0700
+++ linux-2.5/drivers/net/tokenring/ibmtr.c 2004-06-13 12:08:54.000000000 -0700
@@ -371,7 +371,10 @@
for (i = 0; ibmtr_portlist[i]; i++) {
int ioaddr = ibmtr_portlist[i];

+ if (!request_region(ioaddr, IBMTR_IO_EXTENT, "ibmtr"))
+ continue;
if (!ibmtr_probe1(dev, ioaddr)) return 0;
+ release_region(ioaddr, IBMTR_IO_EXTENT);
}
return -ENODEV;
}
@@ -691,15 +694,6 @@
kfree(ti);
return -ENODEV;
}
- /*?? Now, allocate some of the PIO PORTs for this driver.. */
- /* record PIOaddr range as busy */
- if (!request_region(PIOaddr, IBMTR_IO_EXTENT, "ibmtr")) {
- DPRINTK("Could not grab PIO range. Halting driver.\n");
- free_irq(dev->irq, dev);
- iounmap(t_mmio);
- kfree(ti);
- return -EBUSY;
- }

if (!version_printed++) {
printk(version);
Index: linux-2.5/drivers/net/wd.c
===================================================================
--- linux-2.5.orig/drivers/net/wd.c 2004-06-13 11:57:15.000000000 -0700
+++ linux-2.5/drivers/net/wd.c 2004-06-13 12:08:54.000000000 -0700
@@ -131,6 +131,7 @@
release_region(dev->base_addr - WD_NIC_OFFSET, WD_IO_EXTENT);
}

+#ifndef MODULE
struct net_device * __init wd_probe(int unit)
{
struct net_device *dev = alloc_ei_netdev();
@@ -145,7 +146,7 @@
err = do_wd_probe(dev);
if (err)
goto out;
- err = register_netdev(dev);
+ err = register_ei_netdev(dev);
if (err)
goto out1;
return dev;
@@ -155,6 +156,7 @@
free_netdev(dev);
return ERR_PTR(err);
}
+#endif

static int __init wd_probe1(struct net_device *dev, int ioaddr)
{
@@ -182,9 +184,9 @@
if (ei_debug && version_printed++ == 0)
printk(version);

- printk("%s: WD80x3 at %#3x,", dev->name, ioaddr);
+ printk("wd: WD80x3 at %#3x,", ioaddr);
for (i = 0; i < 6; i++)
- printk(" %2.2X", dev->dev_addr[i] = inb(ioaddr + 8 + i));
+ dev->dev_addr[i] = inb(ioaddr + 8 + i);

/* The following PureData probe code was contributed by
Mike Jagdis <[email protected]>. Puredata does software
@@ -300,7 +302,7 @@

/* Snarf the interrupt now. There's no point in waiting since we cannot
share and the board will usually be enabled. */
- i = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev);
+ i = request_irq(dev->irq, ei_interrupt, 0, "wd", dev);
if (i) {
printk (" unable to get IRQ %d.\n", dev->irq);
return i;
@@ -515,7 +517,7 @@
dev->mem_start = mem[this_dev];
dev->mem_end = mem_end[this_dev];
if (do_wd_probe(dev) == 0) {
- if (register_netdev(dev) == 0) {
+ if (register_ei_netdev(dev) == 0) {
dev_wd[found++] = dev;
continue;
}
Index: linux-2.5/drivers/net/zorro8390.c
===================================================================
--- linux-2.5.orig/drivers/net/zorro8390.c 2004-06-13 11:57:15.000000000 -0700
+++ linux-2.5/drivers/net/zorro8390.c 2004-06-13 12:08:54.000000000 -0700
@@ -115,7 +115,7 @@
if (!dev)
return -ENOMEM;
SET_MODULE_OWNER(dev);
- if (!request_mem_region(ioaddr, NE_IO_EXTENT*2, dev->name)) {
+ if (!request_mem_region(ioaddr, NE_IO_EXTENT*2, "zorro8390")) {
free_netdev(dev);
return -EBUSY;
}
@@ -198,7 +198,7 @@
dev->irq = IRQ_AMIGA_PORTS;

/* Install the Interrupt handler */
- i = request_irq(IRQ_AMIGA_PORTS, ei_interrupt, SA_SHIRQ, dev->name, dev);
+ i = request_irq(IRQ_AMIGA_PORTS, ei_interrupt, SA_SHIRQ, "zorro8390", dev);
if (i) return i;

for(i = 0; i < ETHER_ADDR_LEN; i++) {
@@ -227,7 +227,7 @@
#endif

NS8390_init(dev, 0);
- err = register_netdev(dev);
+ err = register_ei_netdev(dev);
if (err) {
free_irq(IRQ_AMIGA_PORTS, dev);
return err;

2004-06-14 00:35:52

by William Lee Irwin III

[permalink] [raw]
Subject: [2/12] lower priority of "too many keys" msg in atkbd.c

* Lowered priority of "too many keys" message in drivers/input/keyboard/atkbd.c
This fixes Debian BTS #239036.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=239036

From: "Jon Thackray" <[email protected]>
Message-ID: <[email protected]>
To: [email protected]
Subject: Keyboard misbehaving

The keyboard under 2.6.4 seems to be behaving strangely, reporting
unknown key codes and too many keys pressed, even when no keys have
been pressed. The keyboard is connected via an 8 way KVM switch, but
was working quite acceptably under 2.4.25 with no such messages.
Trying 2.6.3 is not an option as it doesn't support the hardware
properly, as previously reported.


Index: linux-2.5/drivers/input/keyboard/atkbd.c
===================================================================
--- linux-2.5.orig/drivers/input/keyboard/atkbd.c 2004-06-13 11:57:13.000000000 -0700
+++ linux-2.5/drivers/input/keyboard/atkbd.c 2004-06-13 12:08:54.000000000 -0700
@@ -288,7 +288,7 @@
atkbd_report_key(&atkbd->dev, regs, KEY_HANJA, 3);
goto out;
case ATKBD_RET_ERR:
- printk(KERN_WARNING "atkbd.c: Keyboard on %s reports too many keys pressed.\n", serio->phys);
+ printk(KERN_DEBUG "atkbd.c: Keyboard on %s reports too many keys pressed.\n", serio->phys);
goto out;
}

2004-06-14 00:37:53

by William Lee Irwin III

[permalink] [raw]
Subject: [4/12] unregister driver if probing fails in sb_card.c

* Unregister driver if probing fails in sound/oss/sb_card.c
This fixes Debian BTS #218845.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=218845

From: Robin Gerard <[email protected]>
To: [email protected]
Subject: no sound with kernel-image-2.6.0-test9-1-386
Message-ID: <20031103004939.GA2071@mauritius>

I downlaoded the kernel-image-2.6.0-test9-1-386_2.6.0-test9-1_i386.deb
and I installed it successfully. Everything works fine, except the sound.
(I run also the kernel-image-2.4.20 and the sound is ok with this kernel)
My sound card is a sb.

First I launched modconf but no module was displayed.

I did: modprobe sb=20
and I got:

sb: Init: Done
sb: Init: Starting Probe...
kobject_register failed for OSS SndBlstr (-17)
Call Trace:
[<c0191cda>] kobject_register+0x3a/0x40
[<c01d9bcc>] bus_add_driver+0x30/0x64
[<c01d9e51>] driver_register+0x2d/0x34
[<c011a24a>] preempt_schedule+0x2a/0x48
[<c01b6f84>] pnp_register_driver+0x28/0x58
[<c01b6c5e>] pnp_register_card_driver+0x5e/0x98
[<c488f063>] sb_init+0x63/0xb5 [sb]
[<c0130bf4>] sys_init_module+0xe8/0x1f0
[<c010b577>] syscall_call+0x7/0xb


Index: linux-2.5/sound/oss/sb_card.c
===================================================================
--- linux-2.5.orig/sound/oss/sb_card.c 2004-06-13 11:57:56.000000000 -0700
+++ linux-2.5/sound/oss/sb_card.c 2004-06-13 12:08:55.000000000 -0700
@@ -309,7 +309,13 @@

/* If either PnP or Legacy registered a card then return
* success */
- return (pres > 0 || lres > 0) ? 0 : -ENODEV;
+ if (pres <= 0 && lres <= 0) {
+#ifdef CONFIG_PNP
+ pnp_unregister_card_driver(&sb_pnp_driver);
+#endif
+ return -ENODEV;
+ }
+ return 0;
}

static void __exit sb_exit(void)

2004-06-14 00:40:07

by William Lee Irwin III

[permalink] [raw]
Subject: [3/12] remove irda usage of isa_virt_to_bus()

* Removed uses of isa_virt_to_bus
This resolves Debian BTS #218878.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=218878

From: Paavo Hartikainen <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: IrDA modules fail to load
Message-Id: <[email protected]>

When trying to "modprobe irda irtty", it fails with following message:
FATAL: Error inserting irda (/lib/modules/2.6.0-test9/kernel/net/irda/irda.ko): Unknown symbol in module, or unknown parameter (see dmesg)
And in "dmesg" I see these:
irda: Unknown symbol isa_virt_to_bus
irda: Unknown symbol isa_virt_to_bus


Index: linux-2.5/drivers/net/irda/ali-ircc.c
===================================================================
--- linux-2.5.orig/drivers/net/irda/ali-ircc.c 2004-06-13 11:57:17.000000000 -0700
+++ linux-2.5/drivers/net/irda/ali-ircc.c 2004-06-13 12:08:55.000000000 -0700
@@ -33,6 +33,7 @@
#include <linux/init.h>
#include <linux/rtnetlink.h>
#include <linux/serial_reg.h>
+#include <linux/dma-mapping.h>

#include <asm/io.h>
#include <asm/dma.h>
@@ -304,16 +305,18 @@
self->tx_buff.truesize = 14384;

/* Allocate memory if needed */
- self->rx_buff.head = (__u8 *) kmalloc(self->rx_buff.truesize,
- GFP_KERNEL |GFP_DMA);
+ self->rx_buff.head =
+ dma_alloc_coherent(NULL, self->rx_buff.truesize,
+ &self->rx_buff_dma, GFP_KERNEL);
if (self->rx_buff.head == NULL) {
err = -ENOMEM;
goto err_out2;
}
memset(self->rx_buff.head, 0, self->rx_buff.truesize);

- self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize,
- GFP_KERNEL|GFP_DMA);
+ self->tx_buff.head =
+ dma_alloc_coherent(NULL, self->tx_buff.truesize,
+ &self->tx_buff_dma, GFP_KERNEL);
if (self->tx_buff.head == NULL) {
err = -ENOMEM;
goto err_out3;
@@ -362,9 +365,11 @@
return 0;

err_out4:
- kfree(self->tx_buff.head);
+ dma_free_coherent(NULL, self->tx_buff.truesize,
+ self->tx_buff.head, self->tx_buff_dma);
err_out3:
- kfree(self->rx_buff.head);
+ dma_free_coherent(NULL, self->rx_buff.truesize,
+ self->rx_buff.head, self->rx_buff_dma);
err_out2:
release_region(self->io.fir_base, self->io.fir_ext);
err_out1:
@@ -398,10 +403,12 @@
release_region(self->io.fir_base, self->io.fir_ext);

if (self->tx_buff.head)
- kfree(self->tx_buff.head);
+ dma_free_coherent(NULL, self->tx_buff.truesize,
+ self->tx_buff.head, self->tx_buff_dma);

if (self->rx_buff.head)
- kfree(self->rx_buff.head);
+ dma_free_coherent(NULL, self->rx_buff.truesize,
+ self->rx_buff.head, self->rx_buff_dma);

dev_self[self->index] = NULL;
free_netdev(self->netdev);
@@ -1572,7 +1579,8 @@
self->io.direction = IO_XMIT;

irda_setup_dma(self->io.dma,
- self->tx_fifo.queue[self->tx_fifo.ptr].start,
+ ((u8 *)self->tx_fifo.queue[self->tx_fifo.ptr].start -
+ self->tx_buff.head) + self->tx_buff_dma,
self->tx_fifo.queue[self->tx_fifo.ptr].len,
DMA_TX_MODE);

@@ -1724,8 +1732,8 @@
self->st_fifo.len = self->st_fifo.pending_bytes = 0;
self->st_fifo.tail = self->st_fifo.head = 0;

- irda_setup_dma(self->io.dma, self->rx_buff.data,
- self->rx_buff.truesize, DMA_RX_MODE);
+ irda_setup_dma(self->io.dma, self->rx_buff_dma, self->rx_buff.truesize,
+ DMA_RX_MODE);

/* Set Receive Mode,Brick Wall */
//switch_bank(iobase, BANK0);
Index: linux-2.5/drivers/net/irda/ali-ircc.h
===================================================================
--- linux-2.5.orig/drivers/net/irda/ali-ircc.h 2004-06-13 11:57:17.000000000 -0700
+++ linux-2.5/drivers/net/irda/ali-ircc.h 2004-06-13 12:08:55.000000000 -0700
@@ -26,6 +26,7 @@

#include <linux/spinlock.h>
#include <linux/pm.h>
+#include <linux/types.h>
#include <asm/io.h>

/* SIR Register */
@@ -198,6 +199,8 @@
chipio_t io; /* IrDA controller information */
iobuff_t tx_buff; /* Transmit buffer */
iobuff_t rx_buff; /* Receive buffer */
+ dma_addr_t tx_buff_dma;
+ dma_addr_t rx_buff_dma;

__u8 ier; /* Interrupt enable register */

Index: linux-2.5/drivers/net/irda/nsc-ircc.c
===================================================================
--- linux-2.5.orig/drivers/net/irda/nsc-ircc.c 2004-06-13 11:57:17.000000000 -0700
+++ linux-2.5/drivers/net/irda/nsc-ircc.c 2004-06-13 12:08:55.000000000 -0700
@@ -52,6 +52,7 @@
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/rtnetlink.h>
+#include <linux/dma-mapping.h>

#include <asm/io.h>
#include <asm/dma.h>
@@ -307,8 +308,9 @@
self->tx_buff.truesize = 14384;

/* Allocate memory if needed */
- self->rx_buff.head = (__u8 *) kmalloc(self->rx_buff.truesize,
- GFP_KERNEL|GFP_DMA);
+ self->rx_buff.head =
+ dma_alloc_coherent(NULL, self->rx_buff.truesize,
+ &self->rx_buff_dma, GFP_KERNEL);
if (self->rx_buff.head == NULL) {
err = -ENOMEM;
goto out2;
@@ -316,8 +318,9 @@
}
memset(self->rx_buff.head, 0, self->rx_buff.truesize);

- self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize,
- GFP_KERNEL|GFP_DMA);
+ self->tx_buff.head =
+ dma_alloc_coherent(NULL, self->tx_buff.truesize,
+ &self->tx_buff_dma, GFP_KERNEL);
if (self->tx_buff.head == NULL) {
err = -ENOMEM;
goto out3;
@@ -368,9 +371,11 @@

return 0;
out4:
- kfree(self->tx_buff.head);
+ dma_free_coherent(NULL, self->tx_buff.truesize,
+ self->tx_buff.head, self->tx_buff_dma);
out3:
- kfree(self->rx_buff.head);
+ dma_free_coherent(NULL, self->rx_buff.truesize,
+ self->rx_buff.head, self->rx_buff_dma);
out2:
release_region(self->io.fir_base, self->io.fir_ext);
out1:
@@ -404,10 +409,12 @@
release_region(self->io.fir_base, self->io.fir_ext);

if (self->tx_buff.head)
- kfree(self->tx_buff.head);
+ dma_free_coherent(NULL, self->tx_buff.truesize,
+ self->tx_buff.head, self->tx_buff_dma);

if (self->rx_buff.head)
- kfree(self->rx_buff.head);
+ dma_free_coherent(NULL, self->rx_buff.truesize,
+ self->rx_buff.head, self->rx_buff_dma);

dev_self[self->index] = NULL;
free_netdev(self->netdev);
@@ -1409,7 +1416,8 @@
outb(ECR1_DMASWP|ECR1_DMANF|ECR1_EXT_SL, iobase+ECR1);

irda_setup_dma(self->io.dma,
- self->tx_fifo.queue[self->tx_fifo.ptr].start,
+ ((u8 *)self->tx_fifo.queue[self->tx_fifo.ptr].start -
+ self->tx_buff.head) + self->tx_buff_dma,
self->tx_fifo.queue[self->tx_fifo.ptr].len,
DMA_TX_MODE);

@@ -1566,8 +1574,8 @@
self->st_fifo.len = self->st_fifo.pending_bytes = 0;
self->st_fifo.tail = self->st_fifo.head = 0;

- irda_setup_dma(self->io.dma, self->rx_buff.data,
- self->rx_buff.truesize, DMA_RX_MODE);
+ irda_setup_dma(self->io.dma, self->rx_buff_dma, self->rx_buff.truesize,
+ DMA_RX_MODE);

/* Enable DMA */
switch_bank(iobase, BANK0);
Index: linux-2.5/drivers/net/irda/nsc-ircc.h
===================================================================
--- linux-2.5.orig/drivers/net/irda/nsc-ircc.h 2004-06-13 11:57:17.000000000 -0700
+++ linux-2.5/drivers/net/irda/nsc-ircc.h 2004-06-13 12:08:55.000000000 -0700
@@ -32,6 +32,7 @@

#include <linux/spinlock.h>
#include <linux/pm.h>
+#include <linux/types.h>
#include <asm/io.h>

/* DMA modes needed */
@@ -255,6 +256,8 @@
chipio_t io; /* IrDA controller information */
iobuff_t tx_buff; /* Transmit buffer */
iobuff_t rx_buff; /* Receive buffer */
+ dma_addr_t tx_buff_dma;
+ dma_addr_t rx_buff_dma;

__u8 ier; /* Interrupt enable register */

Index: linux-2.5/drivers/net/irda/smsc-ircc2.c
===================================================================
--- linux-2.5.orig/drivers/net/irda/smsc-ircc2.c 2004-06-13 11:57:18.000000000 -0700
+++ linux-2.5/drivers/net/irda/smsc-ircc2.c 2004-06-13 12:08:55.000000000 -0700
@@ -52,6 +52,7 @@
#include <linux/init.h>
#include <linux/rtnetlink.h>
#include <linux/serial_reg.h>
+#include <linux/dma-mapping.h>

#include <asm/io.h>
#include <asm/dma.h>
@@ -112,6 +113,8 @@
chipio_t io; /* IrDA controller information */
iobuff_t tx_buff; /* Transmit buffer */
iobuff_t rx_buff; /* Receive buffer */
+ dma_addr_t tx_buff_dma;
+ dma_addr_t rx_buff_dma;

struct qos_info qos; /* QoS capabilities for this device */

@@ -413,16 +416,18 @@
self->rx_buff.truesize = SMSC_IRCC2_RX_BUFF_TRUESIZE;
self->tx_buff.truesize = SMSC_IRCC2_TX_BUFF_TRUESIZE;

- self->rx_buff.head = (u8 *) kmalloc(self->rx_buff.truesize,
- GFP_KERNEL|GFP_DMA);
+ self->rx_buff.head =
+ dma_alloc_coherent(NULL, self->rx_buff.truesize,
+ &self->rx_buff_dma, GFP_KERNEL);
if (self->rx_buff.head == NULL) {
ERROR("%s, Can't allocate memory for receive buffer!\n",
driver_name);
goto err_out2;
}

- self->tx_buff.head = (u8 *) kmalloc(self->tx_buff.truesize,
- GFP_KERNEL|GFP_DMA);
+ self->tx_buff.head =
+ dma_alloc_coherent(NULL, self->tx_buff.truesize,
+ &self->tx_buff_dma, GFP_KERNEL);
if (self->tx_buff.head == NULL) {
ERROR("%s, Can't allocate memory for transmit buffer!\n",
driver_name);
@@ -464,9 +469,11 @@

return 0;
err_out4:
- kfree(self->tx_buff.head);
+ dma_free_coherent(NULL, self->tx_buff.truesize,
+ self->tx_buff.head, self->tx_buff_dma);
err_out3:
- kfree(self->rx_buff.head);
+ dma_free_coherent(NULL, self->rx_buff.truesize,
+ self->rx_buff.head, self->rx_buff_dma);
err_out2:
free_netdev(self->netdev);
dev_self[--dev_count] = NULL;
@@ -1159,7 +1166,7 @@
IRCC_CFGB_DMA_BURST, iobase+IRCC_SCE_CFGB);

/* Setup DMA controller (must be done after enabling chip DMA) */
- irda_setup_dma(self->io.dma, self->tx_buff.data, self->tx_buff.len,
+ irda_setup_dma(self->io.dma, self->tx_buff_dma, self->tx_buff.len,
DMA_TX_MODE);

/* Enable interrupt */
@@ -1249,8 +1256,8 @@
outb(2050 & 0xff, iobase+IRCC_RX_SIZE_LO);

/* Setup DMA controller */
- irda_setup_dma(self->io.dma, self->rx_buff.data,
- self->rx_buff.truesize, DMA_RX_MODE);
+ irda_setup_dma(self->io.dma, self->rx_buff_dma, self->rx_buff.truesize,
+ DMA_RX_MODE);

/* Enable burst mode chip Rx DMA */
register_bank(iobase, 1);
@@ -1717,10 +1724,12 @@
release_region(self->io.sir_base, self->io.sir_ext);

if (self->tx_buff.head)
- kfree(self->tx_buff.head);
+ dma_free_coherent(NULL, self->tx_buff.truesize,
+ self->tx_buff.head, self->tx_buff_dma);

if (self->rx_buff.head)
- kfree(self->rx_buff.head);
+ dma_free_coherent(NULL, self->rx_buff.truesize,
+ self->rx_buff.head, self->rx_buff_dma);

free_netdev(self->netdev);

Index: linux-2.5/drivers/net/irda/via-ircc.c
===================================================================
--- linux-2.5.orig/drivers/net/irda/via-ircc.c 2004-06-13 11:57:18.000000000 -0700
+++ linux-2.5/drivers/net/irda/via-ircc.c 2004-06-13 12:08:55.000000000 -0700
@@ -39,6 +39,7 @@
#include <linux/init.h>
#include <linux/rtnetlink.h>
#include <linux/pci.h>
+#include <linux/dma-mapping.h>

#include <asm/io.h>
#include <asm/dma.h>
@@ -383,7 +384,8 @@

/* Allocate memory if needed */
self->rx_buff.head =
- (__u8 *) kmalloc(self->rx_buff.truesize, GFP_KERNEL | GFP_DMA);
+ dma_alloc_coherent(NULL, self->rx_buff.truesize,
+ &self->rx_buff_dma, GFP_KERNEL);
if (self->rx_buff.head == NULL) {
err = -ENOMEM;
goto err_out2;
@@ -391,7 +393,8 @@
memset(self->rx_buff.head, 0, self->rx_buff.truesize);

self->tx_buff.head =
- (__u8 *) kmalloc(self->tx_buff.truesize, GFP_KERNEL | GFP_DMA);
+ dma_alloc_coherent(NULL, self->tx_buff.truesize,
+ &self->tx_buff_dma, GFP_KERNEL);
if (self->tx_buff.head == NULL) {
err = -ENOMEM;
goto err_out3;
@@ -432,9 +435,11 @@

return 0;
err_out4:
- kfree(self->tx_buff.head);
+ dma_free_coherent(NULL, self->tx_buff.truesize,
+ self->tx_buff.head, self->tx_buff_dma);
err_out3:
- kfree(self->rx_buff.head);
+ dma_free_coherent(NULL, self->rx_buff.truesize,
+ self->rx_buff.head, self->rx_buff_dma);
err_out2:
release_region(self->io.fir_base, self->io.fir_ext);
err_out1:
@@ -468,9 +473,11 @@
__FUNCTION__, self->io.fir_base);
release_region(self->io.fir_base, self->io.fir_ext);
if (self->tx_buff.head)
- kfree(self->tx_buff.head);
+ dma_free_coherent(NULL, self->tx_buff.truesize,
+ self->tx_buff.head, self->tx_buff_dma);
if (self->rx_buff.head)
- kfree(self->rx_buff.head);
+ dma_free_coherent(NULL, self->rx_buff.truesize,
+ self->rx_buff.head, self->rx_buff_dma);
dev_self[self->index] = NULL;

free_netdev(self->netdev);
@@ -816,7 +823,7 @@
EnTXDMA(iobase, ON);
EnRXDMA(iobase, OFF);

- irda_setup_dma(self->io.dma, self->tx_buff.data, self->tx_buff.len,
+ irda_setup_dma(self->io.dma, self->tx_buff_dma, self->tx_buff.len,
DMA_TX_MODE);

SetSendByte(iobase, self->tx_buff.len);
@@ -897,7 +904,8 @@
EnTXDMA(iobase, ON);
EnRXDMA(iobase, OFF);
irda_setup_dma(self->io.dma,
- self->tx_fifo.queue[self->tx_fifo.ptr].start,
+ ((u8 *)self->tx_fifo.queue[self->tx_fifo.ptr].start -
+ self->tx_buff.head) + self->tx_buff_dma,
self->tx_fifo.queue[self->tx_fifo.ptr].len, DMA_TX_MODE);
#ifdef DBGMSG
DBG(printk
@@ -1022,8 +1030,8 @@
EnAllInt(iobase, ON);
EnTXDMA(iobase, OFF);
EnRXDMA(iobase, ON);
- irda_setup_dma(self->io.dma2, self->rx_buff.data,
- self->rx_buff.truesize, DMA_RX_MODE);
+ irda_setup_dma(self->io.dma2, self->rx_buff_dma,
+ self->rx_buff.truesize, DMA_RX_MODE);
TXStart(iobase, OFF);
RXStart(iobase, ON);

Index: linux-2.5/drivers/net/irda/via-ircc.h
===================================================================
--- linux-2.5.orig/drivers/net/irda/via-ircc.h 2004-06-13 11:57:18.000000000 -0700
+++ linux-2.5/drivers/net/irda/via-ircc.h 2004-06-13 12:08:55.000000000 -0700
@@ -33,6 +33,7 @@
#include <linux/time.h>
#include <linux/spinlock.h>
#include <linux/pm.h>
+#include <linux/types.h>
#include <asm/io.h>

#define MAX_TX_WINDOW 7
@@ -102,6 +103,8 @@
chipio_t io; /* IrDA controller information */
iobuff_t tx_buff; /* Transmit buffer */
iobuff_t rx_buff; /* Receive buffer */
+ dma_addr_t tx_buff_dma;
+ dma_addr_t rx_buff_dma;

__u8 ier; /* Interrupt enable register */

Index: linux-2.5/drivers/net/irda/w83977af_ir.c
===================================================================
--- linux-2.5.orig/drivers/net/irda/w83977af_ir.c 2004-06-13 11:57:18.000000000 -0700
+++ linux-2.5/drivers/net/irda/w83977af_ir.c 2004-06-13 12:08:55.000000000 -0700
@@ -50,6 +50,7 @@
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/rtnetlink.h>
+#include <linux/dma-mapping.h>

#include <asm/io.h>
#include <asm/dma.h>
@@ -207,8 +208,9 @@
self->tx_buff.truesize = 4000;

/* Allocate memory if needed */
- self->rx_buff.head = (__u8 *) kmalloc(self->rx_buff.truesize,
- GFP_KERNEL|GFP_DMA);
+ self->rx_buff.head =
+ dma_alloc_coherent(NULL, self->rx_buff.truesize,
+ &self->rx_buff_dma, GFP_KERNEL);
if (self->rx_buff.head == NULL) {
err = -ENOMEM;
goto err_out1;
@@ -216,8 +218,9 @@

memset(self->rx_buff.head, 0, self->rx_buff.truesize);

- self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize,
- GFP_KERNEL|GFP_DMA);
+ self->tx_buff.head =
+ dma_alloc_coherent(NULL, self->tx_buff.truesize,
+ &self->tx_buff_dma, GFP_KERNEL);
if (self->tx_buff.head == NULL) {
err = -ENOMEM;
goto err_out2;
@@ -252,9 +255,11 @@

return 0;
err_out3:
- kfree(self->tx_buff.head);
+ dma_free_coherent(NULL, self->tx_buff.truesize,
+ self->tx_buff.head, self->tx_buff_dma);
err_out2:
- kfree(self->rx_buff.head);
+ dma_free_coherent(NULL, self->rx_buff.truesize,
+ self->rx_buff.head, self->rx_buff_dma);
err_out1:
free_netdev(dev);
err_out:
@@ -297,10 +302,12 @@
release_region(self->io.fir_base, self->io.fir_ext);

if (self->tx_buff.head)
- kfree(self->tx_buff.head);
+ dma_free_coherent(NULL, self->tx_buff.truesize,
+ self->tx_buff.head, self->tx_buff_dma);

if (self->rx_buff.head)
- kfree(self->rx_buff.head);
+ dma_free_coherent(NULL, self->rx_buff.truesize,
+ self->rx_buff.head, self->rx_buff_dma);

free_netdev(self->netdev);

@@ -606,10 +613,10 @@
disable_dma(self->io.dma);
clear_dma_ff(self->io.dma);
set_dma_mode(self->io.dma, DMA_MODE_READ);
- set_dma_addr(self->io.dma, isa_virt_to_bus(self->tx_buff.data));
+ set_dma_addr(self->io.dma, self->tx_buff_dma);
set_dma_count(self->io.dma, self->tx_buff.len);
#else
- irda_setup_dma(self->io.dma, self->tx_buff.data, self->tx_buff.len,
+ irda_setup_dma(self->io.dma, self->tx_buff_dma, self->tx_buff.len,
DMA_MODE_WRITE);
#endif
self->io.direction = IO_XMIT;
@@ -763,10 +770,10 @@
disable_dma(self->io.dma);
clear_dma_ff(self->io.dma);
set_dma_mode(self->io.dma, DMA_MODE_READ);
- set_dma_addr(self->io.dma, isa_virt_to_bus(self->rx_buff.data));
+ set_dma_addr(self->io.dma, self->rx_buff_dma);
set_dma_count(self->io.dma, self->rx_buff.truesize);
#else
- irda_setup_dma(self->io.dma, self->rx_buff.data, self->rx_buff.truesize,
+ irda_setup_dma(self->io.dma, self->rx_buff_dma, self->rx_buff.truesize,
DMA_MODE_READ);
#endif
/*
Index: linux-2.5/drivers/net/irda/w83977af_ir.h
===================================================================
--- linux-2.5.orig/drivers/net/irda/w83977af_ir.h 2004-06-13 11:57:18.000000000 -0700
+++ linux-2.5/drivers/net/irda/w83977af_ir.h 2004-06-13 12:08:55.000000000 -0700
@@ -26,6 +26,7 @@
#define W83977AF_IR_H

#include <asm/io.h>
+#include <linux/types.h>

/* Flags for configuration register CRF0 */
#define ENBNKSEL 0x01
@@ -179,6 +180,8 @@
chipio_t io; /* IrDA controller information */
iobuff_t tx_buff; /* Transmit buffer */
iobuff_t rx_buff; /* Receive buffer */
+ dma_addr_t tx_buff_dma;
+ dma_addr_t rx_buff_dma;

/* Note : currently locking is *very* incomplete, but this
* will get you started. Check in nsc-ircc.c for a proper
Index: linux-2.5/include/net/irda/irda_device.h
===================================================================
--- linux-2.5.orig/include/net/irda/irda_device.h 2004-06-13 11:57:46.000000000 -0700
+++ linux-2.5/include/net/irda/irda_device.h 2004-06-13 12:08:55.000000000 -0700
@@ -39,11 +39,13 @@
#ifndef IRDA_DEVICE_H
#define IRDA_DEVICE_H

+#include <linux/config.h>
#include <linux/tty.h>
#include <linux/netdevice.h>
#include <linux/spinlock.h>
#include <linux/skbuff.h> /* struct sk_buff */
#include <linux/irda.h>
+#include <linux/types.h>

#include <net/pkt_sched.h>
#include <net/irda/irda.h>
@@ -236,7 +238,7 @@
int irda_device_dongle_cleanup(dongle_t *dongle);

#ifdef CONFIG_ISA
-void irda_setup_dma(int channel, char *buffer, int count, int mode);
+void irda_setup_dma(int channel, dma_addr_t buffer, int count, int mode);
#endif

void irda_task_delete(struct irda_task *task);
Index: linux-2.5/net/irda/irda_device.c
===================================================================
--- linux-2.5.orig/net/irda/irda_device.c 2004-06-13 11:57:48.000000000 -0700
+++ linux-2.5/net/irda/irda_device.c 2004-06-13 12:08:55.000000000 -0700
@@ -536,7 +536,7 @@
* Setup the DMA channel. Commonly used by ISA FIR drivers
*
*/
-void irda_setup_dma(int channel, char *buffer, int count, int mode)
+void irda_setup_dma(int channel, dma_addr_t buffer, int count, int mode)
{
unsigned long flags;

@@ -545,7 +545,7 @@
disable_dma(channel);
clear_dma_ff(channel);
set_dma_mode(channel, mode);
- set_dma_addr(channel, isa_virt_to_bus(buffer));
+ set_dma_addr(channel, buffer);
set_dma_count(channel, count);
enable_dma(channel);

2004-06-14 00:41:22

by William Lee Irwin III

[permalink] [raw]
Subject: [6/12] fix advansys.c highmem bugs

* Added basic highmem support in drivers/scsi/advansys.c
This fixes Debian BTS #245238.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=245238

From: "Jamin W. Collins" <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Message-Id: <[email protected]>
Subject: kernel-image-2.6.5-1-k7: fails to boot with "request_module: runaway loop modprobe binfmt-0000"

Attempting to boot my system after installing the
kernel-image-2.6.5-1-k7 package fails with the following errors:

request_module: runaway loop modprobe binfmt-0000
request_module: runaway loop modprobe binfmt-0000
request_module: runaway loop modprobe binfmt-0000
request_module: runaway loop modprobe binfmt-0000

The system boots fine from a 2.4.24 kernel and used to boot properly
from a custom 2.6.3 kernel. After taking hte system down to add more
memory, I noticed the above error with my custom 2.6.3 kernel and
reverted to the 2.4.24. I've since removed the custom 2.6.3 and
installed the Debian 2.6.5.


Index: linux-2.5/drivers/scsi/advansys.c
===================================================================
--- linux-2.5.orig/drivers/scsi/advansys.c 2004-06-13 11:57:23.000000000 -0700
+++ linux-2.5/drivers/scsi/advansys.c 2004-06-13 12:08:56.000000000 -0700
@@ -801,6 +801,7 @@
#include <linux/blkdev.h>
#include <linux/stat.h>
#include <linux/spinlock.h>
+#include <linux/dma-mapping.h>

#include <asm/io.h>
#include <asm/system.h>
@@ -3337,10 +3338,10 @@
#define AdvWriteDWordLramNoSwap(iop_base, addr, dword) \
((ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr)), \
ADV_MEM_WRITEW((iop_base) + IOPW_RAM_DATA, \
- cpu_to_le16((ushort) ((dword) & 0xFFFF)))), \
+ ((le32_to_cpu(dword)) & 0xFFFF))), \
(ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr) + 2), \
ADV_MEM_WRITEW((iop_base) + IOPW_RAM_DATA, \
- cpu_to_le16((ushort) ((dword >> 16) & 0xFFFF)))))
+ ((le32_to_cpu(dword) >> 16) & 0xFFFF))))

/* Read word (2 bytes) from LRAM assuming that the address is already set. */
#define AdvReadWordAutoIncLram(iop_base) \
@@ -4214,7 +4215,7 @@
STATIC int asc_execute_scsi_cmnd(Scsi_Cmnd *);
STATIC int asc_build_req(asc_board_t *, Scsi_Cmnd *);
STATIC int adv_build_req(asc_board_t *, Scsi_Cmnd *, ADV_SCSI_REQ_Q **);
-STATIC int adv_get_sglist(asc_board_t *, adv_req_t *, Scsi_Cmnd *);
+STATIC int adv_get_sglist(asc_board_t *, adv_req_t *, Scsi_Cmnd *, int);
STATIC void asc_isr_callback(ASC_DVC_VAR *, ASC_QDONE_INFO *);
STATIC void adv_isr_callback(ADV_DVC_VAR *, ADV_SCSI_REQ_Q *);
STATIC void adv_async_callback(ADV_DVC_VAR *, uchar);
@@ -6381,9 +6382,30 @@

ASC_DBG(2, "asc_scsi_done_list: begin\n");
while (scp != NULL) {
+ asc_board_t *boardp;
+ struct pci_dev *pci_dev;
+ int dir;
+
ASC_DBG1(3, "asc_scsi_done_list: scp 0x%lx\n", (ulong) scp);
tscp = REQPNEXT(scp);
scp->host_scribble = NULL;
+
+ boardp = ASC_BOARDP(scp->device->host);
+
+ if (ASC_NARROW_BOARD(boardp))
+ pci_dev = boardp->dvc_cfg.asc_dvc_cfg.pci_dev;
+ else
+ pci_dev = boardp->dvc_cfg.adv_dvc_cfg.pci_dev;
+
+ dir = scsi_to_pci_dma_dir(scp->sc_data_direction);
+
+ if (scp->use_sg)
+ pci_unmap_sg(pci_dev, (struct scatterlist *)scp->request_buffer,
+ scp->use_sg, dir);
+ else if (scp->request_bufflen)
+ pci_unmap_single(pci_dev, scp->SCp.dma_handle,
+ scp->request_bufflen, dir);
+
ASC_STATS(scp->device->host, done);
ASC_ASSERT(scp->scsi_done != NULL);
if (from_isr)
@@ -6619,6 +6641,9 @@
STATIC int
asc_build_req(asc_board_t *boardp, Scsi_Cmnd *scp)
{
+ struct pci_dev *pci_dev = boardp->dvc_cfg.asc_dvc_cfg.pci_dev;
+ int dir = scsi_to_pci_dma_dir(scp->sc_data_direction);
+
/*
* Mutually exclusive access is required to 'asc_scsi_q' and
* 'asc_sg_head' until after the request is started.
@@ -6679,8 +6704,10 @@
* CDB request of single contiguous buffer.
*/
ASC_STATS(scp->device->host, cont_cnt);
- asc_scsi_q.q1.data_addr =
- cpu_to_le32(virt_to_bus(scp->request_buffer));
+ scp->SCp.dma_handle = scp->request_bufflen ?
+ pci_map_single(pci_dev, scp->request_buffer,
+ scp->request_bufflen, dir) : 0;
+ asc_scsi_q.q1.data_addr = cpu_to_le32(scp->SCp.dma_handle);
asc_scsi_q.q1.data_cnt = cpu_to_le32(scp->request_bufflen);
ASC_STATS_ADD(scp->device->host, cont_xfer,
ASC_CEILING(scp->request_bufflen, 512));
@@ -6691,12 +6718,17 @@
* CDB scatter-gather request list.
*/
int sgcnt;
+ int use_sg;
struct scatterlist *slp;

- if (scp->use_sg > scp->device->host->sg_tablesize) {
+ slp = (struct scatterlist *)scp->request_buffer;
+ use_sg = pci_map_sg(pci_dev, slp, scp->use_sg, dir);
+
+ if (use_sg > scp->device->host->sg_tablesize) {
ASC_PRINT3(
"asc_build_req: board %d: use_sg %d > sg_tablesize %d\n",
- boardp->id, scp->use_sg, scp->device->host->sg_tablesize);
+ boardp->id, use_sg, scp->device->host->sg_tablesize);
+ pci_unmap_sg(pci_dev, slp, scp->use_sg, dir);
scp->result = HOST_BYTE(DID_ERROR);
asc_enqueue(&boardp->done, scp, ASC_BACK);
return ASC_ERROR;
@@ -6715,19 +6747,16 @@
asc_scsi_q.q1.data_cnt = 0;
asc_scsi_q.q1.data_addr = 0;
/* This is a byte value, otherwise it would need to be swapped. */
- asc_sg_head.entry_cnt = asc_scsi_q.q1.sg_queue_cnt = scp->use_sg;
+ asc_sg_head.entry_cnt = asc_scsi_q.q1.sg_queue_cnt = use_sg;
ASC_STATS_ADD(scp->device->host, sg_elem, asc_sg_head.entry_cnt);

/*
* Convert scatter-gather list into ASC_SG_HEAD list.
*/
- slp = (struct scatterlist *) scp->request_buffer;
- for (sgcnt = 0; sgcnt < scp->use_sg; sgcnt++, slp++) {
- asc_sg_head.sg_list[sgcnt].addr =
- cpu_to_le32(virt_to_bus(
- (unsigned char *)page_address(slp->page) + slp->offset));
- asc_sg_head.sg_list[sgcnt].bytes = cpu_to_le32(slp->length);
- ASC_STATS_ADD(scp->device->host, sg_xfer, ASC_CEILING(slp->length, 512));
+ for (sgcnt = 0; sgcnt < use_sg; sgcnt++, slp++) {
+ asc_sg_head.sg_list[sgcnt].addr = cpu_to_le32(sg_dma_address(slp));
+ asc_sg_head.sg_list[sgcnt].bytes = cpu_to_le32(sg_dma_len(slp));
+ ASC_STATS_ADD(scp->device->host, sg_xfer, ASC_CEILING(sg_dma_len(slp), 512));
}
}

@@ -6755,6 +6784,8 @@
ADV_SCSI_REQ_Q *scsiqp;
int i;
int ret;
+ struct pci_dev *pci_dev = boardp->dvc_cfg.adv_dvc_cfg.pci_dev;
+ int dir = scsi_to_pci_dma_dir(scp->sc_data_direction);

/*
* Allocate an adv_req_t structure from the board to execute
@@ -6827,15 +6858,23 @@
* Build ADV_SCSI_REQ_Q for a contiguous buffer or a scatter-gather
* buffer command.
*/
- scsiqp->data_cnt = cpu_to_le32(scp->request_bufflen);
- scsiqp->vdata_addr = scp->request_buffer;
- scsiqp->data_addr = cpu_to_le32(virt_to_bus(scp->request_buffer));

if (scp->use_sg == 0) {
/*
* CDB request of single contiguous buffer.
*/
reqp->sgblkp = NULL;
+ scsiqp->data_cnt = cpu_to_le32(scp->request_bufflen);
+ if (scp->request_bufflen) {
+ scsiqp->vdata_addr = scp->request_buffer;
+ scp->SCp.dma_handle =
+ pci_map_single(pci_dev, scp->request_buffer,
+ scp->request_bufflen, dir);
+ } else {
+ scsiqp->vdata_addr = 0;
+ scp->SCp.dma_handle = 0;
+ }
+ scsiqp->data_addr = cpu_to_le32(scp->SCp.dma_handle);
scsiqp->sg_list_ptr = NULL;
scsiqp->sg_real_addr = 0;
ASC_STATS(scp->device->host, cont_cnt);
@@ -6845,10 +6884,21 @@
/*
* CDB scatter-gather request list.
*/
- if (scp->use_sg > ADV_MAX_SG_LIST) {
+ struct scatterlist *slp;
+ int use_sg;
+
+ scsiqp->data_cnt = 0;
+ scsiqp->vdata_addr = 0;
+ scsiqp->data_addr = 0;
+
+ slp = (struct scatterlist *)scp->request_buffer;
+ use_sg = pci_map_sg(pci_dev, slp, scp->use_sg, dir);
+
+ if (use_sg > ADV_MAX_SG_LIST) {
ASC_PRINT3(
"adv_build_req: board %d: use_sg %d > ADV_MAX_SG_LIST %d\n",
- boardp->id, scp->use_sg, scp->device->host->sg_tablesize);
+ boardp->id, use_sg, scp->device->host->sg_tablesize);
+ pci_unmap_sg(pci_dev, slp, scp->use_sg, dir);
scp->result = HOST_BYTE(DID_ERROR);
asc_enqueue(&boardp->done, scp, ASC_BACK);

@@ -6862,7 +6912,7 @@
return ASC_ERROR;
}

- if ((ret = adv_get_sglist(boardp, reqp, scp)) != ADV_SUCCESS) {
+ if ((ret = adv_get_sglist(boardp, reqp, scp, use_sg)) != ADV_SUCCESS) {
/*
* Free the adv_req_t structure by adding it back to the
* board free list.
@@ -6874,7 +6924,7 @@
}

ASC_STATS(scp->device->host, sg_cnt);
- ASC_STATS_ADD(scp->device->host, sg_elem, scp->use_sg);
+ ASC_STATS_ADD(scp->device->host, sg_elem, use_sg);
}

ASC_DBG_PRT_ADV_SCSI_REQ_Q(2, scsiqp);
@@ -6898,7 +6948,7 @@
* ADV_ERROR(-1) - SG List creation failed
*/
STATIC int
-adv_get_sglist(asc_board_t *boardp, adv_req_t *reqp, Scsi_Cmnd *scp)
+adv_get_sglist(asc_board_t *boardp, adv_req_t *reqp, Scsi_Cmnd *scp, int use_sg)
{
adv_sgblk_t *sgblkp;
ADV_SCSI_REQ_Q *scsiqp;
@@ -6910,7 +6960,7 @@

scsiqp = (ADV_SCSI_REQ_Q *) ADV_32BALIGN(&reqp->scsi_req_q);
slp = (struct scatterlist *) scp->request_buffer;
- sg_elem_cnt = scp->use_sg;
+ sg_elem_cnt = use_sg;
prev_sg_block = NULL;
reqp->sgblkp = NULL;

@@ -6982,11 +7032,9 @@

for (i = 0; i < NO_OF_SG_PER_BLOCK; i++)
{
- sg_block->sg_list[i].sg_addr =
- cpu_to_le32(virt_to_bus(
- (unsigned char *)page_address(slp->page) + slp->offset));
- sg_block->sg_list[i].sg_count = cpu_to_le32(slp->length);
- ASC_STATS_ADD(scp->device->host, sg_xfer, ASC_CEILING(slp->length, 512));
+ sg_block->sg_list[i].sg_addr = cpu_to_le32(sg_dma_address(slp));
+ sg_block->sg_list[i].sg_count = cpu_to_le32(sg_dma_len(slp));
+ ASC_STATS_ADD(scp->device->host, sg_xfer, ASC_CEILING(sg_dma_len(slp), 512));

if (--sg_elem_cnt == 0)
{ /* Last ADV_SG_BLOCK and scatter-gather entry. */

2004-06-14 00:43:21

by William Lee Irwin III

[permalink] [raw]
Subject: [7/12] Handle NO_SENSE in sd_rw_intr in sd.c

* Handle NO_SENSE in sd_rw_intr in drivers/scsi/sd.c (Alan Stern)
This fixes Debian BTS #232494.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=232494

Message-ID: <[email protected]>
From: =?windows-1252?Q?Tonda_M=ED=9Aek?= <[email protected]>
To: [email protected]
Subject: mount not work for usb-storage with vfat

I have unstable Debian distribution.
The usb-storage device is USB flash disk.

mount -t vfat /dev/sda1 /ahd/

mount: /dev/sda1: can't read superblock
SCSI error: <1 0 0 0> return code 0x8000000
Current sda: sense key No sense
end_request: I/O error, dev sda, sector 32
FAT: unable to read boot sector

Moreover vfat driver not recognize mount option "isocharset=iso8859-2"
at all.

With kernel 2.4.24 all works without problems

Index: linux-2.5/drivers/scsi/sd.c
===================================================================
--- linux-2.5.orig/drivers/scsi/sd.c 2004-06-13 11:57:24.000000000 -0700
+++ linux-2.5/drivers/scsi/sd.c 2004-06-13 12:08:56.000000000 -0700
@@ -770,6 +770,14 @@
* hard error.
*/
print_sense("sd", SCpnt);
+ /* FALLS THROUGH */
+
+ case NO_SENSE:
+ /*
+ * The low-level driver got the sense data but
+ * everything was all right. Don't treat this
+ * as an error.
+ */
SCpnt->result = 0;
SCpnt->sense_buffer[0] = 0x0;
good_bytes = this_count;

2004-06-14 00:43:21

by William Lee Irwin III

[permalink] [raw]
Subject: [5/12] Ignore errors from tw_setfeature in 3w-xxxx.c

* Ignore errors from tw_setfeature in drivers/scsi/3w-xxxx.c
This fixes Debian BTS #181581.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=181581

From: Blars Blarson <[email protected]>
To: [email protected]
Subject: kernel-source-2.4.20: 3w-xxxx driver won't configure older 3ware card
Message-ID: <[email protected]>

The 3w-xxxx driver has changed so it will no longer configure older
3ware raid cards. The attached patch allows it to work with my 3ware
card. (The source is the same in 2.4.20-5.) (Note: this is an ide
controler pretending it's scsi.)


Index: linux-2.5/drivers/scsi/3w-xxxx.c
===================================================================
--- linux-2.5.orig/drivers/scsi/3w-xxxx.c 2004-06-13 11:57:23.000000000 -0700
+++ linux-2.5/drivers/scsi/3w-xxxx.c 2004-06-13 12:08:55.000000000 -0700
@@ -1220,13 +1220,6 @@
error = tw_setup_irq(tw_dev2);
if (error) {
printk(KERN_WARNING "3w-xxxx: tw_findcards(): Error requesting irq for card %d.\n", j);
- scsi_unregister(host);
- release_region((tw_dev->tw_pci_dev->resource[0].start), TW_IO_ADDRESS_RANGE);
-
- tw_free_device_extension(tw_dev);
- kfree(tw_dev);
- numcards--;
- continue;
}

/* Re-enable interrupts on the card */

2004-06-14 00:44:48

by William Lee Irwin III

[permalink] [raw]
Subject: [8/12] fake inquiry for Sony Clie PEG-TJ25 in unusual_devs.h

* Fake inquiry for Sony Clie PEG-TJ25 in drivers/usb/storage/unusual_devs.h
This fixes Debian BTS #243650.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=243650

From: Mike Alborn <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: kernel-image-2.6.5-1-686: usb-storage fails to enumerate Sony Clie PEG-TJ25
Message-Id: <E1BDet8-0000ND-00@dominique>

When I connect my Sony Clie PEG-TJ25 to my computer and run the MS
Import function, the usb-storage module reports the following error:

scsi0 : SCSI emulation for USB Mass Storage devices
scsi scan: 56 byte inquiry failed with code 134217730. Consider
BLIST_INQUIRY_36 for this device.

lsusb shows the Clie device, but when I try to mount /dev/sda1, I get
'/dev/sda1 is not a valid block device' and cfdisk is 'unable to open
/dev/sda' I have no other SCSI hard disks installed on the system, so I
assume /dev/sda1 is where I should find my Clie.

Note that this function worked with a Debian package of a 2.4 kernel (I
believe it was 2.4.24).

Index: linux-2.5/drivers/usb/storage/unusual_devs.h
===================================================================
--- linux-2.5.orig/drivers/usb/storage/unusual_devs.h 2004-06-13 11:57:26.000000000 -0700
+++ linux-2.5/drivers/usb/storage/unusual_devs.h 2004-06-13 12:08:56.000000000 -0700
@@ -342,6 +342,13 @@
"PEG Mass Storage",
US_SC_DEVICE, US_PR_DEVICE, NULL,
US_FL_FIX_INQUIRY ),
+
+/* Submitted by Mike Alborn <[email protected]> */
+UNUSUAL_DEV( 0x054c, 0x016a, 0x0000, 0x9999,
+ "Sony",
+ "PEG Mass Storage",
+ US_SC_DEVICE, US_PR_DEVICE, NULL,
+ US_FL_FIX_INQUIRY ),

UNUSUAL_DEV( 0x057b, 0x0000, 0x0000, 0x0299,
"Y-E Data",

2004-06-14 00:47:03

by William Lee Irwin III

[permalink] [raw]
Subject: [9/12] fix duplicate environment variables passed to init

* Fixed argument processing bug in init/main.c (Eric Delaunay)
This fixes Debian BTS #58566.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=58566

From: Eric Delaunay <[email protected]>
Message-Id: <[email protected]>
Subject: pb in handling parameters on kernel command line
To: [email protected] (debian bug tracking system)

Hello, I found some bugs in kernel command line parser. AFAIK, they are not
Debian nor sparc specific but I'm not subscribed to linux-kernel mailing list
and since I'm involved with boot-floppies (mainly for sparc), I think I'm right
to report it here. Feel free to forward it upstream (I checked the latest
2.3.46 sources and it seems these bugs are still there).

These bugs are not release critical. The latter just not gives the user a
chance to overwrite TERM env var at boot time. It could be just
inconvenient for serial console boot, and in this case, our busybox' init is
already enforcing TERM=vt102.
Nevertheless if it could not be fixed before the release, I could even write a
workaround in busybox' init (it's just a matter of rewriting getenv()).

At last, it does not affect sysvinit package because serial console tty is
controlled by a getty process which is reading terminal settings on its command
line (take a look in inittab for T0 entries, if any).


Ok, here is my modest contribution to kernel hacking. I don't know much about
kernel internals but it seems that argument parsing is a bit broken.

One trivial patch for command line like "init=/bin/sh console=prom" where
console=prom is replaced by lot of spaces in previous call to setup_arch() on
sparc, therefore the line parsed by parse_options() is really
"init=/bin/sh " and a lot of null args are pushed into argv_init.

The other patch is for command line like "TERM=vt100" where both default & user
TERM entries are pushed into the env array.
Taking a look into /proc/1/environ, it shows up:
HOME=/
TERM=linux
TERM=vt100

It appears that ash (maybe other shells too) is giving the latter entry but
glibc getenv() is giving the former. It is therefore impossible to get entry
from the user in a C program like busybox' init (used in Debian boot-floppies).

I guess getenv() is not written to support duplicate entries, therefore the
kernel should avoid such construct.


Index: linux-2.5/init/main.c
===================================================================
--- linux-2.5.orig/init/main.c 2004-06-13 11:57:47.000000000 -0700
+++ linux-2.5/init/main.c 2004-06-13 12:08:56.000000000 -0700
@@ -268,6 +268,8 @@
panic_later = "Too many boot env vars at `%s'";
panic_param = param;
}
+ if (!strncmp(param, envp_init[i], val - param))
+ break;
}
envp_init[i] = param;
} else {

2004-06-14 00:48:24

by William Lee Irwin III

[permalink] [raw]
Subject: [10/12] fix handling of '/' embedded in filenames in isofs

* Fix slashes in broken Acorn ISO9660 images in fs/isofs/dir.c (Darren Salt)
This fixes Debian BTS #141660.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=141660

From: Darren Salt <[email protected]>
Message-ID: <4B238BA09A%[email protected]>
To: [email protected]
Subject: Handle '/' in filenames in broken ISO9660 images

[Also applicable to 2.2.x]

There has been for some time a problem with certain CD-ROMs whose images were
generated using a particular tool on Acorn RISC OS. The problem is that in
certain catalogue entries, the extension separator character '/' (RISC OS
uses '.' and '/' the other way round) was not replaced with '.'; thus Linux
cannot properly parse this without this patch, thinking that it is a
directory separator.

Index: linux-2.5/fs/isofs/dir.c
===================================================================
--- linux-2.5.orig/fs/isofs/dir.c 2004-06-13 11:57:34.000000000 -0700
+++ linux-2.5/fs/isofs/dir.c 2004-06-13 12:08:57.000000000 -0700
@@ -64,7 +64,8 @@
break;

/* Convert remaining ';' to '.' */
- if (c == ';')
+ /* Also '/' to '.' (broken Acorn-generated ISO9660 images) */
+ if (c == ';' || c == '/')
c = '.';

new[i] = c;

2004-06-14 00:50:24

by William Lee Irwin III

[permalink] [raw]
Subject: [11/12] fix isofs ignoring noexec and mode mount options

* Removed period check for executables in fs/isofs/inode.c
This fixes Debian BTS #162190
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=162190

From: Jan Gregor <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: kernel-source-2.4.18: kernel ignores noexec and mode option in cdrom case
Message-ID: <20020924162129.A328@pisidlo>

In /etc/fstab i have following line:
/dev/cdrom /cdrom iso9660 gid=100,noauto,ro,noexec,mode=0444,user 0 0

I found on one CD that some files have exec bit set. From brief view
those files has no extension (filename.ext).

My drive is asus-1610a (ATAPI writer) connected throught scsi-emulation.


Index: linux-2.5/fs/isofs/inode.c
===================================================================
--- linux-2.5.orig/fs/isofs/inode.c 2004-06-13 11:57:34.000000000 -0700
+++ linux-2.5/fs/isofs/inode.c 2004-06-13 12:08:57.000000000 -0700
@@ -1250,14 +1250,6 @@
inode->i_mode = sbi->s_mode;
inode->i_nlink = 1;
inode->i_mode |= S_IFREG;
- /* If there are no periods in the name,
- * then set the execute permission bit
- */
- for(i=0; i< de->name_len[0]; i++)
- if(de->name[i]=='.' || de->name[i]==';')
- break;
- if(i == de->name_len[0] || de->name[i] == ';')
- inode->i_mode |= S_IXUGO; /* execute permission */
}
inode->i_uid = sbi->s_uid;
inode->i_gid = sbi->s_gid;

2004-06-14 00:51:48

by William Lee Irwin III

[permalink] [raw]
Subject: [12/12] fix thread_info.h ignoring __HAVE_THREAD_FUNCTIONS

* Check __HAVE_THREAD_FUNCTIONS in include/linux/thread_info.h (m68k)
This fixes the build on m68k; its thread_info functions need to be used.

Index: linux-2.5/include/linux/thread_info.h
===================================================================
--- linux-2.5.orig/include/linux/thread_info.h 2004-06-13 11:57:45.000000000 -0700
+++ linux-2.5/include/linux/thread_info.h 2004-06-13 12:08:57.000000000 -0700
@@ -21,6 +21,7 @@
#include <asm/thread_info.h>

#ifdef __KERNEL__
+#ifndef __HAVE_THREAD_FUNCTIONS

/*
* flag set/clear/test wrappers
@@ -87,6 +88,7 @@
clear_thread_flag(TIF_NEED_RESCHED);
}

-#endif
+#endif /* __HAVE_THREAD_FUNCTIONS */
+#endif /* __KERNEL__ */

#endif /* _LINUX_THREAD_INFO_H */

2004-06-14 04:15:16

by Andrew Morton

[permalink] [raw]
Subject: Re: [1/12] don't dereference netdev->name before register_netdev()

William Lee Irwin III <[email protected]> wrote:
>
> * Removed dev->name lookups before register_netdev
> This fixes Debian BTS #234817.
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=234817
>
> From: Shaul Karl <[email protected]>
> To: [email protected]
> Subject: Reports about eth%%d at boot
> Message-ID: <20040225225611.GA3532@rakefet>
>
> The problem is that most reports at boot time about the eth modules
> use %%d instead of the interface number. For example,
>
> eth%%d: NE2000 found at 0x280, using IRQ 5.
> NE*000 ethercard probe at 0x240: 00 c0 f0 10 eb 56

This generates a storm of rejects against Jeff's current tree. This patch
fixes more than Jeff's tree does, but in some places does it slightly
differently.

It needs to be split up and generally chewed through.

2004-06-14 04:27:01

by Andrew Morton

[permalink] [raw]
Subject: Re: [6/12] fix advansys.c highmem bugs

William Lee Irwin III <[email protected]> wrote:
>
> * Added basic highmem support in drivers/scsi/advansys.c

14 out of 16 hunks FAILED -- saving rejects to file drivers/scsi/advansys.c.rej

Looks like this has been addressed in the bk scsi tree, only differently.

2004-06-14 04:27:59

by Jeff Garzik

[permalink] [raw]
Subject: Re: [1/12] don't dereference netdev->name before register_netdev()

Herbert Xu has an updated patch for this, I'll compare both more closely...

2004-06-14 05:27:19

by Herbert Xu

[permalink] [raw]
Subject: Re: [1/12] don't dereference netdev->name before register_netdev()

Jeff Garzik <[email protected]> wrote:
> Herbert Xu has an updated patch for this, I'll compare both more closely...

Please ignore the one posted in this thread. It is hopelessly out
of date.

Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

2004-06-14 08:10:58

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [1/12] don't dereference netdev->name before register_netdev()

On Sun, Jun 13, 2004 at 05:33:31PM -0700, William Lee Irwin III wrote:
> * Removed dev->name lookups before register_netdev
> This fixes Debian BTS #234817.
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=234817

Herbert has worked with Jeff on this issue already. And -netdev would
be the right list for it.

2004-06-14 08:11:09

by William Lee Irwin III

[permalink] [raw]
Subject: Re: [6/12] fix advansys.c highmem bugs

William Lee Irwin III <[email protected]> wrote:
>> * Added basic highmem support in drivers/scsi/advansys.c

On Sun, Jun 13, 2004 at 09:26:11PM -0700, Andrew Morton wrote:
> 14 out of 16 hunks FAILED -- saving rejects to file drivers/scsi/advansys.c.rej
> Looks like this has been addressed in the bk scsi tree, only differently.

I'm in a maze of bk trees, all slightly different. Then the dungeon
collapses. I generated this stuff vs. 2.6.x-bk-CURRENT, presuming there
was some sort of recency to either the patches or the tree I was
looking at. Apparently, there was such for neither of the two.


-- wli

2004-06-14 08:13:03

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [3/12] remove irda usage of isa_virt_to_bus()

On Sun, Jun 13, 2004 at 05:36:05PM -0700, William Lee Irwin III wrote:
> * Removed uses of isa_virt_to_bus
> This resolves Debian BTS #218878.
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=218878
>
> From: Paavo Hartikainen <[email protected]>
> To: Debian Bug Tracking System <[email protected]>
> Subject: IrDA modules fail to load
> Message-Id: <[email protected]>
>
> When trying to "modprobe irda irtty", it fails with following message:
> FATAL: Error inserting irda (/lib/modules/2.6.0-test9/kernel/net/irda/irda.ko): Unknown symbol in module, or unknown parameter (see dmesg)
> And in "dmesg" I see these:
> irda: Unknown symbol isa_virt_to_bus
> irda: Unknown symbol isa_virt_to_bus

netdev would be the right list I guess.

2004-06-14 08:12:32

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [2/12] lower priority of "too many keys" msg in atkbd.c

On Sun, Jun 13, 2004 at 05:34:59PM -0700, William Lee Irwin III wrote:
> * Lowered priority of "too many keys" message in drivers/input/keyboard/atkbd.c
> This fixes Debian BTS #239036.
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=239036
>
> From: "Jon Thackray" <[email protected]>
> Message-ID: <[email protected]>
> To: [email protected]
> Subject: Keyboard misbehaving
>
> The keyboard under 2.6.4 seems to be behaving strangely, reporting
> unknown key codes and too many keys pressed, even when no keys have
> been pressed. The keyboard is connected via an 8 way KVM switch, but
> was working quite acceptably under 2.4.25 with no such messages.
> Trying 2.6.3 is not an option as it doesn't support the hardware
> properly, as previously reported.

I already sent this patch to lkml, please read up the discussion that
happened on it here.

2004-06-14 08:15:49

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [5/12] Ignore errors from tw_setfeature in 3w-xxxx.c

On Sun, Jun 13, 2004 at 05:38:35PM -0700, William Lee Irwin III wrote:
> * Ignore errors from tw_setfeature in drivers/scsi/3w-xxxx.c
> This fixes Debian BTS #181581.
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=181581
>
> From: Blars Blarson <[email protected]>
> To: [email protected]
> Subject: kernel-source-2.4.20: 3w-xxxx driver won't configure older 3ware card
> Message-ID: <[email protected]>
>
> The 3w-xxxx driver has changed so it will no longer configure older
> 3ware raid cards. The attached patch allows it to work with my 3ware
> card. (The source is the same in 2.4.20-5.) (Note: this is an ide
> controler pretending it's scsi.)

This patch is bogus. (And should have been sent to linux-scsi).

2004-06-14 08:16:51

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [7/12] Handle NO_SENSE in sd_rw_intr in sd.c

On Sun, Jun 13, 2004 at 05:40:34PM -0700, William Lee Irwin III wrote:
> * Handle NO_SENSE in sd_rw_intr in drivers/scsi/sd.c (Alan Stern)
> This fixes Debian BTS #232494.
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=232494
>
> Message-ID: <[email protected]>
> From: =?windows-1252?Q?Tonda_M=ED=9Aek?= <[email protected]>
> To: [email protected]
> Subject: mount not work for usb-storage with vfat
>
> I have unstable Debian distribution.
> The usb-storage device is USB flash disk.
>
> mount -t vfat /dev/sda1 /ahd/
>
> mount: /dev/sda1: can't read superblock
> SCSI error: <1 0 0 0> return code 0x8000000
> Current sda: sense key No sense
> end_request: I/O error, dev sda, sector 32
> FAT: unable to read boot sector
>
> Moreover vfat driver not recognize mount option "isocharset=iso8859-2"
> at all.
>
> With kernel 2.4.24 all works without problems


James didn't like this version of the patch but I sent him one addressing his
concerns. Again linux-scsi is the right list for this.

2004-06-14 08:19:39

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [12/12] fix thread_info.h ignoring __HAVE_THREAD_FUNCTIONS

On Sun, Jun 13, 2004 at 05:48:55PM -0700, William Lee Irwin III wrote:
> * Check __HAVE_THREAD_FUNCTIONS in include/linux/thread_info.h (m68k)
> This fixes the build on m68k; its thread_info functions need to be used.

I don't like this one a lot and prefer to discuss it with the m68k folks
first. Given they didn't sent it to Linus themselves I guess they're not
completely proud of it ;-)

2004-06-14 08:19:40

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [6/12] fix advansys.c highmem bugs

On Sun, Jun 13, 2004 at 05:39:29PM -0700, William Lee Irwin III wrote:
> * Added basic highmem support in drivers/scsi/advansys.c
> This fixes Debian BTS #245238.
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=245238
>
> From: "Jamin W. Collins" <[email protected]>
> To: Debian Bug Tracking System <[email protected]>
> Message-Id: <[email protected]>
> Subject: kernel-image-2.6.5-1-k7: fails to boot with "request_module: runaway loop modprobe binfmt-0000"
>
> Attempting to boot my system after installing the
> kernel-image-2.6.5-1-k7 package fails with the following errors:
>
> request_module: runaway loop modprobe binfmt-0000
> request_module: runaway loop modprobe binfmt-0000
> request_module: runaway loop modprobe binfmt-0000
> request_module: runaway loop modprobe binfmt-0000
>
> The system boots fine from a 2.4.24 kernel and used to boot properly
> from a custom 2.6.3 kernel. After taking hte system down to add more
> memory, I noticed the above error with my custom 2.6.3 kernel and
> reverted to the 2.4.24. I've since removed the custom 2.6.3 and
> installed the Debian 2.6.5.

An improved version of this already is in the linux-scsi tree.

2004-06-14 08:16:56

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [8/12] fake inquiry for Sony Clie PEG-TJ25 in unusual_devs.h

On Sun, Jun 13, 2004 at 05:41:47PM -0700, William Lee Irwin III wrote:
> * Fake inquiry for Sony Clie PEG-TJ25 in drivers/usb/storage/unusual_devs.h
> This fixes Debian BTS #243650.
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=243650
>
> From: Mike Alborn <[email protected]>
> To: Debian Bug Tracking System <[email protected]>
> Subject: kernel-image-2.6.5-1-686: usb-storage fails to enumerate Sony Clie PEG-TJ25
> Message-Id: <E1BDet8-0000ND-00@dominique>
>
> When I connect my Sony Clie PEG-TJ25 to my computer and run the MS
> Import function, the usb-storage module reports the following error:
>
> scsi0 : SCSI emulation for USB Mass Storage devices
> scsi scan: 56 byte inquiry failed with code 134217730. Consider
> BLIST_INQUIRY_36 for this device.
>
> lsusb shows the Clie device, but when I try to mount /dev/sda1, I get
> '/dev/sda1 is not a valid block device' and cfdisk is 'unable to open
> /dev/sda' I have no other SCSI hard disks installed on the system, so I
> assume /dev/sda1 is where I should find my Clie.
>
> Note that this function worked with a Debian package of a 2.4 kernel (I
> believe it was 2.4.24).

This one is already in for some time.

2004-06-14 08:24:25

by William Lee Irwin III

[permalink] [raw]
Subject: Re: [1/12] don't dereference netdev->name before register_netdev()

On Sun, Jun 13, 2004 at 05:33:31PM -0700, William Lee Irwin III wrote:
>> * Removed dev->name lookups before register_netdev
>> This fixes Debian BTS #234817.
>> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=234817

On Mon, Jun 14, 2004 at 09:10:56AM +0100, Christoph Hellwig wrote:
> Herbert has worked with Jeff on this issue already. And -netdev would
> be the right list for it.

Good stuff. Looks like I can drop a few more patches, then.


-- wli

2004-06-14 08:24:24

by William Lee Irwin III

[permalink] [raw]
Subject: Re: [1/12] don't dereference netdev->name before register_netdev()

Jeff Garzik <[email protected]> wrote:
>> Herbert Xu has an updated patch for this, I'll compare both more closely...

On Mon, Jun 14, 2004 at 03:26:45PM +1000, Herbert Xu wrote:
> Please ignore the one posted in this thread. It is hopelessly out
> of date.

Go with Herbert's, I'm basically shipping whatever I've seen from him,
and you've seen more recent and better.

Sorry about that Herbert, I appear to have dropped a number of packets
regarding the state of these things.


-- wli

2004-06-14 08:16:56

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [10/12] fix handling of '/' embedded in filenames in isofs

On Sun, Jun 13, 2004 at 05:45:16PM -0700, William Lee Irwin III wrote:
> * Fix slashes in broken Acorn ISO9660 images in fs/isofs/dir.c (Darren Salt)
> This fixes Debian BTS #141660.
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=141660
>
> From: Darren Salt <[email protected]>
> Message-ID: <4B238BA09A%[email protected]>
> To: [email protected]
> Subject: Handle '/' in filenames in broken ISO9660 images
>
> [Also applicable to 2.2.x]
>
> There has been for some time a problem with certain CD-ROMs whose images were
> generated using a particular tool on Acorn RISC OS. The problem is that in
> certain catalogue entries, the extension separator character '/' (RISC OS
> uses '.' and '/' the other way round) was not replaced with '.'; thus Linux
> cannot properly parse this without this patch, thinking that it is a
> directory separator.

-fsdevel is the right list and if you checked I already sent a rfc there
for this and the other iso9660 patch.

2004-06-14 08:36:00

by William Lee Irwin III

[permalink] [raw]
Subject: Re: [12/12] fix thread_info.h ignoring __HAVE_THREAD_FUNCTIONS

On Sun, Jun 13, 2004 at 05:48:55PM -0700, William Lee Irwin III wrote:
>> * Check __HAVE_THREAD_FUNCTIONS in include/linux/thread_info.h (m68k)
>> This fixes the build on m68k; its thread_info functions need to be used.

On Mon, Jun 14, 2004 at 09:16:39AM +0100, Christoph Hellwig wrote:
> I don't like this one a lot and prefer to discuss it with the m68k folks
> first. Given they didn't sent it to Linus themselves I guess they're not
> completely proud of it ;-)

Including this in the series was a mistake, though it one I thought about
and made a wrong decision on. I'll defer to the m68k arch people for this
entirely.


-- wli

2004-06-14 10:19:37

by Roman Zippel

[permalink] [raw]
Subject: Re: [12/12] fix thread_info.h ignoring __HAVE_THREAD_FUNCTIONS

Hi,

On Mon, 14 Jun 2004, Christoph Hellwig wrote:

> On Sun, Jun 13, 2004 at 05:48:55PM -0700, William Lee Irwin III wrote:
> > * Check __HAVE_THREAD_FUNCTIONS in include/linux/thread_info.h (m68k)
> > This fixes the build on m68k; its thread_info functions need to be used.
>
> I don't like this one a lot and prefer to discuss it with the m68k folks
> first. Given they didn't sent it to Linus themselves I guess they're not
> completely proud of it ;-)

That's out of the "should we just blindly copy everything from i386?"
department. These thread info functions used char fields for a short
while, which is actually preferable over bitfields on a lot of archs.
The various thread flags have different usage, often the current thread is
the only one accessing it, but all of them right now use possibly
expensive bit field functions.
I'm thinking about reverting this one and just copy what everyone else is
doing, as the benefit is probably not that big for m68k.

There is another pending change in this department: current_thread_info().
For all nonbroken archs which have proper thread register it would
actually be beneficial, to keep the task structure and thread info
together and access them via the thread register, but a certain arch
and include dependencies forces everyone to derive the thread info pointer
from the stack pointer.
The most important change here is to separate task_struct out of sched.h
and I'd really like to get this change in, even if it has to wait for 2.7.

bye, Roman

2004-06-14 10:23:56

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [12/12] fix thread_info.h ignoring __HAVE_THREAD_FUNCTIONS

On Mon, Jun 14, 2004 at 12:19:12PM +0200, Roman Zippel wrote:
> There is another pending change in this department: current_thread_info().
> For all nonbroken archs which have proper thread register it would
> actually be beneficial, to keep the task structure and thread info
> together and access them via the thread register, but a certain arch
> and include dependencies forces everyone to derive the thread info pointer
> from the stack pointer.

ia64 actually has thread_info and task_info in a single allocation and
uses a thread register to find that one.

2004-06-14 10:47:50

by Roman Zippel

[permalink] [raw]
Subject: Re: [12/12] fix thread_info.h ignoring __HAVE_THREAD_FUNCTIONS

Hi,

On Mon, 14 Jun 2004, Christoph Hellwig wrote:

> ia64 actually has thread_info and task_info in a single allocation and
> uses a thread register to find that one.

Hmm, it's a possible solution, although it rather just works around the
include mess.

bye, Roman

2004-06-15 01:43:47

by Jean Tourrilhes

[permalink] [raw]
Subject: Re: [3/12] remove irda usage of isa_virt_to_bus()

William Lee Irwin III wrote :
>
> * Removed uses of isa_virt_to_bus
> This resolves Debian BTS #218878.
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=218878
>
> From: Paavo Hartikainen <[email protected]>
> To: Debian Bug Tracking System <[email protected]>
> Subject: IrDA modules fail to load
> Message-Id: <[email protected]>
>
> When trying to "modprobe irda irtty", it fails with following message:
> FATAL: Error inserting irda (/lib/modules/2.6.0-test9/kernel/net/irda/irda.ko): \
> Unknown symbol in module, or unknown parameter (see dmesg) And in "dmesg" I see \
> these: irda: Unknown symbol isa_virt_to_bus
> irda: Unknown symbol isa_virt_to_bus

Could you please send this directly to me. I hate scrubbing
large patches from the mailing list archive.
Note that before even thinking of pushing this patch in the
kernel, we need to perform testing with the hardware on i386 and
potentially on ARM. The author only tried with irtty that doesn't use
this function, so that's not a valid test at all. Finding people test
those changes is going to be tough, as usual.
I'm also wondering about the validity of those changes, but
that's another matter I need to go through. During 2.5.X, some people
assured me that using isa_virt_to_bus was safe on all platform with an
ISA bus...

Thanks...

Jean

2004-06-15 09:21:52

by William Lee Irwin III

[permalink] [raw]
Subject: Re: [3/12] remove irda usage of isa_virt_to_bus()

On Mon, Jun 14, 2004 at 06:43:44PM -0700, Jean Tourrilhes wrote:
> Could you please send this directly to me. I hate scrubbing
> large patches from the mailing list archive.
> Note that before even thinking of pushing this patch in the
> kernel, we need to perform testing with the hardware on i386 and
> potentially on ARM. The author only tried with irtty that doesn't use
> this function, so that's not a valid test at all. Finding people test
> those changes is going to be tough, as usual.
> I'm also wondering about the validity of those changes, but
> that's another matter I need to go through. During 2.5.X, some people
> assured me that using isa_virt_to_bus was safe on all platform with an
> ISA bus...

Okay, well, I myself didn't produce this, and I couldn't tell offhand
if it was bogus or not. I presumed bugreporter made happy and spraying
it across the debian userbase was enough to verify it at runtime. From
what you're telling me, this is not the case.

Can you recommend people to do this kind of testing?

Apparently people aren't entirely happy with "dump it on lkml and wait
for an ack or nak", which I've noted for future reference, but probably
won't have a need to consider again (it's very rare that I have to deal
with changes I didn't write myself or are otherwise in areas I don't
have much knowledge about). OTOH, it was easier to find than buried in
a distro BTS and/or cvs, not that that makes it ideal.


-- wli

2004-06-15 17:24:27

by Jean Tourrilhes

[permalink] [raw]
Subject: Re: [3/12] remove irda usage of isa_virt_to_bus()

On Tue, Jun 15, 2004 at 02:12:19AM -0700, William Lee Irwin III wrote:
> On Mon, Jun 14, 2004 at 06:43:44PM -0700, Jean Tourrilhes wrote:
> > Could you please send this directly to me. I hate scrubbing
> > large patches from the mailing list archive.
> > Note that before even thinking of pushing this patch in the
> > kernel, we need to perform testing with the hardware on i386 and
> > potentially on ARM. The author only tried with irtty that doesn't use
> > this function, so that's not a valid test at all. Finding people test
> > those changes is going to be tough, as usual.
> > I'm also wondering about the validity of those changes, but
> > that's another matter I need to go through. During 2.5.X, some people
> > assured me that using isa_virt_to_bus was safe on all platform with an
> > ISA bus...
>
> Okay, well, I myself didn't produce this, and I couldn't tell offhand
> if it was bogus or not.

I can't either, that's why we need to check it.

> I presumed bugreporter made happy and spraying
> it across the debian userbase was enough to verify it at runtime. From
> what you're telling me, this is not the case.

IrDA is a special case because there are few users and most
are still using 2.4.X.

> Can you recommend people to do this kind of testing?

Me. I'll also post the patch to the linux-irda mailing list.

> Apparently people aren't entirely happy with "dump it on lkml and wait
> for an ack or nak", which I've noted for future reference, but probably
> won't have a need to consider again (it's very rare that I have to deal
> with changes I didn't write myself or are otherwise in areas I don't
> have much knowledge about).

I'm not a full time Linux hacker, I follow lkml from the
archive. No big deal.

> OTOH, it was easier to find than buried in
> a distro BTS and/or cvs, not that that makes it ideal.

Debian is usually very good sending me bug reports (especiall
on wireless tools), so I'm a bit surprised that it did not work this
time. But I've seen a recent trend by Debian to do more Debian
specific stuff for system level config, which I find disturbing.

> -- wli

Thanks !

Jean

2004-06-15 17:48:48

by William Lee Irwin III

[permalink] [raw]
Subject: Re: [3/12] remove irda usage of isa_virt_to_bus()

On Tue, Jun 15, 2004 at 02:12:19AM -0700, William Lee Irwin III wrote:
>> OTOH, it was easier to find than buried in
>> a distro BTS and/or cvs, not that that makes it ideal.

On Tue, Jun 15, 2004 at 10:01:58AM -0700, Jean Tourrilhes wrote:
> Debian is usually very good sending me bug reports (especiall
> on wireless tools), so I'm a bit surprised that it did not work this
> time. But I've seen a recent trend by Debian to do more Debian
> specific stuff for system level config, which I find disturbing.

These seem to be the ones that have leaked through the cracks. Apart
from this (and the posting is helping to find all the concerned parties)
things should go largely through normal channels in general.

Also, thanks for doing the footwork to get this thing properly
evaluated, as it was unclear to me the risks involved. I don't want
bogus code going in.


-- wli