Commit:     2e17c5508fa015f2c7690e29041f437e9308c64f
Parent:     6f8bc500a10ab9cb3861e5bb71155d7bd2bbd2d5
Author:     David Brownell <[EMAIL PROTECTED]>
AuthorDate: Tue May 8 00:25:29 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 8 11:15:00 2007 -0700

    init dma masks in pnp_dev
    PNP now initializes device dma masks, which prevents oopses when generic
    dma calls are made using pnp device nodes.
    This assumes PNP only uses ISA DMA, with 24 bit addresses; and that it's
    safe to init those masks for all devices (rather than finding out which
    devices have been assigned DMA channels, and handling only those).
    Signed-off-by: David Brownell <[EMAIL PROTECTED]>
    Cc: Adam Belay <[EMAIL PROTECTED]>
    Cc: Jaroslav Kysela <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 drivers/pnp/core.c  |    3 +++
 include/linux/pnp.h |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c
index aec83ec..d8d7554 100644
--- a/drivers/pnp/core.c
+++ b/drivers/pnp/core.c
@@ -14,6 +14,7 @@
 #include <linux/string.h>
 #include <linux/slab.h>
 #include <linux/errno.h>
+#include <linux/dma-mapping.h>
 #include "base.h"
@@ -114,6 +115,8 @@ int __pnp_add_device(struct pnp_dev *dev)
        int ret;
        dev->dev.bus = &pnp_bus_type;
+       dev->dev.dma_mask = &dev->dma_mask;
+       dev->dma_mask = dev->dev.coherent_dma_mask = DMA_24BIT_MASK;
        dev->dev.release = &pnp_release_device;
        dev->status = PNP_READY;
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index 9a5226f..00dae5b 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -177,6 +177,7 @@ static inline void pnp_set_card_drvdata (struct 
pnp_card_link *pcard, void *data
 struct pnp_dev {
        struct device dev;              /* Driver Model device interface */
+       u64 dma_mask;
        unsigned char number;           /* used as an index, must be unique */
        int status;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to