Re: 53052feb6 (PNP: remove pnp_mem_flags() as an lvalue) breaks myALSA intel8x0 sound card regression

From: Rene Herman
Date: Mon Jun 02 2008 - 20:11:57 EST


On 03-06-08 01:58, Rene Herman wrote:

Bjorn, before you repost the option series due to this, wait a minute. Am now looking at/testing 14/15 and see some stuff that needs changing as well.

Well, or not if you're in a hurry. Just see it's 02:00+ here again so I'm off. But at least this bit from 14/15 isn't right:

===
@ -176,33 +184,10 @@ static void quirk_ad1815_mpu_resources(s
if (!irq || irq->next)
return;

- res = dev->dependent;
- if (!res)
- return;
-
- while (1) {
- struct pnp_irq *copy;
-
- copy = pnp_alloc(sizeof *copy);
- if (!copy)
- break;
-
- bitmap_copy(copy->map.bits, irq->map.bits, PNP_IRQ_NR);
- copy->flags = irq->flags;
-
- copy->next = res->irq; /* Yes, this is NULL */
- res->irq = copy;
-
- if (!res->next)
- break;
- res = res->next;
- }
- kfree(irq);
+ irq->flags |= IORESOURCE_IRQ_OPTIONAL;
+ dev_info(&dev->dev, "made independent IRQ optional\n");

res->next = quirk_isapnp_mpu_options(dev);
-
- res = dev->independent;
- res->irq = NULL;
}
===

The deleted while loop traversedf the dependent optiosn so that at the end res->next= added to the end of teh dependent chain. Now this adds to the independent optiion.

Fortunately fix is simple; just delete the res->next = line completely. This previously distributed the independent IRQ over the dependents so I _could_ have an IRQ-less option by adding IRQ-less dependents but with an OPTIONAL flag this is no longer needed.

Specifically, ad1815 MPU401 starts out as:

rene@ax6bc:~$ cat /sys/devices/pnp1/01\:01/01\:01.01/options
irq 5,7,2/9,11,12 High-Edge
Dependent: 00 - Priority preferred
port 0x330-0x330, align 0x0, size 0x2, 10-bit address decoding
Dependent: 01 - Priority acceptable
port 0x300-0x300, align 0x0, size 0x2, 10-bit address decoding
Dependent: 02 - Priority functional
port 0x100-0x3fe, align 0x1, size 0x2, 10-bit address decoding

and with your current code ends up as:

rene@ax6bc:~$ cat /sys/devices/pnp1/01\:01/01\:01.01/options
irq 5,7,2/9,11,12 High-Edge
Dependent: 00 - Priority preferred
port 0x330-0x330, align 0x0, size 0x2, 10-bit address decoding
Dependent: 01 - Priority acceptable
port 0x300-0x300, align 0x0, size 0x2, 10-bit address decoding
Dependent: 02 - Priority functional
port 0x100-0x3fe, align 0x1, size 0x2, 10-bit address decoding
Dependent: 03 - Priority functional
port 0x330-0x330, align 0x0, size 0x2, 10-bit address decoding
Dependent: 04 - Priority functional
port 0x300-0x300, align 0x0, size 0x2, 10-bit address decoding
Dependent: 05 - Priority functional
port 0x100-0x3fe, align 0x1, size 0x2, 10-bit address decoding

As you see, no need for 4, 5 and 6. So no need fior the cloning. This also means functi9ons can be folded back in but I'll do that later if you prefer.

Unfortunately, the optional thing doesn't seem to work at all at the moment (this is post your series):

ad1816a 01:01.01: pnp_assign_resources, try dependent set 0
ad1816a 01:01.01: couldn't assign irq 0
ad1816a 01:01.01: pnp_assign_resources failed (-16)
ad1816a 01:01.01: pnp_assign_resources, try dependent set 1
ad1816a 01:01.01: couldn't assign irq 0
ad1816a 01:01.01: pnp_assign_resources failed (-16)
ad1816a 01:01.01: pnp_assign_resources, try dependent set 2
ad1816a 01:01.01: couldn't assign irq 0
ad1816a 01:01.01: pnp_assign_resources failed (-16)
ad1816a 01:01.01: pnp_assign_resources, try dependent set 3
ad1816a 01:01.01: couldn't assign irq 0
ad1816a 01:01.01: pnp_assign_resources failed (-16)
ad1816a 01:01.01: pnp_assign_resources, try dependent set 4
ad1816a 01:01.01: couldn't assign irq 0
ad1816a 01:01.01: pnp_assign_resources failed (-16)
ad1816a 01:01.01: pnp_assign_resources, try dependent set 5
ad1816a 01:01.01: couldn't assign irq 0
ad1816a 01:01.01: pnp_assign_resources failed (-16)
ad1816a 01:01.01: unable to assign resources
ad1816a: MPU401 PnP configure failure

but I ran out of day again. Will look.

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