lkml.org 
[lkml]   [2008]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Re: 2.6.26-rc1 regression: ISA DMA broken (bisected)
On 14-05-08 21:09, Rene Herman wrote:

> On 14-05-08 20:50, Bjorn Helgaas wrote:

>> I agree, it seems a bit of a hack to use a DMA mask from the card
>> instead of from the device, since the driver should be programming
>> the device to do the DMA.
>>
>> But I know very little about pnp_card in general, so don't attach too
>> much weight to my opinion.
>
> Okay, I'll sit on this for a bit. Right now we're using a global device
> even but this is exactly about cleaning that up so couldn't convince
> myself. Will see what happens when I try to make it nice...

It gets uglier. ALSA ISA drivers (for cards that exist both as legacy
and as ISAPnP at least) keep a merged legacy/isapnp model; PnP is used
mostly for initializing global variables that the same old legacy probe
routines then reference. This means that beyond that global resource
init step the specific struct device is no longer available. Without
restructuring too many things really only fixable through other hacks
again such as a global dma_dev[] array or some such.

From the viewpoint of PnP itself setting the dma_mask for a pnp_card (a
pnp_dev collection) makes isolated sense so if no objections, I'll
submit the attached after all. From the ALSA side we'd then pass the
card dev (which we'd also do for isa_dev) and keep in mind that we might
want to get more specific if over time structure permits it.

struct snd_pcm already has its own struct device * which would be the
right one here but it's setting that which gets ugly...

Rene.
From b4e8e6b833d2e8ed3a2b78912c4afff563d8ae21 Mon Sep 17 00:00:00 2001
From: Rene Herman <rene.herman@gmail.com>
Date: Fri, 30 May 2008 23:10:23 +0200
Subject: [PATCH] PNP: set the pnp_card dma_mask for use by ISAPnP cards.

This makes the pnp_card->dev available as a DMAable device same as
the pnp_dev->dev.

Signed-off-by: Rene Herman <rene.herman@gmail.com>
---
drivers/pnp/card.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/pnp/card.c b/drivers/pnp/card.c
index a762a41..b00ef10 100644
--- a/drivers/pnp/card.c
+++ b/drivers/pnp/card.c
@@ -8,6 +8,7 @@
#include <linux/ctype.h>
#include <linux/slab.h>
#include <linux/pnp.h>
+#include <linux/dma-mapping.h>
#include "base.h"

LIST_HEAD(pnp_cards);
@@ -167,6 +168,9 @@ struct pnp_card *pnp_alloc_card(struct pnp_protocol *protocol, int id, char *pnp
sprintf(card->dev.bus_id, "%02x:%02x", card->protocol->number,
card->number);

+ card->dev.coherent_dma_mask = DMA_24BIT_MASK;
+ card->dev.dma_mask = &card->dev.coherent_dma_mask;
+
dev_id = pnp_add_card_id(card, pnpid);
if (!dev_id) {
kfree(card);
--
1.5.2.2
\
 
 \ /
  Last update: 2008-05-30 23:15    [W:0.105 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site