]>
Commit | Line | Data |
---|---|---|
2a2a4ae2 SL |
1 | From 4ff44e652fbd0c7037c7a9cbc6ae00c8f1ce8724 Mon Sep 17 00:00:00 2001 |
2 | From: Lianbo Jiang <lijiang@redhat.com> | |
3 | Date: Mon, 27 May 2019 08:59:34 +0800 | |
4 | Subject: scsi: smartpqi: properly set both the DMA mask and the coherent DMA | |
5 | mask | |
6 | ||
7 | [ Upstream commit 1d94f06e7f5df4064ef336b7b710f50143b64a53 ] | |
8 | ||
9 | When SME is enabled, the smartpqi driver won't work on the HP DL385 G10 | |
10 | machine, which causes the failure of kernel boot because it fails to | |
11 | allocate pqi error buffer. Please refer to the kernel log: | |
12 | .... | |
13 | [ 9.431749] usbcore: registered new interface driver uas | |
14 | [ 9.441524] Microsemi PQI Driver (v1.1.4-130) | |
15 | [ 9.442956] i40e 0000:04:00.0: fw 6.70.48768 api 1.7 nvm 10.2.5 | |
16 | [ 9.447237] smartpqi 0000:23:00.0: Microsemi Smart Family Controller found | |
17 | Starting dracut initqueue hook... | |
18 | [ OK ] Started Show Plymouth Boot Scre[ 9.471654] Broadcom NetXtreme-C/E driver bnxt_en v1.9.1 | |
19 | en. | |
20 | [ OK ] Started Forward Password Requests to Plymouth Directory Watch. | |
21 | [[0;[ 9.487108] smartpqi 0000:23:00.0: failed to allocate PQI error buffer | |
22 | .... | |
23 | [ 139.050544] dracut-initqueue[949]: Warning: dracut-initqueue timeout - starting timeout scripts | |
24 | [ 139.589779] dracut-initqueue[949]: Warning: dracut-initqueue timeout - starting timeout scripts | |
25 | ||
26 | Basically, the fact that the coherent DMA mask value wasn't set caused the | |
27 | driver to fall back to SWIOTLB when SME is active. | |
28 | ||
29 | For correct operation, lets call the dma_set_mask_and_coherent() to | |
30 | properly set the mask for both streaming and coherent, in order to inform | |
31 | the kernel about the devices DMA addressing capabilities. | |
32 | ||
33 | Signed-off-by: Lianbo Jiang <lijiang@redhat.com> | |
34 | Acked-by: Don Brace <don.brace@microsemi.com> | |
35 | Tested-by: Don Brace <don.brace@microsemi.com> | |
36 | Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> | |
37 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
38 | --- | |
39 | drivers/scsi/smartpqi/smartpqi_init.c | 2 +- | |
40 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
41 | ||
42 | diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c | |
43 | index 5ec2898d21cd..d34351c6b9af 100644 | |
44 | --- a/drivers/scsi/smartpqi/smartpqi_init.c | |
45 | +++ b/drivers/scsi/smartpqi/smartpqi_init.c | |
46 | @@ -6392,7 +6392,7 @@ static int pqi_pci_init(struct pqi_ctrl_info *ctrl_info) | |
47 | else | |
48 | mask = DMA_BIT_MASK(32); | |
49 | ||
50 | - rc = dma_set_mask(&ctrl_info->pci_dev->dev, mask); | |
51 | + rc = dma_set_mask_and_coherent(&ctrl_info->pci_dev->dev, mask); | |
52 | if (rc) { | |
53 | dev_err(&ctrl_info->pci_dev->dev, "failed to set DMA mask\n"); | |
54 | goto disable_device; | |
55 | -- | |
56 | 2.20.1 | |
57 |