Skip to content

Commit

Permalink
scsi: message: fusion: Use dma_alloc_coherent() in mpt_alloc_fw_memory()
Browse files Browse the repository at this point in the history
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/[email protected]/
[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 <[email protected]>
Signed-off-by: Christophe JAILLET <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
tititiou36 authored and martinkpetersen committed Jan 10, 2022
1 parent b114dda commit 2d50607
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/message/fusion/mptbase.c
Original file line number Diff line number Diff line change
Expand Up @@ -3512,7 +3512,8 @@ mpt_alloc_fw_memory(MPT_ADAPTER *ioc, int size)
rc = 0;
goto out;
}
ioc->cached_fw = pci_alloc_consistent(ioc->pcidev, size, &ioc->cached_fw_dma);
ioc->cached_fw = dma_alloc_coherent(&ioc->pcidev->dev, size,
&ioc->cached_fw_dma, GFP_ATOMIC);
if (!ioc->cached_fw) {
printk(MYIOC_s_ERR_FMT "Unable to allocate memory for the cached firmware image!\n",
ioc->name);
Expand Down

0 comments on commit 2d50607

Please sign in to comment.