|
19 | 19 |
|
20 | 20 | #include <linux/compat.h> |
21 | 21 | #include <linux/blkdev.h> |
| 22 | +#include <linux/blk-mq-pci.h> |
22 | 23 | #include <linux/completion.h> |
23 | 24 | #include <linux/init.h> |
24 | 25 | #include <linux/interrupt.h> |
@@ -504,6 +505,15 @@ static int aac_slave_configure(struct scsi_device *sdev) |
504 | 505 | return 0; |
505 | 506 | } |
506 | 507 |
|
| 508 | +static void aac_map_queues(struct Scsi_Host *shost) |
| 509 | +{ |
| 510 | + struct aac_dev *aac = (struct aac_dev *)shost->hostdata; |
| 511 | + |
| 512 | + blk_mq_pci_map_queues(&shost->tag_set.map[HCTX_TYPE_DEFAULT], |
| 513 | + aac->pdev, 0); |
| 514 | + aac->use_map_queue = true; |
| 515 | +} |
| 516 | + |
507 | 517 | /** |
508 | 518 | * aac_change_queue_depth - alter queue depths |
509 | 519 | * @sdev: SCSI device we are considering |
@@ -1488,6 +1498,7 @@ static const struct scsi_host_template aac_driver_template = { |
1488 | 1498 | .bios_param = aac_biosparm, |
1489 | 1499 | .shost_groups = aac_host_groups, |
1490 | 1500 | .slave_configure = aac_slave_configure, |
| 1501 | + .map_queues = aac_map_queues, |
1491 | 1502 | .change_queue_depth = aac_change_queue_depth, |
1492 | 1503 | .sdev_groups = aac_dev_groups, |
1493 | 1504 | .eh_abort_handler = aac_eh_abort, |
@@ -1775,6 +1786,8 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) |
1775 | 1786 | shost->max_lun = AAC_MAX_LUN; |
1776 | 1787 |
|
1777 | 1788 | pci_set_drvdata(pdev, shost); |
| 1789 | + shost->nr_hw_queues = aac->max_msix; |
| 1790 | + shost->host_tagset = 1; |
1778 | 1791 |
|
1779 | 1792 | error = scsi_add_host(shost, &pdev->dev); |
1780 | 1793 | if (error) |
@@ -1906,6 +1919,7 @@ static void aac_remove_one(struct pci_dev *pdev) |
1906 | 1919 | struct aac_dev *aac = (struct aac_dev *)shost->hostdata; |
1907 | 1920 |
|
1908 | 1921 | aac_cancel_rescan_worker(aac); |
| 1922 | + aac->use_map_queue = false; |
1909 | 1923 | scsi_remove_host(shost); |
1910 | 1924 |
|
1911 | 1925 | __aac_shutdown(aac); |
|
0 commit comments