diff options
Diffstat (limited to 'drivers/nvme/host/pci.c')
-rw-r--r-- | drivers/nvme/host/pci.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index f3b53af789ef..9e294ff4e652 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c | |||
@@ -2708,6 +2708,18 @@ static int nvme_dev_map(struct nvme_dev *dev) | |||
2708 | dev->q_depth = min_t(int, NVME_CAP_MQES(cap) + 1, NVME_Q_DEPTH); | 2708 | dev->q_depth = min_t(int, NVME_CAP_MQES(cap) + 1, NVME_Q_DEPTH); |
2709 | dev->db_stride = 1 << NVME_CAP_STRIDE(cap); | 2709 | dev->db_stride = 1 << NVME_CAP_STRIDE(cap); |
2710 | dev->dbs = ((void __iomem *)dev->bar) + 4096; | 2710 | dev->dbs = ((void __iomem *)dev->bar) + 4096; |
2711 | |||
2712 | /* | ||
2713 | * Temporary fix for the Apple controller found in the MacBook8,1 and | ||
2714 | * some MacBook7,1 to avoid controller resets and data loss. | ||
2715 | */ | ||
2716 | if (pdev->vendor == PCI_VENDOR_ID_APPLE && pdev->device == 0x2001) { | ||
2717 | dev->q_depth = 2; | ||
2718 | dev_warn(dev->dev, "detected Apple NVMe controller, set " | ||
2719 | "queue depth=%u to work around controller resets\n", | ||
2720 | dev->q_depth); | ||
2721 | } | ||
2722 | |||
2711 | if (readl(&dev->bar->vs) >= NVME_VS(1, 2)) | 2723 | if (readl(&dev->bar->vs) >= NVME_VS(1, 2)) |
2712 | dev->cmb = nvme_map_cmb(dev); | 2724 | dev->cmb = nvme_map_cmb(dev); |
2713 | 2725 | ||