Skip to content

Commit 2d50607

Browse files
tititiou36martinkpetersen
authored andcommitted
scsi: message: fusion: Use dma_alloc_coherent() in mpt_alloc_fw_memory()
In [1], Christoph Hellwig has proposed to remove the wrappers in include/linux/pci-dma-compat.h. Some reasons why this API should be removed have been given by Julia Lawall in [2]. mpt_alloc_fw_memory() should still use GFP_ATOMIC, because it can be called from mpt_do_upload() which might sleep. [1]: https://lore.kernel.org/kernel-janitors/20200421081257.GA131897@infradead.org/ [2]: https://lore.kernel.org/kernel-janitors/alpine.DEB.2.22.394.2007120902170.2424@hadrien/ Link: https://lore.kernel.org/r/db3db9db219005b75659561d08117d312d0cfb13.1641500561.git.christophe.jaillet@wanadoo.fr Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent b114dda commit 2d50607

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/message/fusion/mptbase.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3512,7 +3512,8 @@ mpt_alloc_fw_memory(MPT_ADAPTER *ioc, int size)
35123512
rc = 0;
35133513
goto out;
35143514
}
3515-
ioc->cached_fw = pci_alloc_consistent(ioc->pcidev, size, &ioc->cached_fw_dma);
3515+
ioc->cached_fw = dma_alloc_coherent(&ioc->pcidev->dev, size,
3516+
&ioc->cached_fw_dma, GFP_ATOMIC);
35163517
if (!ioc->cached_fw) {
35173518
printk(MYIOC_s_ERR_FMT "Unable to allocate memory for the cached firmware image!\n",
35183519
ioc->name);

0 commit comments

Comments
 (0)