opl3sa2 didn't accept dma=0 in 2.4 due to isapnp
In a recent thread [1], someone described problems with opl3sa2 on
Linux-2.4 when dma 0 was used, since isapnp didn't support dma 0. If it's
necessary to patch this in Linux-2.5 either, please apply this one.
[1] <URL:http://marc.theaimsgroup.com/?l=linux-kernel&m=102310599324992&w=2>
--- linus-2.5/sound/oss/opl3sa2.c Mon Jun 3 06:32:51 2002
+++ thunder-2.5.20/sound/oss/opl3sa2.c Mon Jun 3 16:26:38 2002
@@ -874,8 +874,18 @@
opl3sa2_activated[card] = 1;
}
else {
+ /*
+ * isapnp.c disallows dma=0, but the opl3sa2 card itself
+ * accepts this value perfectly.
+ */
+ if (dev->ro) {
+ isapnp_resource_change(&dev->dma_resource[0], 0, 1);
+ isapnp_resource_change(&dev->dma_resource[1], 1, 1);
+ }
+ opl3sa2_state[card].activated = 1;
+
if(dev->activate(dev) < 0) {
- printk(KERN_WARNING "opl3sa2: ISA PnP activate failed\n");
+ printk(KERN_WARNING "opl3sa2: ISA PnP activate failed!\n");
opl3sa2_activated[card] = 0;
return -ENODEV;
}
--
Lightweight patch manager using pine. If you have any objections, tell me.
On Mon, 3 Jun 2002, Lightweight patch manager wrote:
> opl3sa2 didn't accept dma=0 in 2.4 due to isapnp
>
> In a recent thread [1], someone described problems with opl3sa2 on
> Linux-2.4 when dma 0 was used, since isapnp didn't support dma 0. If it's
> necessary to patch this in Linux-2.5 either, please apply this one.
>
> [1] <URL:http://marc.theaimsgroup.com/?l=linux-kernel&m=102310599324992&w=2>
I think it would be better to wait until Zwane sends something to Alan
and/or Marcelo, as this patch is incorrect on a couple of levels. See my
annotations below:
> --- linus-2.5/sound/oss/opl3sa2.c Mon Jun 3 06:32:51 2002
> +++ thunder-2.5.20/sound/oss/opl3sa2.c Mon Jun 3 16:26:38 2002
> @@ -874,8 +874,18 @@
> opl3sa2_activated[card] = 1;
> }
> else {
> + /*
> + * isapnp.c disallows dma=0, but the opl3sa2 card itself
> + * accepts this value perfectly.
> + */
> + if (dev->ro) {
This is wrong, it was:
+ if (!dev->ro) {
in Gerald's original patch, and that actually made sense.
> + isapnp_resource_change(&dev->dma_resource[0], 0, 1);
> + isapnp_resource_change(&dev->dma_resource[1], 1, 1);
> + }
> + opl3sa2_state[card].activated = 1;
This line should really be below the following if statement, as I believe
Zwane mentioned to Gerald.
> +
> if(dev->activate(dev) < 0) {
> - printk(KERN_WARNING "opl3sa2: ISA PnP activate failed\n");
> + printk(KERN_WARNING "opl3sa2: ISA PnP activate failed!\n");
> opl3sa2_activated[card] = 0;
> return -ENODEV;
> }
I think always blindly remapping the the DMA channels to 0 and 1 is a bad
idea and will likely break things for some people. It would be better if
the core isapnp code could be made smarter, but a simple alternative would
be to rework the opl3sa2 module parameter parsing to allow using the DMA
parameters as an override when using PnP.
Scott
PS: Zwane, any chance you want to update MAINTAINERS to "officially" take
over opl3sa2?
--
Scott Murray
SOMA Networks, Inc.
Toronto, Ontario
e-mail: [email protected]
Hi,
On Mon, 3 Jun 2002, Scott Murray wrote:
> I think it would be better to wait until Zwane sends something to Alan
> and/or Marcelo, as this patch is incorrect on a couple of levels. See my
> annotations below:
His patch won't match for 2.5. I just adapted it, even though I've had a
typo there.
> > + opl3sa2_state[card].activated = 1;
>
> This line should really be below the following if statement, as I believe
> Zwane mentioned to Gerald.
You could of course have it there. No problem with that.
> I think always blindly remapping the the DMA channels to 0 and 1 is a bad
> idea and will likely break things for some people. It would be better if
> the core isapnp code could be made smarter, but a simple alternative would
> be to rework the opl3sa2 module parameter parsing to allow using the DMA
> parameters as an override when using PnP.
As I mentioned, I was just porting it.
> Scott
Regards,
Thunder
--
ship is leaving right on time | Thunder from the hill at ngforever
empty harbour, wave goodbye |
evacuation of the isle | free inhabitant not directly
caveman's paintings drowning | belonging anywhere
On Mon, 3 Jun 2002, Thunder from the hill wrote:
> Hi,
>
> On Mon, 3 Jun 2002, Scott Murray wrote:
> > I think it would be better to wait until Zwane sends something to Alan
> > and/or Marcelo, as this patch is incorrect on a couple of levels. See my
> > annotations below:
>
> His patch won't match for 2.5. I just adapted it, even though I've had a
> typo there.
[snip]
> As I mentioned, I was just porting it.
I gotta say, I'm a little lost as to why you're taking this upon yourself,
considering that Zwane is for all intents and purposes the maintainer now
instead of me, and he seems to be effectively pushing stuff into 2.5 via
the Alan -> Marcelo -> Dave Jones -> Linus scheme. I would really prefer
that you let him submit a patch for this, as I'm pretty sure that the
addition of the isapnp_change_resource calls will break the driver for
anyone whose machine doesn't have DMA 0 available.
Scott
--
Scott Murray
SOMA Networks, Inc.
Toronto, Ontario
e-mail: [email protected]
Hi,
On Mon, 3 Jun 2002, Scott Murray wrote:
> I gotta say, I'm a little lost as to why you're taking this upon yourself,
> considering that Zwane is for all intents and purposes the maintainer now
> instead of me, and he seems to be effectively pushing stuff into 2.5 via
> the Alan -> Marcelo -> Dave Jones -> Linus scheme. I would really prefer
> that you let him submit a patch for this, as I'm pretty sure that the
> addition of the isapnp_change_resource calls will break the driver for
> anyone whose machine doesn't have DMA 0 available.
Because I considered to get it into the -ct1. But if you see it like this,
I pull it.
Regards,
Thunder
--
ship is leaving right on time | Thunder from the hill at ngforever
empty harbour, wave goodbye |
evacuation of the isle | free inhabitant not directly
caveman's paintings drowning | belonging anywhere
Hi Scott,
On Mon, 3 Jun 2002, Scott Murray wrote:
> I think always blindly remapping the the DMA channels to 0 and 1 is a bad
> idea and will likely break things for some people. It would be better if
> the core isapnp code could be made smarter, but a simple alternative would
> be to rework the opl3sa2 module parameter parsing to allow using the DMA
> parameters as an override when using PnP.
I'm working with Gerald in order to get a decent workaround in without
messing with isapnp using your recommendation.
> PS: Zwane, any chance you want to update MAINTAINERS to "officially" take
> over opl3sa2?
I sent a patch for that with a patch a while back, i'll double check.
Thanks,
Zwane Mwaikambo
--
http://function.linuxpower.ca
On Mon, 3 Jun 2002, Thunder from the hill wrote:
> His patch won't match for 2.5. I just adapted it, even though I've had a
> typo there.
That would be because the one in 2.5 is quite a few revisions behind
(perhaps 2-3 patches)
> > > + opl3sa2_state[card].activated = 1;
> >
> > This line should really be below the following if statement, as I believe
> > Zwane mentioned to Gerald.
>
> You could of course have it there. No problem with that.
If you put it there you'd have to unset it on a failure path.
Regards,
Zwane Mwaikambo
--
http://function.linuxpower.ca