All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rene Herman <rene.herman@keyaccess.nl>
To: Andrew Morton <akpm@osdl.org>
Cc: Takashi Iwai <tiwai@suse.de>,
	ALSA devel <alsa-devel@alsa-project.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Bjorn Helgaas <bjorn.helgaas@hp.com>
Subject: [PATCH] ISA: set 24-bit dma_mask for ISA devices.
Date: Sat, 31 May 2008 01:55:52 +0200	[thread overview]
Message-ID: <48409408.8090901@keyaccess.nl> (raw)
In-Reply-To: <48407B99.4080209@keyaccess.nl>

[-- Attachment #1: 0002-ISA-set-24-bit-dma_mask-for-ISA-devices.patch --]
[-- Type: text/plain, Size: 1817 bytes --]

>From 56e4b14aa58612aeb41b51d73a75f85dd72127a1 Mon Sep 17 00:00:00 2001
From: Rene Herman <rene.herman@gmail.com>
Date: Sat, 31 May 2008 00:31:40 +0200
Subject: [PATCH] ISA: set 24-bit dma_mask for ISA devices.

dma_alloc_coherent() on x86 currently takes a passed in NULL device
pointer to mean that it should allocate an ISA compatible (24-bit)
buffer which is a bit of a hack.

The ALSA ISA drivers are the main consumers of this but have a struct
device in fact readily available.

For the legacy drivers, this sets the device dma_mask in preparation
for using the actual device with the DMA API so as to eventually not
need the NULL hack in dma_alloc_coherent().

This does not fix a current bug -- 2.6.26-rc1 stumbled over the NULL
hack in dma_alloc_coherent() but this has already been fixed in commit
4a367f3a9dbf2e7ffcee4702203479809236ee6e by Takashi Iwai.

Signed-off-by: Rene Herman <rene.herman@gmail.com>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
---
 drivers/base/isa.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/base/isa.c b/drivers/base/isa.c
index d222239..efd5775 100644
--- a/drivers/base/isa.c
+++ b/drivers/base/isa.c
@@ -7,6 +7,7 @@
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/init.h>
+#include <linux/dma-mapping.h>
 #include <linux/isa.h>
 
 static struct device isa_bus = {
@@ -141,6 +142,9 @@ int isa_register_driver(struct isa_driver *isa_driver, unsigned int ndev)
 		isa_dev->dev.release		= isa_dev_release;
 		isa_dev->id			= id;
 
+		isa_dev->dev.coherent_dma_mask = DMA_24BIT_MASK;
+		isa_dev->dev.dma_mask = &isa_dev->dev.coherent_dma_mask;
+
 		error = device_register(&isa_dev->dev);
 		if (error) {
 			put_device(&isa_dev->dev);
-- 
1.5.2.2

WARNING: multiple messages have this Message-ID (diff)
From: Rene Herman <rene.herman@keyaccess.nl>
To: Andrew Morton <akpm@osdl.org>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>,
	Takashi Iwai <tiwai@suse.de>, Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	ALSA devel <alsa-devel@alsa-project.org>
Subject: [PATCH] ISA: set 24-bit dma_mask for ISA devices.
Date: Sat, 31 May 2008 01:55:52 +0200	[thread overview]
Message-ID: <48409408.8090901@keyaccess.nl> (raw)
In-Reply-To: <48407B99.4080209@keyaccess.nl>

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0002-ISA-set-24-bit-dma_mask-for-ISA-devices.patch --]
[-- Type: text/plain, Size: 1818 bytes --]

>From 56e4b14aa58612aeb41b51d73a75f85dd72127a1 Mon Sep 17 00:00:00 2001
From: Rene Herman <rene.herman@gmail.com>
Date: Sat, 31 May 2008 00:31:40 +0200
Subject: [PATCH] ISA: set 24-bit dma_mask for ISA devices.

dma_alloc_coherent() on x86 currently takes a passed in NULL device
pointer to mean that it should allocate an ISA compatible (24-bit)
buffer which is a bit of a hack.

The ALSA ISA drivers are the main consumers of this but have a struct
device in fact readily available.

For the legacy drivers, this sets the device dma_mask in preparation
for using the actual device with the DMA API so as to eventually not
need the NULL hack in dma_alloc_coherent().

This does not fix a current bug -- 2.6.26-rc1 stumbled over the NULL
hack in dma_alloc_coherent() but this has already been fixed in commit
4a367f3a9dbf2e7ffcee4702203479809236ee6e by Takashi Iwai.

Signed-off-by: Rene Herman <rene.herman@gmail.com>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
---
 drivers/base/isa.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/base/isa.c b/drivers/base/isa.c
index d222239..efd5775 100644
--- a/drivers/base/isa.c
+++ b/drivers/base/isa.c
@@ -7,6 +7,7 @@
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/init.h>
+#include <linux/dma-mapping.h>
 #include <linux/isa.h>
 
 static struct device isa_bus = {
@@ -141,6 +142,9 @@ int isa_register_driver(struct isa_driver *isa_driver, unsigned int ndev)
 		isa_dev->dev.release		= isa_dev_release;
 		isa_dev->id			= id;
 
+		isa_dev->dev.coherent_dma_mask = DMA_24BIT_MASK;
+		isa_dev->dev.dma_mask = &isa_dev->dev.coherent_dma_mask;
+
 		error = device_register(&isa_dev->dev);
 		if (error) {
 			put_device(&isa_dev->dev);
-- 
1.5.2.2


  parent reply	other threads:[~2008-05-30 23:52 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-09  1:37 2.6.26-rc1 regression: ISA DMA broken (bisected) Rene Herman
2008-05-09  1:37 ` Rene Herman
2008-05-09  6:06 ` Takashi Iwai
2008-05-09  6:06   ` Takashi Iwai
2008-05-09  8:55   ` Ingo Molnar
2008-05-09  8:55     ` Ingo Molnar
2008-05-09  8:58     ` Ingo Molnar
2008-05-09 17:20       ` Jesse Barnes
2008-05-09 12:03   ` Rene Herman
2008-05-09 12:03     ` Rene Herman
2008-05-09 12:28     ` Ingo Molnar
2008-05-09 12:28       ` Ingo Molnar
2008-05-09 23:00       ` Rene Herman
2008-05-09 23:00         ` Rene Herman
2008-05-13 14:36         ` Ingo Molnar
2008-05-13 14:36           ` Ingo Molnar
2008-05-13 15:26           ` Rene Herman
2008-05-09 12:29     ` Pete Clements
2008-05-09 12:29       ` Pete Clements
2008-05-09 12:48   ` Glauber Costa
2008-05-13 16:59   ` Bjorn Helgaas
2008-05-13 16:59     ` Bjorn Helgaas
2008-05-13 17:01     ` Alan Cox
2008-05-13 17:01       ` Alan Cox
2008-05-13 17:33       ` Rene Herman
2008-05-13 17:33         ` Rene Herman
2008-05-13 23:18         ` Bjorn Helgaas
2008-05-13 23:18           ` Bjorn Helgaas
2008-05-14  9:25           ` Takashi Iwai
2008-05-14  9:25             ` Takashi Iwai
2008-05-14 12:46           ` Rene Herman
2008-05-14 12:46             ` Rene Herman
2008-05-14 13:01             ` Takashi Iwai
2008-05-14 15:40               ` Rene Herman
2008-05-14 15:40                 ` Rene Herman
2008-05-14 15:53                 ` Takashi Iwai
2008-05-14 15:53                   ` Takashi Iwai
2008-05-14 18:41                 ` Rene Herman
2008-05-14 18:50                   ` Bjorn Helgaas
2008-05-14 19:09                     ` Rene Herman
2008-05-14 19:09                       ` Rene Herman
2008-05-30 21:15                       ` [PATCH] " Rene Herman
2008-05-30 21:15                         ` Rene Herman
2008-05-30 21:28                         ` [DEVICE MODEL] dev->dma_mask Rene Herman
2008-05-30 21:28                           ` Rene Herman
2008-05-30 21:43                         ` [PATCH] Re: 2.6.26-rc1 regression: ISA DMA broken (bisected) Bjorn Helgaas
2008-05-30 21:43                           ` Bjorn Helgaas
2008-05-30 22:11                           ` Rene Herman
2008-05-30 22:11                             ` Rene Herman
2008-05-30 22:37                             ` [PATCH] ISA: set 24-bit dma_mask for ISA devices Rene Herman
2008-05-30 22:37                               ` Rene Herman
2008-05-30 22:55                               ` Andrew Morton
2008-05-30 22:55                                 ` Andrew Morton
2008-05-30 23:50                                 ` Rene Herman
2008-05-30 23:50                                   ` Rene Herman
2008-05-30 23:54                             ` [PATCH] PNP: set the pnp_card dma_mask for use by ISAPnP cards Rene Herman
2008-05-30 23:54                               ` Rene Herman
2008-05-31  8:55                               ` Takashi Iwai
2008-05-31  8:55                                 ` Takashi Iwai
2008-05-30 23:55                             ` Rene Herman [this message]
2008-05-30 23:55                               ` [PATCH] ISA: set 24-bit dma_mask for ISA devices Rene Herman
2008-05-31  8:56                               ` Takashi Iwai
2008-05-31  8:56                                 ` Takashi Iwai
2008-05-14 15:26             ` 2.6.26-rc1 regression: ISA DMA broken (bisected) Bjorn Helgaas
2008-05-14 15:26               ` 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=48409408.8090901@keyaccess.nl \
    --to=rene.herman@keyaccess.nl \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=bjorn.helgaas@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tiwai@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.