History

Merge branch 'nvme-4.14' of git://git.infradead.org/nvme into for-linus

Pull NVMe fixes from Christoph: "A trivial one-liner from Martin to fix the visible of the uuid attr, and another one (originally from Abhishek Shah, rewritten by me) to fix the CMB addresses passed back to the controller in case of a system that remaps BAR addresses between host and device."

Jens Axboe committed 9 years ago

Commit d7b544d2 parents eab40cf 8969f1f2 files · +8 −8Browse files

Unified · Split

2 files
  1. drivers/nvme/host/core.c +1 −1
  2. drivers/nvme/host/pci.c +7 −7
drivers/nvme/host/core.c+1−1
@@ -2136,7 +2136,7 @@ static umode_t nvme_ns_attrs_are_visible(struct kobject *kobj, · 2135 unmodified lines
21362136 struct nvme_ns *ns = nvme_get_ns_from_dev(dev);
21372137
21382138 if (a == &dev_attr_uuid.attr) {
2139− if (uuid_is_null(&ns->uuid) ||
2139+ if (uuid_is_null(&ns->uuid) &&
21402140 !memchr_inv(ns->nguid, 0, sizeof(ns->nguid)))
21412141 return 0;
21422142 }
drivers/nvme/host/pci.c+7−7
@@ -94,7 +94,7 @@ struct nvme_dev { · 93 unmodified lines
9494 struct mutex shutdown_lock;
9595 bool subsystem;
9696 void __iomem *cmb;
97− dma_addr_t cmb_dma_addr;
97+ pci_bus_addr_t cmb_bus_addr;
9898 u64 cmb_size;
9999 u32 cmbsz;
100100 u32 cmbloc;
@@ -1226,7 +1226,7 @@ static int nvme_alloc_sq_cmds(struct nvme_dev *dev, struct nvme_queue *nvmeq, · 1125 unmodified lines
12261226 if (qid && dev->cmb && use_cmb_sqes && NVME_CMB_SQS(dev->cmbsz)) {
12271227 unsigned offset = (qid - 1) * roundup(SQ_SIZE(depth),
12281228 dev->ctrl.page_size);
1229− nvmeq->sq_dma_addr = dev->cmb_dma_addr + offset;
1229+ nvmeq->sq_dma_addr = dev->cmb_bus_addr + offset;
12301230 nvmeq->sq_cmds_io = dev->cmb + offset;
12311231 } else {
12321232 nvmeq->sq_cmds = dma_alloc_coherent(dev->dev, SQ_SIZE(depth),
@@ -1527,7 +1527,7 @@ static void __iomem *nvme_map_cmb(struct nvme_dev *dev) · 294 unmodified lines
15271527 resource_size_t bar_size;
15281528 struct pci_dev *pdev = to_pci_dev(dev->dev);
15291529 void __iomem *cmb;
1530− dma_addr_t dma_addr;
1530+ int bar;
15311531
15321532 dev->cmbsz = readl(dev->bar + NVME_REG_CMBSZ);
15331533 if (!(NVME_CMB_SZ(dev->cmbsz)))
@@ -1540,7 +1540,8 @@ static void __iomem *nvme_map_cmb(struct nvme_dev *dev) · 6 unmodified lines
15401540 szu = (u64)1 << (12 + 4 * NVME_CMB_SZU(dev->cmbsz));
15411541 size = szu * NVME_CMB_SZ(dev->cmbsz);
15421542 offset = szu * NVME_CMB_OFST(dev->cmbloc);
1543− bar_size = pci_resource_len(pdev, NVME_CMB_BIR(dev->cmbloc));
1543+ bar = NVME_CMB_BIR(dev->cmbloc);
1544+ bar_size = pci_resource_len(pdev, bar);
15441545
15451546 if (offset > bar_size)
15461547 return NULL;
@@ -1553,12 +1554,11 @@ static void __iomem *nvme_map_cmb(struct nvme_dev *dev) · 6 unmodified lines
15531554 if (size > bar_size - offset)
15541555 size = bar_size - offset;
15551556
1556− dma_addr = pci_resource_start(pdev, NVME_CMB_BIR(dev->cmbloc)) + offset;
1557− cmb = ioremap_wc(dma_addr, size);
1557+ cmb = ioremap_wc(pci_resource_start(pdev, bar) + offset, size);
15581558 if (!cmb)
15591559 return NULL;
15601560
1561− dev->cmb_dma_addr = dma_addr;
1561+ dev->cmb_bus_addr = pci_bus_address(pdev, bar) + offset;
15621562 dev->cmb_size = size;
15631563 return cmb;
15641564 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t