From: David Miller <davem@davemloft.net>
To: stefanr@s5r6.in-berlin.de
Cc: sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org,
gregkh@suse.de, krh@bitplanet.net,
linux1394-devel@lists.sourceforge.net
Subject: Re: No dma_sync_* during pci_probe? (Sparc, post 2.6.22 regression)
Date: Thu, 20 Dec 2007 00:40:33 -0800 (PST) [thread overview]
Message-ID: <20071220.004033.75315225.davem@davemloft.net> (raw)
In-Reply-To: <476947C1.2010405@s5r6.in-berlin.de>
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
Date: Wed, 19 Dec 2007 17:33:05 +0100
> Does arch/sparc64/kernel/pci.c fill them in incorrectly or too late?
The problem is that I created indirection that was totally unused, the
operation vectors members for these cases thus didn't get filled in,
and we OOPS trying to call NULL pointers as functions :-)
This should fix the crash:
diff --git a/include/asm-sparc64/dma-mapping.h b/include/asm-sparc64/dma-mapping.h
index 1fc6554..38cbec7 100644
--- a/include/asm-sparc64/dma-mapping.h
+++ b/include/asm-sparc64/dma-mapping.h
@@ -25,15 +25,9 @@ struct dma_ops {
void (*sync_single_for_cpu)(struct device *dev,
dma_addr_t dma_handle, size_t size,
enum dma_data_direction direction);
- void (*sync_single_for_device)(struct device *dev,
- dma_addr_t dma_handle, size_t size,
- enum dma_data_direction direction);
void (*sync_sg_for_cpu)(struct device *dev, struct scatterlist *sg,
int nelems,
enum dma_data_direction direction);
- void (*sync_sg_for_device)(struct device *dev, struct scatterlist *sg,
- int nelems,
- enum dma_data_direction direction);
};
extern const struct dma_ops *dma_ops;
@@ -105,7 +99,7 @@ static inline void dma_sync_single_for_device(struct device *dev,
size_t size,
enum dma_data_direction direction)
{
- dma_ops->sync_single_for_device(dev, dma_handle, size, direction);
+ /* No flushing needed to sync cpu writes to the device. */
}
static inline void dma_sync_single_range_for_cpu(struct device *dev,
@@ -123,7 +117,7 @@ static inline void dma_sync_single_range_for_device(struct device *dev,
size_t size,
enum dma_data_direction direction)
{
- dma_sync_single_for_device(dev, dma_handle+offset, size, direction);
+ /* No flushing needed to sync cpu writes to the device. */
}
@@ -138,7 +132,7 @@ static inline void dma_sync_sg_for_device(struct device *dev,
struct scatterlist *sg, int nelems,
enum dma_data_direction direction)
{
- dma_ops->sync_sg_for_device(dev, sg, nelems, direction);
+ /* No flushing needed to sync cpu writes to the device. */
}
static inline int dma_mapping_error(dma_addr_t dma_addr)
next prev parent reply other threads:[~2007-12-20 8:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bug-9160-4803@http.bugzilla.kernel.org/>
[not found] ` <47112797.7060003@s5r6.in-berlin.de>
2007-12-17 23:53 ` No dma_sync_* during pci_probe? (Sparc, post 2.6.22 regression) Stefan Richter
2007-12-18 0:50 ` David Miller
2007-12-18 10:38 ` Stefan Richter
2007-12-18 22:29 ` David Miller
2007-12-19 16:33 ` Stefan Richter
2007-12-19 23:06 ` David Miller
2007-12-20 8:40 ` David Miller [this message]
2007-12-20 20:19 ` Emanuele Rocca
2007-12-22 13:10 ` Stefan Richter
2007-12-18 22:30 ` David Miller
2007-12-19 21:08 ` Benjamin Herrenschmidt
2007-12-19 21:07 ` Benjamin Herrenschmidt
2007-12-18 2:58 ` Chris Newport
2007-12-18 3:03 ` David Miller
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=20071220.004033.75315225.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=gregkh@suse.de \
--cc=krh@bitplanet.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux1394-devel@lists.sourceforge.net \
--cc=sparclinux@vger.kernel.org \
--cc=stefanr@s5r6.in-berlin.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox