|
23 | 23 | #define XDMA_WORKER_STOPPED_ON_REQUEST_BIT (2)
|
24 | 24 | #define PCI_VENDOR_ID_AMAZON (0x1d0f)
|
25 | 25 | #define PCI_DEVICE_ID_FPGA (0xf001)
|
26 |
| -#define XMDA_NUMBER_OF_USER_EVENTS (16) |
| 26 | +#define XMDA_NUMBER_OF_USER_EVENTS (1) |
| 27 | +#define XDMA_LIMIT_NUMBER_OF_QUEUES (1) |
27 | 28 | #define CLASS_NAME "edma"
|
28 | 29 |
|
29 | 30 | struct class* edma_class;
|
@@ -145,17 +146,15 @@ static int edma_xdma_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
145 | 146 | pci_save_state(pdev);
|
146 | 147 |
|
147 | 148 | number_of_xdma_channels = xdma_device_open(pdev, &channel_list);
|
148 |
| - if(number_of_xdma_channels < 0) { |
149 |
| - ret = number_of_xdma_channels; |
150 |
| - goto done; |
151 |
| - } |
152 |
| - |
153 | 149 | if(unlikely(number_of_xdma_channels < 0)){
|
154 | 150 | ret = number_of_xdma_channels;
|
155 | 151 | goto done;
|
156 | 152 | }
|
157 | 153 |
|
158 |
| - dev_info(dev, "xdma opened %d channels\n", number_of_xdma_channels); |
| 154 | + if(number_of_xdma_channels > XDMA_LIMIT_NUMBER_OF_QUEUES) |
| 155 | + number_of_xdma_channels = XDMA_LIMIT_NUMBER_OF_QUEUES; |
| 156 | + |
| 157 | + dev_info(dev, "DMA backend opened %d channels\n", number_of_xdma_channels); |
159 | 158 |
|
160 | 159 | command_queue = (command_queue_t*)kzalloc(
|
161 | 160 | number_of_xdma_channels * sizeof(command_queue_t),
|
@@ -451,14 +450,15 @@ int edma_backend_stop(void *q_handle)
|
451 | 450 | !test_bit(XDMA_WORKER_STOPPED_ON_TIMEOUT_BIT, &command_queue->thread_status))
|
452 | 451 | BUG();
|
453 | 452 |
|
454 |
| - for(i = 0; i < edma_queue_depth; i++) |
455 |
| - { |
| 453 | + for(i = 0; i < edma_queue_depth; i++) { |
456 | 454 | memset(&(queue[i]), 0, sizeof(command_t));
|
457 | 455 | }
|
458 | 456 |
|
459 | 457 | command_queue->head = 0;
|
460 | 458 | command_queue->tail = 0;
|
461 | 459 | command_queue->next_to_recycle = 0;
|
| 460 | + command_queue->worker_thread = NULL; |
| 461 | + command_queue->thread_status = 0; |
462 | 462 |
|
463 | 463 | return 0;
|
464 | 464 | }
|
|
0 commit comments