diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2012-04-09 14:51:18 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2012-04-17 16:27:37 -0400 |
commit | 0b6c4857f7684f6d3f59e0506f62953575346978 (patch) | |
tree | c266c9232022a962f1cb868d0f3664074efa2134 /drivers/firewire/core.h | |
parent | fe2af11c220c7bb3a67f7aec0594811e5c59e019 (diff) |
firewire: core: fix DMA mapping direction
Seen with recent libdc1394: If a client mmap()s the buffer of an
isochronous reception buffer with PROT_READ|PROT_WRITE instead of just
PROT_READ, firewire-core sets the wrong DMA mapping direction during
buffer initialization.
The fix is to split fw_iso_buffer_init() into allocation and DMA mapping
and to perform the latter after both buffer and DMA context were
allocated. Buffer allocation and context allocation may happen in any
order, but we need the context type (reception or transmission) in order
to set the DMA direction of the buffer.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/core.h')
-rw-r--r-- | drivers/firewire/core.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/firewire/core.h b/drivers/firewire/core.h index 9047f5547d98..94257aecd054 100644 --- a/drivers/firewire/core.h +++ b/drivers/firewire/core.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
5 | #include <linux/device.h> | 5 | #include <linux/device.h> |
6 | #include <linux/dma-mapping.h> | ||
6 | #include <linux/fs.h> | 7 | #include <linux/fs.h> |
7 | #include <linux/list.h> | 8 | #include <linux/list.h> |
8 | #include <linux/idr.h> | 9 | #include <linux/idr.h> |
@@ -169,7 +170,11 @@ void fw_node_event(struct fw_card *card, struct fw_node *node, int event); | |||
169 | 170 | ||
170 | /* -iso */ | 171 | /* -iso */ |
171 | 172 | ||
172 | int fw_iso_buffer_map(struct fw_iso_buffer *buffer, struct vm_area_struct *vma); | 173 | int fw_iso_buffer_alloc(struct fw_iso_buffer *buffer, int page_count); |
174 | int fw_iso_buffer_map_dma(struct fw_iso_buffer *buffer, struct fw_card *card, | ||
175 | enum dma_data_direction direction); | ||
176 | int fw_iso_buffer_map_vma(struct fw_iso_buffer *buffer, | ||
177 | struct vm_area_struct *vma); | ||
173 | 178 | ||
174 | 179 | ||
175 | /* -topology */ | 180 | /* -topology */ |