Commit cdcb30b5 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
  firewire: fw-ohci: fix IOMMU resource exhaustion
  ieee1394: node manager causes up to ~3.25s delay in freezing tasks
parents c1ab6cc6 1d1dc5e8
...@@ -974,6 +974,7 @@ at_context_queue_packet(struct context *ctx, struct fw_packet *packet) ...@@ -974,6 +974,7 @@ at_context_queue_packet(struct context *ctx, struct fw_packet *packet)
packet->ack = RCODE_SEND_ERROR; packet->ack = RCODE_SEND_ERROR;
return -1; return -1;
} }
packet->payload_bus = payload_bus;
d[2].req_count = cpu_to_le16(packet->payload_length); d[2].req_count = cpu_to_le16(packet->payload_length);
d[2].data_address = cpu_to_le32(payload_bus); d[2].data_address = cpu_to_le32(payload_bus);
...@@ -1025,7 +1026,6 @@ static int handle_at_packet(struct context *context, ...@@ -1025,7 +1026,6 @@ static int handle_at_packet(struct context *context,
struct driver_data *driver_data; struct driver_data *driver_data;
struct fw_packet *packet; struct fw_packet *packet;
struct fw_ohci *ohci = context->ohci; struct fw_ohci *ohci = context->ohci;
dma_addr_t payload_bus;
int evt; int evt;
if (last->transfer_status == 0) if (last->transfer_status == 0)
...@@ -1038,9 +1038,8 @@ static int handle_at_packet(struct context *context, ...@@ -1038,9 +1038,8 @@ static int handle_at_packet(struct context *context,
/* This packet was cancelled, just continue. */ /* This packet was cancelled, just continue. */
return 1; return 1;
payload_bus = le32_to_cpu(last->data_address); if (packet->payload_bus)
if (payload_bus != 0) dma_unmap_single(ohci->card.device, packet->payload_bus,
dma_unmap_single(ohci->card.device, payload_bus,
packet->payload_length, DMA_TO_DEVICE); packet->payload_length, DMA_TO_DEVICE);
evt = le16_to_cpu(last->transfer_status) & 0x1f; evt = le16_to_cpu(last->transfer_status) & 0x1f;
...@@ -1697,6 +1696,10 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet) ...@@ -1697,6 +1696,10 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet)
if (packet->ack != 0) if (packet->ack != 0)
goto out; goto out;
if (packet->payload_bus)
dma_unmap_single(ohci->card.device, packet->payload_bus,
packet->payload_length, DMA_TO_DEVICE);
log_ar_at_event('T', packet->speed, packet->header, 0x20); log_ar_at_event('T', packet->speed, packet->header, 0x20);
driver_data->packet = NULL; driver_data->packet = NULL;
packet->ack = RCODE_CANCELLED; packet->ack = RCODE_CANCELLED;
......
...@@ -207,6 +207,7 @@ fw_fill_request(struct fw_packet *packet, int tcode, int tlabel, ...@@ -207,6 +207,7 @@ fw_fill_request(struct fw_packet *packet, int tcode, int tlabel,
packet->speed = speed; packet->speed = speed;
packet->generation = generation; packet->generation = generation;
packet->ack = 0; packet->ack = 0;
packet->payload_bus = 0;
} }
/** /**
...@@ -581,6 +582,8 @@ fw_fill_response(struct fw_packet *response, u32 *request_header, ...@@ -581,6 +582,8 @@ fw_fill_response(struct fw_packet *response, u32 *request_header,
BUG(); BUG();
return; return;
} }
response->payload_bus = 0;
} }
EXPORT_SYMBOL(fw_fill_response); EXPORT_SYMBOL(fw_fill_response);
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/spinlock_types.h> #include <linux/spinlock_types.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/types.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#define TCODE_IS_READ_REQUEST(tcode) (((tcode) & ~1) == 4) #define TCODE_IS_READ_REQUEST(tcode) (((tcode) & ~1) == 4)
...@@ -153,6 +154,7 @@ struct fw_packet { ...@@ -153,6 +154,7 @@ struct fw_packet {
size_t header_length; size_t header_length;
void *payload; void *payload;
size_t payload_length; size_t payload_length;
dma_addr_t payload_bus;
u32 timestamp; u32 timestamp;
/* /*
......
...@@ -1685,6 +1685,7 @@ static int nodemgr_host_thread(void *data) ...@@ -1685,6 +1685,7 @@ static int nodemgr_host_thread(void *data)
g = get_hpsb_generation(host); g = get_hpsb_generation(host);
for (i = 0; i < 4 ; i++) { for (i = 0; i < 4 ; i++) {
msleep_interruptible(63); msleep_interruptible(63);
try_to_freeze();
if (kthread_should_stop()) if (kthread_should_stop())
goto exit; goto exit;
...@@ -1725,6 +1726,7 @@ static int nodemgr_host_thread(void *data) ...@@ -1725,6 +1726,7 @@ static int nodemgr_host_thread(void *data)
/* Sleep 3 seconds */ /* Sleep 3 seconds */
for (i = 3000/200; i; i--) { for (i = 3000/200; i; i--) {
msleep_interruptible(200); msleep_interruptible(200);
try_to_freeze();
if (kthread_should_stop()) if (kthread_should_stop())
goto exit; goto exit;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment