public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rene Herman <rene.herman@keyaccess.nl>
To: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	torvalds@linux-foundation.org, avuton@gmail.com,
	rene.herman@gmail.com, len.brown@intel.com,
	linux-kernel@vger.kernel.org, rjw@sisk.pl
Subject: Re: 53052feb6 (PNP: remove pnp_mem_flags() as an lvalue) breaks my ALSA intel8x0 sound card regression
Date: Tue, 03 Jun 2008 02:15:05 +0200	[thread overview]
Message-ID: <48448D09.3000701@keyaccess.nl> (raw)
In-Reply-To: <48448932.80803@keyaccess.nl>

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.

  parent reply	other threads:[~2008-06-03  0:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-01 14:42 53052feb6 (PNP: remove pnp_mem_flags() as an lvalue) breaks my ALSA intel8x0 sound card regression Avuton Olrich
2008-06-01 16:20 ` Rene Herman
2008-06-02  3:25   ` Avuton Olrich
2008-06-02 19:06     ` Rene Herman
2008-06-02 22:05       ` Bjorn Helgaas
2008-06-02 22:23         ` Avuton Olrich
2008-06-02 22:42           ` Bjorn Helgaas
2008-06-02 23:49             ` Andrew Morton
2008-06-02 23:58               ` Rene Herman
2008-06-03  0:03                 ` Andrew Morton
2008-06-03  0:31                   ` Rene Herman
2008-06-03  0:15                 ` Rene Herman [this message]
2008-06-03 18:40               ` Bjorn Helgaas
2008-06-04 23:38             ` Tony Luck
2008-06-05 16:18               ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48448D09.3000701@keyaccess.nl \
    --to=rene.herman@keyaccess.nl \
    --cc=akpm@linux-foundation.org \
    --cc=avuton@gmail.com \
    --cc=bjorn.helgaas@hp.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rene.herman@gmail.com \
    --cc=rjw@sisk.pl \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox