mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 16:44:58 +02:00
nvmet: pci-epf: move DMA initialization to EPC init callback
For DMA initialization to work across all EPC drivers, the DMA initialization has to be done in the .init() callback. This is because not all EPC drivers will have a refclock (which is often needed to access registers of a DMA controller embedded in a PCIe controller) at the time the .bind() callback is called. However, all EPC drivers are guaranteed to have a refclock by the time the .init() callback is called. Thus, move the DMA initialization to the .init() callback. This change was already done for other EPF drivers in commit60bd3e039a("PCI: endpoint: pci-epf-{mhi/test}: Move DMA initialization to EPC init callback"). Cc: stable@vger.kernel.org Fixes:0faa0fe6f9("nvmet: New NVMe PCI endpoint function target driver") Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com> Signed-off-by: Niklas Cassel <cassel@kernel.org> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Keith Busch <kbusch@kernel.org>
This commit is contained in:
parent
edd17206e3
commit
511b3b644e
|
|
@ -2325,6 +2325,8 @@ static int nvmet_pci_epf_epc_init(struct pci_epf *epf)
|
|||
return ret;
|
||||
}
|
||||
|
||||
nvmet_pci_epf_init_dma(nvme_epf);
|
||||
|
||||
/* Set device ID, class, etc. */
|
||||
epf->header->vendorid = ctrl->tctrl->subsys->vendor_id;
|
||||
epf->header->subsys_vendor_id = ctrl->tctrl->subsys->subsys_vendor_id;
|
||||
|
|
@ -2422,8 +2424,6 @@ static int nvmet_pci_epf_bind(struct pci_epf *epf)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
nvmet_pci_epf_init_dma(nvme_epf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user